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 <stdio.h> #include <string.h> int main(void) { char s[100]; scanf("%s", &s); int n; n = strlen(s); int i = 0; int k = n - 1; while (i < n / 2) { if (s[i] != s[k]) { printf("No"); return 0; } i++; k--; } int s2, s3; s2 = (n - 1) / 2 - 1; s3 = (n + 3) / 2 - 1...
#include <stdio.h> #include <string.h> int main(void) { char s[100]; scanf("%s", &s); int n; n = strlen(s); int i = 0; int k = n - 1; while (i < n / 2) { if (s[i] != s[k]) { printf("No"); return 0; } i++; k--; } int s2, s3; s2 = (n - 1) / 2 - 1; s3 = (n + 3) / 2 - 1...
[["+", 15, 23, 0, 16, 12, 16, 12, 69, 28, 22], ["+", 15, 23, 0, 16, 12, 16, 12, 69, 0, 70], ["+", 15, 23, 0, 16, 12, 16, 12, 69, 0, 73]]
0
191
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int long...
[["+", 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
243
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String input = reader.readLine(); int length =...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String input = reader.readLine(); int length =...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
251
#if defined(__GNUC__) #include <bits/stdc++.h> #define __int32 __int32_t // __GNUC__ #else #include "bits/stdc++.h" #endif using namespace std; #define int long long #define itn __int32 #define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i)) #define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i)) #define ALL(x) (x).beg...
#if defined(__GNUC__) #include <bits/stdc++.h> #define __int32 __int32_t // __GNUC__ #else #include "bits/stdc++.h" #endif using namespace std; #define int long long #define itn __int32 #define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i)) #define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i)) #define ALL(x) (x).beg...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 31, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 12, 22]]
1
332
#include <bits/stdc++.h> using namespace std; bool pal(string cad) { for (int i = 0; i < cad.size(); i++) { if (cad[i] != cad[cad.size() - i - 1]) return false; } return true; } int main() { string s; cin >> s; int a, b; a = ((s.size() - 1) / 2); b = ((s.size() + 3) / 2) - 1; string x = s.su...
#include <bits/stdc++.h> using namespace std; bool pal(string cad) { for (int i = 0; i < cad.size(); i++) { if (cad[i] != cad[cad.size() - i - 1]) return false; } return true; } int main() { string s; cin >> s; int a, b; a = ((s.size() - 1) / 2); b = ((s.size() + 3) / 2) - 1; string x = s.su...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 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
170
s=input() sl=len(s) if s[:(sl-1)/2]==s[((sl+3)/2)-1:]: print('Yes') else : print('No')
s=input() sl=len(s) if s[:int((sl-1)/2)]==s[int(((sl+3)/2)-1):]: print('Yes') else : print('No')
[["+", 15, 666, 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
54
def check_palindrome(s): n = len(s) return all([s[i] == s[n - 1 - i] for i in range(n // 2)]) def main(): s = input() n = len(s) print(check_palindrome(s) and check_palindrome(s[:n // 2])) main()
def check_palindrome(s): n = len(s) return all([s[i] == s[n - 1 - i] for i in range(n // 2)]) def main(): s = input() n = len(s) print('Yes' if check_palindrome(s) and check_palindrome(s[:n // 2]) else 'No') main()
[["+", 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
77
S = list(input()) def f(s): n = len(s)//2 for i in range(n): if s[i] != s[-i - 1]: return False return True N = len(S) if f(S[:(N - 1) // 2]) and f(S[(N + 3) // 2 - 1:]): print('Yes') else: print('No')
S = list(input()) def f(s): n = len(s)//2 for i in range(n): if s[i] != s[-i - 1]: return False return True N = len(S) if f(S[:(N - 1) // 2]) and f(S[(N + 3) // 2 - 1:]) and f(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
101
#include <iostream> #include <string.h> using namespace std; bool func(char *str, int len); int main(void) { char str[100]; char str2[50]; bool ret; int len; cin >> str; len = strlen(str); if (func(str, len) && func(str, len / 2)) { cout << "yes" << endl; } else { cout << "no" << endl; }...
#include <iostream> #include <string.h> using namespace std; bool func(char *str, int len); int main(void) { char str[100]; char str2[50]; bool ret; int len; cin >> str; len = strlen(str); if (func(str, len) && func(str, len / 2)) { cout << "Yes" << endl; } else { cout << "No" << endl; }...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
178
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (int)(b); ++i) using ll = long long; using namespace std; const auto mod = 1e9 + 7; bool isPalindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setpreci...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (int)(b); ++i) using ll = long long; using namespace std; const auto mod = 1e9 + 7; bool isPalindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setpreci...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33]]
1
165
S = input() N = len(S) Sd = S[:(N-1)//2] Sdd = S[(N+1)//2:N] print(Sd,Sdd) if S == S[::-1] and Sd == Sd[::-1] and Sdd == Sdd[::-1]: print("Yes") else: print("No")
S = input() N = len(S) Sd = S[:(N-1)//2] Sdd = S[(N+1)//2:N] if S == S[::-1] and Sd == Sd[::-1] and Sdd == Sdd[::-1]: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
89
n = len(s) sa = s[:(n-1)//2] sb = s[(n+3)//2-1:n] if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]: print("Yes") else: print("No")
s = input() n = len(s) sa = s[:(n-1)//2] sb = s[(n+3)//2-1:n] if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]: print("Yes") else: print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
80
n = len(s) sa = s[:int((n-1)/2)] sb = s[int((n+3)/2)-1:] if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]: print("Yes") else: print("No")
s = input() n = len(s) sa = s[:int((n-1)/2)] sb = s[int((n+3)/2)-1:] if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]: print("Yes") else: print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
85
#include <bits/stdc++.h> #include <string> using namespace std; int palindrome(string str, int s, int e) { int check = 1; for (int i = s; i < e / 2; i++) { if (str[i] == str[(e - s) - i - 1]) { } else { check = 0; break; } } return check; } int main() { string str; cin >> str; in...
#include <bits/stdc++.h> #include <string> using namespace std; int palindrome(string str, int s, int e) { int check = 1; for (int i = s; i < e / 2; i++) { if (str[i] == str[(e - s) - i - 1]) { } else { check = 0; break; } } return check; } int main() { string str; cin >> str; in...
[["-", 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
175
# coding: utf-8 S = input() def check(S): ret = True for i in range(len(S)//2): if S[i] != S[-i-1]: ret = False return ret if len(S) == 3: if S[0] != S[-1]: print("No") else: print("Yes") exit() flag = True if not check(S): flag = False if not check(S[:(le...
# coding: utf-8 S = input() def check(S): ret = True for i in range(len(S)//2): if S[i] != S[-i-1]: ret = False return ret if len(S) == 3: if S[0] != S[-1]: print("No") else: print("Yes") exit() flag = True if not check(S): flag = False if not check(S[:(le...
[["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
155
def kaibun(s): n=len(s) a=True if n%2==0: for i in range(n/2): if s[i]!=s[n-1-i]: a=False else: for i in range((n-1)/2): if s[i]!=s[n-1-i]: a=False return a S=input() N=len(S) if kaibun(S)==True and kaibun(S[0:(N-1)/2])==True and kaibun(S[(N+3)/2-1:N])==True: print("Yes")...
def kaibun(s): n=len(s) a=True if n%2==0: for i in range(n//2): if s[i]!=s[n-1-i]: a=False else: for i in range((n-1)//2): if s[i]!=s[n-1-i]: a=False return a S=input() N=len(S) if kaibun(S)==True and kaibun(S[0:(N-1)//2])==True and kaibun(S[(N+3)//2-1:N])==True: print("Y...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 676], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 85], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 676], ["-", 0, 206, 206, 663, 0, 657, 31, 657, 17, 85], ["+", 0, 206, 206, 663, 0, 657, 31, 657, 17, 676]]
5
157
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); for (long long i = 0; i < n; i++) { if (s[i] != s[n - i - 1]) { cout << "No" << endl; return 0; } } long long x = (n - 1) / 2; for (long long i = 0; i < x; i++) { if (s[i] != s[x - i -...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); for (long long i = 0; i < n; i++) { if (s[i] != s[n - i - 1]) { cout << "No" << endl; return 0; } } long long x = (n - 1) / 2; for (long long i = 0; i < x; i++) { if (s[i] != s[x - i -...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
201
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define ALL(x) (x).begin(), (x).end() #define ...
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define ALL(x) (x).begin(), (x).end() #define ...
[["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
273
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> s; n = s.size(); string c(s.rbegin(), s.rend()); string s1(s.begin(), s.begin() + n / 2); string c1(s1.rbegin(), s1.rend()); string s2(s.begin() + 1 + n / 2, s.end()); string c2(s2.rbegin(), s2.rend()); // cout<<c<<"...
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> s; n = s.size(); string c(s.rbegin(), s.rend()); string s1(s.begin(), s.begin() + n / 2); string c1(s1.rbegin(), s1.rend()); string s2(s.begin() + 1 + n / 2, s.end()); string c2(s2.rbegin(), s2.rend()); // cout<<c<<" ...
[["-", 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
156
#include <algorithm> #include <bitset> #include <cstdio> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <utility> #include <vector> //#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using p = pair<int, int>; u...
#include <algorithm> #include <bitset> #include <cstdio> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <utility> #include <vector> //#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using p = pair<int, int>; u...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 12, 13]]
1
252
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void process() throws IOException { String s = nln(); int N = s.length(); if (isPalin(s.substring(0, (N - 1) / 2)) && isPalin(s.substring((N + 2) / 2, N))) pn("Yes"); else pn("No"); } s...
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void process() throws IOException { String s = nln(); int N = s.length(); if (isPalin(s.substring(0, (N - 1) / 2)) && isPalin(s.substring((N + 2) / 2, N)) && isPalin(s)) pn("Yes"); else pn("...
[["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 98], ["+", 0, 57, 15, 15, 0, 16, 12, 492, 141, 22], ["+", 15, 15, 0, 16, 12, 492, 3, 4, 0, 24], ["+", 15, 15, 0, 16, 12, 492, 3, 4, 0, 22], ["+", 15, 15, 0, 16, 12, 492, 3, 4, 0, 25]]
3
780
#include <bits/stdc++.h> #define ll long long #define rep(i, a, b) for (int i = a; i <= b; ++i) using namespace std; void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } string s; int main() { io(); cin >> s; string tmp = s; reverse(tmp.begin(), tmp.end()); if (tmp != s) { ...
#include <bits/stdc++.h> #define ll long long #define rep(i, a, b) for (int i = a; i <= b; ++i) using namespace std; void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } string s; int main() { io(); cin >> s; string tmp = s; reverse(tmp.begin(), tmp.end()); if (tmp != s) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
160
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define IFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define RPT(i, a, b) for (int i = (a); i < ((a) + (b)); ++i) #define IRPT(i, a, b) for (int i = ((a) + (b)-1); i >= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define IFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define RPT(i, a, b) for (int i = (a); i < ((a) + (b)); ++i) #define IRPT(i, a, b) for (int i = ((a) + (b)-1); 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
196
def ispalindrome(s): print(s) l=len(s) for i in range(l//2): if s[i]!=s[l-i-1]: return False return True s=input() l=len(s) if ispalindrome(s) and ispalindrome(s[:l//2]) and ispalindrome(s[(l+1)//2:]): print("Yes") else: print("No")
def ispalindrome(s): #print(s) l=len(s) for i in range(l//2): if s[i]!=s[l-i-1]: return False return True s=input() l=len(s) if ispalindrome(s) and ispalindrome(s[:l//2]) and ispalindrome(s[(l+1)//2:]): 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
102
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); char[] charS = S.toCharArray(); int N = charS.length; boolean isStrong = true; for (int i = 0; i < N; i++) { if (charS[i] != charS[N - 1 - i]) { is...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); char[] charS = S.toCharArray(); int N = charS.length; boolean isStrong = true; for (int i = 0; i < N; i++) { if (charS[i] != charS[N - 1 - i]) { is...
[["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25]]
3
231
#include <bits/stdc++.h> using namespace std; #define mem(a, b) memset(a, b, sizeof(a)) #define pii pair<int, int> const int inf = 0x3f3f3f3f; const int maxn = 201110; const int M = 1e9 + 7; int n, m, k, ok; string s; bool judge(int l, int r) { int len = (r - l); for (int i = 0; i < len / 2; i++) { // cout<<i...
#include <bits/stdc++.h> using namespace std; #define mem(a, b) memset(a, b, sizeof(a)) #define pii pair<int, int> const int inf = 0x3f3f3f3f; const int maxn = 201110; const int M = 1e9 + 7; int n, m, k, ok; string s; bool judge(int l, int r) { int len = (r - l); // cout<<l<<' '<<r<<endl; for (int i = 0; i <= l...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
188
S = input() N = len(S) flag1 = (S == S[::-1]) s = S[0:(N - 3)//2] flag2 = (s == s[::-1]) if flag1 and flag2: print("Yes") else: print("No")
S = input() N = len(S) flag1 = (S == S[::-1]) s = S[0:(N - 1)//2] flag2 = (s == s[::-1]) if flag1 and flag2: 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
70
#include <iostream> using namespace std; bool a(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); if (a(s) && a(s.substr(0, (n - 1) / 2)) && a(s.substr(0, (n + 1) / 2))) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <iostream> using namespace std; bool a(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; cin >> s; int n = s.size(); if (a(s) && a(s.substr(0, (n - 1) / 2)) && a(s.substr((n + 1) / 2))) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 21]]
1
121
#include <bits/stdc++.h> using namespace std; bool plindrome(string s, int n) { int half = n / 2; for (int i = 0, j = n - 1; i < half; i++, j--) { if (s[i] != s[j]) { return false; } } return true; } int main() { string s, s1 = "", s2 = ""; cin >> s; int n = s.size(); for (int i = 0; i <...
#include <bits/stdc++.h> using namespace std; bool plindrome(string s, int n) { int half = n / 2; for (int i = 0, j = n - 1; i < half; i++, j--) { if (s[i] != s[j]) { return false; } } return true; } int main() { string s, s1 = "", s2 = ""; cin >> s; int n = s.size(); for (int i = 0; i <...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
251
#include <bits/stdc++.h> using namespace std; int main() { string s, sr1, s2, s3, sr2, sr3; sr1 = s2 = s3 = sr2 = sr3 = ""; cin >> s; sr1 = s; reverse(sr1.begin(), sr1.end()); int len = s.length(); for (int i = 0; i < ceil((len - 1) / 2); i++) { s2 = s[i]; } for (int i = ((len + 3) / 2) - 1; i < l...
#include <bits/stdc++.h> using namespace std; int main() { string s, sr1, s2, s3, sr2, sr3; sr1 = s2 = s3 = sr2 = sr3 = ""; cin >> s; sr1 = s; reverse(sr1.begin(), sr1.end()); int len = s.length(); for (int i = 0; i < ((len - 1) / 2); i++) { s2 += s[i]; } for (int i = ((len + 3) / 2) - 1; i < len;...
[["-", 8, 9, 0, 7, 15, 16, 12, 2, 63, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107]]
1
223
#include <iostream> using namespace std; bool stringPalindrome(string s, long long int start, long long int end) { while (start < end) { if (s[start] != s[end - 1]) return false; start++; end--; } return true; } int main() { string s; cin >> s; int N; N = s.length(); if (stringPali...
#include <iostream> using namespace std; bool stringPalindrome(string s, long long int start, long long int end) { while (start < end) { if (s[start] != s[end - 1]) return false; start++; end--; } return true; } int main() { string s; cin >> s; int N; N = s.length(); if (stringPali...
[["-", 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
137
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool ans = false; for (int i = 0; i <= (S.size() - 1) / 2; i++) { if (S.at(i) != S.at(S.size() - 1 - i)) { ans = true; break; } } for (int i = 0; i <= ((S.size() - 1) / 2) - 1; i++) { if (S.at(i) != S.at...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; bool ans = false; for (int i = 0; i <= (S.size() - 1) / 2; i++) { if (S.at(i) != S.at(S.size() - 1 - i)) { ans = true; break; } } for (int i = 0; i <= ((S.size() - 1) / 2) - 1; i++) { if (S.at(i) != S.at...
[["-", 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
249
#include <bits/stdc++.h> using namespace std; bool check(string s) { string s1 = s; reverse(s.begin(), s.end()); if (s1 == s) return true; return false; } int main() { string s; cin >> s; int n = s.size(); if (!check(s)) { cout << "NO" << endl; return 0; } string s1 = ""; for (int i...
#include <bits/stdc++.h> using namespace std; bool check(string s) { string s1 = s; reverse(s.begin(), s.end()); if (s1 == s) return true; return false; } int main() { string s; cin >> s; int n = s.size(); if (!check(s)) { cout << "No" << endl; return 0; } string s1 = ""; for (int i...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
188
s = input() length = len(s) def palindrome(string): if s == s[::-1]: return True else: return False if palindrome(s) and palindrome(s[:(length-1)//2]) and palindrome(s[(length+1)//2:]): print('Yes') else: print('No')
s = input() length = len(s) def palindrome(string): if string == string[::-1]: return True else: return False if palindrome(s) and palindrome(s[:(length-1)//2]) and palindrome(s[(length+1)//2:]): print('Yes') else: print('No')
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 206, 51, 22]]
5
84
#include <iostream> using namespace std; main() { string s; cin >> s; int n = s.size(); bool b = 0; for (int i = 0; i <= n / 2; i++) { if (s[i] != s[n - 1 - i]) { b = 1; break; } } if (b == 1) { cout << "NO\n"; return 0; } for (int i = 0; i <= (n - 3) / 4; i++) { if (s[...
#include <iostream> using namespace std; main() { string s; cin >> s; int n = s.size(); bool b = 0; for (int i = 0; i <= n / 2; i++) { if (s[i] != s[n - 1 - i]) { b = 1; break; } } if (b == 1) { cout << "No\n"; return 0; } for (int i = 0; i <= (n - 3) / 4; i++) { if (s[...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
237
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string s, s_rev; bool ans = true; cin >> s; int N = s.size(); s_rev = s; reverse(s_rev.begin(), s_rev.end()); if (s == s_rev && s.substr(0, (N - 1) / 2) == s.substr((N + 1) / 2, (N - 1) / 2)) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { string s, s_rev; bool ans = false; cin >> s; int N = s.size(); s_rev = s; reverse(s_rev.begin(), s_rev.end()); if (s == s_rev && s.substr(0, (N - 1) / 2) == s.substr((N + 1) / 2, (N - 1) / 2)) ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 147], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 146]]
1
121
s=input() n=len(s) count=0 a=(n-1)//2 b=(n+3)//2 for i in range(n//2): if s[i]!=s[-abs(i+1)]: count+=1 for i in range(a//2): c=ord(s[i]) d=ord(s[(a-1-i)]) if c!=d: count+=1 for i in range((n-b+1)//2): c=ord(s[n-i]) d=ord(s[b-1+i]) if c!=d: count+=1 if count!=0: print('No') else: pri...
s=input() n=len(s) count=0 a=(n-1)//2 b=(n+3)//2 for i in range(n//2): if s[i]!=s[-abs(i+1)]: count+=1 for i in range(a//2): c=ord(s[i]) d=ord(s[(a-1-i)]) if c!=d: count+=1 for i in range((n-b+1)//2): c=ord(s[-(i+1)]) d=ord(s[b-1+i]) if c!=d: count+=1 if count!=0: print('No') else: ...
[["-", 12, 652, 3, 4, 0, 206, 206, 657, 31, 22], ["+", 3, 4, 0, 206, 206, 664, 28, 23, 0, 24], ["+", 0, 206, 206, 664, 28, 23, 0, 657, 17, 72], ["+", 0, 206, 206, 664, 28, 23, 0, 657, 12, 612], ["+", 3, 4, 0, 206, 206, 664, 28, 23, 0, 25]]
5
171
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { String s = sc.next(); int width = (s.length() - 1) / 2; boolean isStrong = checkCircle(s) && checkCircle(s.substring(0, width)) && check...
import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { String s = sc.next(); int width = (s.length() - 1) / 2; boolean isStrong = checkCircle(s) && checkCircle(s.substring(0, width)) && check...
[["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 499]]
3
192
#include <bits/stdc++.h> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string S; cin >> S; int pos1 = (S.size() - 1) / 2; string cord1 = S.substr(0, pos1); int pos2 = (S.size() + 3) / 2; string cord2 = S.substr(pos2, string::npos); ...
#include <bits/stdc++.h> using namespace std; bool is_palindrome(string s) { string t(s.rbegin(), s.rend()); return s == t; } int main() { string S; cin >> S; int pos1 = (S.size() - 1) / 2; string cord1 = S.substr(0, pos1); int pos2 = (S.size() + 1) / 2; string cord2 = S.substr(pos2, string::npos); ...
[["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
138
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); string s1 = S.substr(0, (N - 1) / 2); string s2 = S.substr((N + 1) / 2); if (s1 == s2) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N; N = S.size(); string s1 = S.substr(0, (N - 1) / 2); string s2 = S.substr((N + 1) / 2); if (s1 == s2) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
94
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define all(x) (x).begin(), (x).end() #define mp make_pair #define pb push_back #define fi first #define se second #define sz(x) ((int)(x).size()) #define rep(x, y, z) for (int x = y; x < z; x++) #define per(x, z, y) for (int x = z - 1; x >= y; x--) #...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define all(x) (x).begin(), (x).end() #define mp make_pair #define pb push_back #define fi first #define se second #define sz(x) ((int)(x).size()) #define rep(x, y, z) for (int x = y; x < z; x++) #define per(x, z, y) for (int x = z - 1; x >= y; x--) #...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 161]]
1
287
#include <bits/stdc++.h> using namespace std; int kaibun(string S) { int k = S.size(); if (k == 1) return 1; for (int i = 0; i < (k - 1) / 2; i++) { if (S[i] != S[k - 1 - i]) { return 0; } } return 1; } int main() { string s; cin >> s; int K = s.size(); string f, b; f = s.substr(...
#include <bits/stdc++.h> using namespace std; int kaibun(string S) { int k = S.size(); if (k == 1) return 1; for (int i = 0; i < k / 2; i++) { if (S[i] != S[k - 1 - i]) { return 0; } } return 1; } int main() { string s; cin >> s; int K = s.size(); string f, b; f = s.substr(0, (K ...
[["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 25]]
1
188
S=str(input()) import sys t=0 lista=[] for i in range(99): try: lista.append(S[i]) t=t+1 except IndexError: break u=t//2 v=u//2+1 p=1 for i in range(v): if S[i]==S[u-i-1] and S[u-i+1]==S[u+i+1] and S[u+i+1]==S[t-1-i]: p=p*1 else: print ('No') sys.exit() print ('Yes')
S=str(input()) import sys t=0 lista=[] for i in range(99): try: lista.append(S[i]) t=t+1 except IndexError: break u=t//2 v=u//2+1 p=1 for i in range(v): if S[i]==S[u-i-1] and S[u-i-1]==S[u+i+1] and S[u+i+1]==S[t-1-i]: p=p*1 else: print ('No') sys.exit() pr...
[["-", 31, 679, 12, 666, 0, 206, 206, 657, 17, 72], ["+", 31, 679, 12, 666, 0, 206, 206, 657, 17, 33]]
5
143
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for (int i = (s); (i) < (int)(e); ++(i)) #define REP(i, e) FOR(i, 0, e) #define each(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define all(o) (o).begin(), (...
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for (int i = (s); (i) < (int)(e); ++(i)) #define REP(i, e) FOR(i, 0, e) #define each(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define all(o) (o).begin(), (...
[["-", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68]]
1
221
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for (int i = (s); (i) < (int)(e); ++(i)) #define REP(i, e) FOR(i, 0, e) #define each(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define all(o) (o).begin(), (...
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, e) for (int i = (s); (i) < (int)(e); ++(i)) #define REP(i, e) FOR(i, 0, e) #define each(it, c) \ for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define all(o) (o).begin(), (...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 49, 22], ["-", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+",...
1
249
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define st first #define nd second #define fori(i, a, b, c) for (int i = (int)(a); i <= (int)(b); i += (int)(c)) #define ford(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c)) #define MOD 998244353 using namespace std; typedef pair<int,...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define st first #define nd second #define fori(i, a, b, c) for (int i = (int)(a); i <= (int)(b); i += (int)(c)) #define ford(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c)) #define MOD 998244353 using namespace std; typedef pair<int,...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22]]
1
242
// nani? #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #define pi acos(-1); #define fs first #define sc second #define pb push_back #define mp make_pai...
// nani? #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #define pi acos(-1); #define fs first #define sc second #define pb push_back #define mp make_pai...
[["-", 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
354
/* Sometimes you win , sometimes you learn . */ /* Sometimes you win , sometimes you learn . */ #include <bits/stdc++.h> #define lp(i, N) for (ll i = 0; i < ll(N); i++) #define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define debug(x) cout << " [ " << #x << " is: " << x << " ] " << endl; using namesp...
/* Sometimes you win , sometimes you learn . */ /* Sometimes you win , sometimes you learn . */ #include <bits/stdc++.h> #define lp(i, N) for (ll i = 0; i < ll(N); i++) #define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define debug(x) cout << " [ " << #x << " is: " << x << " ] " << endl; using namesp...
[["+", 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
186
S=input();print("YNeos"[S==S[::-1]and S.endswith(S[:len(S)//2])::2])
S=input();print("YNeos"[S!=S[::-1]or 1-S.endswith(S[:len(S)//2])::2])
[["-", 0, 206, 206, 663, 0, 679, 31, 666, 667, 60], ["+", 0, 206, 206, 663, 0, 679, 31, 666, 667, 79], ["-", 3, 4, 0, 206, 206, 663, 0, 679, 17, 355], ["+", 3, 4, 0, 206, 206, 663, 0, 679, 17, 354], ["+", 0, 206, 206, 663, 0, 679, 12, 657, 31, 612], ["+", 0, 206, 206, 663, 0, 679, 12, 657, 17, 33]]
5
42
S = input() N = len(S) isPal = lambda s: s == s[::-1] print("Yes" if isPal(S[:(N-1)//2]) and isPal(S[(N+1)//2:]) else "No")
S = input() N = len(S) isPal = lambda s: s == s[::-1] print("Yes" if isPal(S) and isPal(S[:(N-1)//2]) and isPal(S[(N+1)//2:]) else "No")
[["+", 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
65
import math def jds(strin): js = 0 newSt = strin[::-1] if strin == newSt: js +=1 return js a = input() jud = 0 leee = len(a) if leee % 2 == 0: b = a[:math.ceil((len(a) - 1) / 2)] c = a[math.floor((len(a) + 1) / 2):] else: b = a[:int((len(a) - 1) / 2)] c = a[int((len(a) + 2) ...
import math def jds(strin): js = 0 newSt = strin[::-1] if strin == newSt: js +=1 return js a = input() jud = 0 leee = len(a) if leee % 2 == 0: b = a[:math.ceil((len(a) - 1) / 2)] c = a[math.floor((len(a) + 1) / 2):] else: b = a[:int((len(a) - 1) / 2)] c = a[int((len(a) + 2) ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
172
#include <bits/stdc++.h> using namespace std; int main() { string s, s1, s2, s3, s4, s5; cin >> s; s = s5; reverse(s5.begin(), s5.end()); int len = s.size(); int a = (len - 1) / 2; int b = (len + 3) / 2; s1 = s.substr(0, a); s3 = s1; s2 = s.substr(b - 1, len); s4 = s2; reverse(s3.begin(), s3.en...
#include <bits/stdc++.h> using namespace std; int main() { string s, s1, s2, s3, s4, s5; cin >> s; s5 = s; reverse(s5.begin(), s5.end()); int len = s.size(); int a = (len - 1) / 2; int b = (len + 3) / 2; s1 = s.substr(0, a); s3 = s1; s2 = s.substr(b - 1, len); s4 = s2; reverse(s3.begin(), s3.en...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22]]
1
174
#include "bits/stdc++.h" #define FOR(i, a, b) for (int i = a; i < b; i++) #define mFOR(i, a, b) for (int i = a; i > b; i--) #define MP make_pair #define PB push_back #define ALL(v) v.begin(), v.end() #define N 100007 #define INF 1000000007 using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b == 0 ...
#include "bits/stdc++.h" #define FOR(i, a, b) for (int i = a; i < b; i++) #define mFOR(i, a, b) for (int i = a; i > b; i--) #define MP make_pair #define PB push_back #define ALL(v) v.begin(), v.end() #define N 100007 #define INF 1000000007 using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b == 0 ...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 17, 33], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13]]
1
287
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<pair<int, int>> vip; #define ZOOM ...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vii; typedef vector<pair<int, int>> vip; #define ZOOM ...
[["+", 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
244
S = input() N = len(S) if S == S[::-1] and S[:(N-1)//2] == S[:(N-1)//2:-1] and S[(N+1)//2:] == S[(N+1)//2::-1] : print('Yes') else: print('No')
S = input() N = len(S) if S == S[::-1] and S[:(N-1)//2] == S[(N-3)//2::-1] and S[(N+1)//2:] == S[:(N-1)//2:-1] : print('Yes') else: print('No')
[["-", 31, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 31, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["+", 15, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 206, 663, 0...
5
90
#include <bits/stdc++.h> // __builtin_ctz : no of trailing zeros #define ll long long #define pp pair<ll, ll> #define mod 1000000007 #define trace(x) cerr << #x << ": " << x << " " << endl #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl #define trace3(x, y, z) ...
#include <bits/stdc++.h> // __builtin_ctz : no of trailing zeros #define ll long long #define pp pair<ll, ll> #define mod 1000000007 #define trace(x) cerr << #x << ": " << x << " " << endl #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl #define trace3(x, y, z) ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 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
316
#include <iostream> #include <string> using namespace std; int main() { string S; cin >> S; cout << "\n"; int judge = 0; int N = S.size(); char eg[200]; int i = 1; while (i <= N) { eg[i] = S[i - 1]; i++; } while (i <= N) { if (eg[i] != eg[N - i + 1]) { judge++; // cou...
#include <iostream> #include <string> using namespace std; int main() { string S; cin >> S; cout << "\n"; int judge = 0; int N = S.size(); char eg[200]; int i = 1; while (i <= N) { eg[i] = S[i - 1]; i++; } i = 1; while (i <= N) { if (eg[i] != eg[N - i + 1]) { judge++; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
241
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); for (int i = 0; i < n / 2; i++) { if (s[i] != s[n - 1]) { // temp = 1; cout << "No"; return 0; } } for (int i = 0; i < n / 4; i++) { if (s[i] != s[n / 2 - 1 - i]) { cout <<...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); for (int i = 0; i < n / 2; i++) { if (s[i] != s[n - 1 - i]) { // temp = 1; cout << "No"; return 0; } } for (int i = 0; i < n / 4; i++) { if (s[i] != s[n / 2 - 1 - i]) { cou...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
128
def palind(LIST, N): for i in range(N): if LIST[i] != LIST[-1-i]: return False return True S = list(input()) n = len(S) flag = palind(S, n) front = S[:((n+1)//2-1)] rear = S[((n+3)//2-1):] n = len(front) flag = palind(front, n) flag = palind(rear, n) if flag == True: print('Yes') else...
def palind(LIST, N): for i in range(N): if LIST[i] != LIST[-1-i]: return False return True S = list(input()) n = len(S) flag = palind(S, n) front = S[:((n+1)//2-1)] rear = S[((n+3)//2-1):] n = len(front) flag = flag and palind(front, n) and palind(rear, n) if flag == True: print('Yes'...
[["+", 0, 1, 0, 662, 12, 679, 31, 679, 31, 22], ["+", 0, 1, 0, 662, 12, 679, 31, 679, 17, 355], ["-", 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, 679, 17, 355]]
5
131
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; // MACROS #define ll long long #define ull unsigned long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vld vector<ld> #define u_s unordered_set #define pii pair<int...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; // MACROS #define ll long long #define ull unsigned long long #define ld long double #define vi vector<int> #define vll vector<ll> #define vld vector<ld> #define u_s unordered_set #define pii pair<int...
[["+", 0, 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
348
S = input() n = len(S) isKaibun = True for i in range(n//2): if(S[i] != S[n-i-1] or S[i] != S[n//2-i-1] or S[n//2+i+a1] != S[n//2-i-1]): isKaibun = False break if(isKaibun): print("Yes") else: print("No")
S = input() n = len(S) isKaibun = True for i in range(n//2): if(S[i] != S[n-i-1] or S[i] != S[n//2-i-1] or S[n//2+i+1] != S[n//2-i-1]): isKaibun = False break if(isKaibun): print("Yes") else: print("No")
[["-", 0, 679, 12, 666, 0, 206, 206, 657, 12, 22], ["+", 0, 679, 12, 666, 0, 206, 206, 657, 12, 612]]
5
102
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int size = S.size(); string o = "Yes"; for (int i = 0; i <= S.size() / 2; i++) { if (S.at(i) != S.at(size - i - 1)) { o = "No"; } } for (int i = 0; i <= S.size() / 4; i++) { if (S.at(i) != S.at((size - 1) ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int size = S.size(); string o = "Yes"; for (int i = 0; i <= S.size() / 2; i++) { if (S.at(i) != S.at(size - i - 1)) { o = "No"; } } for (int i = 0; i <= S.size() / 4; i++) { if (S.at(i) != S.at((size - 1) ...
[["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
145
s=input() n=len(s) a=s[:(n-1)//2] b=s[(n+1)//2:] if(a==a[::-1] and b==b[::-1]): print("Yes") else: print("No")
s=input() n=len(s) a=s[:(n-1)//2] b=s[(n+1)//2:] if(a==a[::-1] and a==b): print("Yes") else: print("No")
[["-", 0, 57, 15, 23, 0, 679, 12, 666, 0, 22], ["+", 0, 57, 15, 23, 0, 679, 12, 666, 0, 22], ["-", 15, 23, 0, 679, 12, 666, 0, 206, 0, 70], ["-", 0, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["-", 12, 666, 0, 206, 206, 663, 0, 664, 17, 33], ["-", 12, 666, 0, 206, 206, 663, 0, 664, 28, 612], ["-", 15, 23, 0, 679, 12, 666...
5
74
#include <bits/stdc++.h> using namespace std; bool ans = true; bool isPalindrome(string n) { for (int i = 0; i < n.size() / 2 + 1; i++) { if (n.at(i) != n.at(n.size() - i - 1)) { ans = false; } } return ans; } int main() { string S; cin >> S; string M = S.substr(0, S.size() / 2); isPalin...
#include <bits/stdc++.h> using namespace std; bool ans = true; bool isPalindrome(string n) { for (int i = 0; i < n.size() / 2 + 1; i++) { if (n.at(i) != n.at(n.size() - i - 1)) { ans = false; } } return ans; } int main() { string S; cin >> S; isPalindrome(S); string M = S.substr(0, S.si...
[["+", 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
164
#include <bits/stdc++.h> using namespace std; bool ip(string s) { for (int i = 0; i < s.length() / 2; ++i) { if (s[i] != s[s.length() - i - 1]) return false; } return true; } int main() { string s; cin >> s; int n(s.length()); cout << (ip(s) && ip(s.substr(0, n / 2)) && ip(s.substr(n / 2 + 2))...
#include <bits/stdc++.h> using namespace std; bool ip(string s) { for (int i = 0; i < s.length() / 2; ++i) { if (s[i] != s[s.length() - i - 1]) return false; } return true; } int main() { string s; cin >> s; int n(s.length()); cout << (ip(s) && ip(s.substr(0, n / 2)) && ip(s.substr(n / 2 + 1))...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
137
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define ll long long using namespace std; long double pi = 3.14159265358979323846; #define fast ios_base:...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define ll long long using namespace std; long double pi = 3.14159265358979323846; #define fast ios_base:...
[["-", 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; int main() { string A; cin >> A; int b; b = A.size(); int ans = 0; int c = b / 2; for (int j = 0; j < c; j++) { if (A.at(j) != A.at(b - j - 1)) ans = 999; } for (int k = 0; k < c / 2; k++) { if (A.at(k) != A.at(c - k - 1)) ans ...
#include <bits/stdc++.h> using namespace std; int main() { string A; cin >> A; int b; b = A.size(); int ans = 0; int c = b / 2; for (int j = 0; j < c; j++) { if (A.at(j) != A.at(b - j - 1)) ans = 999; } for (int k = 0; k < (c / 2); k++) { if (A.at(k) != A.at(c - k - 1)) an...
[["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13]]
1
179
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define ss second #define ff first #define INF 300000000000001 #define ll_max 9000000000000000001 #define mod 998244353 #define PI 3.14159265358979323846L #define fast ...
#include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define ss second #define ff first #define INF 300000000000001 #define ll_max 9000000000000000001 #define mod 998244353 #define PI 3.14159265358979323846L #define fast ...
[["-", 8, 9, 0, 57, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
327
s = input() n = len(s) def ok(string): N = len(string) for i in range(N//2): if string[i] != string[-i-1]:return False return True if ok(s[:n//2]) and ok(s[n//2+1:]):print('Yes') else:print('No')
s = input() n = len(s) def ok(string): N = len(string) for i in range(N//2): if string[i] != string[-i-1]:return False return True if ok(s[:n//2]) and ok(s[n//2+1:]) and ok(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
90
st=input() def iskaibun(s): print(s) if(s==""): return 1; else: if(s[0]==s[-1]): return iskaibun(s[1:-1]) else: return 0 l = len(st) q = (l-1)//2 st1 = st[0:q] st2 = st[q+1:] if(st1 == st2[::-1] and iskaibun(st1)==1 and iskaibun(st2)==1): print("Yes") else: print(...
st=input() def iskaibun(s): if(s==""): return 1; else: if(s[0]==s[-1]): return iskaibun(s[1:-1]) else: return 0 l = len(st) q = (l-1)//2 st1 = st[0:q] st2 = st[q+1:] if(st1 == st2[::-1] and iskaibun(st1)==1 and iskaibun(st2)==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
130
#include <bits/stdc++.h> using namespace std; #define ll long long int bool check(string &str) { ll l = str.size(); ll i, j; for (i = 0; i < l; i++) { if (str[i] != str[l - i - 1]) { return false; break; } } return true; } int main() { string str; getline(cin, str); ll l = str.size()...
#include <bits/stdc++.h> using namespace std; #define ll long long int bool check(string &str) { ll l = str.size(); ll i, j; for (i = 0; i < l; i++) { if (str[i] != str[l - i - 1]) { return false; break; } } return true; } int main() { string str; getline(cin, str); ll l = str.size()...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 51, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24]]
1
233
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vd = vector<double>; using vvd = vector<vd>; using vc = vector<char>; using vb = vector<bool>; using vl = vector<ll>; using vs = vector<string>; #define rep(i, x, n) for (int i = x; i < n; i++) #def...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vd = vector<double>; using vvd = vector<vd>; using vc = vector<char>; using vb = vector<bool>; using vl = vector<ll>; using vs = vector<string>; #define rep(i, x, n) for (int i = x; i < n; i++) #def...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
260
s = input() n = len(s) l = (n - 1) r = (n + 3) if s == s[::-1] and s[0:l] == s[0:l][::-1] and s[r-1:n] == s[r-1:n][::-1]: print('Yes') else: print('No')
# 入力 s = input() n = len(s) l = (n - 1) // 2 r = (n + 3) // 2 if s == s[::-1] and s[0:l] == s[0:l][::-1] and s[r-1:n] == s[r-1:n][::-1]: print('Yes') else: print('No')
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
94
s = input() s = [c for c in s] left = s[:len(s)//2] right = s[len(s)//2+1:] def check(s): left = [] right = [] while len(s)>1: left.append(s.pop(0)) right.append(s.pop()) if left==right: return True else: return False if check(left)==True and check(right)==T...
s = input() s = [c for c in s] left = s[:len(s)//2] right = s[len(s)//2+1:] def check(s): left = [] right = [] while len(s)>1: left.append(s.pop(0)) right.append(s.pop()) if left==right: return True else: return False if check(left)==True and check(right)==True ...
[["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 15, 679, 12, 666, 0, 652, 63, 22], ["+", 15, 679, 12, 666, 0, 652, 3, 4, 0, 24], ["+", 15, 679, 12, 666, 0, 652, 3, 4, 0, 22], ["+", 15, 679, 12, 666, 0, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 146]]
5
127
#include <bits/stdc++.h> #define CYES \ cout << "Yes" \ << "\n" #define CNO \ cout << "No" ...
#include <bits/stdc++.h> #define CYES \ cout << "Yes" \ << "\n" #define CNO \ cout << "No" ...
[["+", 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
259
s = input() if len(s) / 2 == 0: print("No") exit() def check(i): if len(i) % 2 != 0: i2 = i[len(i) // 2 + 1:len(i)] else: i2 = i[len(i) // 2:len(i)] if i[0:len(i) // 2] == i2[::-1] or len(i2) == 1: return(True) return(False) s2 = s[0:(len(s) - 1) // 2] s3 = s[(len(s) - ...
s = input() if len(s) / 2 == 0: print("No") exit() def check(i): if len(i) % 2 != 0: i2 = i[len(i) // 2 + 1:len(i)] else: i2 = i[len(i) // 2:len(i)] if i[0:len(i) // 2] == i2[::-1] or len(i) == 1: return(True) return(False) s2 = s[0:(len(s) - 1) // 2] s3 = s[(len(s) - 1...
[["-", 15, 679, 12, 666, 0, 652, 3, 4, 0, 22], ["+", 15, 679, 12, 666, 0, 652, 3, 4, 0, 22]]
5
187
#include <bits/stdc++.h> using namespace std; /* ����s�� t(s���t�ɂ�������)������������true��Ԃ��B */ bool is_palindrome(string s) { string t(s.begin(), s.end()); return s == t; } int main() { string s; cin >> s; int n = s.size(); /* if���ŁA���ׂĂ̕����񂪓��������A0�`(n-1)/2�܂ł����������A(n+1)/2�`�Ō�܂ł������...
#include <bits/stdc++.h> using namespace std; /* ����s�� t(s���t�ɂ�������)������������true��Ԃ��B */ bool is_palindrome(string s) { /* rbegin()�Arend()�͋t���ɂ����l��Ԃ��B ��js = {10,2,5}; t(s.rbegin(), s.rend()); t = {5,2,10}; */ string t(s.rbegin(), s.rend()); return s == t; } int main() { string s; ...
[["-", 49, 50, 51, 4, 0, 2, 63, 118, 119, 120], ["+", 49, 50, 51, 4, 0, 2, 63, 118, 119, 120]]
1
119
def judge(s): for i in range(len(s)//2): if s[i]!=s[-(i+1)]: return False else: return True s=input() if judge(s)==False: print('No') else: if judge(s[:(len(s)-1)//2])==False: print('No') else: if judge(s[(len(s)+3)//2:])==False: print('No') else: print('Yes')
def judge(s): for i in range(len(s)//2): if s[i]!=s[-(i+1)]: return False else: return True s=input() if judge(s)==False: print('No') else: if judge(s[:(len(s)-1)//2])==False: print('No') else: if judge(s[(len(s)+3)//2-1:])==False: print('No') else: print('Yes')
[["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
126
S = input() N = len(S) K = (N-3)//2 if S == S[::-1] and S[0:K] == S[0:K:-1]: print ('Yes') else: print ('No')
S = input() N = len(S) K = (N-3)//2 if S == S[::-1] and S[0:K] == S[K:0:-1]: print ('Yes') else: print ('No')
[["-", 15, 679, 12, 666, 0, 206, 206, 663, 0, 612], ["-", 15, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["+", 15, 679, 12, 666, 0, 206, 206, 663, 0, 102], ["+", 15, 679, 12, 666, 0, 206, 206, 663, 0, 612]]
5
62
s = input() def check(s): if(s==s[::-1]): return True else: return False n = len(s) if(check(s[:(n-1)//2])): if(check(s[((n+3)//2)-1:])): if(check(2)): print('Yes') else: print('No') else: print('No') else: print('No')
s = input() def check(s): if(s==s[::-1]): return True else: return False n = len(s) if(check(s[:(n-1)//2])): if(check(s[((n+3)//2)-1:])): if(check(s)): print('Yes') else: print('No') else: print('No') else: print('No')
[["-", 0, 57, 15, 23, 0, 652, 3, 4, 0, 612], ["+", 0, 57, 15, 23, 0, 652, 3, 4, 0, 22]]
5
114
S = input() N = len(S) def kaibun(s,n): for i in range(n//2): if(s[i]!=s[n-i-1]): return false return true if(kaibun(S,N) & kaibun(S[0:(N+1)//2-1],N//2) & kaibun(S[N:(N+3)//2-2:-1],N//2)): print("Yes") else: print("No")
S = input() N = len(S) def kaibun(s,n): for i in range(n//2): if(s[i]!=s[n-i-1]): return False return True if(kaibun(S,N) & kaibun(S[0:(N+1)//2-1],N//2) & kaibun(S[N:(N+3)//2-2:-1],N//2)): print("Yes") else: print("No")
[["-", 8, 196, 0, 57, 64, 196, 0, 37, 0, 22], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 147], ["-", 0, 656, 0, 14, 8, 196, 0, 37, 0, 22], ["+", 0, 656, 0, 14, 8, 196, 0, 37, 0, 146]]
5
121
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char c[] = sc.next().toCharArray(); int n = c.length; boolean b = true; for (int i = 0; i < n / 2; i++) { if (c[i] != c[n - 1 - i]) b = false; } for (int i = 0; i < ...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char c[] = sc.next().toCharArray(); int n = c.length; boolean b = true; for (int i = 0; i < n / 2; i++) { if (c[i] != c[n - 1 - i]) b = false; } for (int i = 0; i < ...
[["+", 15, 15, 0, 16, 12, 504, 71, 16, 17, 33], ["+", 15, 15, 0, 16, 12, 504, 71, 16, 12, 499]]
3
158
#!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for ...
#!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for ...
[["+", 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, 23, 0, 24], ["+", 15, 679, 31, 679, 12, 23, 0, 206, 51, 22]]
5
308
sel='B' #A if sel=='A': N,M=map(int,input().split()) ans=0 ans+=M*(M-1)//2 ans+=N*(N-1)//2 print(ans) #B if sel=='B': def ispal(s): for i in range(len(s)//2+1): if s[i]!=s[-(i+1)]: return False return True S=input() if ispal(S) and ispal(S[:(...
sel='B' #A if sel=='A': N,M=map(int,input().split()) ans=0 ans+=M*(M-1)//2 ans+=N*(N-1)//2 print(ans) #B if sel=='B': def ispal(s): for i in range(len(s)//2+1): if s[i]!=s[-(i+1)]: return False return True S=input() N=len(S) if ispal(S) a...
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 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
395
#include <bits/stdc++.h> using namespace std; string s; int main() { long long i; cin >> s; long long n = s.length(), st = 0, end = n - 1, c = 0; while (st < end) { if (s[st] == s[end]) { st++; end--; } else { c++; break; } } if (c == 0) { end = (n - 1) / 2 - 1, st = ...
#include <bits/stdc++.h> using namespace std; string s; int main() { long long i; cin >> s; long long n = s.length(), st = 0, end = n - 1, c = 0; while (st < end) { if (s[st] == s[end]) { st++; end--; } else { c++; break; } } if (c == 0) { end = (n - 1) / 2 - 1, st = ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
270
#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() { string s; cin >> s; string f, b; int n = s.length(); // cout << n << endl; f = s.substr(0, ((n - 1) / 2)); b = s.substr((n + 3) / 2 - 1); string f...
#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() { string s; cin >> s; string f, b; int n = s.length(); f = s.substr(0, ((n - 1) / 2)); b = s.substr((n + 3) / 2 - 1); string f_a = f, b_a = b; rever...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
167
def check(s: str): return s == s[::-1] s = input() if check(s) and check(s[:(n-1)//2]): print("Yes") else: print("No")
def check(s: str): return s == s[::-1] s = input() n = len(s) if check(s) and check(s[:(n-1)//2]): print("Yes") else: print("No")
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
58
# Wrote in Mar 22, 2020 22:36 by reetok require 'time' require 'prime' require 'bigdecimal' def inp(type=:to_i,spst=" ") return eval("gets.chomp.split(#{spst}).map(&:#{type})") end def inpf() return self.inp(:to_f," ") end def inps() return self.inp(:to_s," ") end def r_up(a, b) (a/b).ceil end def r_down(a, b) (a/b)....
# Wrote in Mar 22, 2020 22:36 by reetok require 'time' require 'prime' require 'bigdecimal' def inp(type=:to_i,spst=" ") return eval("gets.chomp.split(#{spst}).map(&:#{type})") end def inpf() return self.inp(:to_f," ") end def inps() return self.inp(:to_s," ") end def r_up(a, b) (a/b).ceil end def r_down(a, b) (a/b)....
[["-", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22]]
4
417
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); string s; bool flag = false; cin >> s; int N = s.length(); for (int i = 0; i < (N - 1) / 2; i++) { if (s.compare(i, 1, s, N - 1 - i, 1) == 0) { flag = true; } ...
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); string s; bool flag = false; cin >> s; int N = s.length(); for (int i = 0; i < (N - 1) / 2; i++) { if (s.compare(i, 1, s, N - 1 - i, 1) == 0) { flag = true; } ...
[["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
323
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); if (N = 3) { if (S.at(0) == S.at(2)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } else { for (int i = 0; i < N / 2; i++) { char A = S.at(i); char B = S.at(N...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int N = S.size(); if (N == 3) { if (S.at(0) == S.at(2)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } else { for (int i = 0; i < N / 2; i++) { char A = S.at(i); char B = S.at(...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
240
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long const int mod = 1000000007; // const int mod = 998244353; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mi...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define ll long long const int mod = 1000000007; // const int mod = 998244353; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mi...
[["+", 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
804
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); string s; cin >> s; int n = s.length(); if (n % 2 == 0) { cout << "No\n"; return 0; } else { for (int i = 1; i <= n / 2; ++i) { ...
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); string s; cin >> s; int n = s.length(); if (n % 2 == 0) { cout << "No\n"; return 0; } else { for (int i = 1; i <= n / 2; ++i) { ...
[["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
231
S = str(input()) N = int(len(S)) x = int((N-1)/2) y = int((N+3)/2) a = str(S[:x]) b = str(S[y:N]) reverse_S = ''.join(list(reversed(S))) reverse_a = ''.join(list(reversed(a))) reverse_b = ''.join(list(reversed(b))) if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b): print('Yes')...
S = str(input()) N = int(len(S)) x = int((N-1)/2) y = int((N+3)/2) a = str(S[:x]) b = str(S[y:N-1]) reverse_S = ''.join(list(reversed(S))) reverse_a = ''.join(list(reversed(a))) reverse_b = ''.join(list(reversed(b))) if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b): print('Yes...
[["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
152
#include <stdio.h> #include <string.h> int main() { char a[110] = {}; int n, i, j, leap = 0; while (~scanf("%s", a)) { n = strlen(a); for (j = n - 1, i = 0; i < n / 2; j--, i++) { // printf("one:%d %c-%d %c\n",i,a[i],j,a[j]); if (a[i] != a[j]) { leap = 1; break; ...
// WA #include <stdio.h> #include <string.h> int main() { char a[110] = {}; int n, i, j, leap = 0; while (~scanf("%s", a)) { n = strlen(a); for (j = n - 1, i = 0; i < n / 2; j--, i++) { // printf("one:%d %c-%d %c\n",i,a[i],j,a[j]); if (a[i] != a[j]) { leap = 1; brea...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
263
#include <bits/stdc++.h> #define int long long int using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // cout<<"I must do it...Yeahhh"; int t = 1; // cin>>t; while (t--) { string s; cin >> s; int n = s.size(); int f1 = 0, f2 = 0, f3 = 0;...
#include <bits/stdc++.h> #define int long long int using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // cout<<"I must do it...Yeahhh"; int t = 1; // cin>>t; while (t--) { string s; cin >> s; int n = s.size(); int f1 = 0, f2 = 0, f3 = 0;...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
250
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); string l = ""; for (int i = n - 1; i >= 0; --i) { l += s[i]; } if (l == s) { string a = s.substr(0, (n - 1) / 2); string x = ""; for (int i = a.length() - 1; i >= 0; --i) { x += a[i]; ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.length(); string l = ""; for (int i = n - 1; i >= 0; --i) { l += s[i]; } if (l == s) { string a = s.substr(0, (n - 1) / 2); string x = ""; for (int i = a.length() - 1; i >= 0; --i) { x += a[i]; ...
[["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 72], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
244
#include <bits/stdc++.h> using namespace std; using LL = long long int; using uLL = unsigned long long int; using uint = unsigned int; using ld = long double; int main() { cin.tie(NULL); ios_base::sync_with_stdio(0); string s; cin >> s; string temp = s; reverse(temp.begin(), temp.end()); int n = s.size(...
#include <bits/stdc++.h> using namespace std; using LL = long long int; using uLL = unsigned long long int; using uint = unsigned int; using ld = long double; int main() { cin.tie(NULL); ios_base::sync_with_stdio(0); string s; cin >> s; string temp = s; reverse(temp.begin(), temp.end()); int n = s.size(...
[["-", 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
216
#include <bits/stdc++.h> using namespace std; int a; bool b = true; string A; int main() { cin >> A; a = A.size(); for (int i = 0; i < a; i++) if (A.at(i) != A.at(a - i - 1)) b = false; for (int i = 0; i < (a - 1) / 2; i++) if (A.at(i) != A.at((a - 1) / 2 - i - 1)) b = false; for (int i = ...
#include <bits/stdc++.h> using namespace std; int a; bool b = true; string A; int main() { cin >> A; a = A.size(); for (int i = 0; i < a; i++) if (A.at(i) != A.at(a - i - 1)) b = false; for (int i = 0; i < (a - 1) / 2; i++) if (A.at(i) != A.at((a - 1) / 2 - i - 1)) b = false; for (int i = ...
[["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
200
#include <iostream> #include <string> bool IsPalindrome(const std::string &str) { const size_t half_size = str.size() / 2; const size_t size = str.size(); for (int i = 0; i < half_size; ++i) { if (str.at(i) != str.at(str.size() - (i + 1))) { return false; } } return true; } int main(int, char ...
#include <iostream> #include <string> bool IsPalindrome(const std::string &str) { const size_t half_size = str.size() / 2; const size_t size = str.size(); for (int i = 0; i < half_size; ++i) { if (str.at(i) != str.at(str.size() - (i + 1))) { return false; } } return true; } int main(int, char ...
[["+", 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
218
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, N) for (int i = 0; i < (int)(N); i++) int main() { string s; cin >> s; int n = s.size(); string t = "Yes"; rep(i, n) { if (s[i] != s[n - i]) { t = "No"; break; } } rep(i, (n - 1) / ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, N) for (int i = 0; i < (int)(N); i++) int main() { string s; cin >> s; int n = s.size(); string t = "Yes"; rep(i, n) { if (s[i] != s[n - i - 1]) { t = "No"; break; } } rep(i, (n - 1...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
182