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 <iostream> #include <string> int main() { std::string s; std::cin >> s; int len = s.size(); bool kaibun = true; int i; int N = len / 2; for (i = 0; i < N; i++) { if (s[i] != s[len - 1 - i]) kaibun = false; } N = (len - 1) / 2; for (i = 0; i < N / 2; i++) { if (s[i] != s[N -...
#include <iostream> #include <string> int main() { std::string s; std::cin >> s; int len = s.size(); bool kaibun = true; int i; int N = len / 2; for (i = 0; i < N; i++) { if (s[i] != s[len - 1 - i]) kaibun = false; } N = (len - 1) / 2; for (i = 0; i < N / 2; i++) { if (s[i] != s[N -...
[["-", 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
210
S = input() N = len(S) kai = [] kai2 = [] kai3 = [] rev = [] rev2 = [] rev3 = [] for i in range(N): kai.append(S[i]) for i in range(0, int((N - 1) / 2)): kai2.append(S[i]) for i in range(int((N + 3) / 2) - 1, N): kai3.append(S[i]) kai.reverse kai2.reverse kai3.reverse for i in range(N): rev.append(S[i]) f...
S = input() N = len(S) kai = [] kai2 = [] kai3 = [] rev = [] rev2 = [] rev3 = [] for i in range(N): kai.append(S[i]) for i in range(0, int((N - 1) / 2)): kai2.append(S[i]) for i in range(int((N + 3) / 2) - 1, N): kai3.append(S[i]) kai.reverse() kai2.reverse() kai3.reverse() for i in range(N): rev.append(S[...
[["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
239
def main(): S = input() N = len(S) if check(S[:(N-1)//2]) and check(S[(N+3)//2-1:]): print("Yes") else: print("No") def check(s): for i in range(len(s) // 2): c1 = s[i] c2 = s[-(i+1)] if c1 != c2: return False return True main()
def main(): S = input() N = len(S) if check(S) and check(S[:(N-1)//2]) and check(S[(N+3)//2-1:]): print("Yes") else: print("No") def check(s): #print(s) for i in range(len(s) // 2): c1 = s[i] c2 = s[-(i+1)] if c1 != c2: return False retu...
[["+", 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], ["+", 31, 679, 12, 652, 3, 4, 0, 206, 51, 22]]
5
111
def pal(string): return True if string==string[::-1] else False S = input() if palindrome(S) and palindrome(S[0:int((len(S)-1)/2)]) and palindrome(S[int((len(S)+3)/2)-1:]): print('Yes') else: print('No')
def pal(string): return True if string==string[::-1] else False S = input() if pal(S) and pal(S[0:int((len(S)-1)/2)]) and pal(S[int((len(S)+3)/2)-1:]): print('Yes') else: print('No')
[["-", 0, 57, 15, 679, 31, 679, 31, 652, 63, 22], ["+", 0, 57, 15, 679, 31, 679, 31, 652, 63, 22], ["-", 0, 57, 15, 679, 31, 679, 12, 652, 63, 22], ["+", 0, 57, 15, 679, 31, 679, 12, 652, 63, 22], ["-", 0, 656, 0, 57, 15, 679, 12, 652, 63, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 652, 63, 22]]
5
90
def palindrome(string): return 1 if string == string[::-1] else 0 s = input() N = len(s) # print(s[0:(N - 1) // 2]) # print(s[(N + 3) // 2 - 1:N]) if palindrome(s[0:(N - 1) // 2]) and palindrome(s[(N + 3) // 2 - 1:N]): print("Yes") else: print("No")
def palindrome(string): return 1 if string == string[::-1] else 0 s = input() N = len(s) # print(s[0:(N - 1) // 2]) # print(s[(N + 3) // 2 - 1:N]) if palindrome(s[0:(N - 1) // 2]) and palindrome(s[(N + 3) // 2 - 1:N]) and palindrome(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
82
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> using namespace std; int main() { string a; bool flag = true; cin >> a; int len = a.length(); for (int i = 0; i <= len / 2 - 1; i++) { if (a[i] != a[len / 2 - 1 - i]) flag = false; } ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> using namespace std; int main() { string a; bool flag = true; cin >> a; int len = a.length(); for (int i = 0; i <= len / 2 - 1; i++) { if (a[i] != a[len / 2 - 1 - i]) flag = false; } ...
[["-", 341, 342, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 341, 342, 0, 16, 31, 16, 12, 16, 17, 85], ["-", 341, 342, 0, 16, 31, 16, 12, 16, 12, 13], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
155
#include <bits/stdc++.h> using namespace std; int main(void) { string S; string Sr; cin >> S; Sr = S; int len = S.length(); for (int i = 0; i <= len; i++) { Sr[i] = S[len - i - 1]; } bool tsuyoi = true; if (S.compare(Sr)) { tsuyoi = false; } string p = S.substr(0, (len - 1) / 2); st...
#include <bits/stdc++.h> using namespace std; int main(void) { string S; string Sr; cin >> S; Sr = S; int len = S.length(); for (int i = 0; i <= len; i++) { Sr[i] = S[len - i - 1]; } bool tsuyoi = true; if (S.compare(Sr)) { tsuyoi = false; } string p = S.substr(0, (len - 1) / 2); st...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]]
1
222
import copy S = list(input()) N = len(S) ReS = copy.copy(S) o = 1 for i in S: ReS[N-o] = i o += 1 if S == reversed(S): print("Yes") if S == ReS: if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]: if S[int(N+1/2): N] == ReS[0:int((N-1)/2)]: print("Yes") else: print("No"...
import copy S = list(input()) N = len(S) ReS = copy.copy(S) o = 1 for i in S: ReS[N-o] = i o += 1 if S == reversed(S): print("Yes") if S == ReS: if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]: if S[int((N+1)/2): N] == ReS[0:int((N-1)/2)]: print("Yes") else: print("N...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
156
#include <iostream> #include <string.h> using namespace std; bool huiwen(char *s, int start, int end) { for (int i = start; start >= end; start++) { // cout<<s[start]<<" "<<s[end]<<endl; if (s[start] != s[end]) { return false; } end--; } return true; } int main() { char s[105]; int n;...
#include <iostream> #include <string.h> using namespace std; bool huiwen(char *s, int start, int end) { for (int i = start; start <= end; start++) { // cout<<s[start]<<" "<<s[end]<<endl; if (s[start] != s[end]) { return false; } end--; } return true; } int main() { char s[105]; int n;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
182
/* --------DO NOT COPY I REQUEST YOU PLEASE-------- AUTHOR : Chandan Agrawal College : Poornima College of Engg. jaipur, Raj Mail : chandanagrawal23@gmail.com ___ _ _ __ _ _ ____ __ _ _ / __)( )_( ) /__\ ( \( )( _ \ /__\ ( \( ) ( (__ ) _ ( /(__)\ ) ( )(_) )/(__)\ ) ( \___)(_) (_)(__...
/* --------DO NOT COPY I REQUEST YOU PLEASE-------- AUTHOR : Chandan Agrawal College : Poornima College of Engg. jaipur, Raj Mail : chandanagrawal23@gmail.com ___ _ _ __ _ _ ____ __ _ _ / __)( )_( ) /__\ ( \( )( _ \ /__\ ( \( ) ( (__ ) _ ( /(__)\ ) ( )(_) )/(__)\ ) ( \___)(_) (_)(__...
[["+", 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
2,216
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; bool chk = true; int fst = (s.length() - 1) / 2; int lst = (s.length() + 3) / 2; for (int i = 0; i < fst; i++) { if (s[i] != s[i + lst - 1]) { chk = false; } } if (chk) { cout << "yes"; } e...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; bool chk = true; int fst = (s.length() - 1) / 2; int lst = (s.length() + 3) / 2; for (int i = 0; i < fst; i++) { if (s[i] != s[i + lst - 1]) { chk = false; } } if (chk) { cout << "Yes"; } e...
[["-", 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
115
# coding: utf-8 def check(string): if (string[::-1] == string): return True return False string = input() mid = int((len(string)-1)/2) if check(string[:mid]) and check(string[mid+1:]): print("Yes") else: print("No")
# coding: utf-8 def check(string): if (string[::-1] == string): return True return False string = input() mid = int((len(string)-1)/2) if check(string) and check(string[:mid]) and check(string[mid+1:]): print("Yes") else: print("No")
[["+", 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
79
import math import sys s = input() n= len(s) """ sが回文かどうかのチェック """ end = n for i in range(end): head = s[i] tail = s[end-i-1] if head != tail: print('No') sys.exit() """ 2つめチェック """ end = int((n-1)/2) for i in range(end): head = s[i] tail = s[end-i-1] if head != tail: print('No') sys...
import math import sys s = input() n= len(s) """ sが回文かどうかのチェック """ end = n for i in range(end): head = s[i] tail = s[end-i-1] if head != tail: print('No') sys.exit() """ 2つめチェック """ end = int((n-1)/2) for i in range(end): head = s[i] tail = s[end-i-1] if head != tail: print('No') sys...
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
184
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) // cout << fixed << setprecision(1...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) // cout << fixed << setprecision(1...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
282
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #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; int n = s.size(); bool kaibun = true; for (size_t i = 0; i < s.size() / 2; i++) { if (s.at(i) != s.at(n ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #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; int n = s.size(); bool kaibun = true; for (size_t i = 0; i < s.size() / 2; i++) { if (s.at(i) != s.at(n ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
254
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define sort(s) sort(s.begin(), s.end()) #define reverse(s) reverse(s.begin(), s.end()) #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) const ll mod = 1e9 + 7; //最大公約数 ll gcd(ll a, ll b) { return b ?...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define sort(s) sort(s.begin(), s.end()) #define reverse(s) reverse(s.begin(), s.end()) #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) const ll mod = 1e9 + 7; //最大公約数 ll gcd(ll a, ll b) { return b ?...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
684
#include <stdio.h> #include <string.h> int palindromo(char *s, int ini, int lim) { int i = ini - 1, j = lim - 1; while (i >= j) if (s[i++] != s[j--]) return 0; return 1; } int main() { char s[100]; int n; scanf("%s", s); n = strlen(s); if (palindromo(s, 1, n) && palindromo(s, 1, (n - 1) / ...
#include <stdio.h> #include <string.h> int palindromo(char *s, int ini, int lim) { int i = ini - 1, j = lim - 1; while (i <= j) if (s[i++] != s[j--]) return 0; return 1; } int main() { char s[101]; int n; scanf("%s", s); n = strlen(s); if (palindromo(s, 1, n) && palindromo(s, 1, (n - 1) / ...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
1
147
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <unordered_map> #include <vector> using namespace std; bool kaibun(const string &str) { string rev = str; reverse(rev.begin(), rev.end()); return rev == str; } int main() { string str; cin >> str; int si...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <unordered_map> #include <vector> using namespace std; bool kaibun(const string &str) { string rev = str; reverse(rev.begin(), rev.end()); return rev == str; } int main() { string str; cin >> str; int si...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
162
s = input() n = len(s) def f(s): n = len(s) if n % 2 == 0: return list(s[:n // 2]) == list(reversed(s[n // 2:])) else: return list(s[:n // 2]) == list(reversed(s[n // 2 + 1:])) if f(s) and f(s[:(n - 1)//2]) and f(s[(n + 3) // 2:]): print('Yes') else: print('No')
s = input() n = len(s) def f(s): n = len(s) if n % 2 == 0: return list(s[:n // 2]) == list(reversed(s[n // 2:])) else: return list(s[:n // 2]) == list(reversed(s[n // 2 + 1:])) if f(s) and f(s[:(n - 1)//2]) and f(s[(n + 3) // 2 - 1:]): print('Yes') else: print('No')
[["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
134
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define M 1000000007 #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const int N = 2e5 + 5; bool ispal(const string &x) { int n = x.size(); for (int i = 0, j = n - 1; i < n / 2...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define M 1000000007 #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const int N = 2e5 + 5; bool ispal(const string &x) { int n = x.size(); for (int i = 0, j = n - 1; i < n / 2...
[["-", 0, 34, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 34, 31, 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
234
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; bool check(string str) { int len = str.length(); for (int s = 0, e = len - 1; s < len / 2; s++, e--) { if (str[s] != str[e]) return false; } return true; } int main() { string str; c...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; bool check(string str) { int len = str.length(); for (int s = 0, e = len - 1; s < len / 2; s++, e--) { if (str[s] != str[e]) return false; } return true; } int main() { string str; c...
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 23, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 23, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
165
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int n = s.length(); int half = n / 2; boolean flag = true; for (int i = 0; i < half; i++) { if (s.charAt(i) != s.charAt(half - 1 - i) &&...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int n = s.length(); int half = n / 2; boolean flag = true; for (int i = 0; i < half; i++) { if (s.charAt(i) != s.charAt(half - 1 - i) ||...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 98], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["-", 31, 492, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 31, 492, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 31, 492, 3, 4, 0, 16, 31, 16, 12, 499], ["-", 12, 16, 31, 492, 3, 4, 0, 16, 17, 72]]
3
160
s = list(input()) n = len(s) flag = 1 c = int((n - 1) / 2) for i in range(c): if s[i] != s[n - 1 - i]: flag = 0 break if flag: c2 = int(c / 2) for i in range(c2): if s[i] != s[c2 - 1 - i]: flag = 0 break if flag: print('Yes') else : print('No')
s = list(input()) n = len(s) flag = 1 c = int((n - 1) / 2) for i in range(c): if s[i] != s[n - 1 - i]: flag = 0 break if flag: c2 = int(c / 2) for i in range(c2): if s[i] != s[c - 1 - i]: flag = 0 break if flag: print('Yes') else : print('No')
[["-", 15, 666, 0, 206, 206, 657, 31, 657, 31, 22], ["+", 15, 666, 0, 206, 206, 657, 31, 657, 31, 22]]
5
111
import java.io.*; import java.util.*; // solution classes here public class Main { // main solution here static Scanner sc = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) throws IOException { String str = sc.next(); int n = str....
import java.io.*; import java.util.*; // solution classes here public class Main { // main solution here static Scanner sc = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) throws IOException { String str = sc.next(); int n = str....
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499], ["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
431
S = input() end = len(S) half = int(end/2) for i in range(0,half): if S[i] is not S[half-1-i]: print("NO") exit() S1 = S[0:half] S2 = S[half+1:end] if S1 == S2: print("YES") else: print("NO")
S = input() end = len(S) half = int(end/2) for i in range(0,half): if S[i] is not S[half-1-i]: print("No") exit() S1 = S[0:half] S2 = S[half+1:end] if S1 == S2: 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
91
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define vii vector<vi> #define ALL(s) (s).begin(), (s).end() #define pii pair<int, int> #define pll pair<ll, ll> #define si set<int> #define mp make_pair #define F first #define S second #define pb push_back #define tc(t) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define vi vector<int> #define vii vector<vi> #define ALL(s) (s).begin(), (s).end() #define pii pair<int, int> #define pll pair<ll, ll> #define si set<int> #define mp make_pair #define F first #define S second #define pb push_back #define tc(t) ...
[["-", 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
301
#include <bits/stdc++.h> using namespace std; #define ll long long bool solve(string s) { bool ans = true; for (int i = 0; i < (s.size() - 1) / 2; i++) { if (s.at(i) != s.at(s.size() - 1 - i)) ans = false; } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string S; ...
#include <bits/stdc++.h> using namespace std; #define ll long long bool solve(string s) { bool ans = true; for (int i = 0; i < s.size(); i++) { if (s.at(i) != s.at(s.size() - 1 - i)) ans = false; } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string S; cin >> S;...
[["-", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["-", 31, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 85], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
221
#include <algorithm> #include <cstdio> #include <iostream> #include <stdio.h> #include <string> using namespace std; bool REVERSE(string s) { // cout<<s<<endl; string t = s; reverse(s.begin(), s.end()); return s == t; } int main() { string s; cin >> s; if (REVERSE(s) && REVERSE(s.substr(0, (s.size() - 1)...
#include <algorithm> #include <cstdio> #include <iostream> #include <stdio.h> #include <string> using namespace std; bool REVERSE(string s) { // cout<<s<<endl; string t = s; reverse(s.begin(), s.end()); return s == t; } int main() { string s; cin >> s; if (REVERSE(s) && REVERSE(s.substr(0, (s.size() - 1)...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
134
import math import sys s = input() if s==s[::-1]: n = len(s) right = int((n-1)/2) print(right) tmp = s[:right] if tmp == tmp[::-1]: left = int((n+3)/2) tmp2 = s[left-1:] if tmp2 == tmp2[::-1]: print('Yes') sys.exit() print('No')
import math import sys s = input() if s==s[::-1]: n = len(s) right = int((n-1)/2) tmp = s[:right] if tmp == tmp[::-1]: left = int((n+3)/2) tmp2 = s[left-1:] if tmp2 == tmp2[::-1]: print('Yes') sys.exit() print('No')
[["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
109
#include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORD(i, a, b) for (int i = (a); i >= (b); i--) #define ff first #define ss second #define END "\n" #define p...
#include <bits/stdc++.h> using namespace std; #define DEBUG(x) cout << '>' << #x << ':' << x << endl; #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORD(i, a, b) for (int i = (a); i >= (b); i--) #define ff first #define ss second #define END "\n" #define p...
[["+", 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
490
#include <stdio.h> #include <string.h> int main() { char c[100]; int len, tr = 1, n = 1; scanf("%s", c); len = strlen(c); while ((tr == 1) && (n <= len)) { if ((c[n - 1] != c[(len + 1) / 2 - n - 1]) || (c[(len + 1) / 2 - n - 1] != c[(len + 1) / 2 + n - 1]) || (c[(len + 1) / 2 + n - 1] != c...
#include <stdio.h> #include <string.h> int main() { char c[100]; int len, tr = 1, n = 1; scanf("%s", c); len = strlen(c); while ((tr == 1) && (n <= len / 4 + 1)) { if ((c[n - 1] != c[(len + 1) / 2 - n - 1]) || (c[(len + 1) / 2 - n - 1] != c[(len + 1) / 2 + n - 1]) || (c[(len + 1) / 2 + n -...
[["+", 12, 23, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 12, 23, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 12, 23, 0, 16, 12, 16, 17, 72], ["+", 0, 16, 12, 23, 0, 16, 12, 16, 12, 13]]
0
172
#include <stdio.h> int main() { int i, n = 0, m = 1; char s[100]; scanf("%s", &s); while (s[n] != 0) n++; for (i = 0; (i < n / 2) && (m != 0); i++) { if (s[n - i - 1] != s[i]) m = 0; } for (i = 0; (i < (n - 1) / 4) && (m != 0); i++) { if (s[(n - 1) / 2 - i - 1] != s[i]) m = 0; }...
#include <stdio.h> int main() { int i, n = 0, m = 1; char s[100]; scanf("%s", &s); while (s[n] != 0) n++; for (i = 0; (i < n / 2) && (m != 0); i++) { if (s[n - i - 1] != s[i]) m = 0; } for (i = 0; (i < (n - 1) / 4) && (m != 0); i++) { if (s[(n - 1) / 2 - i - 1] != s[i]) m = 0; }...
[["-", 0, 16, 31, 69, 71, 16, 31, 16, 17, 72], ["-", 0, 16, 31, 69, 71, 16, 31, 16, 12, 13], ["+", 15, 23, 0, 16, 31, 69, 71, 16, 17, 33], ["+", 15, 23, 0, 16, 31, 69, 71, 16, 12, 13]]
0
236
S = input() def is_kaibun(s): for i in range(len(s) // 2): if s[i] != s[-i-1]: print('No') N = len(S) is_kaibun(S) is_kaibun(S[:(N-1)//2]) is_kaibun(S[(N+3)//2-1:]) print('Yes')
S = input() def is_kaibun(s): for i in range(len(s) // 2): if s[i] != s[-i-1]: print('No') exit() N = len(S) is_kaibun(S) is_kaibun(S[:(N-1)//2]) is_kaibun(S[(N+3)//2-1:]) print('Yes')
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
90
#include <bits/stdc++.h> using namespace std; char s[100000]; bool is(int l, int r) { for (int i = 0; i <= (r - l); i++) { if (s[l + i] != s[r - i]) return 0; } return 1; } int main() { scanf("%s", s + 1); int n = strlen(s + 1); if (is(1, n), is(1, (n - 1) / 2), is((n + 3) / 2, n)) puts("Y...
#include <bits/stdc++.h> using namespace std; char s[150]; bool is(int l, int r) { for (int i = 0; i <= (r - l); i++) { if (s[l + i] != s[r - i]) return 0; } return 1; } int main() { scanf("%s", s + 1); int n = strlen(s + 1); if (is(1, n) && is(1, (n - 1) / 2) && is((n + 3) / 2, n)) puts("...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 34, 0, 21], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 34, 12, 34, 0, 21], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
145
s = list(input()) t = s[::-1] n = len(s) if s != t: print ('No') exit() if n == 3: print('Yes') exit() d = s[:int((n-1)/2)+1] e = d[::-1] r = s[int((n+3)/2-1):] q = r[::-1] #print(r,q) if d != e: print('No') exit() if r != q: print ('No') exit() print('Yes')
s = list(input()) t = s[::-1] n = len(s) if s != t: print ('No') exit() if n == 3: print('Yes') exit() d = s[:int((n-1)/2)] e = d[::-1] #print(d,e) r = s[int((n+3)/2-1):] q = r[::-1] #print(r,q) if d != e: print('No') exit() if r != q: print ('No') exit() print('Yes')
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
140
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <vector> typedef long long ll; //#pragma comment(linker, "/STACK:1024000000,10...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <vector> typedef long long ll; //#pragma comment(linker, "/STACK:1024000000,10...
[["-", 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
327
from sys import stdin def check_palindrome(str_): if str_ == str_[::-1]: return True return False def get_result(data): S = data[0] right_idx = int((len(S) - 1) / 2) left_idx = int((len(S) + 3) / 2) - 1 right_S = S[0:right_idx] left_S = S[left_idx:] if check_palindrome(S) and c...
from sys import stdin def check_palindrome(str_): if str_ == str_[::-1]: return True return False def get_result(data): S = data[0] right_idx = int((len(S) - 1) / 2) left_idx = int((len(S) + 3) / 2) - 1 right_S = S[0:right_idx] left_S = S[left_idx:] if check_palindrome(S) and c...
[["+", 0, 652, 63, 319, 500, 652, 63, 319, 319, 22], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 63, 319, 500, 652, 3, 4, 0, 557, 0, 654], ["+", 500, 652, 3, 4, 0, 557, 0, 6, 0, 44], ["+", 63, 319, 500, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 0, 652, 3, 4, 0, 652, 63, 3...
5
147
#include <bits/stdc++.h> #define f1(n) for (int i = 0; i < n; ++i) #define f2(n) for (int i = 1; i <= n; ++i) #define lson(x) x << 1 #define rson(x) x << 1 | 1 #define mp make_pair using namespace std; typedef long long ll; typedef long double llf; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<int...
#include <bits/stdc++.h> #define f1(n) for (int i = 0; i < n; ++i) #define f2(n) for (int i = 1; i <= n; ++i) #define lson(x) x << 1 #define rson(x) x << 1 | 1 #define mp make_pair using namespace std; typedef long long ll; typedef long double llf; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<int...
[["+", 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
315
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; bool reversible(const string &s) { bool reversible = true; int n = s.size(); for (int i = 0; i < n; ++i) { if (s[i] != s[n - 1 - i]) { reversible = false; } } return reversible; } int main() { ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; bool reversible(const string &s) { bool reversible = true; int n = s.size(); for (int i = 0; i < n; ++i) { if (s[i] != s[n - 1 - i]) { reversible = false; } } return reversible; } int main() { ...
[["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 98], ["+", 49, 50, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24]]
1
168
s=input() n=len(s) s1=s[:n//2] s2=s[n//2+1:] test =True if(s!=s[::-1]): test=False if (s1!=s1[::-1]): test=False if(s2!=s2[::-1]): test=False if(test==True): print("YES") else: print("NO")
s=input() n=len(s) s1=s[:n//2] s2=s[n//2+1:] test =True if(s!=s[::-1]): test=False if (s1!=s1[::-1]): test=False if(s2!=s2[::-1]): test=False if(test==True): 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
103
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int x = (n - 1) / 2; string s2 = string(s.rbegin(), s.rend()); string s3(s.begin(), s.begin() + x); string s4(s.begin() + (n + 3) / 2 - 1, s.end()); string s5 = string(s3.rbegin(), s3.rend()); string...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int x = (n - 1) / 2; string s2 = string(s.rbegin(), s.rend()); string s3(s.begin(), s.begin() + x); string s4(s.begin() + (n + 3) / 2 - 1, s.end()); string s5 = string(s3.rbegin(), s3.rend()); string...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13]]
1
226
#include <bits/stdc++.h> #define ll long long #define sf(n) scanf("%lld", &n) #define pf(n) printf("%lld\n", n) #define sff(x, y) scanf("%lld %lld", &x, &y) #define pff(x, y) printf("%lld %lld\n", x, y) #define REP(I, N) for (I = 0; I < N; I++) #define REPP(I, A, B) for (I = A; I <= B; I++) #define MS0(X) memset(X, 0, ...
#include <bits/stdc++.h> #define ll long long #define sf(n) scanf("%lld", &n) #define pf(n) printf("%lld\n", n) #define sff(x, y) scanf("%lld %lld", &x, &y) #define pff(x, y) printf("%lld %lld\n", x, y) #define REP(I, N) for (I = 0; I < N; I++) #define REPP(I, A, B) for (I = A; I <= B; I++) #define MS0(X) memset(X, 0, ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
319
/* author: Salam_35 Created at : */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define sc(n) scanf("%d", &n) #define Max 100005 #define scan(n) scanf("%lld", &n) #define pi acos(-1.0) #define _fastio ...
/* author: Salam_35 Created at : */ #include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define sc(n) scanf("%d", &n) #define Max 100005 #define scan(n) scanf("%lld", &n) #define pi acos(-1.0) #define _fastio ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
303
#include <bits/stdc++.h> using namespace std; int main() { string s, x; cin >> s; x = s; reverse(x.begin(), x.end()); if (!(x == s)) { cout << "No0" << endl; return 0; } string c1 = s.substr(0, (s.size() - 1) / 2); string cr = c1; reverse(c1.begin(), c1.end()); if (!(c1 == cr)) { co...
#include <bits/stdc++.h> using namespace std; int main() { string s, x; cin >> s; x = s; reverse(x.begin(), x.end()); if (!(x == s)) { cout << "No" << endl; return 0; } string c1 = s.substr(0, (s.size() - 1) / 2); string cr = c1; reverse(c1.begin(), c1.end()); if (!(c1 == cr)) { cou...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
205
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define pll pair<ll, ll> #define pq priority_queue #define speed_up \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define pll pair<ll, ll> #define pq priority_queue #define speed_up \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
383
#include <iostream> #include <string> using namespace std; bool chss(const string s, int l, int r) { for (int i = 0; l + i < r - i; i++) { if (s[l + i] != s[r - i]) return false; } return true; } int main() { string S; cin >> S; if (chss(S, 0, (S.length() - 3) / 2) == true && chss(S, 0, S....
#include <iostream> #include <string> using namespace std; bool chss(const string s, int l, int r) { for (int i = 0; l + i < r - i; i++) { if (s[l + i] != s[r - i]) return false; } return true; } int main() { string S; cin >> S; if (chss(S, 0, (S.length() - 3) / 2) == true && chss(S, 0, S....
[["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["-", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
137
s = input() def palind(word): l = len(word) i=0 j=l-1 while i <= j: if word[i] != word[j]: return False i += 1 j -= 1 return True n = len(s) if palind(s) and palind(s[:(((n-1)//2))]) and palind(s[(((n+3)//2)-1):]): print("YES") else: print("NO")
s = input() def palind(word): l = len(word) i=0 j=l-1 while i <= j: if word[i] != word[j]: return False i += 1 j -= 1 return True n = len(s) if palind(s) and palind(s[:(((n-1)//2))]) and palind(s[(((n+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
117
// PLUS ULTRA #include <bits/stdc++.h> using namespace std; #define SPEED \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #...
// PLUS ULTRA #include <bits/stdc++.h> using namespace std; #define SPEED \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
219
s = input() n = len(s) firsthalf = s[:(n - 1)//2] secondhalf = s[(n + 3)//2 - 1:] # # print(firsthalf) # print(secondhalf) revfirst = firsthalf[::-1] revsecond = secondhalf[::-1] revitself = s[::1] # # print(revfirst) # print(revsecond) if s == revitself and firsthalf == revfirst and secondhalf == revsecond: pr...
s = input() n = len(s) firsthalf = s[:(n - 1)//2] secondhalf = s[(n + 3)//2 - 1:] # # print(firsthalf) # print(secondhalf) revfirst = firsthalf[::-1] revsecond = secondhalf[::-1] revitself = s[::-1] # # print(revfirst) # print(revsecond) if s == revitself and firsthalf == revfirst and secondhalf == revsecond: p...
[["+", 0, 662, 12, 206, 206, 663, 0, 664, 17, 33]]
5
98
#include <bits/stdc++.h> using namespace std; bool isPalindrome(string str) { int l = 0; int h = str.size() - 1; while (h > l) { if (str[l++] != str[h--]) { return false; } } return true; } int main() { string s; cin >> s; string st1; st1 = s[0]; for (int i = 1; i < (s.size()) / 2; ...
#include <bits/stdc++.h> using namespace std; bool isPalindrome(string str) { int l = 0; int h = str.size() - 1; while (h > l) { if (str[l++] != str[h--]) { return false; } } return true; } int main() { string s; cin >> s; string st1; st1 = s[0]; for (int i = 1; i < (s.size()) / 2; ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
235
#include <bits/stdc++.h> #define F first #define S second #define pb(x) push_back(x) #define in(x) insert(x) #define forr(i, a, b) for (int i = a; i <= b; i++) #define sz(s) int(s.size()) #define ioi ios_base::sync_with_stdio(false) #define all(x) x.begin(), x.end() #define tie ...
#include <bits/stdc++.h> #define F first #define S second #define pb(x) push_back(x) #define in(x) insert(x) #define forr(i, a, b) for (int i = a; i <= b; i++) #define sz(s) int(s.size()) #define ioi ios_base::sync_with_stdio(false) #define all(x) x.begin(), x.end() #define tie ...
[["-", 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
155
from bisect import * from collections import * from itertools import * import functools import sys import math from decimal import * from copy import * from heapq import * from fractions import * getcontext().prec = 30 MAX = sys.maxsize MAXN = 50010 MOD = 10**9+7 spf = [i for i in range(MAXN)] spf[0]=spf[1] = -1 def si...
from bisect import * from collections import * from itertools import * import functools import sys import math from decimal import * from copy import * from heapq import * from fractions import * getcontext().prec = 30 MAX = sys.maxsize MAXN = 50010 MOD = 10**9+7 spf = [i for i in range(MAXN)] spf[0]=spf[1] = -1 def si...
[["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
499
#include <bits/stdc++.h> #define COUT(x) cout << #x << " = " << (x) << ", " typedef long long ll; using namespace std; static const ll MOD = 1000000007; bool kaibun(string s) { bool flag = true; int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] != s[len - 1 - i]) { flag = false; } } ...
#include <bits/stdc++.h> #define COUT(x) cout << #x << " = " << (x) << ", " typedef long long ll; using namespace std; static const ll MOD = 1000000007; bool kaibun(string s) { bool flag = true; int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] != s[len - 1 - i]) { flag = false; } } ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 67]]
1
192
// #include<iostream> #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int p1 = 0, p2 = ((n - 1) / 2) - 1, p3 = ((n + 3) / 2) - 1, p4 = n - 1; bool flag = true; while (p1 <= p2 && p3 <= p4) { // cout<<p1<<" "<<p2<<" "<<p3<<" " <<p4<<"\n"; if ((s[p1] ...
// #include<iostream> #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int p1 = 0, p2 = ((n - 1) / 2) - 1, p3 = ((n + 3) / 2) - 1, p4 = n - 1; bool flag = true; while (p1 <= p2 && p3 <= p4) { // cout<<p1<<" "<<p2<<" "<<p3<<" " <<p4<<"\n"; if ((s[p1] ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
175
def ispalindrome(str): return 1 if str == str[::-1] else 0 a = input() l = len(a) left = a[0:(l-1)//2] right = a[(l-1)//2+1:] if ispalindrome(left) and ispalindrome(right): print("Yes") else: print("No")
def ispalindrome(str): return 1 if str == str[::-1] else 0 a = input() l = len(a) left = a[0:(l-1)//2] right = a[(l-1)//2+1:] if ispalindrome(left) and ispalindrome(right) and ispalindrome(a): 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
85
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { int began = 0; int ends = s.size() - 1; bool palindrome = true; while (began <= ends) { if (s[began] != s[ends]) { palindrome = false; } began++; ends--; } return palindrome; } int main() { string s, first, sec...
#include <bits/stdc++.h> using namespace std; bool palindrome(string s) { int began = 0; int ends = s.size() - 1; bool palindrome = true; while (began <= ends) { if (s[began] != s[ends]) { palindrome = false; break; } began++; ends--; } return palindrome; } int main() { string ...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
216
def check(st): flag = True n = len(st) for i in range(int(n/2)): if st[i] != st[n-1-i]: flag = False return flag s=input() n=len(s) one = s[0:int((n-1)/2)] two = s[int(((n+3)/2)) - 1:n] if check(one) and check(two): print("Yes") else: print("No")
def check(st): flag = True n = len(st) for i in range(int(n/2)): if st[i] != st[n-1-i]: flag = False return flag s=input() n=len(s) one = s[0:int((n-1)/2)] two = s[int(((n+3)/2)) - 1:n] if check(one) and check(two) and check(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
122
#include <bits/stdc++.h> #define ll long long int #define pii pair<int, int> #define F first #define S second #define mod 998244353 using namespace std; bool check(string s) { // cout <<s<<endl; int i = 0; int j = s.size() - 1; while (i < j) { if (s[i] != s[j]) return false; i += 1; j -= 1; ...
#include <bits/stdc++.h> #define ll long long int #define pii pair<int, int> #define F first #define S second #define mod 998244353 using namespace std; bool check(string s) { // cout <<s<<endl; int i = 0; int j = s.size() - 1; while (i < j) { if (s[i] != s[j]) return false; i += 1; j -= 1; ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 2, 63, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 16, 12, 2, 3, 4, 0, 25]]
1
180
#include <bits/stdc++.h> using namespace std; int main() { char S[111]; cin >> S; int N = 0; while (S[N]) N++; bool x = true; int i; for (i = 0; i <= N - 1; i++) if (S[i] != S[N - 1 - i]) x = false; if (N >= 4) { for (i = 0; i <= (N - 3) / 2; i++) if (S[i] != S[(N - 1) / 2 - i]...
#include <bits/stdc++.h> using namespace std; int main() { char S[111]; cin >> S; int N = 0; while (S[N]) N++; bool x = true; int i; for (i = 0; i <= N - 1; i++) if (S[i] != S[N - 1 - i]) x = false; if (N >= 4) { for (i = 0; i <= (N - 3) / 2; i++) if (S[i] != S[(N - 3) / 2 - i]...
[["-", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13]]
1
193
s = input() def is_kaibun(s): for i in range(len(s)//2): if s[i] != s[-i-1]: return False return True n = len(s) s1 = s[:(n-1)/2] s2 = s[(n+1)/2:] if is_kaibun(s) & is_kaibun(s1) & is_kaibun(s2): print('Yes') else: print('No')
s = input() def is_kaibun(s): for i in range(len(s)//2): if s[i] != s[-i-1]: return False return True n = len(s) s1 = s[:(n-1)//2] s2 = s[(n+1)//2:] if is_kaibun(s) & is_kaibun(s1) & is_kaibun(s2): 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
104
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() 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]) { cout <...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() 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]) { cout <...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
179
def main(): S = list(input()) N = len(S) kaibun_check(S) S1 = S[0:(N-1)//2 + 1] kaibun_check(S1) S2 = S[(N+3)//2 + 1: -1] kaibun_check(S2) print('Yes') def kaibun_check(L): L_ = list(L.__reversed__()) for s, s_ in zip(L, L_): if s != s_: print('No') ...
def main(): S = list(input()) N = len(S) kaibun_check(S) S1 = S[0:(N-1)//2] kaibun_check(S1) S2 = S[(N+3)//2:-1] kaibun_check(S2) print('Yes') def kaibun_check(L): L_ = list(L.__reversed__()) for s, s_ in zip(L, L_): if s != s_: print('No') e...
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
122
import math def check_kai(arr): len_a = len(arr) check_len = int(math.ceil(len_a/2)) lef = arr[0:check_len] arr.reverse() rig = arr[0:check_len] if lef == rig: return True else: return False input = list(input()) N = len(input) if check_kai(input) and check_kai(input[0:(i...
import math def check_kai(arr): len_a = len(arr) check_len = int(math.ceil(len_a/2)) lef = arr[0:check_len] arr.reverse() rig = arr[0:check_len] if lef == rig: return True else: return False input = list(input()) N = len(input) if check_kai(input) and check_kai(input[0:(i...
[["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
132
#include <bits/stdc++.h> #include <string> using namespace std; int main() { string s; cin >> s; int n = s.length(); int f = 0; for (int i = 0; i < n / 2 && f == 0; i++) { if (s[i] != s[n - 1 - i]) f = 1; } for (int i = 0; i < n / 2 && f == 0; i++) { if (s[i] != s[n / 2 - i - 1]) f = ...
#include <bits/stdc++.h> #include <string> using namespace std; int main() { string s; cin >> s; int n = s.length(); int f = 0; for (int i = 0; i < n / 2 && f == 0; i++) { if (s[i] != s[n - 1 - i]) f = 1; } for (int i = 0; i < n / 2 && f == 0; i++) { if (s[i] != s[n / 2 - i - 1]) f = ...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 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
193
S = list(input()) len_s = len(S) print(len_s) right = S[0:(len_s-1)//2] left = S[(len_s+3)//2-1:] if S != list(reversed(S)): print("No") elif right != list(reversed(right)): print("No") elif left != list(reversed(left)): print("No") else: print("Yes")
S = list(input()) len_s = len(S) right = S[0:(len_s-1)//2] left = S[(len_s+3)//2-1:] if S != list(reversed(S)): print("No") elif right != list(reversed(right)): print("No") elif left != list(reversed(left)): print("No") else: print("Yes")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
106
s=input() n=len(s) n1=((n-1)//2) n2=(n+3)//2 s1=s[0:n1] s2=s[n2-1:] if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]: print('yes') else: print('no')
s=input() n=len(s) n1=((n-1)//2) n2=(n+3)//2 s1=s[0:n1] s2=s[n2-1:] if s==s[::-1] and s1==s1[::-1] and s2==s2[::-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
93
#include <bits/stdc++.h> typedef long long lint; using namespace std; bool isKaibun(string t) { int m = t.length(); for (int i = 0; i < m / 2; i++) { if (t[i] != t[m - 1 - i]) { return false; } } return true; } int main() { string s; cin >> s; int n = s.length(); string sub1 = s.substr(0...
#include <bits/stdc++.h> typedef long long lint; using namespace std; bool isKaibun(string t) { int m = t.length(); for (int i = 0; i < m / 2; i++) { if (t[i] != t[m - 1 - i]) { return false; } } return true; } int main() { string s; cin >> s; int n = s.length(); string sub1 = s.substr(0...
[["+", 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
161
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <algorithm> //next_permutation #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <dequ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <algorithm> //next_permutation #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <dequ...
[["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
244
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String[] s = sc.next().split(""); int n = s.length; String[] s1 = new String[n / 2]; String[] s2 = new String[n / 2]; for (int i = 0; i < (n - 1) / 2; i++) { s1[i] = s[i]; ...
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String[] s = sc.next().split(""); int n = s.length; String[] s1 = new String[n / 2]; String[] s2 = new String[n / 2]; for (int i = 0; i < (n - 1) / 2; i++) { s1[i] = s[i]; ...
[["+", 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
266
#include <bits/stdc++.h> using namespace std; #define sp ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define debug1(x) cerr << x << "\n" #define debug2(x, y) cerr << x << " " << y << "\n" #define debug3(x, y, z) cerr << x << " " << y << " " << z << "\n" #define NL cout << "\n"; #define test cerr <<...
#include <bits/stdc++.h> using namespace std; #define sp ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define debug1(x) cerr << x << "\n" #define debug2(x, y) cerr << x << " " << y << "\n" #define debug3(x, y, z) cerr << x << " " << y << " " << z << "\n" #define NL cout << "\n"; #define test cerr <<...
[["-", 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
178
#include <cstdlib> #include <iostream> #include <map> #include <string> #include <vector> using std::cin; using std::cout; using std::endl; int main(int argc, char *argv[]) { std::string s; cin >> s; for (size_t i = 0; i < s.size() / 2; ++i) { if (s[i] != s[s.size() - 1 - i] && s[i] != s[(s.size()) / 2 - i ...
#include <cstdlib> #include <iostream> #include <map> #include <string> #include <vector> using std::cin; using std::cout; using std::endl; int main(int argc, char *argv[]) { std::string s; cin >> s; for (size_t i = 0; i < s.size() / 2; ++i) { // cout << "s[i] != s[s.size()/2-i-1]" << i << ", " << s.size() ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 106], ["-", 0, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["-", 31, 16, 31, 23, 0, 2, 3, 4, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
168
s = input() n = len(s) ans = "Yes" if s != s[::-1]: ans = "no" else: if s[:(n//2):-1] != s[:(n//2)]: ans = "no" if s[n//2 + 1::] != s[:(n//2):-1]: ans = "no" print(ans)
s = input() n = len(s) ans = "Yes" if s != s[::-1]: ans = "No" else: if s[:(n//2):-1] != s[:(n//2)]: ans = "No" if s[n//2 + 1::] != s[:(n//2):-1]: ans = "No" print(ans)
[["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
97
s = input() m = (len(s)-1)//2 def isK(s): return s == s[::-1] print('Yes' if isK(s[:m]) and isK(s[m+1:]) else 'No')
s = input() m = (len(s)-1)//2 def isK(s): return s == s[::-1] print('Yes' if isK(s[:m]) and isK(s[m+1:]) and isK(s) else 'No')
[["+", 0, 652, 3, 4, 0, 41, 0, 679, 17, 355], ["+", 3, 4, 0, 41, 0, 679, 12, 652, 63, 22], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 24], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 22], ["+", 0, 41, 0, 679, 12, 652, 3, 4, 0, 25]]
5
63
#include <bits/stdc++.h> using namespace std; #define int long long int #define double long double #define pb push_back #define endl '\n' #define all(x) (x).begin(), (x).end() #define F first #define S second #define sz(a) (int)((a).size()) #define fuck() cout << "--------" << endl #define see(x) cout << #x << " = " <<...
#include <bits/stdc++.h> using namespace std; #define int long long int #define double long double #define pb push_back #define endl '\n' #define all(x) (x).begin(), (x).end() #define F first #define S second #define sz(a) (int)((a).size()) #define fuck() cout << "--------" << endl #define see(x) cout << #x << " = " <<...
[["+", 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
237
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int mo = 1e9 + 7; constexpr int inf = 1 << 30; constexpr ll infl = 1ll << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = (int)s.size(); auto fir = s.substr(0, n / 2); auto sec = s...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int mo = 1e9 + 7; constexpr int inf = 1 << 30; constexpr ll infl = 1ll << 60; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; int n = (int)s.size(); auto fir = s.substr(0, n / 2); auto sec = s...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 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
177
#include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <string> #include <tuple> #include <utility> #include <vector> using namespa...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdint> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #include <sstream> #include <string> #include <tuple> #include <utility> #include <vector> using namespa...
[["+", 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
175
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pll pair<ll, ll> #define FILL(v, p) memset(v, p, sizeof v) #define FIO \ ios::sync_with_stdio(NULL); \ ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pll pair<ll, ll> #define FILL(v, p) memset(v, p, sizeof v) #define FIO \ ios::sync_with_stdio(NULL); \ ...
[["+", 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
245
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> // ceil(a/b) (a + (b - 1))/ b using namespace std; #d...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <tuple> #include <vector> // ceil(a/b) (a + (b - 1))/ b using namespace std; #d...
[["+", 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
309
// 222/03/2020 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define debug printf("Debug\n"); #define en '\n' #define ll long long #define ull unsigned long long #define pi acos(-1.0) #define mod 1000000007 #d...
// 222/03/2020 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define debug printf("Debug\n"); #define en '\n' #define ll long long #define ull unsigned long long #define pi acos(-1.0) #define mod 1000000007 #d...
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 31, 22]]
1
345
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int n1 = (n - 1) / 2; int n2 = (n + 1) / 2; for (int i = 0; i < n1; ++i) { if (s[i] != s[n1 - i - 1]) { cout << "NO\n"; return 0; } } for (int i = n2; i < n; ++i) { if (s[i] != s[n...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int n1 = (n - 1) / 2; int n2 = (n + 1) / 2; for (int i = 0; i < n1; ++i) { if (s[i] != s[n1 - i - 1]) { cout << "No\n"; return 0; } } for (int i = n2; i < n; ++i) { if (s[i] != s[n...
[["-", 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
148
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rep2(i, s, n) for (int i = s; i < n; ++i) #define all(a) a.begin(), a.end() #define tmax(a, b, c) max(a, max(b, c)) #define tmin(a, b, c) min(a, min(b, c)) #define pb push_back using namespace std; using ll = long long; using P = pair<int, i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define rep2(i, s, n) for (int i = s; i < n; ++i) #define all(a) a.begin(), a.end() #define tmax(a, b, c) max(a, max(b, c)) #define tmin(a, b, c) min(a, min(b, c)) #define pb push_back using namespace std; using ll = long long; using P = pair<int, i...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13]]
1
308
s = str(input()) t = s[::-1] if(s != t): print("No") exit c = "" for i in range((len(s)-1)//2): c += s[i] e = c[::-1] if(e != c): print("No") exit() r = "" for i in range(((len(s)+3)//2)-1,len(s),1): r += s[i] y = r[::-1] if(r != y): print("No") exit() print("Yes") """ print(s,t) print(e...
s = str(input()) t = s[::-1] if(s != t): print("No") exit() c = "" for i in range((len(s)-1)//2): c += s[i] e = c[::-1] if(e != c): print("No") exit() r = "" for i in range(((len(s)+3)//2)-1,len(s),1): r += s[i] y = r[::-1] if(r != y): print("No") exit() print("Yes") """ print(s,t) print...
[["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
155
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; //#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define rep(i, a, b) for (ll i = a; i < b; i++) #...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef long double ld; //#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define rep(i, a, b) for (ll i = a; i < b; i++) #...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
442
# class Solution: # def solve(self, a, b, c, s): # return str(a + b + c) + " " + s def main(): inp = lambda: [int(x) for x in input().split()] s = input() n = (len(s)) // 2 is_paliny = lambda a: a == a[::-1] ans = "YES" if is_paliny(s) and is_paliny(s[:n]) else "NO" print(ans) if...
# class Solution: # def solve(self, a, b, c, s): # return str(a + b + c) + " " + s def main(): inp = lambda: [int(x) for x in input().split()] s = input() n = (len(s)) // 2 is_paliny = lambda a: a == a[::-1] ans = "Yes" if is_paliny(s) and is_paliny(s[:n]) else "No" print(ans) if...
[["-", 0, 1, 0, 662, 12, 41, 0, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 41, 0, 557, 0, 6]]
5
94
S = input() N = len(S) ng = False for i in range(N):#First if S[i] != S[-i]: ng = True for i in range(N//2):#Second if S[i] != S[ N // 2 - i - 1]: ng = True print('No') if ng else print('Yes')
S = input() N = len(S) ng = False for i in range(N):#First if S[i] != S[-i-1]: ng = True for i in range(N//2):#Second if S[i] != S[ N // 2 - i - 1]: ng = True print('No') if ng else print('Yes')
[["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 33], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 612]]
5
84
S=input() N=len(S) def chk(s): n=len(s) for i in range(n//2): if s[i]!=s[n-1-i]: return False if chk(S) and chk(S[:((N-1)//2)+1]) and chk(S[(N+3)//2:]): print('Yes') else: print('No')
S=input() N=len(S) def chk(s): n=len(s) for i in range(n//2): if s[i]!=s[n-1-i]: return False return True if chk(S) and chk(S[:((N-1)//2)]) and chk(S[(N+3)//2-1:]): print('Yes') else: print('No')
[["+", 0, 656, 0, 14, 8, 196, 0, 37, 0, 38], ["+", 0, 656, 0, 14, 8, 196, 0, 37, 0, 146], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
104
// Code taken from geeksforgeeks #include <bits/stdc++.h> using namespace std; typedef long long ll; // int fact(int n); // int nCr(int n, int r) // { // return fact(n) / (fact(r) * fact(n - r)); // } // // Returns factorial of n // int fact(int n) // { // int res = 1; // for (int i = 2; i <= n; i++) // ...
// Code taken from geeksforgeeks #include <bits/stdc++.h> using namespace std; typedef long long ll; // int fact(int n); // int nCr(int n, int r) // { // return fact(n) / (fact(r) * fact(n - r)); // } // // Returns factorial of n // int fact(int n) // { // int res = 1; // for (int i = 2; i <= n; 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
220
/* Abu Jafor Mohammad Saleh ios_base :: sync_with_stdio(false); cin.tie(NULL); */ #include <algorithm> #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #inc...
/* Abu Jafor Mohammad Saleh ios_base :: sync_with_stdio(false); cin.tie(NULL); */ #include <algorithm> #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #inc...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
367
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long int i = 0; i < (n); ++i) typedef long long int ll; int main() { string s; cin >> s; for (int i = 0; i < s.size() / 2; i++) { if (s[i] != s[(int)s.size() - i - 1]) { cout << "No1" << endl; return 0; } } for (...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long int i = 0; i < (n); ++i) typedef long long int ll; int main() { string s; cin >> s; for (int i = 0; i < s.size() / 2; i++) { if (s[i] != s[(int)s.size() - i - 1]) { cout << "No" << endl; return 0; } } for (i...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
208
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (b < a) { a = b; return 1; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (b < a) { a = b; return 1; ...
[["+", 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
248
#include <bits/stdc++.h> using namespace std; int main() { char a[1000]; int i, j, n = 0, f = 0, t = 0; scanf("%s", a); while (a[n] != '\0') n++; for (i = 0; i < n; i++) f += (a[i] == a[n - 1 - i]); for (i = 0; i < (n - 3) / 2; i++) t += (a[i] == a[((n - 3) / 2) - i]); if ((f == n) && (t ==...
#include <bits/stdc++.h> using namespace std; int main() { char a[1000] = {}; int i, j, n = 0, f = 0, t = 0; scanf("%s", a); while (a[n] != '\0') n++; for (i = 0; i < n; i++) f += (a[i] == a[n - 1 - i]); for (i = 0; i < (n - 1) / 2; i++) t += (a[i] == a[((n - 3) / 2) - i]); if ((f == n) && ...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46], ["-", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 15, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
172
#include <bits/stdc++.h> using namespace std; string s; bool isP(string st) { int l = 0; int r = st.size() - 1; while (l < r) { if (st[l] == st[r]) { l++; r--; } else { return false; } } return true; } int main() { cin >> s; if (s.size() % 2 == 0) { cout << "No" << endl; ...
#include <bits/stdc++.h> using namespace std; string s; bool isP(string st) { // cout << st << endl; int l = 0; int r = st.size() - 1; while (l < r) { if (st[l] == st[r]) { l++; r--; } else { return false; } } return true; } int main() { cin >> s; if (s.size() % 2 == 0) { ...
[["+", 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
171
def isPalindrome(s): for i in range(len(s) // 2): if s[i] != s[len(s) - i - 1]: return False return True s = input() N = len(s) print("Yes" if isPalindrome(s[:(N - 1) // 2]) and isPalindrome(s[(N + 3) // 2 - 1:]) else "No")
def isPalindrome(s): for i in range(len(s) // 2): if s[i] != s[len(s) - i - 1]: return False return True s = input() N = len(s) print("Yes" if isPalindrome(s) and isPalindrome(s[:(N - 1) // 2]) and isPalindrome(s[(N + 3) // 2 - 1:]) 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
94
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; int a, b, n; string t; char s[100100], u[100100], v[100100]; int check(char a[100100], int n) { int i = 1; int j = n; while (i <= j) { if (a[j] != a[i]) { return 1; } i++; ...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string.h> using namespace std; int a, b, n; string t; char s[100100], u[100100], v[100100]; int check(char a[100100], int n) { int i = 1; int j = n; while (i <= j) { if (a[j] != a[i]) { return 1; } i++; ...
[["-", 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
257
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define re register #define pb push_back #define fi first #define se second #define mp make_pair const int N = 2e6 + 10; const int mod1 = 998244353; const int mod2 = 19260811; void read(int &a) { a = 0; int d = 1; ch...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define re register #define pb push_back #define fi first #define se second #define mp make_pair const int N = 2e6 + 10; const int mod1 = 998244353; const int mod2 = 19260811; void read(int &a) { a = 0; int d = 1; ch...
[["+", 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
339
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool f = true; int m = s.size(); int n = (m - 1) / 2; for (int i = 0; i < m; i++) { if (s[i] != s[m - i - 1]) f = false; } for (int i = 0; i < n; i++) { if (s[i] != s[m - i - 1]) f = false; } if (f == ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; bool f = true; int m = s.size(); int n = (m - 1) / 2; for (int i = 0; i < m; i++) { if (s[i] != s[m - i - 1]) f = false; } for (int i = 0; i < n; i++) { if (s[i] != s[n - i - 1]) f = false; } if (f == ...
[["-", 12, 69, 341, 342, 0, 16, 31, 16, 31, 22], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 31, 22]]
1
142
s = input() p = len(s) - 1 // 2 t = s[:p] u = s[p+1:] res = s == s[::-1] and t == t[::-1] and u == u[::-1] print("Yes" if res else "No")
s = input() p = (len(s) - 1) // 2 t = s[:p] u = s[p+1:] res = s == s[::-1] and t == t[::-1] and u == u[::-1] print("Yes" if res else "No")
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
74
#pragma GCC optimize("O3") #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; using base = complex<double>; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M 1000000007 #define M2 998244353 #define ll long long #define pll pair...
#pragma GCC optimize("O3") #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; using base = complex<double>; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define M 1000000007 #define M2 998244353 #define ll long long #define pll pair...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
897
#include <bits/stdc++.h> #define se second #define fi first using namespace std; const int maxn = 1e3 + 4, mod = 1e9 + 7; typedef pair<int, int> ii; typedef pair<long long, long long> ll; vector<int> ans; void _accepted_by_one_hit_() { #ifdef NTMA freopen("abc.inp", "r", stdin); freopen("abc.out", "w", stdout); #e...
#include <bits/stdc++.h> #define se second #define fi first using namespace std; const int maxn = 1e3 + 4, mod = 1e9 + 7; typedef pair<int, int> ii; typedef pair<long long, long long> ll; vector<int> ans; void _accepted_by_one_hit_() { #ifdef NTMA freopen("abc.inp", "r", stdin); freopen("abc.out", "w", stdout); #e...
[["-", 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
283
#include <bits/stdc++.h> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #define endl "\n" #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector<vi> #define pii pair<int, int> #define pll pair<long long, long long> #define mod 1000000007 #de...
#include <bits/stdc++.h> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #define endl "\n" #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector<vi> #define pii pair<int, int> #define pll pair<long long, long long> #define mod 1000000007 #de...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
240