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
s = gets.chomp.split("").map(&:to_s); sl=s.length ans = "Yes" ck1 = s.slice(0..(sl/2)-1) ck2 = s.slice(((sl/2)+1)..sl-1).reverse if (ck1!=ck2) then ans = "No" end #check2 s2 = s.slice(0..(sl/2)-1) s2l=s2.length if s2l%2==0 then ck3 = s2.slice(0..(s2l/2)) ck4 = s2.reverse.slice(0..(s2l/2)) if ck3 != ck4 then ...
s = gets.chomp.split("").map(&:to_s); sl=s.length ans = "Yes" ck1 = s.slice(0..(sl/2)-1) ck2 = s.slice(((sl/2)+1)..sl-1).reverse if (ck1!=ck2) then ans = "No" end #check2 s2 = s.slice(0..(sl/2)-1) s2l=s2.length if s2l%2==0 then ck3 = s2.slice(0..(s2l/2)) ck4 = s2.reverse.slice(0..(s2l/2)) if ck3 != ck4 then ...
[["-", 75, 95, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 75, 95, 0, 662, 12, 652, 486, 652, 735, 22]]
4
198
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) #define ALL(x) (x).begin(), (x).end() #define SIZE(x) ((ll)(x).size()) #define MAX...
#include <bits/stdc++.h> #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) #define ALL(x) (x).begin(), (x).end() #define SIZE(x) ((ll)(x).size()) #define MAX...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33]]
1
219
s = input() for i in [s, s[:len(s)], s[len(s)+1:]]: if i != i[::-1]: print("No") break else: print("Yes")
s = input() for i in [s, s[:len(s)//2], s[len(s)//2+1:]]: if i != i[::-1]: print("No") break else: print("Yes")
[["+", 12, 634, 0, 206, 206, 663, 0, 657, 17, 676], ["+", 12, 634, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 206, 206, 663, 0, 657, 31, 657, 17, 676], ["+", 0, 206, 206, 663, 0, 657, 31, 657, 12, 612]]
5
58
#include <bits/stdc++.h> using namespace std; typedef long long int lli; string s; lli a, b, c, t, temp1, temp2, x, y, temp, q, d, k, mod = 1e9 + 7; bool is(int i, int j) { string one = "", two = ""; for (int a = i; a <= j; a++) { one += s[a]; two += s[a]; } reverse(two.begin(), two.end()); if (on...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; string s; lli a, b, c, t, temp1, temp2, x, y, temp, q, d, k, mod = 1e9 + 7; bool is(int i, int j) { string one = "", two = ""; for (int a = i; a <= j; a++) { one += s[a]; two += s[a]; } reverse(two.begin(), two.end()); if (on...
[["-", 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
218
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string a; cin >> a; ll b = a.size(); ll c = (b - 1) / 2; for (ll i = 0; i < c / 2 + 1; i++) { if (a.at(i) != a.at(c - i - 1)) { cout << "No" << endl; return 0; } } for (ll i = 0; i < c / 2 + 1; i++) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string a; cin >> a; ll b = a.size(); ll c = (b - 1) / 2; for (ll i = 0; i < c / 2 + 1; i++) { if (a.at(i) != a.at(c - i - 1)) { cout << "No" << endl; return 0; } } for (ll i = 0; i < c + 1; i++) { if (...
[["-", 0, 7, 15, 16, 12, 16, 31, 16, 17, 85], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13], ["-", 31, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
163
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string str; cin >> str; int l = str.length(), c = 0, d = 0; for (int i = 0; i < l / 2; i++) { if (str[i] == str[l - i - 1]) c++; } if (c == l / 2) d++; c = 0; for (int i = 0; i < l / 4; i++) { if (str[i] ==...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string str; cin >> str; int l = str.length(), c = 0, d = 0; for (int i = 0; i < l / 2; i++) { if (str[i] == str[l - i - 1]) c++; } if (c == l / 2) d++; c = 0; for (int i = 0; i < l / 4; i++) { if (str[i] ==...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 17, 29]]
1
223
// This file is a "Hello, world!" in C++ language by GCC for wandbox. #include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> using namespace std; int main() { int i, j, len, lenr, lenp; string s, m, m2, n, m3, n2; cin >> s; len = s.size(); lenr = (len - 1) / 2; m = s; m2 = s....
// This file is a "Hello, world!" in C++ language by GCC for wandbox. #include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> using namespace std; int main() { int i, j, len, lenr, lenp; string s, m, m2, n, m3, n2; cin >> s; len = s.size(); lenr = (len - 1) / 2; m = s; m2 = s....
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
185
s = gets.chomp tsuyoi = false def kaibun?(s) if s == s.reverse return true else return false end end len = s.length tsuyoi = kaibun?(s) tsuyoi = kaibun?(s[0..((len-1)/2 - 1)]) tsuyoi = kaibun?(s[((len+3)/2 - 1)..-1]) puts tsuyoi ? "Yes" : "No"
s = gets.chomp tsuyoi = false def kaibun?(s) if s == s.reverse return true else return false end end len = s.length tsuyoi = kaibun?(s) && kaibun?(s[0..((len-1)/2 - 1)]) && kaibun?(s[((len+3)/2 - 1)..-1]) puts tsuyoi ? "Yes" : "No"
[["-", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 0, 493, 0, 662, 12, 738, 31, 738, 17, 98], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 17, 98]]
4
90
s = gets().chomp is_strong = true is_strong = false unless s == s.reverse s1 = s[0, ((s.length - 1) /2)] is_strong = false unless s1 == s1.reverse offset = ((s.length + 3) / 2) s2 = s[offset, s.length - offset + 1] is_strong = false unless s2 == s2.reverse puts is_strong ? 'Yes' : 'No'
s = gets().chomp is_strong = true is_strong = false unless s == s.reverse s1 = s[0, ((s.length - 1) /2)] is_strong = false unless s1 == s1.reverse offset = ((s.length + 3) / 2) - 1 s2 = s[offset, s.length - offset] is_strong = false unless s2 == s2.reverse puts is_strong ? 'Yes' : 'No'
[["+", 36, 36, 0, 493, 0, 662, 12, 738, 17, 33], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 12, 612], ["-", 0, 493, 0, 662, 12, 742, 0, 738, 17, 72], ["-", 0, 493, 0, 662, 12, 742, 0, 738, 12, 612]]
4
92
def check(a): for i in range(int(len(a)/2)): if a[i]!=a[-(i+1)]: return False return True S=input() if kaibun(S): a=S[0:int(len(S)/2)] b=S[int(len(S)/2)+1:len(S)] if kaibun(a) and kaibun(b): print('Yes') else: print('No') else: print('No')
def check(a): for i in range(int(len(a)/2)): if a[i]!=a[-(i+1)]: return False return True S=input() if check(S): a=S[0:int(len(S)/2)] b=S[int(len(S)/2)+1:len(S)] if check(a) and check(b): print('Yes') else: print('No') else: print('No')
[["-", 36, 36, 0, 656, 0, 57, 15, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 652, 63, 22], ["-", 64, 196, 0, 57, 15, 679, 31, 652, 63, 22], ["+", 64, 196, 0, 57, 15, 679, 31, 652, 63, 22], ["-", 64, 196, 0, 57, 15, 679, 12, 652, 63, 22], ["+", 64, 196, 0, 57, 15, 679, 12, 652, 63, 22]]
5
123
S = input() S_list = list(S) N = len(S_list) no_flag = 0 for i in range(N//2): if S_list[i] != S_list[N-i-1]: no_flag = 1 for i in range(int((N-1)/2)//2 -1): if S_list[i] != S_list[(N-1)/2-i-1]: no_flag = 1 for i in range((N-3)//2-1): if S_list[(N+3)//2+i-1] != S_list[N-1-i]: no_...
S = input() S_list = list(S) N = len(S_list) #print(N) no_flag = 0 for i in range(N//2): if S_list[i] != S_list[N-i-1]: no_flag = 1 for i in range(int((N-1)/2)//2): #print(S_list[i], S_list[(N-1)//2-i-1]) if S_list[i] != S_list[(N-1)//2-i-1]: no_flag = 1 for i in range((N-3)//2): #pr...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 206, 206, 657, 31, 657, 31, 657, 17, 85], ["+", 0, 206, 206, 657, 31, 657, 31, 657, 17, 676]]
5
156
char *t, s[100], *u = s; main(n) { gets(s); n = strlen(s) / 2 + 1; for (t = s + n - 2; u - t;) n = *u - u[n] | *t - t[n] | *u++ - *t-- ? 0 : n; puts(n ? "Yes" : "No"); }
char *t, s[100], *u = s; main(n) { gets(s); n = strlen(s) / 2 + 1; for (t = s + n - 2; t - s;) n = *u - u[n] | *t - t[n] | *u++ - *t-- ? 0 : n; puts(n ? "Yes" : "No"); }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 33], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 33], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
0
94
#include <bits/stdc++.h> using namespace std; int main() { string S0, S1; cin >> S0; long long int N = S0.size(); bool f1, f2; f1 = f2 = false; S1 = S0; reverse(S1.begin(), S1.end()); if (S0 == S1) f1 = true; if (S0.substr(0, (N - 1) / 2) == S1.substr((N + 3) / 2)) f2 = true; if (f1 && f...
#include <bits/stdc++.h> using namespace std; int main() { string S0, S1; cin >> S0; long long int N = S0.size(); bool f1, f2; f1 = f2 = false; S1 = S0; reverse(S1.begin(), S1.end()); if (S0 == S1) f1 = true; if (S0.substr(0, (N - 1) / 2) == S1.substr((N + 3) / 2 - 1)) f2 = true; if (f1 ...
[["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
129
S=input() N=len(S) r_S=S[::-1] c1=int((N-1)/2) c2=int((N+3)/2) S1=S[:c1] r_S1=S1[::-1] S2=S[(c2-1):] r_S2=S2[::-1] #kaibun hantei if S1==r_S1 and S1==r_S1 and S2==r_S2: print("Yes") else: print("No")
S=input() N=len(S) r_S=S[::-1] c1=int((N-1)/2) c2=int((N+3)/2) S1=S[:c1] r_S1=S1[::-1] S2=S[(c2-1):] r_S2=S2[::-1] #kaibun hantei if S==r_S and S1==r_S1 and S2==r_S2: print("Yes") else: print("No")
[["-", 0, 57, 15, 679, 31, 679, 31, 666, 0, 22], ["+", 0, 57, 15, 679, 31, 679, 31, 666, 0, 22]]
5
108
def resolve(): def is_rotatable(S): print(S) for i in range(len(S)//2): if S[i] != S[-1-i]: return False return True S = input() N = len(S) if is_rotatable(S) and is_rotatable(S[:N//2]) and is_rotatable(S[(N//2)+1:]): print("Yes") else: ...
def resolve(): def is_rotatable(S): for i in range(len(S)//2): if S[i] != S[-1-i]: return False return True S = input() N = len(S) if is_rotatable(S) and is_rotatable(S[:N//2]) and is_rotatable(S[(N//2)+1:]): print("Yes") else: print("No") ...
[["-", 0, 14, 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, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
113
S = input() flag = 0 for i in range(0, len(S), 1): if S[i] != S[len(S)-1-i]: flag = 1 for i in range(0, (len(S) + 1) //2, 1): if S[i] != S[len(S)//2-1-i]: flag = 1 if flag == 0: print("Yes") else: print("No")
S = input() flag = 0 for i in range(0, len(S), 1): if S[i] != S[len(S)-1-i]: flag = 1 for i in range(0, len(S)//2, 1): if S[i] != S[len(S)//2-1-i]: flag = 1 if flag == 0: print("Yes") else: print("No")
[["-", 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, 72], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
107
S = input() N = len(S) if S == S[::-1]: if S[:(n-1)//2] == S [(n+1)//2:]: print("Yes") else: print("No") else: print("No")
S = input() N = len(S) if S == S[::-1]: if S[:(N-1)//2] == S [(N+1)//2:]: print("Yes") else: print("No") else: print("No")
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 31, 22]]
5
69
#include <stdio.h> #include <string.h> void main() { int a, b, c, d, e, i, count = 0; char s[100]; scanf("%s", s); a = strlen(s); b = a - 1; c = b / 2; d = a + 3; e = d / 2; for (i = 0; i < c; i++) { s[i] == s[e - 1]; count++; } if (count == c) printf("Yes"); else printf("No"); }...
#include <stdio.h> #include <string.h> void main() { int a, b, c, d, e, i, count = 0; char s[100]; scanf("%s", s); a = strlen(s); b = a - 1; c = b / 2; d = a + 3; e = d / 2; for (i = 0; i < c; i++) { if (s[i] == s[e - 1 + i]) count++; } if (count == c) printf("Yes"); else print...
[["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 23, 0, 24], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 17, 72], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 15, 23, 0, 25]]
0
124
#include <bits/stdc++.h> using namespace std; bool Judge(string s) { int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] != s[len - 1 - i]) return false; } return true; } int main() { string s; cin >> s; string s1 = s.substr(0, (s.size() - 1) / 2); string s2 = s.substr((s.size() + 1...
#include <bits/stdc++.h> using namespace std; bool Judge(string s) { int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] != s[len - 1 - i]) return false; } return true; } int main() { string s; cin >> s; string s1 = s.substr(0, (s.size() - 1) / 2); string s2 = s.substr((s.size() + 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
159
n=len(s) x=n//2 a=s[0:x] b=s[x+1:] if a==b:print('Yes') else:print('No')
s=input() n=len(s) x=n//2 a=s[0:x] b=s[x+1:] if a==b: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, 25]]
5
47
def is_kaibun(st): f = True for x,y in zip(st, st[::-1]): if x != y: f = False break return f S = input() ans = False if is_kaibun(S): if is_kaibun(S[:(len(S)-1)/2+1]): ans = is_kaibun(S[(len(S)+3)/2+1]) if ans: print('Yes') else: print('No')
def is_kaibun(st): f = True for x,y in zip(st, st[::-1]): if x != y: f = False break return f S = input() ans = False if is_kaibun(S): if is_kaibun(S[:(len(S)-1)//2]): ans = is_kaibun(S[(len(S)+3)//2-1:]) if ans: print('Yes') else: print('No')
[["-", 0, 206, 206, 663, 0, 657, 31, 657, 17, 85], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 676], ["-", 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, 657, 31, 657, 17, 85], ["+", 0, 206, 206, 663, 0, 657, 31, 657, 17, 676], ["-", 12, 652, 3, 4, 0, 206...
5
110
s = input() n = len(s) a = s[0:(n-1)//2] b = s[(n+3)//2:n] if s ==s[::-1] and a == a[::-1] and b == b[::-1] : print("Yes") else: print("No")
s = input() n = len(s) a = s[0:(n-1)//2] b = s[(n+3)//2-1:n] if s == s[::-1] and a == a[::-1] and b == b[::-1]: print("Yes") else: print("No")
[["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
84
#include <bits/stdc++.h> using namespace std; // -------------------------------------------------------------------------------- #define fastio ios_base::sync_with_stio(false), cin.tie(NULL), cout.tie(NULL) #define ll long long #define mset(arr, val) memset(arr, val, sizeof(arr)) #define deb(name, value) cout << "->>...
#include <bits/stdc++.h> using namespace std; // -------------------------------------------------------------------------------- #define fastio ios_base::sync_with_stio(false), cin.tie(NULL), cout.tie(NULL) #define ll long long #define mset(arr, val) memset(arr, val, sizeof(arr)) #define deb(name, value) cout << "->>...
[["+", 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
227
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() const ll INF = 1LL << 60; int main() { string s; cin >> s; int size = s.size(); string rev = s; reverse(all(rev)); if (s != rev) { cout << "No...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() const ll INF = 1LL << 60; int main() { string s; cin >> s; int size = s.size(); string rev = s; reverse(all(rev)); if (s != rev) { cout << "No...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
192
s = str(input()) mid = (len(s) + 1)//2 def palin(st): return st == st[::-1] print('Yes' if palin(s[0:mid-1]) and palin(s[mid:]) else 'No')
s = str(input()) mid = (len(s) + 1)//2 def palin(st): return st == st[::-1] print('Yes' if palin(s[0:mid-1]) and palin(s[mid:]) and palin(s) else 'No')
[["+", 0, 652, 3, 4, 0, 41, 0, 679, 17, 355], ["+", 3, 4, 0, 41, 0, 679, 12, 652, 63, 22], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 24], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 22], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 25]]
5
67
s=input() n=len(s) sa=s[:(n-1)//2] sb=s[(n+1)//2:] sar="" sbr="" for i in range(len(sa)): sar+=sa[len(sa)-i-1] sbr+=sb[len(sa)-i-1] if sar==sa and sbr==sb: print("Yes") exit() print("No")
s=input() n=len(s) sa=s[:(n-1)//2] sb=s[(n+1)//2:] sar="" sbr="" for i in range(len(sa)): sar+=sa[len(sa)-i-1] sbr+=sb[len(sa)-i-1] if sar==sa and sbr==sb and sa==sb: print("Yes") exit() print("No")
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60]]
5
106
S = input() S1 = S[:int((len(s)-1)/2)] S2 = S[int((len(s)+3)/2)-1:] print('Yes' if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else 'No')
S = input() S1 = S[:int((len(S)-1)/2)] S2 = S[int((len(S)+3)/2)-1:] print('Yes' if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else 'No')
[["-", 31, 23, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 31, 23, 0, 657, 31, 652, 3, 4, 0, 22]]
5
85
#include <bits/stdc++.h> using namespace std; /* typedef */ typedef long long ll; /* constant */ const int INF = 1 << 30; const ll LINF = 1LL << 50; const int NIL = -1; const int MAX = 10000; const int mod = 1000000007; const double pi = 3.141592653589; /* global variables */ string S; /* function */ bool isPalimdrome(...
#include <bits/stdc++.h> using namespace std; /* typedef */ typedef long long ll; /* constant */ const int INF = 1 << 30; const ll LINF = 1LL << 50; const int NIL = -1; const int MAX = 10000; const int mod = 1000000007; const double pi = 3.141592653589; /* global variables */ string S; /* function */ bool isPalimdrome(...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
192
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; const int MAX_N = 100010; const ll mod = 1000000007; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1,...
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; const int MAX_N = 100010; const ll mod = 1000000007; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1,...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
294
def get_i() #空白区切の入力を数値(整数)の配列で返す return gets.chomp.split(" ").map(&:to_i) end def get_f() #空白区切の入力を数値(実数)の配列で返す return gets.chomp.split(" ").map(&:to_f) end def get() #空白区切の入力を文字列の配列で返す return gets.chomp.split(" ") end def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す return gets.chomp.split("") end def yn_judge(bool...
def get_i() #空白区切の入力を数値(整数)の配列で返す return gets.chomp.split(" ").map(&:to_i) end def get_f() #空白区切の入力を数値(実数)の配列で返す return gets.chomp.split(" ").map(&:to_f) end def get() #空白区切の入力を文字列の配列で返す return gets.chomp.split(" ") end def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す return gets.chomp.split("") end def yn_judge(bool...
[["+", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 12, 146], ["-", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["-", 36, 36, 36, 36, 0, 493, 0, 662, 12, 146]]
4
316
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { int n = s.length(); string former = s.substr(0, n / 2); reverse(former.begin(), former.end()); string latter = s.substr(0, n / 2); if (former == latter) return true; else return false; } int main() { string s; cin >> s;...
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { int n = s.length(); string former = s.substr(0, n / 2); reverse(s.begin(), s.end()); string latter = s.substr(0, n / 2); // cout << former << " " << latter << endl; if (former == latter) return true; else return false; } ...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
181
#include <bits/stdc++.h> /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/ #define itn int #define all(c) c.begin(), c.end() #define make_uni...
#include <bits/stdc++.h> /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/ #define itn int #define all(c) c.begin(), c.end() #define make_uni...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22]]
1
310
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); bool can = true; for (int i = 0; i < (N - 1) / 2; i++) { if (S.at(i) != S.at(N - i - 1)) { can = false; break; } } for (int i = 0; i < ((N - 1) / 2) / 2; i++) { if (S.at(i) != S....
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); bool can = true; for (int i = 0; i < (N - 1) / 2; i++) { if (S.at(i) != S.at(N - i - 1)) { can = false; break; } } for (int i = 0; i < ((N - 1) / 2) / 2; i++) { if (S.at(i) != S....
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
241
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int l = s.length(); for (int i = 0; i < l / 2; i++) { if (s[i] != s[l - 1 - i]) { cout << "No" << endl; goto Exit; } } for (int i = 0; i < (l - 1) / 4; i++) { if (s[i] != s[(l - 1) / 2 - 1 - i]) { ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int l = s.length(); for (int i = 0; i < l / 2; i++) { if (s[i] != s[l - 1 - i]) { cout << "No" << endl; goto Exit; } } for (int i = 0; i < (l - 1) / 4; i++) { if (s[i] != s[(l - 1) / 2 - 1 - i]) { ...
[["+", 31, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
200
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { Main mainObj = new Main(); mainObj.solve(); } public void solve() throws IOException { FastS...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { Main mainObj = new Main(); mainObj.solve(); } public void solve() throws IOException { FastS...
[["+", 12, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
3
594
#include <bits/stdc++.h> // One implementation to rule them all? #define db double #define ll long long int #define ld long long double //#define int long long int #define ull unsigned long long #define fi first #define se second #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, n, b) for (int ...
#include <bits/stdc++.h> // One implementation to rule them all? #define db double #define ll long long int #define ld long long double //#define int long long int #define ull unsigned long long #define fi first #define se second #define rep(i, a, n) for (int i = a; i < n; i++) #define repr(i, n, b) for (int ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
807
#include <bits/stdc++.h> #define ll long long using namespace std; bool peli(string s) { ll n = s.length(); ll q = 1; for (ll i = 0; i <= n / 2; i++) { if (s[i] != s[n - 1 - i]) { q = 0; break; } } return q; } int main() { string s; cin >> s; ll n = s.length(); string sleft =...
#include <bits/stdc++.h> #define ll long long using namespace std; bool peli(string s) { ll n = s.length(); ll q = 1; for (ll i = 0; i <= n / 2; i++) { if (s[i] != s[n - 1 - i]) { q = 0; break; } } return q; } int main() { string s; cin >> s; ll n = s.length(); string sleft =...
[["-", 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
173
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(x) (cerr << #x << " = " << x << endl;) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it) #define MSET(c, v) memset(c, v, sizeof(c) const int IN...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define debug(x) (cerr << #x << " = " << x << endl;) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it) #define MSET(c, v) memset(c, v, sizeof(c) const int IN...
[["+", 31, 16, 12, 23, 0, 41, 15, 16, 17, 98], ["+", 12, 23, 0, 41, 15, 16, 12, 2, 63, 22], ["+", 0, 41, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 41, 15, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 41, 15, 16, 12, 2, 3, 4, 0, 25]]
1
255
#include <bits/stdc++.h> using namespace std; bool check(string s) { int n = s.size(), flag = 0; for (int i = 0; i < n; i++) { if (s[i] != s[n - i - 1]) { flag = 1; break; } } if (flag) return false; else return true; } int main() { string s; cin >> s; if (check(s) == fal...
#include <bits/stdc++.h> using namespace std; bool check(string s) { int n = s.size(), flag = 0; for (int i = 0; i < n; i++) { if (s[i] != s[n - i - 1]) { flag = 1; break; } } if (flag) return false; else return true; } int main() { string s; cin >> s; if (check(s) == fal...
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6]]
1
272
#include <iostream> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); if (is_palindrome(s) && is_palindrome(s.substr(0, (n - 1) / 2)) && is_palindrome(s.substr((n + 3) / 2))) { cout << "Yes" << ...
#include <iostream> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); if (is_palindrome(s) && is_palindrome(s.substr(0, (n - 1) / 2)) && is_palindrome(s.substr((n + 1) / 2))) { cout << "Yes" << ...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
117
s = list(input()) l = len(s) j = -1 for i in range(l // 2): if s[i] != s[j]: print('No') exit(0) j -= 1 h = (l + 3) // 2 - 1 j = h // 2 for h in range(l): if s[h] != s[j]: print('No') exit(0) j -= 1 print('Yes')
s = list(input()) l = len(s) # l = 29 j = l - 1 # j = 28 for i in range(l // 2): if s[i] != s[j]: print('No') exit(0) j -= 1 h = (l + 3) // 2 - 1 # h = 15 j = h - 2 for h in range(l // 2): if s[h] != s[j]: print('No') exit(0) j -= 1 print('Yes')
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
106
#include <iostream> #include <string> bool paro(std::string s) { for (size_t i = 0; i < s.size() / 2; i++) { if (s[i] != s[s.size() - 1 - i]) return false; } return true; } int main() { std::string s; std::cin >> s; int n = s.size(); if (paro(s) && paro(s.substr(0, (n - 1) / 2)), paro(s.s...
#include <iostream> #include <string> bool paro(std::string s) { for (size_t i = 0; i < s.size() / 2; i++) { if (s[i] != s[s.size() - 1 - i]) return false; } return true; } int main() { std::string s; std::cin >> s; int n = s.size(); if (paro(s) && paro(s.substr(0, (n - 1) / 2)) && paro(s...
[["-", 8, 9, 0, 57, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
150
#include <bits/stdc++.h> using namespace std; #define mod 1e9 + 7; #define INF 1e9 + 9; #define ps(x, y) fixed << setprecision(y) << x #define PI 3.14159265358979323846264338327950 L typedef long long ll; typedef unsigned long long ull; bool ispalin(string s) { int n = s.length(); for (int i = 0; i < n / 2; i++) {...
#include <bits/stdc++.h> using namespace std; #define mod 1e9 + 7; #define INF 1e9 + 9; #define ps(x, y) fixed << setprecision(y) << x #define PI 3.14159265358979323846264338327950 L typedef long long ll; typedef unsigned long long ull; bool ispalin(string s) { int n = s.length(); for (int i = 0; i < n / 2; i++) {...
[["+", 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
208
#include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) bool isPalindrome(std::string s) { int n = s.length(); for (int i = 0; i < n; ++i) { if (s[i] != s[n - i - 1]) return false; } return true; } int main() { std::string S; std::cin >> S; int n = S.length(); if (isPalin...
#include <iostream> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) bool isPalindrome(std::string s) { int n = s.length(); for (int i = 0; i < n; ++i) { if (s[i] != s[n - i - 1]) return false; } return true; } int main() { std::string S; std::cin >> S; int n = S.length(); if (isPalin...
[["+", 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
155
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { string s; cin >> s; int a = s.size(); string r = s; reverse(r.begin(), r.end()); string m = s.substr(0, (a - 1) / 2); string o = m; reverse(o.begin(), o.end()); if (s ==...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { string s; cin >> s; int a = s.size(); string r = s; reverse(r.begin(), r.end()); string m = s.substr(0, a / 2); string o = m; reverse(o.begin(), o.end()); if (s == r && ...
[["-", 51, 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], ["-", 51, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
130
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i)) #define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i)) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, n, 0) #define ALL(v) v.begin(), v.end() #define UNIQ(v) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for (ll i = a; (i) < (b); ++(i)) #define RFOR(i, a, b) for (ll i = a; (i) >= (b); --(i)) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, n, 0) #define ALL(v) v.begin(), v.end() #define UNIQ(v) ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47]]
1
282
S = input() N = len(S) left = S[:(N - 1) // 2 + 1] right = S[((N + 3) // 2) - 1:] if left == left[::-1] and right == right[::-1] and S == S[::-1]: print('Yes') else: print('No')
S = input() N = len(S) left = S[:(N - 1) // 2] right = S[((N + 3) // 2) - 1:] if left == left[::-1] and right == right[::-1] and S == S[::-1]: print('Yes') else: print('No')
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
88
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) //#define long long ll; bool good(string s) { string t(s.begin(), s.end()); return t == s; } int main() { string s; cin >> s; int n = s.size(); if (good(s.substr(0, n / 2)) && good(s.substr(n / 2 + 1, n)) && go...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) //#define long long ll; /* int main(){ int n; cin>>n; float ans =(n/3); float vol =(ans*ans*ans); cout<<setprecision(20); cout<<vol<<endl; return 0; } */ bool good(string s) { string t(s.rbegin(), s.rend()); ...
[["-", 49, 50, 51, 4, 0, 2, 63, 118, 119, 120], ["+", 49, 50, 51, 4, 0, 2, 63, 118, 119, 120]]
1
123
def is_palindrome(s): if len(s) > 2: i = 0 n = len(s)-1 while s[i] == s[n]: i += 1 n -= 1 if i >= n: break else: return False return True else: return True s = input() n = len(s) if is_palindrome(s)...
def is_palindrome(s): if len(s) > 1: i = 0 n = len(s)-1 while s[i] == s[n]: i += 1 n -= 1 if i >= n: break else: return False return True else: return True s = input() n = len(s) if is_palindrome(s)...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 612], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
124
#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>; string fn(string &x) { reverse(x.begin(), x.end()); return x; } int main() { string s; cin >> s; bool ok = true; if (s != fn(s)) ok = false; int n = s.size();...
#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>; string fn(string x) { reverse(x.begin(), x.end()); return x; } int main() { string s; cin >> s; bool ok = true; if (s != fn(s)) ok = false; int n = s.size(); ...
[["-", 49, 53, 54, 55, 0, 56, 49, 352, 0, 67]]
1
175
#include <bits/stdc++.h> using namespace std; int main() { int n, m; string s, s1, s2, chk3; cin >> s; chk3 = s; n = s.size(); for (int i = 0; i < (n - 1) / 2; i++) s1 += s[i]; string chk1 = s1; reverse(s1.begin(), s1.end()); for (int i = (n + 3) / 2 - 1; i < n; i++) s2 += s[i]; string chk2 ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; string s, s1, s2, chk3; cin >> s; chk3 = s; n = s.size(); for (int i = 0; i < (n - 1) / 2; i++) s1 += s[i]; string chk1 = s1; reverse(s1.begin(), s1.end()); for (int i = (n + 3) / 2 - 1; i < n; i++) s2 += s[i]; string chk2 ...
[["-", 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], ["-", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22]]
1
216
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef map<int, int> mii; typedef map<ll, ll> mll; typedef vector<pii> vii; typedef vector<pl...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef map<int, int> mii; typedef map<ll, ll> mll; typedef vector<pii> vii; typedef vector<pl...
[["+", 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
337
#include <bits/stdc++.h> using namespace std; int main() { string S; int n = S.size(); for (int i = 0; i < (n + 1) / 2; i++) { if (S[i] != S[n - i - 1] || S[i] != S[((n - 1) / 2) - i - 1] || S[((n + 3) / 2) + i - 1] != S[n - i - 1]) { cout << "No" << endl; return 0; } } cout << "...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n = S.size(); for (int i = 0; i < (n - 1) / 2; i++) { if (S[i] != S[n - i - 1] || S[i] != S[((n - 1) / 2) - i - 1] || S[((n + 3) / 2) + i - 1] != S[n - i - 1]) { cout << "No" << endl; return 0; } }...
[["+", 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], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 17, 33]]
1
134
c=a[0:int((len(a)-1)/2)] b=''.join(list(reversed(a))) d=a[int((len(a)+3)/2)-1:] if a!=b: print("No") elif c!=d: print("No") else: print("Yes")
a=input() #b=reversed(a) c=a[0:int((len(a)-1)/2)] b=''.join(list(reversed(a))) d=a[int((len(a)+3)/2)-1:] if a!=b: print("No") elif c!=d: print("No") else: print("Yes")
[["+", 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, 25]]
5
86
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n = (S.size() - 1) / 2; bool ans = 1; for (int i = 0; i < (n + 1) / 2; i++) { if (S.at(i) != S.at(n - 1 - i) || S.at(i) != S.at(n + 1 + 1) || S.at(i) != S.at(S.size() - 1 - i)) { ans = 0; break; } ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n = (S.size() - 1) / 2; bool ans = 1; for (int i = 0; i < (n + 1) / 2; i++) { if (S.at(i) != S.at(n - 1 - i) || S.at(i) != S.at(n + 1 + i) || S.at(i) != S.at(S.size() - 1 - i)) { ans = 0; break; } ...
[["-", 12, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 12, 22]]
1
145
#include <bits/stdc++.h> #define ll long long using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = 1; i <= n; i++) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); } using P = pair<int, int>; ll MOD = 1000000007; ll INF ...
#include <bits/stdc++.h> #define ll long long using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = 1; i <= n; i++) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); } using P = pair<int, int>; ll MOD = 1000000007; ll INF ...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
223
#include <stdio.h> int main(void) { char s[99]; int n; int i; scanf("%s", s); n = 0; /* 文字数を数える。 */ while (s[n] != '\0') { n++; } /* sが回文であるかどうか調べる。 */ for (i = 0; i < n / 2; i++) { if (s[i] != s[n - i]) { printf("No\n"); return 0; } } /* s全体が回文なので、前半のみ回文かどうか調べる。 */...
#include <stdio.h> int main(void) { char s[99]; int n; int i; scanf("%s", s); n = 0; /* 文字数を数える。 */ while (s[n] != '\0') { n++; } /* sが回文であるかどうか調べる。 */ for (i = 0; i < n / 2; i++) { if (s[i] != s[n - 1 - i]) { printf("No\n"); return 0; } } /* s全体が回文なので、前半のみ回文かどうか調べる...
[["+", 0, 16, 12, 69, 71, 16, 31, 16, 12, 13], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 17, 33], ["+", 0, 16, 12, 69, 71, 16, 31, 16, 17, 33], ["+", 15, 23, 0, 16, 12, 69, 71, 16, 12, 22]]
0
156
s = input() n = len(s)//2 print('Yes' if s[:n]==s[n+1:][::-1] else 'No')
s = input() n = len(s)//2 print('Yes' if s[:n]==s[n+1:] else 'No')
[["-", 3, 4, 0, 41, 0, 666, 0, 206, 0, 70], ["-", 0, 41, 0, 666, 0, 206, 206, 663, 0, 102], ["-", 0, 666, 0, 206, 206, 663, 0, 664, 17, 33], ["-", 0, 666, 0, 206, 206, 663, 0, 664, 28, 612], ["-", 3, 4, 0, 41, 0, 666, 0, 206, 0, 73]]
5
43
S = input() N = len(S) SF_num = int((N-1)/2) SF = S[:SF_num] SF_rev = SF[::-1] SB_num = int((N+3)/2) SB = S[SB_num-1:] SB_rev = SB[::-1] if SF == SB_rev: if SF == SF_rev: if SB == SB_rev: print("Yes") else: print("No")
S = input() N = len(S) SF_num = int((N-1)/2) SF = S[:SF_num] SF_rev = SF[::-1] SB_num = int((N+3)/2) SB = S[SB_num-1:] SB_rev = SB[::-1] if SF == SB_rev and SF == SF_rev and SB == SB_rev: print("Yes") else: print("No")
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102], ["-", 0, 656, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 656, 0, 57, 15, 679, 31, 679, 17, 355], ["-", 0, 656, 0, 57, 64, 196, 0, 57, 0, 102], ["-", 64, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355]]
5
98
s=input() sl=list(reversed(s)) ns="".join(list(reversed(s))) k=(len(s)-1)/2 t=s[:k] tl=list(reversed(t)) nt="".join(list(reversed(t))) n=(len(s)+3)/2 r=s[n-1:len(s)] rl=list(reversed(r)) nr="".join(rl) if s==ns and t==nt and r==nr: print("Yes") else: print("No")
s=input() sl=list(reversed(s)) ns="".join(list(reversed(s))) k=int((len(s)-1)/2) t=s[:k] tl=list(reversed(t)) nt="".join(list(reversed(t))) n=int((len(s)+3)/2) r=s[n-1:len(s)] rl=list(reversed(r)) nr="".join(rl) if s==ns and t==nt and r==nr: print("Yes") else: print("No")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24]]
5
142
s = input() flag = 1 def check(s): return s == s[::-1] if not check(s): flag = 0 if not check(s[:len(s)//2]): ans = 0 if flag: print("Yes") else: print("No")
s = input() flag = True def check(s): return s == s[::-1] if not check(s): flag = False if not check(s[:len(s)//2]): flag = False if flag: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 146], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 147], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22]]
5
70
s = gets l = s.size - 1 hl = (l / 2) - 1 tl = (l + 2) / 2 if s[0..hl] == s[0..hl].reverse && s == s.reverse && s[tl..l] == s[tl..l].reverse puts 'Yes' else puts 'No' end
s = gets.chomp l = s.size - 1 hl = (l - 2) / 2 tl = (l + 2) / 2 if s[0..hl] == s[0..hl].reverse && s == s.reverse && s[tl..l] == s[tl..l].reverse 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], ["-", 0, 662, 12, 738, 31, 739, 0, 738, 17, 85], ["+", 0, 662, 12, 738, 31, 739, 0, 738, 17, 33], ["-", 36, 36, 0, 493, 0, 662, 12, 738, 17, 33], ["-", 36, 36, 0, 493, 0, 662, 12, 738, 12, 612], ["+", 36, 36, 0, 493, 0, 6...
4
76
import math s = str(input()) m = (len(s) - 1) / 2 c = True for i in range(math.floor(m / 2)): if s[i] != s[int(m-1-i)]: c = False for i in range(math.floor(m / 2)): if s[int(m+1+i)] != s[int(len(s)-1-i)]: c = False for i in range(math.floor(m)): if s[i] != s[int(math.floor(len(s)-i))]: ...
import math s = str(input()) m = (len(s) - 1) / 2 c = True for i in range(math.floor(m / 2)): if s[i] != s[int(m-1-i)]: c = False for i in range(math.floor(m / 2)): if s[int(m+1+i)] != s[int(len(s)-1-i)]: c = False for i in range(math.floor(m)): if s[i] != s[int(math.floor(len(s)-1-i))]: ...
[["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33]]
5
164
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); int len = n; for (int i = 0; i < len / 2; i++) { if (s[i] != s[n - 1 - i]) { cout << "no" << endl; return 0; } } for (int i = 0; i < n / 4; i++) { if (s[i] != s[n / 2 - 1 - i] || s[...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); int len = n; for (int i = 0; i < len / 2; i++) { if (s[i] != s[n - 1 - i]) { cout << "No" << endl; return 0; } } for (int i = 0; i < n / 4; i++) { if (s[i] != s[n / 2 - 1 - i] || s[...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
169
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; bool pal(const string &s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main() { string S; cin >> S; string a = S.substr(0, (S.size() - 1) / 2); string b = S.substr((S.size() + 3) / 2...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; bool pal(const string &s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main() { string S; cin >> S; string a = S.substr(0, (S.size() - 1) / 2); string b = S.substr((S.size() + 3) / 2...
[["+", 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
131
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.nextLine(); sc.close(); int N = S.length(); //回文であるかチェック checkPalindrome(S, (N - 1) / 2, 0, N - 1); checkPalindrome(S, (N - 1) / 4, 0, (N - 3) / 2); ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.nextLine(); sc.close(); int N = S.length(); //回文であるかチェック checkPalindrome(S, (N - 1) / 2, 0, N - 1); checkPalindrome(S, (N - 1) / 4, 0, (N - 3) / 2); ...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
215
# coding: utf-8 S = input() N = len(S) n1 = (N-1)//2 - 1 n2 = (N+3)//2 - 1 if S == S[::-1]: if S[:n1] == S[:n1][::-1]: if S[n2:] == S[n2:][::-1]: print('Yes') else: print('No') else: print('No') else: print('No')
# coding: utf-8 S = input() N = len(S) n1 = (N-1)//2 -1 n2 = (N+3)//2 - 1 if S == S[::-1]: if S[:n1+1] == S[:n1+1][::-1]: if S[n2:] == S[n2:][::-1]: print('Yes') else: print('No') else: print('No') else: print('No')
[["+", 15, 666, 0, 206, 206, 663, 0, 657, 17, 72], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 206, 51, 206, 206, 663, 0, 657, 17, 72], ["+", 0, 206, 51, 206, 206, 663, 0, 657, 12, 612]]
5
113
#include <bits/stdc++.h> using namespace std; template <typename T> using vec = vector<T>; int main() { string s; cin >> s; bool flag = 1; for (size_t i = 0; i < s.size(); i++) { if (s[i] != s[s.size() - i]) { flag = false; } } for (size_t i = 0; i < s.size() / 2; i++) { if (s[i] != s[s.s...
#include <bits/stdc++.h> using namespace std; template <typename T> using vec = vector<T>; int main() { string s; cin >> s; bool flag = 1; for (size_t i = 0; i < s.size(); i++) { if (s[i] != s[s.size() - i - 1]) { flag = false; } } for (size_t i = 0; i < s.size() / 2; i++) { if (s[i] != s...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
154
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { string s; cin >> s; bool ans = true; int n = s.size(); rep(i, n / 2) { if (s.at(i) != s.at(n - i - 1)) { ans = false; break; } } rep(i, n / 4) { if ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { string s; cin >> s; bool ans = true; int n = s.size(); rep(i, n / 2) { if (s.at(i) != s.at(n - i - 1)) { ans = false; break; } } rep(i, n / 4) { if ...
[["-", 31, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
179
# -*- coding: <encoding name> -*- s = input() s_former = s[:(len(s) - 1) / 2] s_latter = s[(len(s) + 3) / 2 - 1:] print('Yes' if s == s[::-1] and s_former == s_former[::-1] and s_latter == s_latter[::-1] else 'No')
# -*- coding: <encoding name> -*- s = input() s_former = s[:(len(s) - 1) // 2] s_latter = s[(len(s) + 3) // 2 - 1:] print('Yes' if s == s[::-1] and s_former == s_former[::-1] and s_latter == s_latter[::-1] else 'No')
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 85], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 676], ["-", 12, 206, 206, 663, 0, 657, 31, 657, 17, 85], ["+", 12, 206, 206, 663, 0, 657, 31, 657, 17, 676]]
5
80
st=input() n=len(st) if(n%2==0): print("No") exit(0) if(st==st[::-1]): s1="" for i in range((n-1)//2+1): s1+=st[i] s2="" for i in range((n+3)//2,n): s2+=st[i] if(s1==s1[::-1] and s2==s2[::-1]): print("Yes") else: print("No") else: print("No")
st=input() n=len(st) if(n%2==0): print("No") exit(0) if(st==st[::-1]): s1="" for i in range((n-1)//2): s1+=st[i] s2="" for i in range((n+3)//2-1,n): s2+=st[i] if(s1==s1[::-1] and s2==s2[::-1]): print("Yes") else: print("No") else: print("No")
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 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
140
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(string s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main() { string s; cin >> s; bool ans = true; if (!check(s)) ans = false; if (!check(s.substr(0, (s.size() - 1) / 2))) ans = false; else...
#include <bits/stdc++.h> using namespace std; using ll = long long; bool check(string s) { string t = s; reverse(t.begin(), t.end()); return s == t; } int main() { string s; cin >> s; bool ans = true; if (!check(s)) ans = false; if (!check(s.substr(0, s.size() / 2))) ans = false; cout << (a...
[["-", 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], ["-", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
124
#include <bits/stdc++.h> #define ref(i, n) for (int i = 0; i < n; i++) using namespace std; #define INF 10000000 int main() { string s; cin >> s; int n = s.size(), x = (n - 1) / 2, y = (n + 1) / 2; ref(i, x) if (s[i] != s[x - i] || s[i] != s[y + i]) { cout << "No"; return 0; } cout << "Yes"; ...
#include <bits/stdc++.h> #define ref(i, n) for (int i = 0; i < n; i++) using namespace std; #define INF 10000000 int main() { string s; cin >> s; int n = s.size(), x = (n - 1) / 2, y = (n + 1) / 2; ref(i, x) if (s[i] != s[x - 1 - i] || s[i] != s[y + i]) { cout << "No"; return 0; } cout << "Yes";...
[["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
1
112
s = input() length = len(s) def solve(word, length): first = (length-1) // 2 last = (length+3) // 2 if isPalindrome(s[:first]) and isPalindrome(s[last-1:]): print("Yes") else: print("No") def isPalindrome(word): palindrome = True size = len(word) start = 0 end = size ...
s = input() length = len(s) def solve(word, length): first = (length-1) // 2 last = (length+3) // 2 if isPalindrome(word) and isPalindrome(s[:first]) and isPalindrome(s[last-1:]): print("Yes") else: print("No") def isPalindrome(word): palindrome = True size = len(word) ...
[["+", 15, 679, 31, 679, 31, 652, 3, 4, 0, 22], ["+", 15, 679, 31, 679, 31, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 679, 31, 679, 17, 355], ["+", 0, 57, 15, 679, 31, 679, 12, 652, 63, 22], ["+", 15, 679, 31, 679, 12, 652, 3, 4, 0, 24], ["-", 0, 14, 8, 196, 0, 52, 15, 666, 667, 18], ["+", 0, 14, 8, 196, 0, 52, 15, 6...
5
130
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean isStrong = true; if (S.length() % 4 == 1) { int l = (S.length() - 1) / 2; for (int i = 0; i < l / 2; i++) { if (S.charAt(i) != S.char...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); boolean isStrong = true; if (S.length() % 4 == 1) { int l = (S.length() - 1) / 2; for (int i = 0; i < l / 2; i++) { if (S.charAt(i) != S.char...
[["+", 64, 196, 0, 57, 15, 15, 0, 91, 17, 111], ["+", 3, 4, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 492, 3, 4, 0, 16, 12, 499], ["+", 75, 196, 0, 57, 15, 15, 0, 91, 17, 111]]
3
264
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define PI 3.14...
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define PI 3.14...
[["-", 12, 23, 0, 16, 31, 69, 341, 342, 0, 13], ["+", 12, 23, 0, 16, 31, 69, 341, 342, 0, 22]]
1
190
import numpy as np S = np.array([i for i in input()]) S_rev = S[::-1] N = len(S) ans = 'No' if all(S == S_rev): temp_S = S[:(N-1)//2+1] temp_S_rev = temp_S[::-1] if all(temp_S == temp_S_rev): temp_S = S[(N+3)//2:] temp_S_rev = temp_S[::-1] if all(temp_S == temp_S_rev): ans = 'Yes' pri...
import numpy as np S = np.array([i for i in input()]) S_rev = S[::-1] N = len(S) ans = 'No' if all(S == S_rev): temp_S = S[:(N-1)//2] temp_S_rev = temp_S[::-1] if all(temp_S == temp_S_rev): temp_S = S[(N+3)//2-1:] temp_S_rev = temp_S[::-1] if all(temp_S == temp_S_rev): ans = 'Yes' pri...
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
119
#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>; int main() { char s[100]; int l, k, k2; k = 0; cin >> s; l = strlen(s); rep(i, (l - 1) / 2 + 1) { if (s[i] != s[l - 1 - i]) { k = 1; } } rep(i, (l...
#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>; int main() { char s[100]; int l, k, k2; k = 0; cin >> s; l = strlen(s); rep(i, (l - 1) / 2 + 1) { if (s[i] != s[l - 1 - i]) { k = 1; } } rep(i, (l...
[["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
230
S = input() N = len(S) def check(c): if len(c) == 0: return False if list(c) == list(reversed(c)): return True return False result = "No" if check(S[:int((N-1)/2)]): if check(S[int((N+3)/2)-1:]): result = "Yes" print(result)
S = input() N = len(S) def check(c): if len(c) == 0: return False if list(c) == list(reversed(c)): return True return False result = "No" if check(S): if check(S[:int((N-1)/2)]): if check(S[int((N+3)/2)-1:]): result = "Yes" print(result)
[["+", 0, 656, 0, 57, 15, 652, 3, 4, 0, 25], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102], ["+", 0, 656, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 64, 196, 0, 57, 15, 652, 63, 22], ["+", 64, 196, 0, 57, 15, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 652, 3, 4, 0, 206, 51, 22]]
5
99
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; string a, b; int L = S.size(); a = S.substr(0, (L - 1) / 2 - 1); b = S.substr((L + 3) / 2 - 1, L - 1); string sinv = S, ainv = a, binv = b; reverse(S.begin(), S.end()); reverse(a.begin(), a.end()); reverse(b.begin(), b.e...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; string a, b; int L = S.size(); a = S.substr(0, (L - 1) / 2); b = S.substr((L + 3) / 2 - 1, (L - 1) / 2); string sinv = S, ainv = a, binv = b; reverse(S.begin(), S.end()); reverse(a.begin(), a.end()); reverse(b.begin(), b...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 85], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
165
// In the name of God // SMani24 #include <bits/stdc++.h> using namespace std; int n; string s; int main() { cin >> s; n = s.size(); string cps = s; reverse(cps.begin(), cps.end()); if (s != cps) { cout << "NO" << endl; return 0; } string a; for (int i = 0; i < (n - 1) / 2; i++) a += s[i];...
// In the name of God // SMani24 #include <bits/stdc++.h> using namespace std; int n; string s; int main() { cin >> s; n = s.size(); string cps = s; reverse(cps.begin(), cps.end()); if (s != cps) { cout << "No" << endl; return 0; } string a; for (int i = 0; i < (n - 1) / 2; i++) a += s[i];...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
225
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define CHMAX(a, b) a = std::max(a, b) #define CHMIN(a, b) a = std::min(a, b) #define MAXMIN(a, b, c) std::max(a, min(b, c)) #define ...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define CHMAX(a, b) a = std::max(a, b) #define CHMIN(a, b) a = std::min(a, b) #define MAXMIN(a, b, c) std::max(a, min(b, c)) #define ...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33]]
1
356
s=input().strip(); n=len(S) print("Yes" if s==s[::-1] and s[:(n-1)//2]==s[:(n-1)//2][::-1] and s[(n+3)//2-1:]==s[(n+3)//2-1:][::-1] else "No")
s=input().strip(); n=len(s) print("Yes" if s==s[::-1] and s[:(n-1)//2]==s[:(n-1)//2][::-1] and s[(n+3)//2-1:]==s[(n+3)//2-1:][::-1] else "No")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
100
S = input() left = S[0:(len(S)-1)//2] right = S[(len(S)+3)//2 - 1: len(S)] def kaibun(s): for i in range(len(s)//2): if s[i] != s[len(s)-i-1]: return False return True if kaibun(left) and kaibun(right): print('Yes') else: print('No')
S = input() left = S[0:(len(S)-1)//2] right = S[(len(S)+3)//2 - 1: len(S)] def kaibun(s): for i in range(len(s)//2): if s[i] != s[len(s)-i-1]: return False return True if kaibun(S) and kaibun(left) and kaibun(right): print('Yes') else: print('No')
[["+", 15, 679, 31, 679, 31, 652, 3, 4, 0, 22], ["+", 15, 679, 31, 679, 31, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 57, 15, 679, 31, 679, 17, 355], ["+", 0, 57, 15, 679, 31, 679, 12, 652, 63, 22], ["+", 15, 679, 31, 679, 12, 652, 3, 4, 0, 24]]
5
110
import math S = input() N = len(S) flag = True leftS = S[0:math.floor((N - 1)/2)] rightS = S[math.floor((N + 3)/2) - 1:N] def isPalindrome(str): N =len(str) flag = True for i in range(0,math.floor(N/2)): if str[i] != str[(N-1) - i]: flag = False break return flag flag ...
import math S = input() N = len(S) flag = True leftS = S[0:math.floor((N - 1)/2)] rightS = S[math.floor((N + 3)/2) - 1:N] def isPalindrome(str): N =len(str) flag = True for i in range(0,math.floor(N/2)): if str[i] != str[(N-1) - i]: flag = False break return flag flag ...
[["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 15, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102]]
5
146
def strongPalindrome(S): S2 = S[0:(len(S)-1)//2] S3 = S[(len(S)+3)//2:] return "Yes" if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1] else "No" S = input() print(strongPalindrome(S))
def strongPalindrome(S): S2 = S[0:(len(S)-1)//2] S3 = S[(len(S)+3-1)//2:] return "Yes" if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1] else "No" S = input() print(strongPalindrome(S))
[["+", 206, 663, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]]
5
89
s = input() n = len(s) sf = s[0:(n-1)//2] sr = s[::-1][0:(n-1)//2] print('YNeos'[not[s == s[::-1] and sf == sf[::-1] and sr == sr[::-1]]::2])
s = input() n = len(s) sf = s[0:(n-1)//2] sr = s[::-1][0:(n-1)//2] print('YNeos'[not(s == s[::-1] and sf == sf[::-1] and sr == sr[::-1])::2])
[["-", 0, 206, 206, 663, 0, 681, 28, 634, 0, 70], ["+", 0, 206, 206, 663, 0, 681, 28, 23, 0, 24], ["-", 28, 634, 0, 679, 12, 666, 0, 206, 0, 73], ["+", 0, 206, 206, 663, 0, 681, 28, 23, 0, 25]]
5
88
#include <bits/stdc++.h> #define ull unsigned long long int #define ll long long int #define pb(x) push_back(x) #define mp(a, b) make_pair(a, b) #define li(ini) for (ull i = ini;; i++) #define lfi(i, ini, r) for (ull i = ini; i < r; i++) #define lfd(i, ini, r) for (ull i = ini; i >= r; i--) #define lit(it, v) for (aut...
#include <bits/stdc++.h> #define ull unsigned long long int #define ll long long int #define pb(x) push_back(x) #define mp(a, b) make_pair(a, b) #define li(ini) for (ull i = ini;; i++) #define lfi(i, ini, r) for (ull i = ini; i < r; i++) #define lfd(i, ini, r) for (ull i = ini; i >= r; i--) #define lit(it, v) for (aut...
[["-", 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
319
#include <bits/stdc++.h> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { // your code goes here string s; cin >> s; int n = (int)s.size(); if (is_palindrome(s) && is_palindrome(s.substr(0, (n - 1) / 2)) && is_palindrome(s.substr((n + ...
#include <bits/stdc++.h> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { // your code goes here string s; cin >> s; int n = (int)s.size(); if (is_palindrome(s) && is_palindrome(s.substr(0, (n - 1) / 2)) && is_palindrome(s.substr((n + ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
124
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
[["+", 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
254
s=input() c=list(reversed(s)) n=len(s) t=list(s[:int((n-1)/2)]) a=list(reversed(t)) u=list(s[int((n+3)/2)-1:]) b=list(reversed(u)) #print(b) if t==a and u==b and s==c: print("Yes") else: print("No")
s=list(input()) c=list(reversed(s)) n=len(s) t=list(s[:int((n-1)/2)]) a=list(reversed(t)) u=list(s[int((n+3)/2)-1:]) b=list(reversed(u)) #print(b) if t==a and u==b and s==c: 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], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
106
s = gets n = s.length s1 = s[0..(n-3)/2] s2 = s[(n+1)/2..n-1] def kaibun(m) result = true for i in 1..(m.length) do if m[i-1] != m[-i] then result = false break end end return result end if kaibun(s) && kaibun(s1) && kaibun(s2) then print 'Yes' else print 'No' end
s = gets.chomp.to_s n = s.length s1 = s[0..(n-3)/2] s2 = s[(n+1)/2..n-1] def kaibun(m) result = true for i in 1..(m.length) do if m[i-1] != m[-i] then result = false break end end return result end if kaibun(s) && kaibun(s1) && kaibun(s2) then print 'Yes' else print 'No' end
[["+", 0, 493, 0, 662, 12, 652, 486, 652, 17, 131], ["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
106
#include <bits/stdc++.h> using namespace std; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) string S; int main() { cin >> S; int N = S.size(); int flg = 1; // // N=3の時 if (N == 3 && S[0] == S[2]) { flg *= 1; } else if (N == 3) { flg *= 0; } // N>3の時 else { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) string S; int main() { cin >> S; int N = S.size(); int flg = 1; // // N=3の時 if (N == 3 && S[0] == S[2]) { flg *= 1; } else if (N == 3) { flg *= 0; } // N>3の時 else { ...
[["+", 75, 76, 0, 9, 0, 43, 49, 50, 0, 32], ["+", 75, 76, 0, 9, 0, 43, 49, 50, 51, 22]]
1
239
s = input() if s != s[::-1]: print("No") exit() x = s[:((len(s)-1)//2)] if x != x[::-1]: print("No") exit() y = s[((len(s)+3)//2-1):] print(y) if y != y[::-1]: print("No") exit() print("Yes")
s = input() if s != s[::-1]: print("No") exit() x = s[:((len(s)-1)//2)] if x != x[::-1]: print("No") exit() y = s[((len(s)+3)//2-1):] if y != y[::-1]: print("No") exit() print("Yes")
[["-", 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
113
#! env/bin/local python3 # -*- coding:utf-8 -*- s = input() ls = len(s) def is_kaibun(s): rs = s[::-1] if s == rs: return True else: return False flag = False if is_kaibun(s): if is_kaibun(s[:(ls-1)//2]): if is_kaibun(s[(ls+3)//2: ls]): flag = True print('Yes' i...
#! env/bin/local python3 # -*- coding:utf-8 -*- s = input() ls = len(s) def is_kaibun(s): rs = s[::-1] if s == rs: return True else: return False flag = False if is_kaibun(s): if is_kaibun(s[:(ls-1)//2]): if is_kaibun(s[(ls+3)//2-1: ls]): flag = True print('Yes'...
[["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
96
#include <stdio.h> #include <string.h> #define rep(a, b) for (int i = a; i <= b; i++) int main(void) { char s[100]; scanf("%s", &s); int len = strlen(s); int cnt = 0, pnt = 0; // condition_1 rep(0, len - 1) { if (s[i] = s[len - 1 - i]) { cnt += 1; } } if (cnt == len) { pnt += 1; } ...
#include <stdio.h> #include <string.h> #define rep(a, b) for (int i = a; i <= b; i++) int main(void) { char s[100]; scanf("%s", &s); int len = strlen(s); int cnt = 0, pnt = 0; // condition_1 rep(0, len - 1) { if (s[i] == s[len - 1 - i]) { cnt += 1; } } if (cnt == len) { pnt += 1; }...
[["-", 0, 9, 0, 57, 15, 23, 0, 11, 17, 32], ["+", 0, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
267
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define int long long #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define mll map<ll, ll> #define mii map<int, int> #define mp make_pair #define pb push_back #define rep(i, b) ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define int long long #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define mll map<ll, ll> #define mii map<int, int> #define mp make_pair #define pb push_back #define rep(i, b) ...
[["-", 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
563
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int temp = (s.size() - 3) / 2; bool result = true; for (int i = 0; i < temp; i++) { if (s[i] != s[temp - i]) { result = false; break; } } for (int i = temp + 2; i < s.size(); i++) { if (s[i] == s[s....
#include <bits/stdc++.h> using namespace std; int main(void) { string s; cin >> s; int temp = (s.size() - 3) / 2; bool result = true; for (int i = 0; i < temp; i++) { if (s[i] != s[temp - i]) { result = false; break; } } for (int i = temp + 2; i < s.size(); i++) { if (s[i] != s[s....
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
150
S = input() N = len(S) P = 0 for i in range (N-1//2): if S[i] == S[N-1-i]: for k in range(N-1//2): if S[k] == S[((N-1)//2)-k] and S[((N+1)//2)+k] == S[N-1-k]: P = P else: P += 1 else: P += 1 if P == 0: print('Yes') else: pr...
S = input() N = len(S) P = 0 for i in range ((N-1)//2): if S[i] == S[N-1-i]: for k in range((N-1)//2): if S[k] == S[((N-3)//2)-k] and S[((N+1)//2)+k] == S[N-1-k]: P = P else: P += 1 else: P += 1 if P == 0: print('Yes') else: print(...
[["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 64, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["-", 31, 23, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 12, 612]]
5
130
import sys input = sys.stdin.readline S = str(input()) N = len(S)-1 N1 = (N-1)/2 N2 = (N+3)/2 s1 = S[:N] s2 = S[:N1] s3 = S[N2-1:N] flag = True for ss in [s1, s2, s3]: ss_l = len(ss) for i in range(ss_l): if ss[i] != ss[ss_l-i-1]: flag = False break if not flag: b...
import sys input = sys.stdin.readline S = str(input()) N = len(S)-1 N1 = int((N-1)/2) N2 = int((N+3)/2) s1 = S[:N] s2 = S[:N1] s3 = S[N2-1:N] flag = True for ss in [s1, s2, s3]: ss_l = len(ss) for i in range(ss_l): if ss[i] != ss[ss_l-i-1]: flag = False break if not flag:...
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24]]
5
136