buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
package main import ( "bufio" "fmt" "math" "os" "strconv" ) func exec(stdin *Stdin, stdout *Stdout) { s := stdin.Read() x := (len(s) - 1) / 2 if isPalindromic(s[:x]) && isPalindromic(s[x+1:]) { stdout.Println("Yes") } else { stdout.Println("No") } } func isPalindromic(s string) bool { n := len(s) for...
package main import ( "bufio" "fmt" "math" "os" "strconv" ) func exec(stdin *Stdin, stdout *Stdout) { s := stdin.Read() x := (len(s) - 1) / 2 if isPalindromic(s) && isPalindromic(s[:x]) && isPalindromic(s[x+1:]) { stdout.Println("Yes") } else { stdout.Println("No") } } func isPalindromic(s string) bool...
[["+", 15, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 16, 31, 16, 12, 2, 63, 22], ["+", 15, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 2, 3, 4, 0, 443, 439, 22]]
7
447
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool checkPali(string s) { int p1 = 0, p2 = s.length() - 1; while (p1 < p2) { if (s[p1] != s[p2]) { return false; } p1++, p2--; } if (s.length() % 2 == 0) { if (s[p1] != s[p2]) { return false; } } return tru...
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool checkPali(string s) { int p1 = 0, p2 = s.length() - 1; while (p1 < p2) { if (s[p1] != s[p2]) { return false; } p1++, p2--; } if (s.length() % 2 == 0) { if (s[p1] != s[p2]) { return false; } } return tru...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 355], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
199
#include <iostream> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string stringo, stringo2, stringo3; cin >> stringo; int lengtho; lengtho = stringo.size(); stringo2 = stringo.substr(0, (lengtho - 1) / 2); stringo3 = stringo.substr((...
#include <iostream> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string stringo, stringo2, stringo3; cin >> stringo; int lengtho; lengtho = stringo.size(); stringo2 = stringo.substr(0, (lengtho - 1) / 2); stringo3 = stringo.substr((...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
129
a = input() for i in range(len(a) // 2): if a[i] != b[-(i+1)]: print("No") exit() b = a[0:(len(a) - 1) // 2] c = a[(len(a) + 3) // 2 - 1:len(a)] for i in range(len(b) // 2): if b[i] != b[-(i+1)]: print("No") exit() for i in range(len(c) // 2): if c[i] != c[-(i+1)]: pr...
a = input() for i in range(len(a) // 2): if a[i] != a[-(i+1)]: print("No") exit() b = a[0:(len(a) - 1) // 2] c = a[(len(a) + 3) // 2 - 1:len(a)] for i in range(len(b) // 2): if b[i] != b[-(i+1)]: print("No") exit() for i in range(len(c) // 2): if c[i] != c[-(i+1)]: pr...
[["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22]]
5
164
S = input() N = len(S) ans = 'No' if S == S[::-1]: if S[:N//2] == S[N//2::-1]: ans = 'Yes' print(ans)
S = input() N = len(S) ans = 'No' if S == S[::-1]: if S[:N//2] == S[(N//2)-1::-1]: ans = 'Yes' print(ans)
[["+", 0, 206, 206, 663, 0, 657, 31, 23, 0, 24], ["+", 0, 206, 206, 663, 0, 657, 31, 23, 0, 25], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 12, 612]]
5
56
S = input() N = len(S) a = S[0:(N-1)//2] b = S[(N+3)//2-1:] def k(a): for i in ragne(len(a)): if a[i] != a[len(a)-1-i]: return False else: return True if k(S) & k(a) & k(b): print("Yes") else: print("No")
S = input() N = len(S) a = S[0:(N-1)//2] b = S[(N+3)//2-1:] def k(a): for i in range(len(a)): if a[i] != a[len(a)-1-i]: return False else: return True if k(S) & k(a) & k(b): print("Yes") else: print("No")
[["-", 0, 14, 8, 196, 0, 7, 12, 652, 63, 22], ["+", 0, 14, 8, 196, 0, 7, 12, 652, 63, 22]]
5
111
s = input() def check(s): if len(s) == 1 or len(s) == 0: return True if s[0]!=s[-1]: return False return check(s[1:-1]) mid = len(s)//2 if check(s) and check(s[0:mid]) and check(s[mid:]): print("Yes") else: print("No")
s = input() def check(s): if len(s) == 1 or len(s) == 0: return True if s[0]!=s[-1]: return False return check(s[1:-1]) mid = len(s)//2 if check(s) and check(s[0:mid]) and check(s[mid+1:]): print("Yes") else: print("No")
[["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
100
#include <stdio.h> #include <string.h> int main() { int i; char s[100]; int n; scanf("%s", s); n = strlen(s); for (i = 0; i > n / 2; i++) { if (s[i] != s[n - i - 1]) { printf("No\n"); return 0; } } for (i = 0; i > n / 4; i++) { if (s[i] != s[n / 2 - i - 1]) { printf("No...
#include <stdio.h> #include <string.h> int main() { int i; char s[100]; int n; scanf("%s", s); n = strlen(s); for (i = 0; i < n / 2; i++) { if (s[i] != s[n - i - 1]) { printf("No\n"); return 0; } } for (i = 0; i < n / 4; i++) { if (s[i] != s[n / 2 - i - 1]) { printf("No...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
0
143
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); if (isPalindrome(s.substring(0, (s.length() - 1) / 2)) && isPalindrome(s.substring((s.length() + 3) / 2 - 1))) { System.out.println("...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); if (isPalindrome(s) && isPalindrome(s.substring(0, (s.length() - 1) / 2)) && isPalindrome(s.substring((s.length() + 3) / 2 - 1))) { S...
[["+", 0, 16, 31, 16, 31, 492, 3, 4, 0, 25], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 98], ["+", 15, 15, 0, 16, 31, 16, 12, 492, 141, 22], ["+", 0, 16, 31, 16, 12, 492, 3, 4, 0, 24], ["+", 31, 16, 12, 492, 3, 4, 0, 492, 500, 22]]
3
186
def check(a): i=0 j=len(a)-1 b=True while(i<=j): if(a[i]!=a[j]): return False i+=1; j-=1 return b a=(input()) b=a[:(len(a)-1)//2:] c=a[(len(a)+3)//2::] if(check(a)==True and check(b)==True and check(c)==True): print("Yes") else: print("No")
def check(a): i=0 j=len(a)-1 b=True while(i<=j): if(a[i]!=a[j]): return False i+=1; j-=1 return b a=(input()) b=a[:(len(a)-1)//2:] c=a[(len(a)+2)//2::] #print(a,b,c) if(check(a)==True and check(b)==True and check(c)==True): print("Yes") else: print("No")...
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]]
5
130
S=input() ans="Yes" if all(a==b for a,b in zip(S,reversed(S))): if all(a==b for a,b in zip(S,reversed(S[:N//2]))): pass else: ans="No" else: ans="No" print(ans)
S=input() ans="Yes" if all(a==b for a,b in zip(S,reversed(S))): if all(a==b for a,b in zip(S,reversed(S[:len(S)//2]))): pass else: ans="No" else: ans="No" print(ans)
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 31, 22], ["+", 0, 206, 206, 663, 0, 657, 31, 652, 63, 22], ["+", 206, 663, 0, 657, 31, 652, 3, 4, 0, 24], ["+", 206, 663, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 206, 663, 0, 657, 31, 652, 3, 4, 0, 25]]
5
79
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); string ans = "Yes"; for (int i = 0; i <= (N - 1) / 4; i++) { if (S.at(i) == S.at((N - 1) / 2 - i) && S.at((N - 1) / 2 - i) == S.at((N - 1) / 2 + i) && S.at((N - 1) / 2 + i) == S.at(N - 1 - i))...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); string ans = "Yes"; for (int i = 0; i <= (N - 1) / 4; i++) { if (S.at(i) == S.at((N - 3) / 2 - i) && S.at((N - 3) / 2 - i) == S.at((N + 1) / 2 + i) && S.at((N + 1) / 2 + i) == S.at(N - 1 - i))...
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 16, 31, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72]]
1
158
s = gets def iskaibun(s) if s == s.reverse return true else return false end end len = s.size - 1 if iskaibun(s) \ and iskaibun(s[0..(len-1).div(2)]) \ and iskaibun(s[(len+3).div(2)..len]) puts "Yes" else puts "No" end
s = gets.rstrip def iskaibun(s) if s == s.reverse return true else return false end end len = s.size - 1 if iskaibun(s) \ and iskaibun(s[0..(len-1).div(2)]) \ and iskaibun(s[(len+3).div(2)..len]) puts "Yes" else puts "No" end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
83
#include <bits/stdc++.h> #define ll long long #define pet pair<int, int> #define one first #define two second #ifdef debug #define cin fin #define fileopen fin.open("test.txt"); #else #define fileopen #endif #define int long long #define big 1000000007 #define all(x) x.begin(), x.end() using namespace std; ifstream...
#include <bits/stdc++.h> #define ll long long #define pet pair<int, int> #define one first #define two second #ifdef debug #define cin fin #define fileopen fin.open("test.txt"); #else #define fileopen #endif #define int long long #define big 1000000007 #define all(x) x.begin(), x.end() using namespace std; ifstream...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
443
import numpy as np def judge(s): l = len(s) for i in range(int(l/2)): if(s[i] != s[l-1-i]): return False return True def main(): args = input().rstrip().split(' ') S = np.array([c for c in args[0]]) l = len(S) s1 = np.array([S[i] for i in range(0, int(l/2))]) s2 = n...
import numpy as np def judge(s): l = len(s) for i in range(int(l/2)): if(s[i] != s[l-1-i]): return False return True def main(): args = input().rstrip().split(' ') S = np.array([c for c in args[0]]) l = len(S) s1 = np.array([S[i] for i in range(0, int(l/2))]) s2 = n...
[["+", 0, 679, 31, 679, 31, 652, 3, 4, 0, 22], ["+", 0, 679, 31, 679, 31, 652, 3, 4, 0, 25], ["+", 0, 57, 15, 23, 0, 679, 31, 679, 17, 355], ["+", 15, 23, 0, 679, 31, 679, 12, 652, 63, 22], ["+", 0, 679, 31, 679, 12, 652, 3, 4, 0, 24]]
5
187
s=list("akasaka") N=len(s) a=int((N-1)/2) b=int((N+1)/2) if s[::-1]==s and s[:a]==s[b:]: print('Yes') else: print('No')
s=list(input()) N=len(s) a=int((N-1)/2) b=int((N+1)/2) if s[::-1]==s and s[:a]==s[b:]: print('Yes') else: print('No')
[["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
75
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; int n = s.size(); string ss = s; string sss = s; bool ok = false, ok1 = false, ok2 = false; int i = 0; int j = n - 1; while (i < j) { swap(sss[i], sss[j]); i++; j--; } if (sss == s) ...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string s; cin >> s; int n = s.size(); string ss = s; string sss = s; bool ok = false, ok1 = false, ok2 = false; int i = 0; int j = n - 1; while (i < j) { swap(sss[i], sss[j]); i++; j--; } if (sss == s) ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
290
def palindrome(x): reverse = x[::-1] for i in range(len(x)): if (x[i] != reverse[i]): return False return True c = input() l = len(c) ["No","Yes"][palindrome(c) & palindrome(c[:(l-1)//2])& palindrome(c[(l+2)//2:])]
def palindrome(x): reverse = x[::-1] for i in range(len(x)): if (x[i] != reverse[i]): return False return True c = input() l = len(c) print(["No","Yes"][palindrome(c) & palindrome(c[:(l-1)//2])& palindrome(c[(l+2)//2:])])
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
99
s = input() # 1. Sは回文である。 rs = s[::-1] q1 = 0 if s == rs: q1 = 1 # 2. Nを Sの長さとするとき、Sの 1文字目から (N−1)/2 # 文字目まで(両端含む)からなる文字列は回文である。 n = len(s) h = int((n-1)/2) s1 = s[:h:] rs1 = s[::-1] q2 = 0 if (s1 == rs1): q2 = 1 # 3. Sの (N+3)/2文字目から N文字目まで # (両端含む)からなる文字列は回文である。 n = len(s) h = int((n+2)/2) s2 = s[h::] rs2 = ...
s = input() # 1. Sは回文である。 rs = s[::-1] q1 = 0 if s == rs: q1 = 1 # print("q1=",q1) # 2. Nを Sの長さとするとき、Sの 1文字目から (N−1)/2 # 文字目まで(両端含む)からなる文字列は回文である。 n = len(s) h = int((n-1)/2) # print("n,h=",n,h) s1 = s[:h:] # print("s1=",s1) rs1 = s1[::-1] q2 = 0 if (s1 == rs1): q2 = 1 # print("q2=",q2) # 3. Sの (N+3)/2文字目から N文字目...
[["-", 0, 656, 0, 1, 0, 662, 12, 206, 51, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 206, 51, 22]]
5
153
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) \ for (__typeo...
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) \ for (__typeo...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
332
S = list(str(input())) inv = list(reversed(S)) n = len(S) d = int((n-1)/2) q = int((n+1)/2) if S != inv: print('No') print("1") else: if S[:d] == S[q:]: print('Yes') else: print('No')
S = list(str(input())) inv = list(reversed(S)) n = len(S) d = int((n-1)/2) q = int((n+1)/2) if S != inv: print('No') else: if S[:d] == S[q:]: print('Yes') else: print('No')
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
96
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) ############ ---- Input Functions ---- ############ def in_int(): return (int(input())) def in_list(): return (list(map(int, input().split()))) def in_str(): s = input() return (list(s[:len(s) - 1])) def in_ints(): return (ma...
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) ############ ---- Input Functions ---- ############ def in_int(): return (int(input())) def in_list(): return (list(map(int, input().split()))) def in_str(): s = input() return (list(s[:len(s) - 1])) def in_ints(): return (ma...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
201
S = input() s1 = S[:(N-1)//2] s2 = S[(N+3)//2-1:] if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]: print("Yes") else: print("No")
S = input() N = len(S) s1 = S[:(N-1)//2] s2 = S[(N+3)//2-1:] if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]: print("Yes") else: print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
78
#include <algorithm> #include <iostream> #include <string> using namespace std; int checkPalindrome(string s) { int n = s.length(); string ans = ""; for (int i = n - 1; i >= 0; i--) { ans += s[i]; } if (s == ans) return 1; return 0; } int checkStrongPalindrome(string s) { if (checkPalindrome(s) ...
#include <algorithm> #include <iostream> #include <string> using namespace std; int checkPalindrome(string s) { int n = s.length(); string ans = ""; for (int i = n - 1; i >= 0; i--) { ans += s[i]; } if (s == ans) return 1; return 0; } int checkStrongPalindrome(string s) { if (checkPalindrome(s) ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
187
S = input() def Check1(S): for i in range((len(S) - 1) // 2): if S[i] != S[len(S) - 1 - i]: return False return True def Check2(S): S2 = "" for i in range(0, (len(S) - 1) // 2): S2 = S2 + S[i] return Check1(S2) def Check3(S): S3 = "" for i in range((len(S) + 3)...
S = input() def Check1(S): for i in range(len(S) // 2): if S[i] != S[len(S) - 1 - i]: return False return True def Check2(S): S2 = "" for i in range(0, (len(S) - 1) // 2): S2 = S2 + S[i] return Check1(S2) def Check3(S): S3 = "" for i in range((len(S) + 3) // 2 ...
[["-", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 31, 23, 0, 657, 31, 652, 3, 4, 0, 25], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
167
S=input() N=len(S) F=S[0:(N-1)//2] B=S[(N+3)//2-1:N] print(F,B) if(F==B): l=len(F) for i in range(l//2): if(F[i]!=F[l-1-i]): print("No") break print("Yes") else: print("No")
S=input() N=len(S) F=S[0:(N-1)//2] B=S[(N+3)//2-1:N] if(F==B): l=len(F) for i in range(l//2): if(F[i]!=F[l-1-i]): print("No") break print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
108
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string a, b, s, t; ll i, j, l, f; cin >> a; b = a; reverse(a.begin(), a.end()); if (a == b) { l = b.size() / 2; j = l + 1; f = 0; for (i = 0; i < l; i++) { if (b[i] != b[j]) { f = 1; bre...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string a, b, s, t; ll i, j, l, f; cin >> a; b = a; reverse(a.begin(), a.end()); if (a == b) { l = b.size() / 2; j = l + 1; f = 0; for (i = 0; i < l; i++) { if (b[i] != b[j]) { f = 1; bre...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
158
S=input() N=len(S) cnt=0 cnt1=0 cnt2=0 for i in range (N): if S[i]==S[N-1-i]: cnt+=1 if cnt==N: for j in range((N-1)//2): if S[j]==S[(N-1)//2 -1-j]: cnt1+=1 if cnt1==(N-1)//2: for k in range((N-1)//2): if S[(N+3)//2 -1+k]==S[N-1-k]: cnt2+=1 ...
S=input() N=len(S) cnt=0 cnt1=0 cnt2=0 for i in range (N): if S[i]==S[N-1-i]: cnt+=1 if cnt==N: for j in range((N-1)//2): if S[j]==S[(N-1)//2 -1-j]: cnt1+=1 if cnt1==(N-1)//2: for k in range((N-1)//2): if S[(N+3)//2 -1+k]==S[N-1-k]: cnt2+=1 ...
[["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
183
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool checkpal(string s) { string r = s; reverse(r.begin(), r.end()); return r == s; } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; ll n = s.length(); if (checkpal(s.substr(0, (n - 1) / 2)) && checkpal(s.substr...
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool checkpal(string s) { string r = s; reverse(r.begin(), r.end()); return r == s; } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; ll n = s.length(); if (checkpal(s) && checkpal(s.substr(0, (n - 1) / 2)) && ...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
132
def is_palindrome(str): i, j = 0, len(str)-1 while i >= j: if str[i] != str[j]: return False i += 1 j -= 1 return True s = input() n = len(s) if is_palindrome(s) and is_palindrome(s[0:((n-1)//2)]) and is_palindrome(s[(n+3)//2-1:]): print("Yes") else: print("No")
def is_palindrome(str): i, j = 0, len(str)-1 while i <= j: if str[i] != str[j]: return False i += 1 j -= 1 return True s = input() n = len(s) if is_palindrome(s) and is_palindrome(s[0:((n-1)//2)]) and is_palindrome(s[(n+3)//2-1:]): print("Yes") else: print("No")
[["-", 0, 14, 8, 196, 0, 52, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 52, 15, 666, 667, 19]]
5
110
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { if (s == string(s.rbegin(), s.rend())) { return true; } else { return false; } } int main() { string m; cin >> m; int n = m.length(); string gh = m.substr(0, (n - 1) / 2); string kk = m.substr((n + 3) / 2 - 1, n - (n + 3...
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { if (s == string(s.rbegin(), s.rend())) { return true; } else { return false; } } int main() { string m; cin >> m; int n = m.length(); string gh = m.substr(0, (n - 1) / 2); string kk = m.substr((n + 3) / 2 - 1, n - (n + 3...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
143
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long int #define ld long double #define f(t) for (ll i = 0; i < t; i++) #define vi vector<int> #define vl vector<ll> #define pri pair<int, int> #define mpi map<int, int> #define prl pair<ll, ll> #define mp make_pair #define mpl m...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long int #define ld long double #define f(t) for (ll i = 0; i < t; i++) #define vi vector<int> #define vl vector<ll> #define pri pair<int, int> #define mpi map<int, int> #define prl pair<ll, ll> #define mp make_pair #define mpl m...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24]]
1
333
s = input() l = s[:(len(s)-1)//2:] r = s[(len(s)+1)//2:] if a == b and a == a[::-1]: print("Yes") else: print("No")
s = input() a = s[:(len(s)-1)//2:] b = s[(len(s)+1)//2:] if a == b and a == a[::-1]: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
67
s = input() n = len(s) a = s[:(n-1)//2] b = s[(n+3)//2:] if a == b and a == a[::-1]: print('Yes') else: print('No')
s = input() n = len(s) a = s[:(n-1)//2] b = s[(n+1)//2:] if a == b and a == a[::-1]: print('Yes') else: print('No')
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]]
5
66
s = input() n = len(s) s1 = s[0:(n-1)//2] s2 = s1[::-1] s3 = s[(n+3)//2-1:n] s4 = s3[::-1] if s1 == s2 and s3 == s4: print('Yes') else: print('No')
s = input() n = len(s) s1 = s[0:(n-1)//2] s2 = s1[::-1] s3 = s[(n+3)//2-1:n] s4 = s3[::-1] if s1 == s2 == s3 == s4: print('Yes') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60]]
5
82
/*author : Yashvardhan Tuesday, April 07, 2020 8:24 PM */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll #define pb push_back #define vi vector<int> #define pi pair<int, int> #define vpi vector<pi> #define ff first #define ss second #define mp make_pair #define endl '\n' #define a...
/*author : Yashvardhan Tuesday, April 07, 2020 8:24 PM */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll #define pb push_back #define vi vector<int> #define pi pair<int, int> #define vpi vector<pi> #define ff first #define ss second #define mp make_pair #define endl '\n' #define a...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24]]
1
726
#include <bits/stdc++.h> using namespace std; #define ll long long int bool kaibun(string S) { for (int i = 0; i < S.size() / 2; i++) { if (S.at(i) != S.at(S.size() - i - 1)) { return false; } } return true; } int main() { string S; cin >> S; string mae, ato; for (int i = 0; i < (S.size() ...
#include <bits/stdc++.h> using namespace std; #define ll long long int bool kaibun(string S) { for (int i = 0; i < S.size() / 2; i++) { if (S.at(i) != S.at(S.size() - i - 1)) { return false; } } return true; } int main() { string S; cin >> S; string mae, ato; for (int i = 0; i < (S.size() ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
195
#-String Palindrome import math character = input() re_character = character[::-1] num = int(len(character)) middle = math.ceil(num/2.0) print(middle) #print(character[0:middle-1], re_character[middle:num]) #print(character[0:num], re_character[0:num]) #print (character[middle:num], re_character[0:middle-1]) if (cha...
#-String Palindrome import math character = input() re_character = character[::-1] num = int(len(character)) middle = math.ceil(num/2.0) #print(middle) #print(character[0:middle-1], re_character[middle:num]) #print(character[0:num], re_character[0:num]) #print (character[middle:num], re_character[0:middle-1]) if (ch...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
101
a = input() if a == a[::-1]: b = a[:int((len(a) - 1) / 2)] c = a[int((len(a) + 3) / 2):] if b == b[::-1] and c == c[::-1]: print('Yes') exit(0) print('No')
a = input() if a == a[::-1]: b = a[:int((len(a) - 1) / 2)] c = a[int((len(a) + 3) / 2) - 1:] if b == b[::-1] and c == c[::-1]: print('Yes') exit(0) print('No')
[["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
91
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; int main() { string s; cin >> s; int n; n = s.length(); for (int i = 0; i < n / 2; i++) { if (s[i] != s[n - 1 - i]) { cout << ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; int main() { string s; cin >> s; int n; n = s.length(); for (int i = 0; i < n / 2; i++) { if (s[i] != s[n - 1 - i]) { cout << ...
[["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
183
#include <algorithm> #include <cstdlib> #include <functional> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; int main() { string S, S_reverse, S_small, S_small_reverse; cin >> S; S_reverse = S; reverse(S_reverse.begin(), S_reverse.end()); for (int i = 0; ...
#include <algorithm> #include <cstdlib> #include <functional> #include <iostream> #include <string> #include <vector> #define ll long long using namespace std; int main() { string S, S_reverse, S_small, S_small_reverse; cin >> S; S_reverse = S; reverse(S_reverse.begin(), S_reverse.end()); for (int i = 0; ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107]]
1
142
S = gets.chomp if S == S.reverse && S[0, S.size/2] == S.reverse[0, S.size/2] puts 'Yes' else puts 'No' end
S = gets.chomp if S == S.reverse && S[0, S.size/2] == S[0, S.size/2].reverse puts 'Yes' else puts 'No' end
[["-", 15, 738, 12, 738, 12, 742, 500, 652, 17, 131], ["-", 15, 738, 12, 738, 12, 742, 500, 652, 735, 22], ["+", 0, 121, 15, 738, 12, 738, 12, 652, 17, 131], ["+", 0, 121, 15, 738, 12, 738, 12, 652, 735, 22]]
4
45
# -*- coding: utf-8 -*- """ Created on Thu Mar 19 11:55:12 2020 @author: 17664 """ kaibun = input() joken1 = kaibun[:(len(kaibun)-1)//2] # print(joken1) joken2 = kaibun[(len(kaibun)+2)//2:] # print(joken2) ans = 'no' if kaibun == kaibun[::-1] and joken1 == joken1[::-1] and joken2 == joken2[::-1]: ans = 'yes' ...
# -*- coding: utf-8 -*- """ Created on Thu Mar 19 11:55:12 2020 @author: 17664 """ kaibun = input() joken1 = kaibun[:(len(kaibun)-1)//2] # print(joken1) joken2 = kaibun[(len(kaibun)+2)//2:] # print(joken2) ans = 'No' if kaibun == kaibun[::-1] and joken1 == joken1[::-1] and joken2 == joken2[::-1]: ans = 'Yes' ...
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
88
#include <bits/stdc++.h> using namespace std; string s; bool check(int l, int r) { bool ok = true; while (l <= r) { if (s[l] != s[r]) { ok = false; break; } l++; r--; } return ok; } int main() { cin >> s; int n = s.length(); int l = 0, r = n - 1; bool ok; ok = check(l, r); ...
#include <bits/stdc++.h> using namespace std; string s; bool check(int l, int r) { bool ok = true; while (l <= r) { if (s[l] != s[r]) { ok = false; break; } l++; r--; } return ok; } int main() { cin >> s; int n = s.length(); int l = 0, r = n - 1; bool ok; ok = check(l, r); ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
192
#include <bits/stdc++.h> using namespace std; template <class t> inline t read(t &x) { char c = getchar(); bool f = 0; x = 0; while (!isdigit(c)) f |= c == '-', c = getchar(); while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar(); if (f) x = -x; return x; } template <class t> in...
#include <bits/stdc++.h> using namespace std; template <class t> inline t read(t &x) { char c = getchar(); bool f = 0; x = 0; while (!isdigit(c)) f |= c == '-', c = getchar(); while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar(); if (f) x = -x; return x; } template <class t> in...
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 3, 4, 0, 16, 31, 16, 12, 23, 0, 24], ["-", 31, 16, 12, 23, 0, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 3, 4, 0, 16, 31, 16, 12, 23, 0, 25], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 72]]
1
299
S = input() #initialize IsKaibun = 'NO' N = len(S) def check_kaibun( mojiretu ): names = len(mojiretu) IsKaibunLocal = 'YES' for name in range((names + 1) // 2): if mojiretu[name] != mojiretu[names - 1 - name]: IsKaibunLocal = 'NO' return IsKaibunLocal #pre check if N%2 != 1 and...
S = input() #initialize IsKaibun = 'No' N = len(S) def check_kaibun( mojiretu ): names = len(mojiretu) IsKaibunLocal = 'Yes' for name in range((names + 1) // 2): if mojiretu[name] != mojiretu[names - 1 - name]: IsKaibunLocal = 'No' return IsKaibunLocal #pre check if N%2 != 1 and...
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 8, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0,...
5
159
"use strict"; var processData = function processData(lines) { var s = lines[0]; var mid = s.length / 2; if (s.slice(0, mid) === s.slice(mid)) { console.log('Yes'); } else { console.log('No'); } }; var i = ''; process.stdin.on('data', function(c) { return i += c; }); process.stdin.on('end', function...
"use strict"; var processData = function processData(lines) { var s = lines[0]; var mid = s.length / 2; if (s.slice(0, mid) === s.slice(mid + 1)) { console.log('Yes'); } else { console.log('No'); } }; var i = ''; process.stdin.on('data', function(c) { return i += c; }); process.stdin.on('end', func...
[["+", 0, 16, 12, 2, 3, 3, 0, 16, 17, 72], ["+", 0, 16, 12, 2, 3, 3, 0, 16, 12, 555]]
2
151
input = gets.chop.split('') def palindrome?(str) str == str.reverse end answer = true answer = false if !palindrome?(input) answer = false if !palindrome?(input[0..(input.count / 2)]) puts answer ? 'Yes' : 'No'
input = gets.chop.split('') def palindrome?(str) str == str.reverse end answer = true answer = false if !palindrome?(input) answer = false if !palindrome?(input[0..(input.count - 1) / 2 - 1]) puts answer ? 'Yes' : 'No'
[["+", 444, 738, 31, 738, 31, 739, 0, 738, 17, 33], ["+", 444, 738, 31, 738, 31, 739, 0, 738, 12, 612], ["+", 0, 475, 444, 738, 31, 738, 31, 739, 0, 25], ["-", 3, 4, 0, 742, 0, 475, 444, 739, 0, 25], ["+", 3, 4, 0, 742, 0, 475, 444, 738, 17, 33], ["+", 3, 4, 0, 742, 0, 475, 444, 738, 12, 612]]
4
64
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); int res = 0; int check = 0; for (int i = 0; i < N; i++) { if (S.at(i) == S.at(N - 1 - i)) { check = check + 0; } else { check = check + 1; } } if (check == 0) { res = res + ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); int res = 0; int check = 0; for (int i = 0; i < N; i++) { if (S.at(i) == S.at(N - 1 - i)) { check = check + 0; } else { check = check + 1; } } if (check == 0) { res = res + ...
[["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
305
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const s...
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const s...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
864
s=input() n=len(s) def pal(x): for i in range(len(x)//2): if x[i]!=x[-1-i]: return False return True if pal(s[:n//2]) and pal(s[n//2+1:]): print('Yes') else: print('No')
s=input() n=len(s) def pal(x): for i in range(len(x)//2): if x[i]!=x[-1-i]: return False return True if pal(s[:n//2]) and pal(s[n//2+1:]) and pal(s): print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 679, 12, 652, 63, 22], ["+", 0, 57, 15, 679, 12, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 679, 12, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 679, 12, 652, 3, 4, 0, 25]]
5
87
#include <bits/stdc++.h> using namespace std; bool palin(string str) { string temp = str; reverse(temp.begin(), temp.end()); return (temp == str); } bool fun(string str) { int n = str.length(); string a = str.substr(0, ((n - 1) / 2)); // cout<<a<<endl; string b = str.substr(((n + 3) / 2) - 1); // ...
#include <bits/stdc++.h> using namespace std; bool palin(string str) { string temp = str; reverse(temp.begin(), temp.end()); return (temp == str); } bool fun(string str) { int n = str.length(); string a = str.substr(0, ((n - 1) / 2)); // cout<<a<<endl; string b = str.substr(((n + 3) / 2) - 1); // ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
156
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a), 0LL) #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define RREP(i, n) for (int(i)...
#include <bits/stdc++.h> using namespace std; #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define MIN(a) *min_element(all(a)) #define MAX(a) *max_element(all(a)) #define SUM(a) accumulate(all(a), 0LL) #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) #define RREP(i, n) for (int(i)...
[["+", 15, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 15, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 12, 23, 0, 41, 15, 16, 31, 16, 17, 98], ["+", 0, 41, 15, 16, 31, 16, 12, 2, 63, 22], ["+", 15, 16, 31, 16, 12, 2, 3, 4, 0, 24]]
1
387
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define fi first #define se second #define all(vr) vr.begin(), vr.end() #define pi pair<int, int> typedef long long ll; namespace myrand { mt19937 mt(chrono::system_clock::now().time_since_epoch() / chrono::microseconds...
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define fi first #define se second #define all(vr) vr.begin(), vr.end() #define pi pair<int, int> typedef long long ll; namespace myrand { mt19937 mt(chrono::system_clock::now().time_since_epoch() / chrono::microseconds...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
335
S = list(input()) N = len(S) S2 = S[:(N-1)//2+2] if S == S[::-1] and S2 == S2[::-1]: print('Yes') else: print('No')
S = input() N = len(S) S2 = S[:(N-1)//2] if S == S[::-1] and S2 == S2[::-1]: print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 12, 206, 206, 663, 0, 657, 31, 657, 12, 612], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72]]
5
64
#include <bits/stdc++.h> using namespace std; bool pro(string a) { int st = 0, ed = a.size() - 1; while (st <= ed) { if (a[st] != a[ed]) return false; st++; ed--; } return true; } int main() { string s, s1, s2; cin >> s; int n = s.size(); s1 = s.substr(0, (n - 1) / 2); s2 = s.substr(...
#include <bits/stdc++.h> using namespace std; bool pro(string a) { int st = 0, ed = a.size() - 1; while (st <= ed) { if (a[st] != a[ed]) return false; st++; ed--; } return true; } int main() { string s, s1, s2; cin >> s; int n = s.size(); s1 = s.substr(0, (n - 1) / 2); s2 = s.substr(...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24]]
1
155
#include <cstring> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int l = s.size(); if (l % 2 == 0) cout << "NO\n"; else { for (int i = 0; i < l / 2; i++) { if (s[i] != s[l - i - 1]) { cout << "NO\n"; // cout<<i<<"和"<<l-i-1<<" ...
#include <cstring> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int l = s.size(); if (l % 2 == 0) cout << "No\n"; else { for (int i = 0; i < l / 2; i++) { if (s[i] != s[l - i - 1]) { cout << "No\n"; // cout<<i<<"和"<<l-i-1<<" ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
239
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { string s; cin >> s; vector<char> S(s.length()); rep(i, s.length()) S.at(i) = s.at(i); bool yes = true; rep(i, s.length() / 2) { if (s.at(i) != s...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; int main() { string s; cin >> s; vector<char> S(s.length()); rep(i, s.length()) S.at(i) = s.at(i); bool yes = true; rep(i, s.length() / 2) { if (s.at(i) != s...
[["-", 0, 2, 3, 4, 0, 41, 64, 5, 0, 6], ["+", 0, 2, 3, 4, 0, 41, 64, 5, 0, 6]]
1
268
#include <bits/stdc++.h> using namespace std; bool check_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); bool is = true; is &= check_palindrome(s.substr(0, (n - 1) / 2)); is &= check_palindrome(s.substr((n + 1) / 2)); co...
#include <bits/stdc++.h> using namespace std; bool check_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); bool is = check_palindrome(s); is &= check_palindrome(s.substr(0, (n - 1) / 2)); is &= check_palindrome(s.substr((n + ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]]
1
119
#include <bits/stdc++.h> using namespace std; bool isPalind(string s) { string rs = s; reverse(rs.begin(), rs.end()); return rs == s; } int main() { string s; cin >> s; int n = s.length(); s = "#" + s; string aa = ""; for (int i = 1; i <= (n - 1) / 2; i++) aa.push_back(s[i]); string bb = ""; ...
#include <bits/stdc++.h> using namespace std; bool isPalind(string s) { string rs = s; reverse(rs.begin(), rs.end()); return rs == s; } int main() { string s; cin >> s; int n = s.length(); s = "#" + s + "#"; string aa = ""; for (int i = 1; i <= (n - 1) / 2; i++) aa.push_back(s[i]); string bb ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6]]
1
176
#include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace std; // long long int...
#include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespace std; // long long int...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
373
#include <bits/stdc++.h> using namespace std; string s; bool isPalindrom(string x) { int n = x.length(); int l = 0, r = n - 1; while (l <= r) { if (x[l] != x[r]) return 0; l++; r--; } return 1; } int main() { cin >> s; int n = s.length(); string x1 = s.substr(0, (n - 1) / 2); string ...
#include <bits/stdc++.h> using namespace std; string s; bool isPalindrom(string x) { int n = x.length(); int l = 0, r = n - 1; while (l <= r) { if (x[l] != x[r]) return 0; l++; r--; } return 1; } int main() { cin >> s; int n = s.length(); string x1 = s.substr(0, (n - 1) / 2); string ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
170
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> typedef long long ll; #define pb push_back #define mp make_pair #define all(a) (a).begin(), (a).end() #define clr(a, h) memset(a, (h), sizeof(a)) #define mem(a, h) memset(a, (h), sizeof(a)) #define F first #define...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> typedef long long ll; #define pb push_back #define mp make_pair #define all(a) (a).begin(), (a).end() #define clr(a, h) memset(a, (h), sizeof(a)) #define mem(a, h) memset(a, (h), sizeof(a)) #define F first #define...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
348
#include <bits/stdc++.h> using namespace std; int main() { string s, r; cin >> s; r = s; int i, j; reverse(s.begin(), s.end()); if (r != s) cout << "No"; else { i = 0; j = (s.size() - 1 / 2) - 1; while (i < j) { if (s[i] != s[j]) { cout << "No"; return 0; } ...
#include <bits/stdc++.h> using namespace std; int main() { string s, r; cin >> s; r = s; int i, j; reverse(s.begin(), s.end()); if (r != s) cout << "No"; else { i = 0; j = (s.size() - 1) / 2 - 1; while (i < j) { if (s[i] != s[j]) { cout << "No"; return 0; } ...
[["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
125
//--------O&Oo&oO&O--------------- #include <bits/stdc++.h> #define FAST_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); ...
//--------O&Oo&oO&O--------------- #include <bits/stdc++.h> #define FAST_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
220
#include <bits/stdc++.h> using namespace std; #include <string> #define ll long long int #define ull unsigned long long int #define ld long double #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0...
#include <bits/stdc++.h> using namespace std; #include <string> #define ll long long int #define ull unsigned long long int #define ld long double #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
325
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <u...
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <u...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
628
S=input() N=len(S) S1=S[:((N+1)/2)] S2=S[((N+3)/2):] if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]: print("Yes") else: print("No")
S=input() N=len(S) S1=S[:int((N-1)/2)] S2=S[int((N+1)/2):] if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]: print("Yes") else: print("No")
[["+", 0, 662, 12, 206, 206, 663, 0, 652, 63, 22], ["-", 0, 23, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 0, 23, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
86
#include <iostream> //#include<stack> #include <bits/stdc++.h> #include <string> using namespace std; int P(string s) { int i = 0, n = s.size() - 1; while (i < n) { if (s[i] != s[n]) return 0; i++; n--; } return 1; } int main() { string str; cin >> str; int n = str.size(); int t = ((n ...
#include <iostream> //#include<stack> #include <bits/stdc++.h> #include <string> using namespace std; int P(string s) { int i = 0, n = s.size() - 1; while (i < n) { if (s[i] != s[n]) return 0; i++; n--; } return 1; } int main() { string str; cin >> str; int n = str.size(); int t = ((n ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 22]]
1
167
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctype.h> #include <functional> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef long long lint; int main() { string s; cin >> s; ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <ctype.h> #include <functional> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef long long lint; int main() { string s; cin >> s; ...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13]]
1
172
def palindrome(str): n = len(str) for i in range(n // 2): if str[i] != str[n - 1 - i]: return False return True str = input() is_palindrome = palindrome(str) n = len(str) if n % 2 == 1: is_palindrome = palindrome(str[:(n - 1)// 2]) and palindrome(str[(n + 1) // 2:]) print("Yes" if is_palindrome else...
def palindrome(str): n = len(str) for i in range(n // 2): if str[i] != str[n - 1 - i]: return False return True str = input() is_palindrome = palindrome(str) n = len(str) if is_palindrome and n % 2 == 1: is_palindrome = palindrome(str[:(n - 1)// 2]) and palindrome(str[(n + 1) // 2:]) print("Yes" if ...
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 31, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355]]
5
108
def isPalindrome(s): return s == s[::-1] s = input() n = len(s) res = isPalindrome(s) and isPalindrome(s[:n//2+1]) and isPalindrome(s[n//2+2:]) print("Yes" if res else "No")
def isPalindrome(s): return s == s[::-1] s = input() n = len(s) res = isPalindrome(s) and isPalindrome(s[:n//2]) and isPalindrome(s[n//2+1:]) print("Yes" if res else "No")
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
71
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { s[i] = tolower(s[i]); } int cnt = 0; string s1, s2, s3, s4, s5, s6; string temp = s; s1 = s; reverse(s1.begin(), s1.end()); // cout << endl <<endl << endl; // cout << temp <<"...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int i = 0; i < s.size(); i++) { s[i] = tolower(s[i]); } int cnt = 0; string s1, s2, s3, s4, s5, s6; string temp = s; s1 = s; reverse(s1.begin(), s1.end()); // cout << endl <<endl << endl; // cout << temp <<"...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
245
#include <bits/stdc++.h> using namespace std; int pc(string s) { for (int i = 0; i < s.length(); i++) { if (s[i] != s[s.length() - i - 1]) return 0; } return 1; } int main() { string s; cin >> s; int n = s.length(); string str1 = s.substr(0, ((n - 1) / 2)); string str2 = s.substr(((n + 3) / 2)...
#include <bits/stdc++.h> using namespace std; int pc(string s) { for (int i = 0; i < s.length(); i++) { if (s[i] != s[s.length() - i - 1]) return 0; } return 1; } int main() { string s; cin >> s; int n = s.length(); string str1 = s.substr(0, ((n - 1) / 2)); string str2 = s.substr(((n + 3) / 2)...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
158
#include <iostream> #include <string> int main() { std::string s; std::cin >> s; int i = s.length(); std::string s1 = s.substr(0, (i - 1) / 2); std::string s2 = s.substr((i + 1) / 2, i - 1); int test = 1; for (int j = 0; j < (i - 1) / 2; j++) { if (s1[j] == s1[-j + (i - 1) / 2] && s1[j] == s2[j] && ...
#include <iostream> #include <string> int main() { std::string s; std::cin >> s; int i = s.length(); std::string s1 = s.substr(0, (i - 1) / 2); std::string s2 = s.substr((i + 1) / 2, i - 1); int test = 1; for (int j = 0; j < (i - 3) / 2; j++) { if (s1[j] == s1[-j + (i - 3) / 2] && s1[j] == s2[j] && ...
[["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
200
#include <bits/stdc++.h> using namespace std; bool checkPal(string s) { for (int i = 0, j = s.size() - 1; i < j; i++, j--) { // cout << i << " " << j << endl ; // cout << s[i] << " " << s[j] << endl ; if (s[i] != s[j]) return false; } return true; } int main() { ios_base::sync_with_stdio; c...
#include <bits/stdc++.h> using namespace std; bool checkPal(string s) { for (int i = 0, j = s.size() - 1; i < j; i++, j--) { // cout << i << " " << j << endl ; // cout << s[i] << " " << s[j] << endl ; if (s[i] != s[j]) return false; } return true; } int main() { ios_base::sync_with_stdio; c...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
205
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> typedef long long ll; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const...
[["-", 0, 16, 31, 16, 31, 2, 63, 118, 28, 22], ["+", 0, 16, 31, 16, 31, 2, 63, 118, 28, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9, 0, 37, 0, 38], ["+", 0, 57, 75, 76, 0, 9, 0, 37, 0, 13]]
1
799
s = input() n = len(s) for i in range(n): if s[i] != s[-1 - i]: print("No") exit() if s[:(n + 1) // 2] == s[(n + 3) // 2:]: print("Yes") else: print("No")
s = input() n = len(s) for i in range(n): if s[i] != s[-1 - i]: print("No") exit() if s[:(n - 1) // 2] == s[(n + 1) // 2:]: print("Yes") else: print("No")
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]]
5
81
import java.awt.Point; import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static class Solver { public void solve(MyReader in, PrintWriter out) { String s = in.next(); int n = s.length(); boolean res = isPali(s); String a = (s.substring(0, (n - 1) / 2)...
import java.awt.Point; import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static class Solver { public void solve(MyReader in, PrintWriter out) { String s = in.next(); int n = s.length(); boolean res = isPali(s); String a = (s.substring(0, (n - 1) / 2)...
[["+", 8, 196, 0, 57, 15, 15, 0, 91, 17, 111], ["-", 8, 196, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 196, 0, 57, 64, 1, 0, 11, 12, 147]]
3
695
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define F first #define S second #define endl "\n" #define inf 1000000007 #define FOR(i, a, b) for (int i = a; i < b; i++) #define bigboi 1e18 mt19937 RNG(chrono::st...
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define all(a) (a).begin(), (a).end() #define sz(x) (int)x.size() #define F first #define S second #define endl "\n" #define inf 1000000007 #define FOR(i, a, b) for (int i = a; i < b; i++) #define bigboi 1e18 mt19937 RNG(chrono::st...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
279
line = gets.chomp n = line.size array1 = [] array2 = [] (0..((n-3)/2)).each do |i| array1.push(line[i]) end ((n+1)/2..(n-1)).each do |i| array2.push(line[i]) end if array1 == array2 puts "yes" else puts "No" end
line = gets.chomp n = line.size array1 = [] array2 = [] (0..((n-3)/2)).each do |i| array1.push(line[i]) end ((n+1)/2..(n-1)).each do |i| array2.push(line[i]) end if array1 == array2 puts "Yes" else puts "No" end
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6]]
4
92
def judge(s): inv_str = s[::-1] # print(inv_str) if(s == inv_str): return 0 else: return 1 x = str(input()) len = len(x) x1 = x[:int((len-1)/2)] x2 = x[int((len+3)/2-1):] if(judge(x1)==0 and judge(x2)==0 and judge(x)): print("Yes") else: print("No")
def judge(s): inv_str = s[::-1] # print(inv_str) if(s == inv_str): return 0 else: return 1 x = str(input()) len = len(x) x1 = x[:int((len-1)/2)] x2 = x[int((len+3)/2-1):] if(judge(x1)==0 and judge(x2)==0 and judge(x)==0): print("Yes") else: print("No")
[["+", 0, 57, 15, 23, 0, 679, 12, 666, 667, 60], ["+", 0, 57, 15, 23, 0, 679, 12, 666, 0, 612]]
5
113
#include <iostream> bool is_palindrome(const std::string &s) { for (int i = 0; i < s.size() / 2; i++) { if (s[i] != s[s.size() - i - 1]) { return false; } } return true; } int main() { std::string s; std::cin >> s; std::cout << (is_palindrome(s) && is_palindrome(s....
#include <iostream> bool is_palindrome(const std::string &s) { for (int i = 0; i < s.size() / 2; i++) { if (s[i] != s[s.size() - i - 1]) { return false; } } return true; } int main() { std::string s; std::cin >> s; std::cout << (is_palindrome(s) && is_palindrome(s....
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
169
s = gets.chomp n = s.length num1 = ((n-1)/2) num2 = ((n+3)/2)-1 str1 = s[0,num1] str2 = s[num2,n] p s == s.reverse && str1 == str1.reverse && str2 == str2.reverse ? 'Yes' : 'No'
s = gets.chomp n = s.length num1 = ((n-1)/2) num2 = ((n+3)/2)-1 str1 = s[0,num1] str2 = s[num2,n] print s == s.reverse && str1 == str1.reverse && str2 == str2.reverse ? 'Yes' : 'No'
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
76
S = input() T = list(S) Tlength = len(S) N = int((len(S)-1)/2) halfN1=int(N/2) halfN2=int((Tlength+N)/2) check=0 #print(T[Tlength-2]) #print(N) #print(halfN1) #print(halfN2) for i in range(0,N): if T[i]!=T[Tlength-1-i]: check=1 break for i in range(0,halfN1): if T[i]!=T[N-1-i]: check=1 ...
S = input() T = list(S) Tlength = len(S) N = int((len(S)-1)/2) halfN1=int(N/2) halfN2=int((Tlength+N)/2) check=0 #print(T[Tlength-2]) #print(N) #print(halfN1) #print(halfN2) for i in range(0,N): if T[i]!=T[Tlength-1-i]: check=1 break for i in range(0,halfN1): if T[i]!=T[N-1-i]: check=1 ...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
168
S = input() N = len(S) T = list(S) i = 0 chack = 0 while i != int((N-1)/2): if T[i] != T[N-i-1]: chack = 1 break else: i = i+1 i = 0 while i != int((N-1)/4): if T[i] != T[int((N-1)/2-i-1)]: chack = 1 break else: i = i+1 i = 0 while i != int((N-1)/4): ...
S = input() N = len(S) T = list(S) i = 0 chack = 0 while i != int((N-1)/2): if T[i] != T[N-i-1]: chack = 1 break else: i = i+1 i = 0 while i != int((N-1)/4): if T[i] != T[int((N-1)/2-i-1)]: chack = 1 break else: i = i+1 i = 0 while i != int((N-1)/4): ...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
188
#include <bits/stdc++.h> #define fi first #define se second #define mk make_pair using namespace std; typedef long long LL; const int MAXN = 1e2 + 5; const int MAXM = 5e3 + 5; const int MOD = 1e9 + 7; const LL INF = 1e18; typedef long long LL; typedef pair<double, int> PDI; char s[MAXN]; bool checkPalindrome(int l, in...
#include <bits/stdc++.h> #define fi first #define se second #define mk make_pair using namespace std; typedef long long LL; const int MAXN = 1e2 + 5; const int MAXM = 5e3 + 5; const int MOD = 1e9 + 7; const LL INF = 1e18; typedef long long LL; typedef pair<double, int> PDI; char s[MAXN]; bool checkPalindrome(int l, in...
[["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 31, 22], ["-", 0, 1, 0, 11, 12, 23, 0, 16, 17, 67], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
204
S = input() num = len(S) S1 = S[:(num-1)//2] S2 = S[(num+3)//2:] if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]: print('Yes') else: print('No')
S = input() num = len(S) S1 = S[:(num-1)//2] S2 = S[(num+1)//2:] if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]: print('Yes') else: print('No')
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]]
5
82
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mk make_pair #define ft first #define sc second #define ppb pop_back #define sz size #define forn(i, a, n) for (i = a; i < n; i++) #define M 998244353 #define inf 2e18 int main() { ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mk make_pair #define ft first #define sc second #define ppb pop_back #define sz size #define forn(i, a, n) for (i = a; i < n; i++) #define M 998244353 #define inf 2e18 int main() { ios_base::sync_with_stdio(false); ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
238
#include <algorithm> #include <cstdlib> #include <ctime> #include <ctype.h> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> #define lld long long int #define rep(i, start, end) for (lld i = star...
#include <algorithm> #include <cstdlib> #include <ctime> #include <ctype.h> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <vector> #define lld long long int #define rep(i, start, end) for (lld i = star...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
512
S = list(input()) print(S) FS = S[:int((len(S) - 1)/ 2)] BS = S[int((len(S) + 3) / 2) -1:] r_S = list(reversed(S)) r_FS = list(reversed(FS)) r_BS = list(reversed(BS)) flag = 0 for i in range(len(S)): # print(r_FS, BS) if r_S[i] == S[i] and r_FS == FS and r_BS == BS: flag = 1 continue else...
S = list(input()) # print(S) FS = S[:int((len(S) - 1)/ 2)] BS = S[int((len(S) + 3) / 2) -1:] r_S = list(reversed(S)) r_FS = list(reversed(FS)) r_BS = list(reversed(BS)) flag = 0 for i in range(len(S)): # print(r_FS, BS) if r_S[i] == S[i] and r_FS == FS and r_BS == BS: flag = 1 continue el...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
140
#include <bits/stdc++.h> using namespace std; bool helper(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int n = s.size(); if (helper(s) && helper(s.substr(0, (n - 1) / 2)) && helper(s.substr((n + 3) / 2))) ...
#include <bits/stdc++.h> using namespace std; bool helper(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int n = s.size(); if (helper(s) && helper(s.substr(0, (n - 1) / 2)) && helper(s.substr((n + 1) / 2))) ...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
128
#include <bits/stdc++.h> #define pb emplace_back #define rt(v) return cout << v, 0 #define sz(v) (int)(v.size()) #define all(a) a.begin(), a.end() #define endl '\n' #define space " " typedef long long ll; typedef unsigned long long ull; const int N = 10 + 1e5; const int mod = 1e9 + 7; /* ███╗ ███╗███████╗███╗ ███╗...
#include <bits/stdc++.h> #define pb emplace_back #define rt(v) return cout << v, 0 #define sz(v) (int)(v.size()) #define all(a) a.begin(), a.end() #define endl '\n' #define space " " typedef long long ll; typedef unsigned long long ull; const int N = 10 + 1e5; const int mod = 1e9 + 7; /* ███╗ ███╗███████╗███╗ ███╗...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
224
#include <bits/stdc++.h> using namespace std; #define ll long long int #define f(k, n) for (auto i = k; i < n; i++) #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define f(k, n) for (auto i = k; i < n; i++) #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
155
// file creato da gio il 2020-03-25 09:50:14.760054 #include <bits/stdc++.h> #define FAST #ifdef FAST #pragma GCC optimize("Ofast") #pragma GCC target( \ "fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma GCC optimize("unroll-loop...
// file creato da gio il 2020-03-25 09:50:14.760054 #include <bits/stdc++.h> #define FAST #ifdef FAST #pragma GCC optimize("Ofast") #pragma GCC target( \ "fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #pragma GCC optimize("unroll-loop...
[["+", 15, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
193
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define ff first #define ss second #define mp make_pair #define pb push_back #define io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define M 1000000007 #define ff first #define ss second #define mp make_pair #define pb push_back #define io \ ios_base::sync_with_stdio(false); ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
226
count=0 s=input() len_s=len(s) center=int((len_s-1)/2+1) s_former=s[0:center-1] s_leter=s[center:] for a in range(int((len(s)-1)/2-1)): if(s[a]==s[-1-a]): pass else: count+=1 for a in range(int((len(s_former)-1)/2-1)): if(s_former[a]==s_former[-1-a]): pass else: count+=1 ...
count=0 s=input() len_s=len(s) center=int((len_s-1)/2+1) s_former=s[0:center-1] s_leter=s[center:] for a in range(int((len(s)-1)/2-1)): if(s[a]==s[-1-a]): pass else: count+=1 for a in range(int((len(s_former)+1)/2)): if(s_former[a]==s_former[-1-a]): pass else: count+=1 fo...
[["-", 0, 657, 31, 657, 31, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
198
/* confirm 0LL and 1LL confirm cornercases such as 0 confirm times of cin < 10^6 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector...
/* confirm 0LL and 1LL confirm cornercases such as 0 confirm times of cin < 10^6 */ #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector...
[["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
1
687
#include <bits/stdc++.h> using namespace std; #define vpll vector<pll> #define all(x) x.begin(), x.end() #define present(c, x) ((c).find(x) != (c).end()) #define dbg(...) ZZ(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void ZZ(const char *name, Arg1 &&arg1) { std::cerr << name << " = " << arg1 << "\n"; } templ...
#include <bits/stdc++.h> using namespace std; #define vpll vector<pll> #define all(x) x.begin(), x.end() #define present(c, x) ((c).find(x) != (c).end()) #define dbg(...) ZZ(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void ZZ(const char *name, Arg1 &&arg1) { std::cerr << name << " = " << arg1 << "\n"; } templ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
375
s = str(input()) n = len(s) A = str(s[:n-1//2]) B = str(s[n+3//2-1:]) if s ==(s[::-1]) and A == (A[::-1]) and B == (B[::-1]): print("Yes") else: print ("No")
s = str(input()) n = len(s) A = str(s[:(n-1)//2]) B = str(s[(n+3)//2-1:]) if s ==(s[::-1]) and A == (A[::-1]) and B == (B[::-1]): print("Yes") else: print ("No")
[["+", 0, 206, 206, 663, 0, 657, 31, 23, 0, 24], ["+", 0, 206, 206, 663, 0, 657, 31, 23, 0, 25], ["+", 206, 663, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 206, 663, 0, 657, 31, 657, 31, 23, 0, 25]]
5
95