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
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const long long INF = 1LL << 60; string Reverse(string s) { string ans; for (int i = s.size() - 1; i >= 0; i--) ans += s.at(i); return ans; } bool kaibun(string s) { string s_rev = Reve...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const long long INF = 1LL << 60; string Reverse(string s) { string ans; for (int i = s.size() - 1; i >= 0; i--) ans += s.at(i); return ans; } bool kaibun(string s) { string s_rev = Reve...
[["+", 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
195
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { string s, a, b, rs, ra, rb; cin >> s; int n = s.length(); a = s.substr(0, (n - 1) / 2 - 1); b = s.substr((n + 3) / 2 - 1); rs = s; reverse(rs.begin(), rs.end()); ra = ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { string s, a, b, rs, ra, rb; cin >> s; int n = s.length(); a = s.substr(0, (n - 1) / 2); b = s.substr((n + 3) / 2 - 1); rs = s; reverse(rs.begin(), rs.end()); ra = a; ...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
176
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string s; cin >> s; bool equal = true; rep(i, s.size()) { if (s.at(i) != s.at(s.size() - i - 1)) { equal = false; } } rep(i, (s.size() - 1) / 2) { if (s.at(i) != s.at((s.size() + 1) /...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string s; cin >> s; bool equal = true; rep(i, s.size()) { if (s.at(i) != s.at(s.size() - i - 1)) { equal = false; } } // cout << equal << endl; rep(i, (s.size() - 1) / 2) { if (s.at...
[["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 22]]
1
151
s=input() n=len(s) s1=s[0:(n-1)/2] s2=s[(n+1)/2:n] if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]: print("Yes") else: print("No")
s=input() n=len(s) s1=s[0:(n-1)//2] s2=s[(n+1)//2:n] if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]: print("Yes") else: print("No")
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 85], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 676]]
5
84
#include <bits/stdc++.h> using namespace std; bool f(string s) { bool si = true; int a = 0, b = s.size() - 1; while (a < b) { if (s[a] != s[b]) si = false; a++; b--; } return si; } int main() { string s; cin >> s; if (f(s)) { int mitad = (s.size()) / 2; string sub = s.substr...
#include <bits/stdc++.h> using namespace std; bool f(string s) { bool si = true; int a = 0, b = s.size() - 1; while (a < b) { if (s[a] != s[b]) si = false; a++; b--; } return si; } int main() { string s; cin >> s; if (f(s)) { int mitad = (s.size()) / 2; string sub = s.substr...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
182
def palindrome(word): if len(word) <= 1: return True if word[0] != word[-1]: return False return palindrome(word[1:-1]) word = input() n = len(word) // 2 issuper = palindrome(word[:n]) and palindrome(word[n+1:]) print("Yes" if isupper else "No")
def palindrome(word): if len(word) <= 1: return True if word[0] != word[-1]: return False return palindrome(word[1:-1]) word = input() n = len(word) // 2 issuper = palindrome(word[:n]) and palindrome(word[n+1:]) and palindrome(word) print("Yes" if issuper else "No")
[["+", 0, 656, 0, 1, 0, 662, 12, 679, 17, 355], ["+", 0, 1, 0, 662, 12, 679, 12, 652, 63, 22], ["+", 0, 662, 12, 679, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 679, 12, 652, 3, 4, 0, 22], ["+", 0, 662, 12, 679, 12, 652, 3, 4, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 41, 0, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 41, 0, 22]]
5
87
s = input() def kai(l): n = len(l) output = 'Yes' for i in range(n%2): if l[i] != l[n-i-1]: output = 'No' return output ans = kai(s) if ans == 'Yes': ans = kai(s[:len(s)%2]) if ans == 'Yes': ans = kai(s[len(s)%2+1:]) print(ans)
s = input() def kai(l): n = len(l) output = 'Yes' for i in range(n//2): if l[i] != l[n-i-1]: output = 'No' return output ans = kai(s) if ans == 'Yes': ans = kai(s[:len(s)//2]) if ans == 'Yes': ans = kai(s[len(s)//2+1:]) print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 676], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 109], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 676], ["-", 0, 206, 206, 663, 0, 657, 31, 657, 17, 109], ["+", 0, 206, 206, 663, 0, 657, 31, 657, 17, 676]]
5
110
#include <algorithm> #include <iostream> using namespace std; #define ll long long int int main() { string s; cin >> s; int N = s.size(); int l, r; l = (N - 1) / 2; r = (N + 3) / 2; string s2, s3; for (int i = 0; i < l; i++) { s2 += s[i]; } for (int i = r - 1; i < N; i++) { s3 += s[i]; } ...
#include <algorithm> #include <iostream> using namespace std; #define ll long long int int main() { string s; cin >> s; int N = s.size(); int l, r; l = (N - 1) / 2; r = (N + 3) / 2; string s2, s3; for (int i = 0; i < l; i++) { s2 += s[i]; } for (int i = r - 1; i < N; i++) { s3 += s[i]; } ...
[["-", 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
137
import java.io.*; import java.lang.Math; import java.util.*; public class Main { static boolean check(String s) { int n = s.length(); for (int i = 0; i < n; ++i) { if (s.charAt(i) != s.charAt(n - 1 - i)) { return false; } } return true; } public static void main(String[] args)...
import java.io.*; import java.lang.Math; import java.util.*; public class Main { static boolean check(String s) { int n = s.length(); for (int i = 0; i < n; ++i) { if (s.charAt(i) != s.charAt(n - 1 - i)) { return false; } } return true; } public static void main(String[] args)...
[["+", 0, 16, 31, 16, 31, 492, 3, 4, 0, 22], ["+", 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]]
3
201
s = input() def isPalindrome(a): i = 0 j = len(a)-1 while(i<j): if(a[i] != a[j]): return False i += 1 j -= 1 return True n = len(s) # print(s[:int((n-1)/2)]) # print(s[int((n+3)/2)-1:]) # print(isPalindrome(s[:int((n-1)/2)])) print("Yes" if isPalindrome(s[:int((n-1)...
s = input() def isPalindrome(a): i = 0 j = len(a)-1 while(i<j): if(a[i] != a[j]): return False i += 1 j -= 1 return True n = len(s) # print(s[:int((n-1)/2)]) # print(s[int((n+3)/2)-1:]) # print(isPalindrome(s[:int((n-1)/2)])) print("Yes" if isPalindrome(s) and isPal...
[["+", 0, 679, 31, 679, 31, 652, 3, 4, 0, 25], ["+", 3, 4, 0, 41, 0, 679, 31, 679, 17, 355], ["+", 0, 41, 0, 679, 31, 679, 12, 652, 63, 22], ["+", 0, 679, 31, 679, 12, 652, 3, 4, 0, 24], ["+", 31, 679, 12, 652, 3, 4, 0, 206, 51, 22]]
5
109
#include <bits/stdc++.h> using namespace std; int main() { string str, str2, str3, rev, rev2, rev3; cin >> str; long int N = (long int)(str.length()), f = 0; reverse_copy(str.begin(), str.end(), back_inserter(rev)); if (str == rev) f += 1; str2 = str.substr(0, (N - 1) / 2); // cout << str2 << end...
#include <bits/stdc++.h> using namespace std; int main() { string str, str2, str3, rev, rev2, rev3; cin >> str; long int N = (long int)(str.length()), f = 0; reverse_copy(str.begin(), str.end(), back_inserter(rev)); if (str == rev) f += 1; str2 = str.substr(0, (N - 1) / 2); reverse_copy(str2.beg...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
203
def main(): # s = int(input()) s = str(input()) s_1_mae = list(s[:((len(s)-1) // 2)]) s_2 = list(s[((len(s)+3)// 2) -1 :]) if s_1_mae == list(reversed(s_1_mae)) and s_2 == list(reversed(s_2)) and list(s) == reversed(list(s)): print("Yes") else: print("No") if __name__ == '__main__': main()
def main(): s = str(input()) s_1_mae = list(s[:((len(s)-1) // 2)]) s_2 = list(s[((len(s)+3)// 2) -1 :]) if s_1_mae == list(reversed(s_1_mae)) and s_2 == list(reversed(s_2)) and list(s) == list(reversed(list(s))): print("Yes") else: print("No") if __name__ == '__main__': main()
[["+", 0, 57, 15, 679, 12, 666, 0, 652, 63, 22], ["+", 15, 679, 12, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
116
S = input() judge = True for i in range(len(S)//2): if S[i] != S[len(S) - i - 1]: judge = False break if judge: for i in range(int((len(S)-1)/2)): if S[i] != S[int((len(S)-1)/2)- 1 - i]: judge = False break elif S[int((N+3)/2)-1 + i] != S[N-1-...
S = input() N = len(S) judge = True for i in range(len(S)//2): if S[i] != S[len(S) - i - 1]: judge = False break if judge: for i in range(int((len(S)-1)/2)): if S[i] != S[int((len(S)-1)/2)- 1 - i]: judge = False break elif S[int((N+3)/2)-1 + i...
[["+", 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
146
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); if (S.substr(0, (N - 1) / 2) == S.substr((N + 3) / 2, (N - 1) / 2)) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); if (S.substr(0, (N - 1) / 2) == S.substr((N + 3) / 2 - 1, (N - 1) / 2)) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
87
s = input() l = len(s) s1 = s[:int((l-1)/2)] s3 = s[int((l+1)/2):] s4 = s3[::-1] m = s[:int((l-1)/2)] n = len(m) m1 = m[:int((n-1)/2)] m3 = m[int((n+1)/2):] m4 = m3[::-1] a = s[int((l+3)/2-1):] b = len(a) a1 = a[:int((b-1)/2)] a3 = a[int((b+1)/2):] a4 = a3[::-1] if (s1 in s4) & (m1 in m4) & (a1 in a4): print("Y...
s = input() l = len(s) s1 = s[:int((l-1)/2)] s3 = s[int((l+1)/2):] s4 = s3[::-1] m = s[:int((l-1)/2)] n = len(m) m1 = m[:int((n)/2)] m3 = m[int((n+1)/2):] m4 = m3[::-1] a = s[int((l+3)/2-1):] b = len(a) a1 = a[:int((b-1)/2)] a3 = a[int((b+1)/2):] a4 = a3[::-1] if (s1 in s4) & (m1 in m4) & (a1 in a4): print("Yes...
[["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
213
def reverse(x): if x[::-1]==x: return True else: return False def main(s): l=len(s)//2 x1=s[:l] x2=s[l+1:] if reverse(x1) and reverse(x2): print("Yes") else: print("No") if __name__=='__main__': main(input())
def reverse(x): if x[::-1]==x: return True else: return False def main(s): l=len(s)//2 x1=s[:l] x2=s[l+1:] if reverse(s) and reverse(x1) and reverse(x2): print("Yes") else: print("No") if __name__=='__main__': main(input())
[["+", 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]]
5
91
s = str(input()) n = len(s) s1 = s[:(n-1)/2] if s != s[::-1] or s1 != s1[::-1]: print('No') else: print('Yes')
s = str(input()) n = len(s) s1 = s[:int((n-1)/2)] if s != s[::-1] or s1 != s1[::-1]: print('No') else: print('Yes')
[["+", 0, 662, 12, 206, 206, 663, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 206, 206, 663, 0, 652, 3, 4, 0, 25]]
5
62
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); \ cout.tie(NULL); #define fr(i,...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); \ cin.tie(NULL); \ cout.tie(NULL); #define fr(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
292
s=gets.to_s n=s.size.to_i a=(n-3)/2.to_i b=(n+1)/2.to_i c=(n-1).to_i puts s.slice(0..a)==s.slice(b..c)? "Yes":"No"
s=gets.chomp.to_s n=s.size.to_i a=(n-3)/2.to_i b=(n+1)/2.to_i c=(n-1).to_i puts s.slice(0..a)==s.slice(b..c)? "Yes":"No"
[["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131]]
4
69
s=input() n=len(s) x=(n-1)//2 while i<x: if s[i]!=s[n-1-i] or s[i]!=s[x-1-i]: print('No') break i=i+1 else: print('Yes')
s=input() n=len(s) x=(n-1)//2 i=0 while i<x: if s[i]!=s[n-1-i] or s[i]!=s[x-1-i]: print('No') break i=i+1 else: print('Yes')
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
74
#include <bits/stdc++.h> typedef long long ll; using namespace std; bool isPalindrome(string s) { return (s == string(s.rbegin(), s.rend())); } int main() { string s; cin >> s; if (isPalindrome(s.substr(0, (s.length() - 1) / 2)) and isPalindrome(string(s.begin() + (s.length() + 3) / 2 - 1, s.end()))) { ...
#include <bits/stdc++.h> typedef long long ll; using namespace std; bool isPalindrome(string s) { return (s == string(s.rbegin(), s.rend())); } int main() { string s; cin >> s; if (isPalindrome(s) and isPalindrome(s.substr(0, (s.length() - 1) / 2)) and isPalindrome(string(s.begin() + (s.length() + 3) / 2...
[["+", 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
123
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool a = true; for (int i = 0; i < S.size() / 2; i++) { if (S.at(i) != S.at(S.size() - i - 1)) a = false; } for (int i = 0; i < S.size() / 4; i++) { if (S.at(i) != S.at(S.size() / 2 - i - 1)) a = false; } ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool a = true; for (int i = 0; i < S.size() / 2; i++) { if (S.at(i) != S.at(S.size() - i - 1)) a = false; } for (int i = 0; i < S.size() / 4; i++) { if (S.at(i) != S.at(S.size() / 2 - i - 1)) a = false; } ...
[["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
211
s = input() n = len(s) s1 = s[:(n - 1) // 2] s2 = s[(n + 2) // 2:] print(s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1])
s = input() n = len(s) s1 = s[:(n - 1) // 2] s2 = s[(n + 2) // 2:] print("Yes" if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1] else "No")
[["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 655], ["+", 0, 1, 0, 652, 3, 4, 0, 41, 0, 121], ["+", 0, 1, 0, 652, 3, 4, 0, 41, 0, 95]]
5
69
#include <bits/stdc++.h> using namespace std; #define ll long long int #define lh long double #define f(a, b, i) for (ll i = a; i < b; i++) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; ll len = s.length(); string r = s.substr(0, ((len - 1) / 2)); string w = s.substr(...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define lh long double #define f(a, b, i) for (ll i = a; i < b; i++) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; ll len = s.length(); string r = s.substr(0, ((len - 1) / 2)); string w = s.substr(...
[["-", 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
181
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, N) for (ll(i) = 0; (i) < (N); (i)++) const int mod = 1000000007; bool judge(string s) { bool res = true; int r = s.length() - 1; for (int i = 0; i != r; ++i) { if (s[i] != s[r]) res = false; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, N) for (ll(i) = 0; (i) < (N); (i)++) const int mod = 1000000007; bool judge(string s) { bool res = true; int r = s.length() - 1; for (int i = 0; i < r; ++i) { if (s[i] != s[r]) res = false; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 79], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
241
def check(string2): N = len(string2) rev = string2[::-1] for i in range((N//2)+1): if(rev[i]!=string2[i]): return False return True string = input() n = len(string) n-=1 str1 = string[0:int((n)/2)] # print(str1) str2 = string[int((n)/2)+1:n+1] # print(str2) if check(str1) and check(str2): print("Yes") else:...
def check(string2): N = len(string2) rev = string2[::-1] for i in range((N//2)+1): if(rev[i]!=string2[i]): return False return True string = input() n = len(string) n-=1 str1 = string[0:int((n)/2)] # print(str1) str2 = string[int((n)/2)+1:n+1] # print(str2) if check(str1) and check(str2) and check(string): ...
[["+", 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
127
#include <bits/stdc++.h> using namespace std; int palindrome(string s1) { int k = 0, flag = 1; int l = s1.size() - 1; while (k < l) { if (s1[k] != s1[l]) { flag = 0; break; } k++; l--; } return flag; } int main() { string s; cin >> s; int n = s.size(); if (palindrome(s)) { ...
#include <bits/stdc++.h> using namespace std; int palindrome(string s1) { int k = 0, flag = 1; int l = s1.size() - 1; while (k < l) { if (s1[k] != s1[l]) { flag = 0; break; } k++; l--; } return flag; } int main() { string s; cin >> s; int n = s.size(); if (palindrome(s)) { ...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
181
def solve(s): s = list(s) n = len(s) ans = check_palindrome(s) & check_palindrome(s[0:int(((n-1)//2))]) & check_palindrome(s[0:int(((n+3)//2))]) return "Yes" if ans else "No" def check_palindrome(st): a = list(st) b = list(reversed(st)) return a == b s = str(input()) # n, m = [int(s) for s in input(...
def solve(s): s = list(s) n = len(s) ans = check_palindrome(s) & check_palindrome(s[:int(((n-1)//2))]) & check_palindrome(s[int(((n+3)//2)-1):]) return "Yes" if ans else "No" def check_palindrome(st): a = list(st) b = list(reversed(st)) return a == b s = str(input()) # n, m = [int(s) for s in input(...
[["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["+", 206, 663, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 206, 663, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 12, 652, 3, 4, 0, 206, 206, 663, 0, 102]]
5
117
class atcorder: S=list(input()) inv=list(reversed(S)) i=0 j=0 if S==inv: i+=1 N=int((len(S)-1)/2) for x in range(N-1): if S[x]==S[N-1-x] and inv[x]==inv[N-1-x]: pass else: j+=1 if j==0 and i==1: print(...
class atcorder: S=list(input()) inv=list(reversed(S)) i=0 j=0 if S==inv: i+=1 N=int((len(S)-1)/2) for x in range(N-1): if S[x]==S[N-1-x] and inv[x]==inv[N-1-x]: pass else: j+=1 if j==0 and i==1: print(...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
117
s = input() n = len(s) s1 = s[0:(n-1)//2] s2 = s[(n+1)//2:n] def check(s): sr = s[::-1] if s == sr: return True else: return False if check(s1) and check(s2): print('Yes') else: print('No')
s = input() n = len(s) s1 = s[0:(n-1)//2] s2 = s[(n+1)//2:n] def check(s): sr = s[::-1] if s == sr: return True else: return False if check(s) and check(s1) and check(s2): 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
90
s = list(input()) n = len(s) if n==n[::-1] and n[0:int((n-1)/2)]==n[0:int((n-1)/2)][::-1] and n[int((n+3)/2-1):n]==n[int((n+3)/2-1):n][::-1]: print('Yes') else: print('No')
s = list(input()) n = len(s) if s==s[::-1] and s[0:int((n-1)/2)]==s[0:int((n-1)/2)][::-1] and s[int((n+3)/2-1):n]==s[int((n+3)/2-1):n][::-1]: 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], ["-", 15, 679, 31, 679, 31, 666, 0, 206, 51, 22], ["+", 15, 679, 31, 679, 31, 666, 0, 206, 51, 22], ["-", 15, 679, 31, 679, 12, 666, 0, 206, 51, 22], ["+", 15, 679, 31, 679, 12, 666, 0, 206, 51, 22], ["-", 31, 679, 12, 666,...
5
119
s = list(input()) n = len(s) def kaibun(st): sta = list() for k in range(len(st)//2): sta.append(st[k]) for k in range(len(st)//2): if st[-(-len(st)//2)+k] != sta.pop(): return False return True if kaibun(s) == False: print('No') elif kaibun(s[:(n-1)//2]) == No: print('No') elif kaibun(s[(n+...
s = list(input()) n = len(s) def kaibun(st): sta = list() for k in range(len(st)//2): sta.append(st[k]) for k in range(len(st)//2): if st[-(-len(st)//2)+k] != sta.pop(): return False return True if kaibun(s) == False: print('No') elif kaibun(s[:(n-1)//2]) == False: print('No') elif kaibun(s[...
[["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 0, 147]]
5
159
#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 - 3) / 2; i++) { if (S.at(i) != S.at(N - i - 1) || S.at(i) != S.at((N - 3) / 2)) { ans = "No"; break; } } cout << ans << endl; return 0; }
#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 - 3) / 2; i++) { if (S.at(i) != S.at(N - i - 1) || S.at(i) != S.at((N - 3) / 2 - i)) { ans = "No"; break; } } cout << ans << endl; return 0; }
[["+", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 12, 22]]
1
116
s=input() n=len(s) s1=s[:(n-1)//2] s2=s[(n-1)//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-1)//2+1:] if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]: print('Yes') else: print('No')
[["+", 31, 666, 0, 206, 206, 663, 0, 664, 17, 33]]
5
83
s=input() n=len(s) if s[:(n-1)/2-1]==s[:(n-1)/2-1][::-1] and s==s[::-1]: print('Yes') else: print('No')
s=input() n=len(s) if s[:(n-1)//2]==s[:(n-1)//2][::-1] and s==s[::-1]: print('Yes') else: print('No')
[["-", 0, 206, 206, 663, 0, 657, 31, 657, 17, 85], ["+", 31, 666, 0, 206, 206, 663, 0, 657, 17, 676], ["-", 31, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 31, 666, 0, 206, 206, 663, 0, 657, 12, 612], ["-", 51, 206, 206, 663, 0, 657, 31, 657, 17, 85], ["+", 0, 206, 51, 206, 206, 663, 0, 657, 17, 676], ["-", 0, 206, 5...
5
70
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll inf = 1000000007; string rev(string s) { reverse(s.begin(), s.end()); return s; } int main() { string s; cin >> s; string t; t = rev(s); if (t != s) { cout << "No" << endl; return 0; } ...
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll inf = 1000000007; string rev(string s) { reverse(s.begin(), s.end()); return s; } int main() { string s; cin >> s; string t; t = rev(s); if (t != s) { cout << "No" << endl; return 0; } ...
[["+", 0, 14, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
222
S=list(str(input())) N=len(S) S_left=[S[i] for i in range((N-1)//2)] S_right=[S[i] for i in range((N+2)//2,N)] def kaibun(X): count=0 for i in range(len(X)//2): if S[i]==S[len(X)-1-i]: count+=1 if count==len(X)//2: return 1 else: return 0 print("Yes" if ka...
S=list(str(input())) N=len(S) S_left=[S[i] for i in range((N-1)//2)] S_right=[S[i] for i in range((N+2)//2,N)] def kaibun(X): count=0 for i in range(len(X)//2): if S[i]==S[len(X)-1-i]: count+=1 if count==len(X)//2: return 1 else: return 0 print("Yes" if ka...
[["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 25], ["+", 0, 41, 0, 666, 0, 657, 31, 657, 17, 48], ["+", 0, 666, 0, 657, 31, 657, 12, 652, 63, 22], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 0, 24]]
5
142
def kaibun(S): lenS = len(S) # print() # print(S) # print(S[:lenS//2]) # print(S[:(lenS-1)//2:-1]) if S[:lenS//2] == S[:(lenS-1)//2:-1]: return 1 else: return 0 S = input() lenS = len(S) if kaibun(S[:lenS//2]) and kaibun(S[lenS//2+1:]): print('Yes') else: print('No')
def kaibun(S): lenS = len(S) # print() # print(S) # print(S[:lenS//2]) # print(S[:(lenS-1)//2:-1]) if S[:lenS//2] == S[:(lenS-1)//2:-1]: return 1 else: return 0 S = input() lenS = len(S) if kaibun(S) and kaibun(S[:lenS//2]) and kaibun(S[lenS//2+1:]): print('Yes') else: p...
[["+", 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], ["+", 31, 679, 12, 652, 3, 4, 0, 206, 51, 22]]
5
96
S=input() N=len(S) a=False for i in range(N): if S[i]!=S[N-1-i]: print("No") break else: a=True if a==True: for j in range(int((N-3)/2)+1): if S[j]!=S[int((N-3)/2)-j]: a=False print("No") break if a==True: for k in range(int((N-3)/2)...
S=input() N=len(S) a=False for i in range(N): if S[i]!=S[N-1-i]: print("No") a=False break else: a=True if a==True: for j in range(int((N-3)/2)+1): if S[j]!=S[int((N-3)/2)-j]: a=False print("No") break if a==True: for k in...
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 147]]
5
176
S=input() N=len(S) a=False for i in range(N): if S[i]!=S[N-1-i]: print("No") break else: a=True if a==True: for j in range(int((N-3)/2)+1): if S[j]!=S[int((N-3)/2)-j]: a=False print("No") break if a==True: for k in range(int((N-3)/2)...
S=input() N=len(S) a=True for i in range(N): if S[i]!=S[N-1-i]: print("No") a=False break if a==True: for j in range(int((N-3)/2)+1): if S[j]!=S[int((N-3)/2)-j]: a=False print("No") break if a==True: for k in range(int((N-3)/2)+1): ...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 147], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 146], ["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 146], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 147], ["+...
5
176
s = input() n = len(s) A = s[0:(n-1)//2] B = s[(n+1)//2:n] if 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+1)//2:n] if A == B and A == A[::-1] and B == B[::-1]: print("Yes") else: print("No")
[["+", 0, 57, 15, 679, 31, 679, 31, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 31, 679, 17, 355], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 0, 22], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 667, 60]]
5
74
S=input() l=len(S) S1=S[1:int((l+1)/2)] S2=S[int((l+3)/2)::] if S==S[::] and S1==S1[::-1] and S2==S2[::-1]: print("Yes") else: print("No")
S=input() l=len(S) S1=S[:int((l-1)/2)] S2=S[int((l+1)/2)::] if S==S[::-1] and S1==S1[::-1] and S2==S2[::-1]: print("Yes") else: print("No")
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 31, 666, 0, 206, 206, 663, 0, 664, 17, 33], ["+", 31, 666, 0, 206, 206, 663, 0, 664...
5
88
S=list(input()) n=len(S) ans='No' if S==list(reversed(S)): new=S[0:((n-1)//2)] if new==list(reversed(new)): new2=S[((n+3)//2):n+1] if new2==list(reversed(new2)): ans='Yes' print(ans)
S=list(input()) n=len(S) ans='No' if S==list(reversed(S)): new=S[0:((n-1)//2)] if new==list(reversed(new)): new2=S[((n+3)//2)-1:] if new2==list(reversed(new2)): ans='Yes' print(ans)
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 31, 22], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102]]
5
95
string=input() kaibun=list(string) n=int(len(kaibun)) if kaibun==list(reversed(kaibun)): if (list(reversed(kaibun[:int((n-1)/2)]))==kaibun[:int((n-1)/2)]) and (list(reversed(kaibun[int((n+1)/2):]))==kaibun[int((n+1)/2):]): print("Yes") else: print("No")
string=input() kaibun=list(string) n=int(len(kaibun)) if (kaibun==list(reversed(kaibun)))and(list(reversed(kaibun[:int((n-1)/2)]))==kaibun[:int((n-1)/2)]) and (list(reversed(kaibun[int((n+1)/2):]))==kaibun[int((n+1)/2):]): print("Yes") else: print("No")
[["+", 0, 57, 15, 679, 31, 679, 31, 23, 0, 24], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102], ["-", 0, 656, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 57, 15, 679, 31, 679, 31, 23, 0, 25], ["+", 0, 656, 0, 57, 15, 679, 31, 679, 17, 355]]
5
122
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string s; cin >> s; bool flag = true; for (int r = 0, l = s.size() - 1; r < l; ++r, --l) { if (s[r] != s[l]) { flag = false; break; } } if (flag) { for (int r = 0, l = (s.size() - 2) / 2; r <...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string s; cin >> s; bool flag = true; for (int r = 0, l = s.size() - 1; r < l; ++r, --l) { if (s[r] != s[l]) { flag = false; break; } } if (flag) { for (int r = 0, l = (s.size() - 2) / 2; r <...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
164
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; size_t n = s.length(); for (int i = 0; i < (n - 1) / 2; i++) { if (s[i] != s[(n + 3) / 2 + i]) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; size_t n = s.length(); for (int i = 0; i < (n - 1) / 2; i++) { if (s[i] != s[(n + 1) / 2 + i]) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13]]
1
96
S = input() words = [] words.append(S) words.append(S[:(N-1)//2]) words.append(S[(N+3)//2 - 1:]) ans = all([word == word[::-1] for word in words]) print("Yes" if ans else "No")
S = input() N = len(S) words = [] words.append(S) words.append(S[:(N-1)//2]) words.append(S[(N+3)//2 - 1:]) ans = all([word == word[::-1] for word in words]) print("Yes" if ans else "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
81
import sys S = input() N = len(S) if S == S[::-1]: if S[0:(N-1)/2] == S[0:(N-1)/2][::-1]: if S[((N+3)/2)-1:N] == S[((N+3)/2)-1:N][::-1]: print("Yes") sys.exit() print("No")
import sys S = input() N = len(S) if S == S[::-1]: if S[0:(N-1)//2] == S[0:(N-1)//2][::-1]: if S[((N+3)//2)-1:N] == S[((N+3)//2)-1:N][::-1]: print("Yes") sys.exit() print("No")
[["-", 15, 666, 0, 206, 206, 663, 0, 657, 17, 85], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 17, 676], ["-", 0, 206, 51, 206, 206, 663, 0, 657, 17, 85], ["+", 0, 206, 51, 206, 206, 663, 0, 657, 17, 676], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 85], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 17, 676]]
5
115
S = input() N = int(len(S)) S_a = S[:(N-1)//2] S_b = S[(N+3)//2:] #print(S) if S == S[::-1] and S_a == S_a[::-1] and S_b == S_b[::-1]: print("Yes") else: print("No")
S = input() N = int(len(S)) S_a = S[:(N-1)//2] S_b = S[(N+1)//2:] #print(S) if S == S[::-1] and S_a == S_a[::-1] and S_b == S_b[::-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
86
s = input() t = s[:(len(s)-1)/2] u = s[(len(s)+3)/2-1:] if s == s[::-1] and t == t[::-1] and u == u[::-1]: print("Yes") else: print("No")
s = input() t = s[:(len(s)-1)//2] u = s[(len(s)+3)//2-1:] if s == s[::-1] and t == t[::-1] and u == u[::-1]: print("Yes") else: print("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
84
s = input() l = len(s) sl = s[:(l-1)//2] sr = s[((l+3)//2 -1):] #print(sl) #print(len(sl)//2) #print(sr) #print(len(sr)//2) def f(s): l = len(s) j = False for i in range(l//2 +1): if s[i] == s[l-1-i]: j = True else : j = False return j if f(s) and f(sl) and f(s...
s = input() l = len(s) sl = s[:(l-1)//2] sr = s[((l+3)//2 -1):] #print(sl) #print(len(sl)//2) #print(sr) #print(len(sr)//2) def f(s): l = len(s) j = False for i in range(l//2 +1): if s[i] == s[l-1-i]: j = True else : j = False break return j if f(s)...
[["+", 0, 57, 75, 76, 8, 196, 0, 93, 0, 94]]
5
130
#include <algorithm> #include <bits/stdc++.h> //piの利用で必要(M_PI) #include <cmath> #include <fstream> #include <iostream> #include <random> #include <stdio.h> #include <string.h> //文字列の代入に使う #include <sys/stat.h> #include <unistd.h> #include <vector> int main() { int N, count = 0, sum = 0; std::string S; std::cin >...
#include <algorithm> #include <bits/stdc++.h> //piの利用で必要(M_PI) #include <cmath> #include <fstream> #include <iostream> #include <random> #include <stdio.h> #include <string.h> //文字列の代入に使う #include <sys/stat.h> #include <unistd.h> #include <vector> int main() { int N, count = 0, sum = 0; std::string S; std::cin ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
251
s = input() t = s[:int((len(s)-1)/2)] u = s[(int(len(s)+3)/2-1):] if s == s[::-1] and t == t[::-1] and u == u[::-1]: print("Yes") else: print("No")
s = input() t = s[:int((len(s)-1)/2)] u = s[(int((len(s)+3)/2)-1):] if s == s[::-1] and t == t[::-1] and u == u[::-1]: print("Yes") else: print("No")
[["+", 31, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 23, 0, 657, 31, 652, 3, 4, 0, 25]]
5
90
S = str(input()) slist = list(S) N = len(slist) print(N) k = int((N-1)/2) rs = slist[::-1] front = slist[0:k] rfront = front[::-1] if front == rfront and rs == slist: print("Yes") else: print("No")
S = str(input()) slist = list(S) N = len(slist) k = int((N-1)/2) rs = slist[::-1] front = slist[0:k] rfront = front[::-1] if front == rfront and rs == slist: 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, 25]]
5
85
#include <bits/stdc++.h> using namespace std; bool is_palindrome(const string &S) { int N = S.size(); for (int ii = 0; ii < N / 2; ii++) { if (S[ii] != S[N - ii]) return false; } return true; } int main() { string S; cin >> S; int N = S.size(); if (is_palindrome(S) && is_palindrome(S.substr(...
#include <bits/stdc++.h> using namespace std; bool is_palindrome(const string &S) { int N = S.size(); for (int ii = 0; ii < N / 2; ii++) { if (S[ii] != S[N - 1 - ii]) return false; } return true; } int main() { string S; cin >> S; int N = S.size(); if (is_palindrome(S) && is_palindrome(S.sub...
[["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
150
#include <iostream> #include <string> using namespace std; bool cal_string_palindrome(string Y) { int num; num = Y.size(); for (int i = 0; i <= (num - 1) / 2; i++) { char s1 = Y[i]; char s2 = Y[num - 1 - i]; // cout << s1 << ":" << s2 << endl; if (s1 != s2) { return false; } }...
#include <iostream> #include <string> using namespace std; bool cal_string_palindrome(string Y) { int num; num = Y.size(); for (int i = 0; i <= (num - 1) / 2; i++) { char s1 = Y[i]; char s2 = Y[num - 1 - i]; // cout << s1 << ":" << s2 << endl; if (s1 != s2) { return false; } }...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
208
S = input() def judge(x): if "".join(list(reversed(x))) == x: return True else: return False def solve(x): if judge(x) and judge(x[0:(len(x)-1)/2]) and judge(x[(len(x)+1)/2:]): print("Yes") else: print("No") solve(S)
S = input() def judge(x): if "".join(list(reversed(x))) == x: return True else: return False def solve(x): if judge(x) and judge(x[0:int((len(x)-1)/2)]) and judge(x[int((len(x)+1)/2):]): print("Yes") else: print("No") solve(S)
[["+", 3, 4, 0, 206, 206, 663, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 206, 206, 663, 0, 652, 3, 4, 0, 25], ["+", 0, 206, 206, 663, 0, 652, 3, 4, 0, 24]]
5
101
import java.io.*; import java.util.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static StringTokenizer st; public static void main(String[] args...
import java.io.*; import java.util.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static StringTokenizer st; public static void main(String[] args...
[["-", 8, 196, 0, 503, 49, 200, 51, 16, 17, 33], ["-", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499]]
3
408
#include <algorithm> #include <iostream> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = s; i < (int)(n); i++) #define out(x) cout << x << endl #define INF 1000000; #include <map> #include <math.h> using ll = ...
#include <algorithm> #include <iostream> #include <set> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, s, n) for (int i = s; i < (int)(n); i++) #define out(x) cout << x << endl #define INF 1000000; #include <map> #include <math.h> using ll = ...
[["-", 341, 342, 0, 16, 31, 16, 31, 16, 17, 85], ["-", 341, 342, 0, 16, 31, 16, 31, 16, 12, 13], ["-", 12, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["-", 12, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
194
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ss = s; reverse(s.begin(), s.end()); int l = (s.length() - 1) / 2; string p = "", pp; for (int i = 0; i < l; i++) p[i] += ss[i]; pp = p; reverse(pp.begin(), pp.end()); if (s == ss && p == pp) cout << "Yes"...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ss = s; reverse(s.begin(), s.end()); int l = (s.length() - 1) / 2; string p = "", pp; for (int i = 0; i < l; i++) { p += ss[i]; } pp = p; reverse(pp.begin(), pp.end()); if (s == ss && p == pp) cout << "...
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["-", 8, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["-", 8, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["-", 8, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
132
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = s; int n = s.size(); string s1 = s.substr(0, (n - 1) / 2); string s2 = s.substr((n + 3) / 2, (n - 1) / 2); string t1 = s1; string t2 = s2; reverse(s.begin(), s.end()); reverse(s1.begin(), s1.end()); reverse(...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string t = s; int n = s.size(); string s1 = s.substr(0, (n - 1) / 2); string s2 = s.substr((n + 1) / 2, (n - 1) / 2); string t1 = s1; string t2 = s2; reverse(s.begin(), s.end()); reverse(s1.begin(), s1.end()); reverse(...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
196
S = input() S_rvs = S[::-1] N = len(S) left = int((N-1)/2-1) right = int((N+3)/2-1) if S == S_rvs and S[:left] == S_rvs[right:] and S[right:] == S_rvs[:left]: print("Yes") else: print("No")
S = input() S_rvs = S[::-1] N = len(S) left = int((N-1)/2) right = int((N+3)/2-1) if S == S_rvs and S[:left] == S_rvs[right:] and S[right:] == S_rvs[:left]: print("Yes") else: print("No")
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
91
#include <bits/stdc++.h> using namespace std; #define sz size() int main() { string s; cin >> s; int n = s.sz; int n1 = (n - 1) / 2; string h = s; reverse(h.begin(), h.end()); bool ch1 = (h == s); h = ""; for (int i = 0; i < n1; ++i) h += s[i]; string k = h; reverse(k.begin(), k.end()); bool...
#include <bits/stdc++.h> using namespace std; #define sz size() int main() { string s; cin >> s; int n = s.sz; int n1 = (n - 1) / 2; string h = s; reverse(h.begin(), h.end()); bool ch1 = (h == s); h = ""; for (int i = 0; i < n1; ++i) h += s[i]; string k = h; // cout << h << ' '; reverse(k.be...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 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
205
moji = list(input()) length = len(moji) count = 0 m = n = 0 for i in range(int(length/2-1)): if moji[i] != moji[length-i-1]: count += 1 k = (length-1)//2-1 for i in range(int((length-1)/2-1)): if moji[i] != moji[k-n]: count += 1 n += 1 n = (length+3-1)/2 for n in range(int(length-1)): ...
moji = list(input()) length = len(moji) count = 0 m = n = 0 for i in range(int(length/2-1)): if moji[i] != moji[length-i-1]: count += 1 k = (length-1)//2-1 for i in range(int((length-1)/2-1)): if moji[i] != moji[k-n]: count += 1 n += 1 n = (length+3-1)/2 for n in range(int(length-1)): ...
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 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]]
5
166
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> S(3), T(3); cin >> S.at(0); int N = S.at(0).size(); T.at(0) = S.at(0); reverse(T.at(0).begin(), T.at(0).end()); if (S.at(0) == T.at(0)) { S.at(1) = S.at(0).substr(0, (N - 1) ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> S(3), T(3); cin >> S.at(0); int N = S.at(0).size(); T.at(0) = S.at(0); reverse(T.at(0).begin(), T.at(0).end()); if (S.at(0) == T.at(0)) { S.at(1) = S.at(0).substr(0, (N - 1) ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
333
//-------All power is within you,you can do Anything and Everything.---------// #include <bits/stdc++.h> using namespace std; //*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ M $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*// #define pb push_back #define MP make_pair #define F first #define S second #define sc(x) scanf("%lld", &x) #def...
//-------All power is within you,you can do Anything and Everything.---------// #include <bits/stdc++.h> using namespace std; //*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ M $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*// #define pb push_back #define MP make_pair #define F first #define S second #define sc(x) scanf("%lld", &x) #def...
[["-", 0, 14, 8, 9, 0, 42, 0, 2, 63, 22], ["-", 8, 9, 0, 42, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 42, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 42, 0, 2, 3, 4, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
580
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.length(); int fac = 1; for (int i = 0; i < N / 2; i++) { if (S.at(i) != S.at(N - 1 - i)) { fac = fac * 0; } } for (int i = 0; i < (N - 3) / 4; i++) { if (S.at(i) != S.at((N - 3) / 2 - i)) { fa...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.length(); int fac = 1; for (int i = 0; i < N / 2; i++) { if (S.at(i) != S.at(N - 1 - i)) { fac = fac * 0; } } for (int i = 0; i < (N - 3) / 4; i++) { if (S.at(i) != S.at((N - 3) / 2 - i)) { fa...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
208
// // // //AUTHOR:BlackBox Inc.// // // // #include<bits/stdc++.h> // // // #include<unordered_map> // // // #include<tr1/unordered_map> // // // #define ll long long // // // #define ull unsigned long long // // // #define vi vector<int> // // // #define vlli vector<long long int> // // // #define vvi vector<...
// // // //AUTHOR:BlackBox Inc.// // // // #include<bits/stdc++.h> // // // #include<unordered_map> // // // #include<tr1/unordered_map> // // // #define ll long long // // // #define ull unsigned long long // // // #define vi vector<int> // // // #define vlli vector<long long int> // // // #define vvi vector<...
[["+", 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, 355], ["+", 51, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24]]
1
535
#include <stdio.h> #include <string.h> // int kaiboon(char s1[],char s2[]); int main() { char s[1000], s1[1000], s2[1000]; int i, j = 0, n; scanf("%s", &s); for (i = 0; i < (strlen(s) - 1) / 2; i++) { s1[i] = s[i]; } for (i = (strlen(s) + 1) / 2; i < strlen(s); i++) { s2[j] = s[i]; j++; } ...
#include <stdio.h> #include <string.h> int main() { char s[10000], s1[10000], s2[10000]; int i, j = 0, n; scanf("%s", &s); for (i = 0; i < (strlen(s) - 1) / 2; i++) { s1[i] = s[i]; } for (i = (strlen(s) + 1) / 2; i < strlen(s); i++) { s2[j] = s[i]; j++; } if (strcmp(s1, s2) == 0) { p...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
155
s=input() n=len(s) s1=s[(n-1)//2] flag=0 for i in range(len(s1)//2): if(s1[i]!=s1[-1-i]): flag=1 break s1=s[(n+3)//2-1] for i in range(len(s1)//2): if(s1[i]!=s1[-1-i]): flag=1 break for i in range(n//2): if s[i]!=s[-1-i]: flag=1 break if flag==1: print(...
s=input() n=len(s) s1=s[:(n-1)//2] flag=0 for i in range(len(s1)//2): if(s1[i]!=s1[-1-i]): flag=1 break s1=s[(n+3)//2-1:] for i in range(len(s1)//2): if(s1[i]!=s1[-1-i]): flag=1 break for i in range(n//2): if s[i]!=s[-1-i]: flag=1 break if flag==1: prin...
[["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102]]
5
153
S = list(input()) M = len(S) // 2 if S == S[::-1] and S[:M] == S[:M:-1]: print("Yes") else: print("No")
S = list(input()) M = len(S) // 2 if S == S[::-1] and S[:M] == S[:M][::-1]: print("Yes") else: print("No")
[["+", 15, 679, 12, 666, 0, 206, 51, 206, 0, 73], ["+", 0, 57, 15, 679, 12, 666, 0, 206, 0, 70], ["+", 15, 679, 12, 666, 0, 206, 206, 663, 0, 102]]
5
56
#include <algorithm> #include <climits> #include <iostream> #include <math.h> using namespace std; int N, A, B; string S; int main() { cin >> S; int n = 0; int con = 0; n = S.size(); for (int i = 0; i < n / 2; i++) { if (S[i] != S[n - 1 - i]) { con++; break; }; } for (int i = 0...
#include <algorithm> #include <climits> #include <iostream> #include <math.h> using namespace std; int N, A, B; string S; int main() { cin >> S; int n = 0; int con = 0; n = S.size(); for (int i = 0; i < n / 2; i++) { if (S[i] != S[n - 1 - i]) { con++; break; }; } for (int i = ...
[["+", 12, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
234
#include <bits/stdc++.h> using namespace std; template <typename T> std::string NumberToString(T Number) { std::ostringstream ss; ss << Number; return ss.str(); } // Usages NumberToString(3) template <typename T> T StringToNumber(const string &Text) { istringstream ss(Text); T result; return ss >> result ...
#include <bits/stdc++.h> using namespace std; template <typename T> std::string NumberToString(T Number) { std::ostringstream ss; ss << Number; return ss.str(); } // Usages NumberToString(3) template <typename T> T StringToNumber(const string &Text) { istringstream ss(Text); T result; return ss >> result ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
297
process.stdin.resume(); process.stdin.setEncoding('utf8'); function kaibun(s) { l = s.length; var flag = true; for (var i = 0; i < (l - l % 2) / 2; i++) { if (s[i] != s[l - 1 - i]) { flag = false; } } return flag; } function Main(input) { var s = input; var mae = s.substr(0, (s.length - 1...
process.stdin.resume(); process.stdin.setEncoding('utf8'); function kaibun(s) { l = s.length; var flag = true; for (var i = 0; i < (l - l % 2) / 2; i++) { if (s[i] != s[l - 1 - i]) { flag = false; } } return flag; } function Main(input) { var s = input.trim(); var mae = s.substr(0, (s.len...
[["+", 0, 198, 0, 200, 51, 2, 63, 558, 0, 131], ["+", 0, 198, 0, 200, 51, 2, 63, 558, 559, 560], ["+", 0, 198, 0, 200, 51, 2, 3, 3, 0, 24], ["+", 0, 198, 0, 200, 51, 2, 3, 3, 0, 25]]
2
216
s = input() def isPalindrome(string): return s == s[::-1] if isPalindrome(s) and isPalindrome(s[0:len(s)//2]): print('Yes') else: print('No')
s = input() def isPalindrome(string): return string == string[::-1] if isPalindrome(s) and isPalindrome(s[0:len(s)//2]): print('Yes') else: print('No')
[["-", 0, 14, 8, 196, 0, 37, 0, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 37, 0, 666, 0, 22], ["-", 8, 196, 0, 37, 0, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 37, 0, 666, 0, 206, 51, 22]]
5
56
s = input() n = len(s) a = s[:n//2] b = s[n//2+1:] def circular(string): return s == s[::-1] if circular(s) and circular(a): print('Yes') else: print('No')
s = input() n = len(s) a = s[:n//2] b = s[n//2+1:] def circular(string): return string == string[::-1] if circular(s) and circular(a): print('Yes') else: print('No')
[["-", 0, 14, 8, 196, 0, 37, 0, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 37, 0, 666, 0, 22], ["-", 8, 196, 0, 37, 0, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 37, 0, 666, 0, 206, 51, 22]]
5
72
import math a= input() length=math.floor(len(a)/2) def kaibun(p): length_p=math.floor(len(p)/2) total_p = 0 for i in range(length_p): if p[i] is not p[-1*i -1]: return False break else: total_p += 1 if total_p == length_p: return True i...
import math a= input() length=math.floor(len(a)/2) def kaibun(p): length_p=math.floor(len(p)/2) total_p = 0 for i in range(length_p): if p[i] is not p[-1*i -1]: return False break else: total_p += 1 if total_p == length_p: return True i...
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
133
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rep1(i, n) for (int i = 1; i < (int)(n); ++i) #define repeq(i, n) for (int i = 0; i <= (int)(n); ++i) #define rep1eq(i, n) for (int ...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; // #define int long long // #define double long double #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rep1(i, n) for (int i = 1; i < (int)(n); ++i) #define repeq(i, n) for (int i = 0; i <= (int)(n); ++i) #define rep1eq(i, n) for (int ...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
1,057
#include <iostream> #include <string> using namespace std; bool palin(string s) { bool P{true}; for (size_t i = 0; i <= s.length() / 2; i++) if (s[i] != s[s.length() - i - 1]) P = false; return P; } int main() { string S{}; cin >> S; if (palin(S) && palin(S.substr(0, S.length() / 2 - 1)) && ...
#include <iostream> #include <string> using namespace std; bool palin(string s) { bool P{true}; for (size_t i = 0; i <= s.length() / 2; i++) if (s[i] != s[s.length() - i - 1]) P = false; return P; } int main() { string S{}; cin >> S; if (palin(S) && palin(S.substr(0, S.length() / 2)) && pali...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
155
s = input() def reverse(text): return text == ''.join(list(reversed(text))) N = len(s) if reverse(s) and reverse(s[:(N-1)/2]) and reverse(s[(N+3)/2 - 1:]): print('Yes') else: print('No')
s = input() def reverse(text): return text == ''.join(list(reversed(text))) N = len(s) if reverse(s) and reverse(s[:int((N-1)/2)]) and reverse(s[int((N+3)/2) - 1:]): print('Yes') else: print('No')
[["+", 3, 4, 0, 206, 206, 663, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 206, 206, 663, 0, 652, 3, 4, 0, 25], ["+", 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, 25]]
5
85
def f(x): return x == x[::-1] S = input() l1 = (len(S)-1)//2 l2 = (len(S)+3)//2 S1 = S[:l1] S2 = S[l2:] if f(S) and f(S1) and f(S2): print("Yes") else: print("No")
def f(x): return x == x[::-1] S = input() l1 = (len(S)-1)//2 l2 = (len(S)+3)//2 S1 = S[:l1] S2 = S[l2-1:] if f(S) and f(S1) and f(S2): 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
89
def f(x): return x==x[::-1] S=input() n=(len(S)-1)/2 S1,S2=S[:n-1],S[n+1:] if f(S) and f(S1) and f(S2): print('Yes') else: print('No')
def f(x): return x==x[::-1] S=input() n=(len(S)-1)//2 S1,S2=S[:n],S[n+1:] if f(S) and f(S1) and f(S2): print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["-", 12, 432, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 12, 432, 0, 206, 206, 663, 0, 657, 12, 612]]
5
82
s = int(input()) n = len(s) s1 = s[0:(n-1)//2] s2 = s[(n +2)//2:n] if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]: print('Yes') else: print('No')
s = str(input()) n = len(s) s1 = s[0:n//2] s2 = s[(n+2)//2:n] if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]: print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 12, 206, 206, 663, 0, 657, 31, 23, 0, 24], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["-", 12, 206, 206, 663, 0, 657, 31, 23, 0, 25]]
5
87
s = input() n = len(s) palin = lambda s: s == s[::-1] f = (n-1)//2 i = (n+3)//2 if palin(s[0:f]) and palin(s[i-1:n]): print("Yes") else: print("No")
s = input() n = len(s) palin = lambda s: s == s[::-1] f = (n-1)//2 i = (n+3)//2 if palin(s[0:f]) and palin(s[i-1:n]) and palin(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
80
// A smoothe sea never made a skilled sailor. // KEEP IT SIMPLE STUPID #include <bits/stdc++.h> using namespace std; #define ll long long #define print(o) \ for (auto it = (o).begin(); it != (o).end(); it++) \ cout << *it << ...
// A smoothe sea never made a skilled sailor. // KEEP IT SIMPLE STUPID #include <bits/stdc++.h> using namespace std; #define ll long long #define print(o) \ for (auto it = (o).begin(); it != (o).end(); it++) \ cout << *it << ...
[["-", 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
193
def pal(t): return t == t[::-1]; s = input(); f = pal(s) and pal(s[0:(len(s)//2 - 1):]) and pal(s[(len(s)//2 + 1)::]); #f = pal(s); if f == True: print("Yes"); else: print("No");
def pal(t): return t == t[::-1]; s = input(); f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]); #f = pal(s); if f == True: print("Yes"); else: print("No");
[["-", 3, 4, 0, 206, 206, 663, 0, 23, 0, 24], ["-", 0, 206, 206, 663, 0, 23, 0, 657, 17, 33], ["-", 0, 206, 206, 663, 0, 23, 0, 657, 12, 612], ["-", 3, 4, 0, 206, 206, 663, 0, 23, 0, 25]]
5
91
akacaka S = [] S_reverse = [] S_first = [] S_first_reverse = [] S_last = [] S_last_reverse = [] S = list(input()) S_reverse = S.copy() S_reverse.reverse() S_first = S[:len(S)//2] S_last = S[(len(S)+1)//2:] S_first_reverse = S_first.copy() S_first_reverse.reverse() S_last_reverse = S_last.copy() S_last_reverse.reverse(...
S = [] S_reverse = [] S_first = [] S_first_reverse = [] S_last = [] S_last_reverse = [] S = list(input()) S_reverse = S.copy() S_reverse.reverse() S_first = S[:len(S)//2] S_last = S[(len(S)+1)//2:] S_first_reverse = S_first.copy() S_first_reverse.reverse() S_last_reverse = S_last.copy() S_last_reverse.reverse() if S...
[["-", 36, 36, 36, 36, 0, 656, 0, 1, 0, 22]]
5
131
#include <iostream> using namespace std; int main() { string s; cin >> s; int first = 0; int last = s.length() - 1; bool palindrome = true; while (first <= last) { if (s[first++] != s[last--]) { palindrome = false; break; } } first = 0; last = (s.length() - 1) / 2; while (first <...
#include <iostream> using namespace std; int main() { string s; cin >> s; int first = 0; int last = s.length() - 1; bool palindrome = true; while (first <= last) { if (s[first++] != s[last--]) { palindrome = false; break; } } first = 0; last = (s.length() - 3) / 2; while (first <...
[["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13]]
1
200
#include <bits/stdc++.h> #include <iostream> #include <string> #define f(i, n) for (int i = 0; i < n; i++) #define fll(i, n) for (long long int i = 0; i < n; i++) #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector<vector<int>> #define vvll vector<vector<ll>> #define inf INT_MAX #...
#include <bits/stdc++.h> #include <iostream> #include <string> #define f(i, n) for (int i = 0; i < n; i++) #define fll(i, n) for (long long int i = 0; i < n; i++) #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector<vector<int>> #define vvll vector<vector<ll>> #define inf INT_MAX #...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
300
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.15f\n",*********); #include <string> //char(小文字-32=大文字) #include <vector> //文字列.erase(n),vector //to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #inc...
#include <algorithm> //next_permutation #include <iostream> #include <set> #include <stdio.h> //printf("%.15f\n",*********); #include <string> //char(小文字-32=大文字) #include <vector> //文字列.erase(n),vector //to_string,string,substr #include <cmath> //min,max #include <complex> #include <iomanip> #inc...
[["-", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 30, 0, 14, 8, 9, 0, 9, 0, 46], ["-", 36, 36, 0, 30, 0, 14, 8, 9, 0, 46], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33]]
1
633
input = gets.chomp input_num = input.length b= (input_num - 1) / 2 input_array = input.split("") c = b - 1 smarl_sentence = input_array[0..c] d = smarl_sentence.join e = (input_num + 3) / 2 f = e - 1 h = input_num - 1 smarl_sentence_2 = input_array[f..h] g = smarl_sentence_2.join puts input input_reverse = in...
input = gets.chomp input_num = input.length b= (input_num - 1) / 2 input_array = input.split("") c = b - 1 smarl_sentence = input_array[0..c] d = smarl_sentence.join e = (input_num + 3) / 2 f = e - 1 h = input_num - 1 smarl_sentence_2 = input_array[f..h] g = smarl_sentence_2.join input_reverse = input.reverse...
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]]
4
113
get = input() if get[:int((len(get)-1)/2)] == get[int(((len(get)+3)/2)-1):]: print('yes') else: print('no')
get = input() if get[:int((len(get)-1)/2)] == get[int(((len(get)+3)/2)-1):]: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
60
s=input() n=len(s) s1=s[:(n-1)//2] s2=s[(n+1)//2:] ans='Yes' for s in [s1,s2]: for i in range(len(s)): if s[i]!=s[-1-i]: ans='No' break print(ans)
s=input() n=len(s) s1=s[:(n-1)//2] s2=s[(n+1)//2:] ans='Yes' for s in [s,s1,s2]: for i in range(len(s)): if s[i]!=s[-1-i]: ans='No' break print(ans)
[["+", 36, 36, 0, 656, 0, 7, 12, 634, 0, 22], ["+", 36, 36, 0, 656, 0, 7, 12, 634, 0, 21]]
5
86
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; string M = N.substr(0, N.size() / 2); bool ans = false; for (int i = 0; i < N.size() / 2; i++) { for (int j = 0; j < M.size() / 2; j++) { if (N.at(i) == N.at(N.size() - 1 - i) && M.at(j) == M.at(M.size() - 1 - ...
#include <bits/stdc++.h> using namespace std; int main() { string N; cin >> N; string M = N.substr(0, N.size() / 2); bool ans = true; for (int i = 0; i < N.size() / 2; i++) { for (int j = 0; j < M.size() / 2; j++) { if (N.at(i) != N.at(N.size() - 1 - i) || M.at(j) != M.at(M.size() - 1 - j...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60],...
1
163
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); string A = S; reverse(A.begin(), A.end()); string B = S.substr(1, (N - 1) / 2); string C = B; reverse(C.begin(), C.end()); if (S == A && B == C) { cout << "Yes" << endl; } else { cout << "No" <<...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); string A = S; reverse(A.begin(), A.end()); string B = S.substr((N + 1) / 2); string C = B; reverse(C.begin(), C.end()); if (S == A && B == C) { cout << "Yes" << endl; } else { cout << "No" << e...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72]]
1
117
//“ In order to be irreplaceable, one must always be different” #include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pi 3.14159265359 #define str string #define vll vector<ll> #define vstr vector<str> #define vchar vector<char> #define pb push_back #define popb pop_back #define p...
//“ In order to be irreplaceable, one must always be different” #include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define pi 3.14159265359 #define str string #define vll vector<ll> #define vstr vector<str> #define vchar vector<char> #define pb push_back #define popb pop_back #define p...
[["-", 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
603
def isPal(s): return s==s[::-1] s = str(input()) n = len(s) if isPal(s[0:(n-1)//2]) and isPal(s[n//2+1:]): print('Yes') else: print('No')
def isPal(s): return s==s[::-1] s = str(input()) n = len(s) if isPal(s[0:(n-1)//2]) and isPal(s[n//2+1:]) and isPal(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
74
str1 = input() n = len(str1) m = int((n-1)/2) o = int((n+3)/2) str2 = str1[:m] str3 = str1[(o-1):n] if str1 != str1[::-1]: print("No") if str2 != str2[::-1]: print("No") if str3 != str3[::-1]: print("No") else: print("Yes")
str1 = input() n = len(str1) m = int((n-1)/2) o = int((n+3)/2) str2 = str1[:m] str3 = str1[(o-1):n] if str1 != str1[::-1]: print("No") else: if str2 != str2[::-1]: print("No") else: if str3 != str3[::-1]: print("No") else: print("Yes")
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 75, 76, 8, 196, 0, 57, 75, 76, 0, 102]]
5
113
S = list(input()) S_len = len(S) S_reverse = list(S[::-1]) ans = 'Yes' # 条件1 Sは回文である if S == S_reverse: pass else: ans = 'No' # 条件2 S_2 = S[0:(S_len - 1) // 2] S_2_reverse = S_2[::-1] if S_2 == S_2_reverse: pass else: ans = 'No' # 条件3 S_3 = S[0:(S_len + 3) // 2] S_3_reverse = S_3[::-1] if S_3 == S_3...
S = list(input()) S_len = len(S) S_reverse = list(S[::-1]) ans = 'Yes' # 条件1 Sは回文である if S == S_reverse: pass else: ans = 'No' # 条件2 S_2 = S[0:(S_len - 1) // 2] S_2_reverse = S_2[::-1] if S_2 == S_2_reverse: pass else: ans = 'No' # 条件3 S_3 = S[(S_len + 3) // 2 - 1:] S_3_reverse = S_3[::-1] if S_3 == ...
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102]]
5
123
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.next(); int first = (s.length() - 1) / 2; int second = (s.length() + 3) / 2; System.out.println(isPalindrom(s.substring(0, first)) && ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.next(); int first = (s.length() - 1) / 2; int second = (s.length() + 3) / 2; System.out.println(isPalindrom(s) && isPalindrom(s.substring(0, first)) && ...
[["+", 15, 16, 31, 16, 31, 492, 3, 4, 0, 25], ["+", 3, 4, 0, 510, 15, 16, 31, 16, 17, 98], ["+", 0, 510, 15, 16, 31, 16, 12, 492, 141, 22], ["+", 15, 16, 31, 16, 12, 492, 3, 4, 0, 24], ["+", 31, 16, 12, 492, 3, 4, 0, 492, 500, 22]]
3
143