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>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << ((n * (n + 1)) / 2 + (m * (m + 1)) / 2) << endl;
} | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << ((n * (n - 1)) / 2 + (m * (m - 1)) / 2) << endl;
} | [["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33]] | 1 | 53 |
A=input()
L=A.split()
N=int(L[0])
M=int(L[1])
x=1
for n in range(1,N+1):
x*=n
x /= 2
y=1
for m in range(1,M+1):
y*=m
y /= 2
print(int(x+y)) | A=input()
L=A.split()
N=int(L[0])
M=int(L[1])
x=1
for n in range(N-1,N+1):
x*=n
x /= 2
y=1
for m in range(M-1,M+1):
y*=m
y /= 2
print(int(x+y)) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33]] | 5 | 81 |
#include <iostream>
using namespace std;
int main() {
long long int N, M;
cin >> N >> M;
cout << (N * ((N - 1) / 2)) + (M * ((M - 1) / 2)) << "\n";
return 0;
} | #include <iostream>
using namespace std;
int main() {
long long int N, M;
cin >> N >> M;
cout << (N * (N - 1) / 2) + (M * (M - 1) / 2) << "\n";
return 0;
} | [["-", 0, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["-", 12, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["-", 12, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 62 |
a,b=int(input().split())
print((a*(a-1))//2+(b*(b-1))//2) | a,b=list(map(int, input().split()))
print((a*(a-1))//2+(b*(b-1))//2) | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 40 |
#include <cstdio>
using namespace std;
int main() {
int n, m, result;
scanf("%d %d", &n, &m);
result = n * (n - 1) + m * (m - 1);
printf("%d", result);
return 0;
} |
#include <cstdio>
using namespace std;
int main() {
int n, m, result;
scanf("%d %d", &n, &m);
result = (n * (n - 1) + m * (m - 1)) / 2;
printf("%d", result);
return 0;
}
| [["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 62 |
n,m = gets.split(/ /).map(&:to_i)
puts (n + m) * (n + m - 1) - n * m | n,m = gets.split(/ /).map(&:to_i)
puts ((n + m) * (n + m - 1) / 2) - n * m | [["+", 31, 739, 0, 738, 31, 738, 31, 739, 0, 24], ["+", 31, 739, 0, 738, 31, 738, 12, 739, 0, 25], ["+", 3, 4, 0, 738, 31, 739, 0, 738, 17, 85], ["+", 3, 4, 0, 738, 31, 739, 0, 738, 12, 612]] | 4 | 36 |
#define _USE_MATH_DEFINES
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N, M;
cin >> N >> M;
int outN = 0;
if (N == 1 || N == 0)
outN = 0;
else
outN = N * ... | #define _USE_MATH_DEFINES
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N, M;
cin >> N >> M;
int outN = 0;
if (N == 1 || N == 0)
outN = 0;
else
outN = N * ... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22]] | 1 | 119 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
int N, M;
cin >> N >> M;
cout << (N * N + N + M * M + M) / 2 << "\n";
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(0);
int N, M;
cin >> N >> M;
cout << (N * N - N + M * M - M) / 2 << "\n";
} | [["-", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 33], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33]] | 1 | 57 |
#include <bits/stdc++.h>
using namespace std;
void fact(int n, int m) {
if (n == 0) {
cout << (m * (m - 1)) / 2;
} else if (m == 0) {
cout << (n * (n - 1)) / 2;
} else {
cout << (m * (m - 1)) / 2 + (n * (n - 1)) / 2;
}
}
int main() {
int m, n;
cin >> m >> n;
if (m == 1 || n == 1)
cout << ... | #include <bits/stdc++.h>
using namespace std;
void fact(int n, int m) {
if (n == 0) {
cout << (m * (m - 1)) / 2;
} else if (m == 0) {
cout << (n * (n - 1)) / 2;
} else {
cout << (m * (m - 1)) / 2 + (n * (n - 1)) / 2;
}
}
int main() {
int m, n;
cin >> n >> m;
if (m == 1 && n == 1)
cout << ... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]] | 1 | 132 |
#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) ... | [["+", 0, 1, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 12, 13]] | 1 | 217 |
a,=b=map(int,input().split())
print(a*(a-1)/2+b*(b-1)/2) | a,b=map(int,input().split())
print (a*(a-1)//2+b*(b-1)//2)
| [["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["-", 0, 652, 3, 4, 0, 657, 12, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676]] | 5 | 39 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c;
c = (a + b) * (a + b - 1);
d = c - a * b;
cout << d << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c;
c = (a + b) * (a + b - 1) / 2;
d = c - a * b;
cout << d << endl;
} | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 59 |
#include <stdio.h>
//#define scanf scanf_s
int main() {
int n, m, s, sum = 1, i;
scanf("%d %d", &n, &m);
s = n + m;
for (i = 1; i <= s; i++)
sum *= i;
sum /= 2;
printf("%d", sum - n * m);
} | #include <stdio.h>
//#define scanf scanf_s
int main() {
int n, m, s, sum = 1, i;
scanf("%d %d", &n, &m);
s = n + m;
for (i = s - 1; i <= s; i++)
sum *= i;
sum /= 2;
printf("%d", sum - n * m);
} | [["+", 8, 9, 0, 7, 10, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 17, 33]] | 0 | 75 |
N,M=map(int, input().split())
if M == 1 or M==0:
answer = N * (N-1)
elif N == 1 or N==0:
answer = M * (M-1)
else:
answer = (N * (N-1))//2 + (M * (M-1))//2
print(answer)
| N,M=map(int, input().split())
if M == 1 or M==0:
answer = N * (N-1)//2
elif N == 1 or N==0:
answer = M * (M-1)//2
else:
answer = (N * (N-1))//2 + (M * (M-1))//2
print(answer) | [["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 676], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 83 |
#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << ((n * (n + 1)) / 2) + ((m * (m + 1)) / 2);
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << ((n * (n - 1)) / 2) + ((m * (m - 1)) / 2);
return 0;
} | [["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33]] | 1 | 56 |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> m >> m;
int ans = m * (m - 1) / 2 + n * (n - 1) / 2;
cout << ans << endl;
return 0;
}
| #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> m >> n;
int ans = m * (m - 1) / 2 + n * (n - 1) / 2;
cout << ans << endl;
return 0;
}
| [["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 59 |
n,m = (int(x) for x in input('').split(''))
sum = (n * (n - 1) / 2) + (m * (m - 1) / 2)
print(sum) | n,m=(int(x) for x in input().split())
sum=int((n*(n-1)/2)+(m*(m-1)/2))
print(sum)
| [["-", 63, 319, 500, 652, 3, 4, 0, 557, 0, 654], ["-", 63, 319, 500, 652, 3, 4, 0, 557, 0, 655], ["-", 0, 659, 12, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 659, 12, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, ... | 5 | 53 |
import math
n, m = map(int, input().split())
ans = n*(n-1)//2 + m(m-1)//2
print(ans)
| import math
n, m = map(int, input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)
| [["+", 0, 662, 12, 657, 12, 657, 31, 657, 17, 48]] | 5 | 42 |
if __name__ == '__main__':
n , m = map(int, input().split())
print(((n * n - 1) / 2 )+ ((m * m - 1)/2)) | if __name__ == '__main__':
n , m = map(int, input().split())
print( ((n * (n - 1)) // 2 ) + ((m * (m - 1))//2))
| [["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 24], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 85], ["+", 0, 657, 31, 23, 0, 657, 31, 23, 0, 25], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 676], ["-", 3, 4, 0, 657, 12, 23, 0, 657, 17, 85], ["+", 0, 657, 12, 23, 0, 657, 31, 23, 0, 25], ["+", 3, 4, 0, 657, 12, 23, 0, 657, 17, 676]] | 5 | 49 |
from sys import stdin,setrecursionlimit
n,m = map(int,stdin.readline().rstrip().split())
print(n*(n-1)+m*(m-1)) | from sys import stdin,setrecursionlimit
n,m = map(int,stdin.readline().rstrip().split())
print(n*(n-1)//2+m*(m-1)//2) | [["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 676], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 12, 612]] | 5 | 46 |
#include <iostream>
using namespace std;
int main() {
int N, M;
int Nnum, Mnum;
cin >> N >> M;
Nnum = (N * N - 1) / 2;
Mnum = (M * M - 1) / 2;
cout << Nnum + Mnum << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int N, M;
int Nnum, Mnum;
cin >> N >> M;
Nnum = N * (N - 1) / 2;
Mnum = M * (M - 1) / 2;
cout << Nnum + Mnum << endl;
return 0;
} | [["-", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24]] | 1 | 63 |
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
return (n * (n - 1)) / 2 + (m * (m - 1)) / 2;
} | #include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << (n * (n - 1)) / 2 + (m * (m - 1)) / 2;
return 0;
} | [["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13]] | 1 | 50 |
#include <bits/stdc++.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>,
rb_tree_tag,tree_order_statistics_node_upd>
//order_of_key (... | #include <bits/stdc++.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>,
rb_tree_tag,tree_order_statistics_node_upd>
//order_of_key (... | [["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 156 |
n, m = map(lambda i: int(i), input().split())
if n == 1 and m ==1:
print(0)
print(int(n*(n-1)/2 + m*(m-1)/2)) | n, m = map(lambda i: int(i), input().split())
if n == 1 and m ==1:
print(0)
else:
print(int(n*(n-1)/2 + m*(m-1)/2)) | [["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int ans;
ans = N * (N - 1) / 2;
ans += M * (M + 1) / 2;
cout << ans;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int ans;
ans = N * (N - 1) / 2;
ans += M * (M - 1) / 2;
cout << ans;
} | [["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 54 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
int n, m;
int sum = 1;
cin >> n >> m;
sum = ((n * n - 1) + (m * m - 1)) / 2;
cout << sum << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
int n, m;
int sum = 1;
cin >> n >> m;
sum = ((n * (n - 1)) / 2 + (m * (m - 1)) / 2);
cout << sum << endl;
return 0;
} | [["+", 31, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 11, 12, 23, 0, 16, 31, 16, 17, 85], ["+", 0, 11, 12, 23, 0, 16, 31, 16, 12, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]] | 1 | 67 |
#include <stdio.h>
int main(void) {
int n, m;
scanf("%d%d", &n, &m);
printf("%d", n * (n - 1) + m * (m - 1));
return 0;
}
| #include <stdio.h>
int main(void) {
int n, m;
scanf("%d%d", &n, &m);
printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
return 0;
} | [["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 85], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 17, 85], ["+", 0, 2, 3, 4, 0, 16, 12, 16, 12, 13]] | 0 | 53 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
cout << N * (N - 1) / 2 + M * (M - 1) << endl;
return (0);
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl;
return (0);
}
| [["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 12, 13]] | 1 | 50 |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define iFOR(idx, from, upto) for (int idx = from; idx < upto; ++idx)
#define lFOR(idx, from, upto) for (long idx = from; idx < upto; ++idx)
#define ll long long
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int retval ... | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define iFOR(idx, from, upto) for (int idx = from; idx < upto; ++idx)
#define lFOR(idx, from, upto) for (long idx = from; idx < upto; ++idx)
#define ll long long
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int retval ... | [["-", 49, 50, 51, 16, 12, 23, 0, 16, 17, 72], ["+", 51, 16, 12, 23, 0, 16, 31, 16, 17, 48]] | 1 | 89 |
#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() {
int n, m;
cin >> n >> m;
cout << n * (n - 1) + m * (m - 1) << endl;
return 0;
}
| #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() {
int n, m;
cin >> n >> m;
cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;
return 0;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 12, 13]] | 1 | 70 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
int c = 0;
int d = 0;
cin >> a >> b;
c = a * (a - 1);
d = b * (b - 1);
cout << c + d << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
int c = 0;
int d = 0;
cin >> a >> b;
c = a * (a - 1) / 2;
d = b * (b - 1) / 2;
cout << c + d << endl;
} | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 61 |
const main =
(inputs) => {
var array = inputs[0].split(" ");
var A = Number(array[0]);
var B = Number(array[1]);
var countA = 1;
var countB = 1;
if (A === 1 && B === 1) {
console.log(0);
} else {
for (var i = A; i >= A - 1; i--) {
countA = countA ... | const main =
(inputs) => {
var array = inputs[0].split(" ");
var A = Number(array[0]);
var B = Number(array[1]);
var countA = 1;
var countB = 1;
if (A === 1 && B === 1) {
console.log(0);
} else {
for (var i = A; i >= A - 1; i--) {
countA = countA ... | [["-", 8, 556, 0, 57, 75, 76, 0, 556, 0, 46], ["+", 8, 556, 0, 57, 75, 76, 0, 556, 0, 46]] | 2 | 179 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end());
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
cout << n * (n - 1)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i < n + 1; i++)
#define sort(A) sort(A.begin(), A.end())
#define reverse(A) reverse(A.begin(), A.end());
typedef long long ll;
int main() {
int n, m;
cin >> n >> m;
cout << n * (n - 1)... | [["-", 0, 16, 31, 16, 12, 16, 12, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 85]] | 1 | 80 |
#include <bits/stdc++.h>
#define rint register int
using namespace std;
int n, m;
int main() {
scanf("%d", &n, &m);
printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
return 0;
} | #include <bits/stdc++.h>
#define rint register int
using namespace std;
int n, m;
int main() {
scanf("%d%d", &n, &m);
printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
return 0;
} | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 63 |
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int n, m;
// string s;
cin >> n >> m;
// cin >> s;
cout << (n * (n - 1)) + (m * (m - 1)) << endl;
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main(void) {
int n, m;
// string s;
cin >> n >> m;
// cin >> s;
cout << (n * (n - 1) / 2) + (m * (m - 1) / 2) << endl;
return 0;
} | [["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 85], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 85], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 12, 13]] | 1 | 55 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N, M;
cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
cout << N * (N - 1) / 2 + M * (M - 1) / 2 << endl;
}
| [["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]] | 1 | 47 |
N,M = map(int,input().split())
if (N == 0 or N == 1) and (M == 0 or M == 1):
print(0)
if (N == 0 or N == 1) and M != 0 and M != 1:
print(M*(M-1)//2)
if N != 0 and N != 1 and (M == 0 or M == 1):
print(N*(N-1)//2)
else:
print(N*(N-1)//2 + M*(M-1)//2) | N,M = map(int,input().split())
if (N == 0 or N == 1) and (M == 0 or M == 1):
print(0)
elif (N == 0 or N == 1) and M != 0 and M != 1:
print(M*(M-1)//2)
elif N != 0 and N != 1 and (M == 0 or M == 1):
print(N*(N-1)//2)
else:
print(N*(N-1)//2 + M*(M-1)//2) | [["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]] | 5 | 127 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N;
cin >> M;
int n = N * (N - 1) / 2;
int m = M * (M - 1);
int ans = n + m;
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N;
cin >> M;
int n = N * (N - 1) / 2;
int m = M * (M - 1) / 2;
int ans = n + m;
cout << ans << endl;
} | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 62 |
def solve():
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
print(0)
return
if a == 0:
ans = b * (b - 1) // 2
print(ans)
if b == 0:
ans = a * (a - 1) // 2
print(ans)
ans = a * (a - 1) // 2
ans += b * (b - 1) // 2
p... | def solve():
a, b = list(map(int, input().split()))
if a == 0 and b == 0:
print(0)
return
if a == 0:
ans = b * (b - 1) // 2
print(ans)
return
if b == 0:
ans = a * (a - 1) // 2
print(ans)
return
ans = a * (a - 1) // 2
... | [["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]] | 5 | 115 |
#include <bits/stdc++.h>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int a, b, c = 0, d = 0;
cin >> a >> b;
cout << (a + a - 1) / 2 + (b + b - 1) / 2;
} | #include <bits/stdc++.h>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int a, b, c = 0, d = 0;
cin >> a >> b;
cout << a * (a - 1) / 2 + b * (b - 1) / 2;
} | [["-", 0, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["-", 31, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 12, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["-", 0, 16, 12, 16, 12, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 12, 16, 12, 16, 31, 16, 17, 48],... | 1 | 63 |
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | [["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 240 |
#include <bits/stdc++.h>
using namespace std;
int c = 0, a, b;
int main() {
cin >> a >> b;
c += a * (a - 1);
c += b * (b - 1);
cout << c << endl;
} | #include <bits/stdc++.h>
using namespace std;
int c = 0, a, b;
int main() {
cin >> a >> b;
c += a * (a - 1);
c += b * (b - 1);
cout << c / 2 << endl;
} | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 53 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
int main() {
ll n, m;
cin >> n >> m;
cout << n * (n - 1) / 2 + m * (m + 1) / 2 << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
int main() {
ll n, m;
cin >> n >> m;
cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;
}
| [["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 93 |
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << ((a * (a + 1) + b * (b + 1)) >> 1) << endl;
} | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a * (a - 1) + b * (b - 1) >> 1) << endl;
} | [["-", 31, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 33], ["-", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25]] | 1 | 49 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | [["+", 51, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 64 |
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define fi first
#define se second
#define pii pair<int, ... | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define fi first
#define se second
#define pii pair<int, ... | [["-", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13]] | 1 | 203 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, ans;
cin >> N >> M;
ans = N * (N - 1) + M * (M - 1);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M, ans;
cin >> N >> M;
ans = N * (N - 1) + M * (M - 1);
cout << ans / 2 << endl;
}
| [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 49 |
// 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)
#... | [["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33]] | 1 | 120 |
#include <bits/stdc++.h>
#define db(x) cout << x << " "
#define db1(x) cout << x << '\n'
#define db2(x, y) cout << x << " " << y << '\n'
#define db3(x, y, z) cout << x << " " << y << " " << z << '\n'
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, ... | #include <bits/stdc++.h>
#define db(x) cout << x << " "
#define db1(x) cout << x << '\n'
#define db2(x, y) cout << x << " " << y << '\n'
#define db3(x, y, z) cout << x << " " << y << " " << z << '\n'
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, ... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 340 |
N, M = map(int, input().split())
ans = N * (N + 1) / 2 + M * (M + 1) / 2
print(int(ans)) | N, M = map(int, input().split())
ans = N * (N - 1) / 2 + M * (M - 1) / 2
print(int(ans)) | [["-", 31, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 31, 657, 31, 657, 12, 23, 0, 657, 17, 33], ["-", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 33]] | 5 | 44 |
#include <algorithm>
#include <iostream>
#include <string>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << n * (n - 1) + m * (m - 1);
} | #include <algorithm>
#include <iostream>
#include <string>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << (n * (n - 1) + m * (m - 1)) / 2;
}
| [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]] | 1 | 55 |
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
print(N*(N-1) + M*(M-1)) | import sys
input = sys.stdin.readline
N, M = map(int, input().split())
print((N*(N-1) + M*(M-1))//2) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 43 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
scanf("%d %d", n, m);
printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
scanf("%d %d", &n, &m);
printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
return 0;
} | [["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]] | 1 | 58 |
#include <bits/stdc++.h>
using namespace std;
// Competetive Template:
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
// Debugging :
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cer... | #include <bits/stdc++.h>
using namespace std;
// Competetive Template:
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
// Debugging :
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cer... | [["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 692 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;... | [["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 283 |
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | [["-", 31, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 177 |
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.14159265;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i)
#define RFOR(i, n, r) for (ll i = (ll)(n - 1); i >= r; --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) R... | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.14159265;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); ++i)
#define RFOR(i, n, r) for (ll i = (ll)(n - 1); i >= r; --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) R... | [["+", 0, 16, 12, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 17, 85], ["+", 0, 1, 0, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 12, 16, 12, 16, 31, 23, 0, 24], ["-", 0, 9, 0, 1, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 12, 16, 12, 13]] | 1 | 280 |
N, M = map(int, input().split())
ans = N*(N-1)/2 + M(M-1)/2
print(ans) | N, M = map(int, input().split())
ans = N*(N-1)/2 + M*(M-1)/2
print(int(ans)) | [["+", 0, 662, 12, 657, 12, 657, 31, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 40 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, ans;
cin >> n >> m;
ans = n * (n - 1) / 2 + m * (m - 1) * 2;
cout << ans;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, ans;
cin >> n >> m;
ans = n * (n - 1) / 2 + m * (m - 1) / 2;
cout << ans;
} | [["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85]] | 1 | 51 |
even, odd = gets.split.map(&:to_i)
puts (even*(even-1)) / 2 + odd(*(odd-1)) / 2 | even, odd = gets.split.map(&:to_i)
puts (even*(even-1) / 2) + (odd*(odd-1) / 2) | [["-", 3, 4, 0, 738, 31, 738, 31, 739, 0, 25], ["+", 0, 652, 3, 4, 0, 738, 31, 739, 0, 25], ["-", 3, 4, 0, 738, 12, 738, 31, 652, 735, 22], ["+", 0, 738, 12, 739, 0, 738, 31, 738, 31, 22], ["-", 31, 652, 3, 4, 0, 741, 0, 739, 0, 25], ["+", 0, 652, 3, 4, 0, 738, 12, 739, 0, 25]] | 4 | 37 |
n, m =map(int,input().split())
ans=n*(n-1)+m*(m-1)
print(ans) | n, m =map(int,input().split())
ans=n*(n-1)//2+m*(m-1)//2
print(ans) | [["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 676], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 612]] | 5 | 37 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool kaibun(string S) {
string T = S;
for (ll i = 0; i < S.size(); i++) {
T.at(i) = S.at(S.size() - 1 - i);
}
if (S == T) {
return true;
} else {
return false;
}
}
int main() {
string S;
cin >> S;
ll N = S.size();
stri... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool kaibun(string S) {
string T = S;
for (ll i = 0; i < S.size(); i++) {
T.at(i) = S.at(S.size() - 1 - i);
}
if (S == T) {
return true;
} else {
return false;
}
}
int main() {
string S;
cin >> S;
ll N = S.size();
stri... | [["+", 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 | 216 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()
int main() {
string S;
cin >> S;
string x = S;
reverse(all(x));
if (x != S) {
cout << "No" << endl;
return 0;
}
ll N = S.size();
for (ll i = 0; i < N / 2; i++) {
if (S[i] != S[N - 1 - i]) {... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()
int main() {
string S;
cin >> S;
string x = S;
reverse(all(x));
if (x != S) {
cout << "No" << endl;
return 0;
}
ll N = S.size() / 2;
for (ll i = 0; i < N / 2; i++) {
if (S[i] != S[N - 1 - i... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 127 |
w = input()
l = len(w)
flag = True
for i in range((l - 1)/2):
if w[i] != w[l - i - 1]:
flag = False
break
mid = (l - 1)/2
mid_mid = mid // 2
for i in range(mid_mid + 1):
if w[i] != w[mid - i - 1] or not flag:
flag = False
break
if w[i + mid + 1] != w[l - i - 1]:
flag = False
break
if flag:... | w = input()
l = len(w)
flag = True
for i in range((l - 1)//2):
if w[i] != w[l - i - 1]:
flag = False
break
mid = (l - 1) // 2
mid_mid = mid // 2
for i in range(mid_mid + 1):
if w[i] != w[mid - i - 1] or not flag:
flag = False
break
if w[i + mid + 1] != w[l - i - 1]:
flag = False
break
if f... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 676], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676]] | 5 | 133 |
S=input()
N=len(S)
SH=S[:(N-1)//2]
ST=S[(N+3)//2-1:]
p=False
if SH==SH[::-1] and ST==ST[::-1]:
p=True
print("Yes" if p else "No") | S=input()
N=len(S)
SH=S[:(N-1)//2]
ST=S[(N+3)//2-1:]
p=False
if SH==SH[::-1] and SH==ST:
p=True
print("Yes" if p else "No") | [["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["-", 0, 57, 15, 679, 12, 666, 0, 206, 0, 70], ["-", 15, 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], ["-", 0, 57, 15, 679, 12, ... | 5 | 78 |
s = input()
print("Yes" if s == s[::-1] and s[:len(s)//2] == s[len(s)//2::-1] else "No") | s = input()
print("Yes" if s == s[::-1] and s[:len(s)//2] == s[len(s)//2-1::-1] else "No") | [["+", 12, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 12, 666, 0, 206, 206, 663, 0, 657, 12, 612]] | 5 | 50 |
def is_p(s):
return s == s[::-1]
s = input()
n = len(s)
l, r = (n - 1)//2, l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No') | def is_p(s):
return s == s[::-1]
s = input()
n = len(s)
l = (n - 1)//2
r = l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No') | [["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 432, 0, 21], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32]] | 5 | 75 |
a=int(input())
c=len(a)
b=a[:(c-1)//2]
d=a[(c+3)//2:]
if a==a[::-1] and b==b[::-1] and d==d[::-1]:
print("Yes")
else:
print("No") | a=input()
c=len(a)
b=a[:(c-1)//2]
d=a[(c+3)//2-1:]
if a==a[::-1] and b==b[::-1] and d==d[::-1]:
print("Yes")
else:
print("No") | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]] | 5 | 85 |
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String inputS = sc.next();
ArrayList<String> slist = new ArrayList<>();
ArrayList<String> first = new ArrayList<>();
ArrayList<String> second = ... | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String inputS = sc.next();
ArrayList<String> slist = new ArrayList<>();
ArrayList<String> first = new ArrayList<>();
ArrayList<String> second = ... | [["+", 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 | 333 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int c = 1;
int b = a.size();
for (int i = 0; i < b; i++) {
if (a.at(i) != a.at(b - i))
c = 0;
}
for (int i = 0; i < (b - 1) / 2; i++) {
if (a.at(i) != a.at((b - 1) / 2 - i))
c = 0;
}
for (int i = (b + 3... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
int c = 1;
int b = a.size();
for (int i = 0; i < b; i++) {
if (a.at(i) != a.at(b - i - 1))
c = 0;
}
for (int i = 0; i < (b - 1) / 2; i++) {
if (a.at(i) != a.at((b - 1) / 2 - i - 1))
c = 0;
}
for (int i ... | [["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 188 |
from sys import stdin,stdout
import bisect
import math
def st():
return list(stdin.readline().strip())
def inp():
return int(stdin.readline())
def li():
return list(map(int,stdin.readline().split()))
def mp():
return map(int,stdin.readline().split())
def pr(n):
stdout.write(str(n)+"\n")
def... | from sys import stdin,stdout
import bisect
import math
def st():
return list(stdin.readline().strip())
def inp():
return int(stdin.readline())
def li():
return list(map(int,stdin.readline().split()))
def mp():
return map(int,stdin.readline().split())
def pr(n):
stdout.write(str(n)+"\n")
def... | [["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]] | 5 | 479 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
ll GCD(ll x, ll y) {
if (y == 0)
return x;
else
return GCD(y, x % y);
}
ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
const int MOD = 1000000007;
int main() {
string s;
cin >> s;
string r = s;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
ll GCD(ll x, ll y) {
if (y == 0)
return x;
else
return GCD(y, x % y);
}
ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
const int MOD = 1000000007;
int main() {
string s;
cin >> s;
string r = s;
... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 222 |
S=input()
T=S[:(len(S)-1)//2-1]
U=S[(len(S)+3)//2-1:]
if S==S[::-1]:
if T==T[::-1]:
if U==U[::-1]:
print('Yes')
else:print('No')
else:print('No')
else:print('No') | S=input()
T=S[:(len(S)-1)//2]
U=S[(len(S)+3)//2-1:]
if S==S[::-1]:
if T==T[::-1]:
if U==U[::-1]:
print('Yes')
else:print('No')
else:print('No')
else:print('No') | [["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]] | 5 | 104 |
S = input()
N = len(S)
def isp(s):
n = len(s)
for i in range(n // 2 - 1):
if s[i] != s[n - 1 - i]:
return False
return True
if isp(S) and isp(S[0:(N - 1) // 2]):
print("Yes")
else:
print("No") | S = input()
N = len(S)
def isp(s):
n = len(s)
for i in range(n // 2):
if s[i] != s[n - 1 - i]:
return False
return True
if isp(S) and isp(S[0:(N - 1) // 2]):
print("Yes")
else:
print("No") | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 90 |
s = input()
n = len(s)
t = s[:(n-1)//2]
u = s[(n+3)//2:]
if (s == s[::-1]
and t == t[::-1]
and u == u[::-1]):
print('Yes')
else:
print('No')
| s = input()
n = len(s)
t = s[:(n-1)//2]
u = s[(n+3)//2-1:]
if (s == s[::-1]
and t == t[::-1]
and u == u[::-1]):
print('Yes')
else:
print('No')
| [["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]] | 5 | 84 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
for (int i = 0; i < N / 2; i++)
if (S[i] != S[N - 1 - i]) {
cout << "No" << endl;
return 0;
}
for (int i = 0; i < N / 4; i++)
if (S[i] != S[N / 2 - 1 - i]) {
cout << "No" << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N = S.size();
for (int i = 0; i < N / 2; i++)
if (S[i] != S[N - 1 - i]) {
cout << "No" << endl;
return 0;
}
for (int i = 0; i < N / 4; i++)
if (S[i] != S[N / 2 - 1 - i]) {
cout << "No" << endl;
... | [["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 12, 69, 341, 342, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 7, 8, 57, 64, 9, 0, 37, 0, 13], ["+", 0, 7, 8, 57, 64, 9, 0, 37, 0, 35]] | 1 | 176 |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma region Macros
/***
* @author uesugi
* @file AtCoder用テンプレート
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
using vi = vector<int>;
using vvi = vector<vi>;
#define _OVERLOAD3(_1, _2, _3, name, ...) name
#define _... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma region Macros
/***
* @author uesugi
* @file AtCoder用テンプレート
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
using vi = vector<int>;
using vvi = vector<vi>;
#define _OVERLOAD3(_1, _2, _3, name, ...) name
#define _... | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 658 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool ok = true;
int size = S.size();
for (int i = 0; i < size; i++) {
if (S.at(i) != S.at(size - i - 1)) {
ok = false;
}
}
for (int i = 0; i < (size - 1) / 2; i++) {
if (S.at(i) != S.at((size - 1) / 2 - i - 1... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
bool ok = true;
int size = S.size();
for (int i = 0; i < size; i++) {
if (S.at(i) != S.at(size - i - 1)) {
ok = false;
}
}
for (int i = 0; i < (size - 1) / 2; i++) {
if (S.at(i) != S.at((size - 1) / 2 - i - 1... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 210 |
S=str(input())
N=len(S)
if S!=S[::-1]:#Sと反転したSが不一致
print('No')
else:
S1=S[0:(N-1)//2]#Sが1文字目~(N-1)/2番目の場合
S2=S[(N+3)//2:N]#Sが(N+3)/2~N番目の場合
if S1==S1[::-1] and S2==S2[::-1]:
print('Yes')
else:
print('No') | S=str(input())
N=len(S)
if S!=S[::-1]:#Sと反転したSが不一致
print('No')
else:
S1=S[0:(N-1)//2]#Sが1文字目~(N-1)/2番目の場合
S2=S[(N+1)//2:N]#Sが(N+3)/2~N番目の場合
if S1==S1[::-1] and S2==S2[::-1]:
print('Yes')
else:
print('No') | [["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]] | 5 | 99 |
def palindrome(S):
for i in range(len(S)//2):
# print(S[i],S[-(i+1)])
if S[i] != S[-(i+1)]:
return 0
return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+3)//2:]
if palindrome(S) == 1:
if palindrome(S1) == 1:
if palindrome(S2) == 1:
ans == "Yes"
print(ans) | def palindrome(S):
for i in range(len(S)//2):
# print(S[i],S[-(i+1)])
if S[i] != S[-(i+1)]:
return 0
return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+1)//2:]
#print(palindrome(S))
#print(palindrome(S1))
#print(palindrome(S2))
if palindrome(S) == 1:
if palindrome(S1) == 1:
if... | [["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["-", 0, 57, 64, 196, 0, 1, 0, 666, 667, 60], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32]] | 5 | 115 |
s = input()
t = s[::-1]
n = len(s)
a = s[:(N - 1) // 2]
b = t[:(n + 3) // 2]
if s == t and a == a[::-1] and b == b[::-1]:
print('Yes')
else:
print('No') | s = input()
t = s[::-1]
n = len(s)
a = s[:(n - 1) // 2]
b = t[:(n - 1) // 2]
if s == t and a == a[::-1] and b == b[::-1]:
print('Yes')
else:
print('No') | [["-", 206, 663, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 31, 22], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 17, 72], ["-", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 17, 33], ["+", 206, 663, 0, 657, 31, 23, 0, 657, 12, 612]] | 5 | 85 |
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(i... | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(i... | [["-", 0, 662, 12, 206, 206, 663, 0, 657, 31, 22], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 31, 22], ["-", 12, 206, 206, 663, 0, 657, 31, 657, 31, 22], ["+", 12, 206, 206, 663, 0, 657, 31, 657, 31, 22]] | 5 | 249 |
#include <bits/stdc++.h>
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
struct Vector {
double x, y;
};
template <class T> inline bool chmin(T &a, T b) {... | #include <bits/stdc++.h>
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
struct Vector {
double x, y;
};
template <class T> inline bool chmin(T &a, T b) {... | [["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 15, 339, 51, 16, 31, 16, 12, 2, 63, 22], ["+", 51, 16, 31, 16, 12, 2, 3, 4, 0, 24]] | 1 | 301 |
S = input()
N = len(S)
a = S[:N // 2]
b = S[N // 2 + 1:]
print('Yes' if a==a[::-1] and b==b[::-1] else 'No')
| S = input()
N = len(S)
a = S[:N // 2]
b = S[N // 2 + 1:]
print('Yes' if a == a[::-1] == b == b[::-1] else 'No')
| [["-", 0, 652, 3, 4, 0, 41, 0, 679, 17, 355], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 60]] | 5 | 61 |
#include <iostream>
#include <string>
using namespace std;
bool isp(string s) {
for (int i = 0, j = s.length() - 1; i < j; i++, j--)
if (s[i] != s[j])
return false;
return true;
}
int main() {
string s;
cin >> s;
bool p = isp(s);
bool q = isp(s.substr(s.length() / 2 - 1));
if (p && q)
cou... | #include <iostream>
#include <string>
using namespace std;
bool isp(string s) {
for (int i = 0, j = s.length() - 1; i < j; i++, j--)
if (s[i] != s[j])
return false;
return true;
}
int main() {
string s;
cin >> s;
bool p = isp(s);
bool q = isp(s.substr(s.length() / 2 + 1));
if (p && q)
cou... | [["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72]] | 1 | 129 |
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define int long long
struct ini... | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define int long long
struct ini... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]] | 1 | 266 |
#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string this_) {
string also = this_;
reverse(also.begin(), also.end());
return also == this_;
}
int main() {
string hello;
cin >> hello;
int n = hello.size();
string first = hello.substr(0, n / 2);
string second = hello.substr(n / 2 + 1, ... | #include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string this_) {
string also = this_;
reverse(also.begin(), also.end());
return also == this_;
}
int main() {
string hello;
cin >> hello;
int n = hello.size();
string first = hello.substr(0, n / 2);
string second = hello.substr(n / 2 + 1, ... | [["+", 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 | 124 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool ip(string s) {
int n = s.size(), l = 0, r = n - 1;
while (l <= r)
if (s[l++] != s[r--])
return false;
return true;
}
int main() {
string s;
cin >> s;
int n = s.size(), l = 0, r = n - 1;
if (ip(s) and ip(s.substr(0, (n - 1) /... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool ip(string s) {
int n = s.size(), l = 0, r = n - 1;
while (l <= r)
if (s[l++] != s[r--])
return false;
return true;
}
int main() {
string s;
cin >> s;
int n = s.size(), l = 0, r = n - 1;
if (ip(s) and ip(s.substr(0, (n - 1) /... | [["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]] | 1 | 148 |
#include <bits/stdc++.h>
using namespace std;
bool isP(string s) {
string k = s;
reverse(s.begin(), s.end());
if (k == s)
return true;
else
return false;
}
int main() {
string s, s1, s2;
cin >> s;
int n = s.size(), a, b;
a = (n - 1) / 2, b = (n + 3) / 2;
s1 = s.substr(0, a), s2 = s.substr(b... |
#include <bits/stdc++.h>
using namespace std;
bool isP(string s) {
string k = s;
reverse(s.begin(), s.end());
if (k == s)
return true;
else
return false;
}
int main() {
string s, s1, s2;
cin >> s;
int n = s.size(), a, b;
a = (n - 1) / 2, b = (n + 3) / 2;
s1 = s.substr(0, a), s2 = s.substr(... | [["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 158 |
S = input()
array = list(S)
N = len(array)
a = (N-2)//2
b = (N+2)//2
if array[0:a] == array[b:N-1]:
print('Yes')
else:
print('No') | S = input()
array = list(S)
N = len(array)
a = (N-2)//2
b = (N+2)//2
if array[0:a+1] == array[b:N]:
print('Yes')
else:
print('No') | [["+", 15, 666, 0, 206, 206, 663, 0, 657, 17, 72], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 12, 612], ["-", 15, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 15, 666, 0, 206, 206, 663, 0, 657, 12, 612]] | 5 | 66 |
def resolve():
s = input()
if s == s[::1]:
s_1 = s[:len(s)//2]
s_2 = s[(len(s)+1)//2:]
if (s_1 == s_1[::-1]) and (s_2 == s_2[::-1]):
print('Yes')
else:
print('No')
else:
print('No')
resolve() | def resolve():
s = input()
if s == s[::-1]:
s_1 = s[:len(s)//2]
s_2 = s[(len(s)+1)//2:]
if (s_1 == s_1[::-1]) and (s_2 == s_2[::-1]):
print('Yes')
else:
print('No')
else:
print('No')
resolve() | [["+", 15, 666, 0, 206, 206, 663, 0, 664, 17, 33]] | 5 | 98 |
S = input()
flag = 0
for i in range(0,len(S)//2):
if S[i] == S[-1-i]:
continue
else:
flag = 1
print("No")
break
if flag == 0:
S = S[:((len(S)-1)//2)]
print(S)
for i in range(0,len(S)//2):
if S[i] == S[-1-i]:
continue
else:
flag ... | S = input()
flag = 0
for i in range(0,len(S)//2):
if S[i] == S[-1-i]:
continue
else:
flag = 1
print("No")
break
if flag == 0:
S = S[:((len(S)-1)//2)]
for i in range(0,len(S)//2):
if S[i] == S[-1-i]:
continue
else:
flag = 1
... | [["-", 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 | 130 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
string t, u;
int main() {
string s;
cin >> s;
ll n = s.size();
string S = s, k;
bool ch = true;
reverse(S.begin(), S.end());
if (s != S) {
ch = false;
}
for (ll i = 0; i < (n - 1) / 2... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
string t, u;
int main() {
string s;
cin >> s;
ll n = s.size();
string S = s, k;
bool ch = true;
reverse(S.begin(), S.end());
if (s != S) {
ch = false;
}
// cout << ch<<endl;
for (ll... | [["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 237 |
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <vector>
#define vi vector<int>
#define tests \
int t; \
cin ... | #include <algorithm>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <vector>
#define vi vector<int>
#define tests \
int t; \
cin ... | [["+", 341, 342, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 341, 342, 0, 16, 31, 16, 31, 16, 17, 72]] | 1 | 516 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool e = true;
int a = s.size();
for (int i = 0; i < (a / 2); i++) {
if (s.at(i) != s.at(a - 1 - i)) {
e = false;
break;
}
}
int b = (a - 1) / 2;
for (int i = 0; i < (b / 2); i++) {
if (s.at(i) != s.a... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool e = true;
int a = s.size();
for (int i = 0; i < (a / 2); i++) {
if (s.at(i) != s.at(a - 1 - i)) {
e = false;
break;
}
}
int b = (a - 1) / 2;
for (int i = 0; i < (b / 2); i++) {
if (s.at(i) != s.a... | [["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 228 |
#include <algorithm>
#include <bit>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
using namespace std;
int main() {
string S;
cin >> S;
int... | #include <algorithm>
#include <bit>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
using namespace std;
int main() {
string S;
cin >> S;
int... | [["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["-", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25]] | 1 | 186 |
#include <bits/stdc++.h>
using namespace std;
bool pal(string s) {
string t = s;
reverse(t.begin(), t.end());
return s == t;
}
int main() {
string S;
cin >> S;
int N = S.size();
if (!pal(S))
return cout << "No"
<< "\n",
0;
string s = S.substr(0, (N - 1) / 2);
string t... | #include <bits/stdc++.h>
using namespace std;
bool pal(string s) {
string t = s;
reverse(t.begin(), t.end());
return s == t;
}
int main() {
string S;
cin >> S;
int N = S.size();
if (!pal(S))
return cout << "No"
<< "\n",
0;
string s = S.substr(0, N / 2);
string t = S.s... | [["-", 51, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 17, 33], ["-", 3, 4, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 51, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 144 |
kaibunkai = input()
n = len(kaibunkai)
zenhan = kaibunkai[:(n-1)//2]
kouhan = kaibunkai[(n+3)//2-1:]
print(zenhan,kouhan)
def kaibun_desuka(bun):
s = len(bun)
for x in range(s//2):
if bun[x] != bun[-x-1]:
return False
return True
if kaibun_desuka(kaibunkai) and kaibun_desuka(zenhan) and kaibun_desuka... | kaibunkai = input()
n = len(kaibunkai)
zenhan = kaibunkai[:(n-1)//2]
kouhan = kaibunkai[(n+3)//2-1:]
def kaibun_desuka(bun):
s = len(bun)
for x in range(s//2):
if bun[x] != bun[-x-1]:
return False
return True
if kaibun_desuka(kaibunkai) and kaibun_desuka(zenhan) and kaibun_desuka(kouhan):
print("Ye... | [["-", 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 | 115 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;
int main() {
string s;
cin >> s;
bool ok = true;
int n = s.size();
n /= 2;
REP(i, n) {
if (s[i] != s[n - i - ... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;
int main() {
string s;
cin >> s;
bool ok = true;
int n = s.size();
REP(i, n) {
if (s[i] != s[n - i - 1])
... | [["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 90], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 147 |
import math
s = list(input())
n = len(s)
s1 = s[ : n-1 // 2]
s2 = s[n+3 // 2 - 1 : n]
flag = 1
for i in range(len(s) // 2):
if s[i] != s[- i - 1]:
flag = 0
for i in range(len(s1) // 2):
if s1[i] != s1[- i - 1]:
flag = 0
for i in range(len(s2) // 2):
if s2[i] != s2[- i - 1]:
flag =... | import math
s = list(input())
n = len(s)
s1 = s[ : (n-1) // 2]
s2 = s[(n+3) // 2 - 1 : n]
flag = 1
for i in range(len(s) // 2):
if s[i] != s[- i - 1]:
flag = 0
for i in range(len(s1) // 2):
if s1[i] != s1[- i - 1]:
flag = 0
for i in range(len(s2) // 2):
if s2[i] != s2[- i - 1]:
fl... | [["+", 12, 206, 206, 663, 0, 657, 31, 23, 0, 24], ["+", 12, 206, 206, 663, 0, 657, 31, 23, 0, 25], ["+", 206, 663, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 206, 663, 0, 657, 31, 657, 31, 23, 0, 25]] | 5 | 148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.