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
X, Y = map(int, input().split()) Z = X * 4 - Y if Z % 2 == 0 and X >= Z >= 0: print('Yes') else: print('No')
X, Y = map(int, input().split()) Z = X * 4 - Y if Z % 2 == 0 and X * 2 >= Z >= 0: print('Yes') else: print('No')
[["+", 0, 57, 15, 679, 12, 666, 0, 657, 17, 48], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 12, 612]]
5
50
def solve(x, y): # |x| = |p + q | = | 1 1 | |p| # |y| |2p + 4q| | 2 4 | |q| # <=> # |p| = 1/2 | 4 -1| |x| = (4x - y)/2 # |q| |-2 1| |y| (-2x +y)/2 p2 = 4 * x - y q2 = -2 * x + y if p2 % 2 == 0 and q2 % 2 == 0 and p2 > 0 and q2 > 0: return "Yes" return "No" ...
def solve(x, y): # |x| = |p + q | = | 1 1 | |p| # |y| |2p + 4q| | 2 4 | |q| # <=> # |p| = 1/2 | 4 -1| |x| = (4x - y)/2 # |q| |-2 1| |y| (-2x +y)/2 p2 = 4 * x - y q2 = -2 * x + y if p2 % 2 == 0 and q2 % 2 == 0 and p2 >= 0 and q2 >= 0: return "Yes" return "No"...
[["-", 0, 57, 15, 679, 31, 679, 12, 666, 667, 47], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 667, 20], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 667, 47], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 667, 20]]
5
125
#include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; const int N = 200000; void Run() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } ll a[N], s, res, f; map<char, ll> mp; vector<ll> v; int main() { Run(); int x, y; cin >> x >> y; ...
#include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; const int N = 200000; void Run() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } ll a[N], s, res, f; map<char, ll> mp; vector<ll> v; int main() { Run(); int x, y; cin >> x >> y; ...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 13], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 17, 48]]
1
142
a,b=map(int,input().split()) if(b%2==0): if(2*a<=b<=4*b): print("Yes") else: print("No") else: print("No")
a,b=map(int,input().split()) if(b%2==0): if(2*a<=b<=4*a): print("Yes") else: print("No") else: print("No")
[["-", 0, 57, 15, 23, 0, 666, 0, 657, 12, 22], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 12, 22]]
5
60
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (ll i = j; i <= n; i++) #define per(i, j, n) for (ll i = j; i >= n; i--) #define ll long long #define ld long double #define ld long double #define ii pair<ll, ll> #define vii vector<ii> #define vi vector<ll> #define adj unordered_map<ll, vii> #defi...
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (ll i = j; i <= n; i++) #define per(i, j, n) for (ll i = j; i >= n; i--) #define ll long long #define ld long double #define ld long double #define ii pair<ll, ll> #define vii vector<ii> #define vi vector<ll> #define adj unordered_map<ll, vii> #defi...
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 47], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 20]]
1
194
import sys def Ii():return int(sys.stdin.readline()) def Mi():return map(int,sys.stdin.readline().split()) def Li():return list(map(int,sys.stdin.readline().split())) x,y = Mi() if y%2 == 1: print("No") exit y = y//2 if x <= y <= 2*x: print("Yes") else: print("No")
import sys def Ii():return int(sys.stdin.readline()) def Mi():return map(int,sys.stdin.readline().split()) def Li():return list(map(int,sys.stdin.readline().split())) x,y = Mi() if y%2 == 1: print('No') exit(0) y = y//2 if x <= y <= 2*x: print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
114
n_all,leg_all=map(int, input().split()) for i in range(n_all): leg_kame=2*(n_all-i) leg_turu=4*i if leg_kame+leg_turu==leg_all: print('Yes') break else: continue else:(print('No'))
n_all,leg_all=map(int, input().split()) for i in range(n_all+1): leg_kame=2*(n_all-i) leg_turu=4*i if leg_kame+leg_turu==leg_all: print('Yes') break else: continue else:(print('No'))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
65
X, Y = map(int, input().split(' ')) if Y % 2 == 0 and Y <= 4 * X: print('Yes') else: print('No')
X, Y = map(int, input().split(' ')) if Y % 2 == 0 and 2 * X <= Y <= 4 * X: print('Yes') else: print('No')
[["+", 0, 57, 15, 679, 12, 666, 0, 657, 31, 612], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 17, 48], ["+", 0, 57, 15, 679, 12, 666, 0, 657, 12, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 19]]
5
46
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) v.bigin(), v.end() #define MAX(a, b) a = a > b ? a : b #define MI...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define all(v) v.bigin(), v.end() #define MAX(a, b) a = a > b ? a : b #define MI...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22]]
1
124
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; if (4 * x < y || y % 2 != 0) { cout << "No"; } else cout << "Yes"; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; if (4 * x < y || y % 2 != 0 || x * 2 > y) { cout << "No"; } else cout << "Yes"; }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
73
a = input() a = a.split() x = int(a[0]) y = int(a[1]) if y >= x * 2 and y <= x * 4 and y % 2 == 0: print("yes") else: print("no")
a = input() a = a.split() x = int(a[0]) y = int(a[1]) if y >= x * 2 and y <= x * 4 and y % 2 == 0: 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
63
x, y = map(int, input().split()) ans = "No" for a in range(0,x + 1): if 2 * a + 4 * (y - a): ans = "Yes" break print(ans)
x, y = map(int, input().split()) ans = "No" for a in range(0,x + 1): if 2 * a + 4 * (x - a) == y: ans = "Yes" break print(ans)
[["-", 15, 657, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
56
X, Y = map(int, input().split()) b = (Y - 2*X)/2 a = X - b print(a, b) is_int = (a.is_integer() and b.is_integer()) is_positive = (a >= 0 and b >= 0) if is_int and is_positive and (a + b) == X and (2*a + 4*b) == Y: print("Yes") else: print("No")
X, Y = map(int, input().split()) b = (Y - 2*X)/2 a = X - b is_int = (a.is_integer() and b.is_integer()) is_positive = (a >= 0 and b >= 0) if is_int and is_positive and (a + b) == X and (2*a + 4*b) == Y: print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
103
#include "bits/stdc++.h" using namespace std; typedef long long int ll; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; if (y & 1) { cout << "No\n"; } else { y /= 2; if (2 * x >= y && x < y) cout << "Yes\n"; else cout << "No\n"; } }
#include "bits/stdc++.h" using namespace std; typedef long long int ll; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int x, y; cin >> x >> y; if (y & 1) { cout << "No\n"; } else { y /= 2; if (2 * x >= y && x <= y) cout << "Yes\n"; else cout << "No\n"; } }
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19]]
1
101
#include <stdio.h> int main(void) { int x, y; scanf("%d%d", &x, &y); if (y % 2 == 0 && 2 * x <= y && y <= 4 * x) { printf("yes"); } else { printf("no"); } return 0; }
#include <stdio.h> int main(void) { int x, y; scanf("%d%d", &x, &y); if (y % 2 == 0 && 2 * x <= y && y <= 4 * x) { printf("Yes"); } else { printf("No"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
69
#include <stdio.h> int main(void) { int x, y; scanf("%d%d", &x, &y); if (y % 2 == 0 && y <= 400 && 2 <= y) { printf("Yes"); } else { printf("No"); } return 0; }
#include <stdio.h> int main(void) { int x, y; scanf("%d%d", &x, &y); if (y % 2 == 0 && y <= 4 * x && 2 * x <= y) { printf("Yes"); } else { printf("No"); } return 0; }
[["-", 15, 23, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 31, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 12, 16, 12, 22], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 23, 0, 16, 12, 16, 31, 16, 12, 22]]
0
65
x,y = gets.chomp.split(' ').map(&:to_i) if x*2 < y && x*4 > y && y%2 == 0 puts "Yes" else puts "No" end
x,y = gets.chomp.split(' ').map(&:to_i) if x*2 <= y && x*4 >= y && y%2 == 0 puts "Yes" else puts "No" end
[["-", 0, 121, 15, 738, 31, 738, 31, 738, 17, 18], ["+", 0, 121, 15, 738, 31, 738, 31, 738, 17, 19], ["-", 0, 121, 15, 738, 31, 738, 12, 738, 17, 47], ["+", 0, 121, 15, 738, 31, 738, 12, 738, 17, 20]]
4
48
x,y = gets.chomp.split.map(&:to_i) if y <= (4*x) && y >= (2*x) puts "Yes" else puts "No" end
x,y = gets.chomp.split.map(&:to_i) if y <= (4*x) && y >= (2*x) && y.even? puts "Yes" else puts "No" end
[["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 98], ["+", 0, 493, 0, 121, 15, 738, 12, 652, 486, 22], ["+", 0, 493, 0, 121, 15, 738, 12, 652, 17, 131], ["+", 0, 493, 0, 121, 15, 738, 12, 652, 735, 22]]
4
41
X, Y = map(int,input().split()) if Y%2!=0: print('No') exit() turu = (4*X-Y)/2 kame = (Y-2*X)/2 if turu > 0 and turu.is_integer() and kame > 0 and kame.is_integer(): print('Yes') else: print('No')
X, Y = map(int,input().split()) if Y%2!=0: print('No') exit() turu = (4*X-Y)/2 kame = (Y-2*X)/2 if turu >= 0 and turu.is_integer() and kame >= 0 and kame.is_integer(): print('Yes') else: print('No')
[["-", 15, 679, 31, 679, 31, 679, 31, 666, 667, 47], ["+", 15, 679, 31, 679, 31, 679, 31, 666, 667, 20], ["-", 0, 57, 15, 679, 31, 679, 12, 666, 667, 47], ["+", 0, 57, 15, 679, 31, 679, 12, 666, 667, 20]]
5
89
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < ll(b); i++) #define FORD(i, a, b) for (ll i = a; i > ll(b); i--) #define ALL(x) x.b...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < ll(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < ll(b); i++) #define FORD(i, a, b) for (ll i = a; i > ll(b); i--) #define ALL(x) x.b...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
182
#include <bits/stdc++.h> using namespace std; void solve() { return; } int main() { int n, l; cin >> n >> l; string ans = "No"; for (int i = 1; i <= n; i++) { int rem = n - i; if (2 * i + 4 * rem == l) ans = "Yes"; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; void solve() { return; } int main() { int n, l; cin >> n >> l; string ans = "No"; for (int i = 0; i <= n; i++) { int rem = n - i; if (2 * i + 4 * rem == l) ans = "Yes"; } cout << ans << endl; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
88
#include <iostream> using namespace std; int x, y; int main() { cin >> x >> y; if (x * 2 >= y && x * 4 <= y && y % 2 == 0) cout << "Yes"; else cout << "No"; }
#include <iostream> using namespace std; int x, y; int main() { cin >> x >> y; if (x * 2 <= y && x * 4 >= y && y % 2 == 0) cout << "Yes"; else cout << "No"; }
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 20], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 19], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 19], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 20]]
1
56
x, y = map(int, input().split()) for a in range(x+1): b = x - a if a*2 + b*4 == y: print('Yes') else: print('No')
x, y = map(int, input().split()) for a in range(x+1): b = x - a if a*2 + b*4 == y: print('Yes') break else: print('No')
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
56
x, y = map(int,input().split()) count = 0 for i in range(x): for j in range(x): if (i*2 + j*4 )== y and (i + j) == x: count +=1 if count == 0: print("No") else: print("Yes")
x, y = map(int,input().split()) count = 0 for i in range(x+1): for j in range(x+1): if (i*2 + j*4 )== y and (i + j) == x: count +=1 if count == 0: print("No") else: print("Yes")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
78
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> typed...
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <time.h> #include <vector> typed...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
116
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a = n * 2, b = n * 4, c = m % 2; if (m >= a && m <= b && !c) cout << "Yes" << endl; else cout << "N0" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a = n * 2, b = n * 4, c = m % 2; if (m >= a && m <= b && !c) cout << "Yes" << endl; else cout << "No" << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
72
data=input().split() x=int(data[0]) y=int(data[1]) if (y%2 != 0) and (y-2*x >= 0) and ((y-2*x)/2 <=x): print('Yes') else: print('No')
data=input().split() x=int(data[0]) y=int(data[1]) if (y%2 == 0) and (y-2*x >= 0) and ((y-2*x)/2 <=x): print('Yes') else: print('No')
[["-", 15, 679, 31, 679, 31, 23, 0, 666, 667, 79], ["+", 15, 679, 31, 679, 31, 23, 0, 666, 667, 60]]
5
74
x, y = map(int, input().split()) flag = True for a in range(101): if 2*a + 4*(x-a) == y: print("Yes") flag = False break if flag: print("No")
x, y = map(int, input().split()) flag = True for a in range(x+1): if 2*a + 4*(x-a) == y: print("Yes") flag = False break if flag: print("No")
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
61
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #includ...
#include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <forward_list> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #includ...
[["-", 51, 16, 12, 16, 31, 16, 31, 16, 12, 13], ["+", 51, 16, 12, 16, 31, 16, 31, 16, 12, 13]]
1
168
#include <bits/stdc++.h> using namespace std; int main() { int X, Y, a, count = 0; cin >> X >> Y; for (int a = 1; a <= X; a++) { int b = X - a; if (2 * a + 4 * b == Y) { count++; } } if (count > 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int X, Y, a, count = 0; cin >> X >> Y; for (int a = 0; a <= X; a++) { int b = X - a; if (2 * a + 4 * b == Y) { count++; } } if (count > 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
96
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (b % 2 == 0 && b - 2 * a >= 0 && 4 * a - b >= 0) cout << "yes"; else cout << "no"; return 0; }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (b % 2 == 0 && b - 2 * a >= 0 && 4 * a - b >= 0) cout << "Yes"; else cout << "No"; return 0; }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
63
#include <stdio.h> int main(void) { int X, Y, i; scanf("%d %d", &X, &Y); for (i = 0; i <= X; i++) { if (4 * X - 2 * i == Y) { printf("YES"); return 0; } } printf("NO"); return 0; }
#include <stdio.h> int main(void) { int X, Y, i; scanf("%d %d", &X, &Y); for (i = 0; i <= X; i++) { if (4 * X - 2 * i == Y) { printf("Yes"); return 0; } } printf("No"); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
78
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int X = scan.nextInt(); int Y = scan.nextInt(); /* This comes from the equations c + t = X --> 2c + 2t = 2X and 2c + 4t = Y, so 2t = Y - 2X */ if ((Y - 2 * X) / 2 >= 0 &&...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int X = scan.nextInt(); int Y = scan.nextInt(); if ((Y - 2 * X) >= 0 && (Y - 2 * X) % 2 == 0 && (4 * X - Y) >= 0) { System.out.println("Yes"); return; } Syste...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 17, 85], ["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 499], ["+", 8, 196, 0, 57, 64, 196, 0, 1, 0, 35], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38]]
3
114
#include <iostream> using namespace std; int main() { int X, Y, i; cin >> X >> Y; for (i = 0; i <= X; i++) { if (i * 2 + (X - i) * 4 == Y) { cout << "YES"; return 0; } } cout << "NO"; return 0; }
#include <iostream> using namespace std; int main() { int X, Y, i; cin >> X >> Y; for (i = 0; i <= X; i++) { if (i * 2 + (X - i) * 4 == Y) { cout << "Yes"; return 0; } } cout << "No"; return 0; }
[["-", 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
76
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; if (m % 2 != 0) { cout << "No" << endl; return 0; } ll maxi = (m / 2); ll mini = (m / 4); if (m % 4 != 0) maxi++; if ((n >= mini) && (n <= maxi)) cout << "Yes" << endl; else ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n, m; cin >> n >> m; if (m % 2 != 0) { cout << "No" << endl; return 0; } ll maxi = (m / 2); ll mini = (m / 4); if (m % 4 != 0) mini++; if ((n >= mini) && (n <= maxi)) cout << "Yes" << endl; else ...
[["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22]]
1
110
#n = int(input()) x, y = map(int, input().split()) #l = list(map(int, input().split())) #s = input() ans = "No" for i in range(x+1): if 2*i+4*x == y: ans = "Yes" print(ans)
#n = int(input()) x, y = map(int, input().split()) #l = list(map(int, input().split())) #s = input() ans = "No" for i in range(x+1): if 2*i+4*(x-i) == y: ans = "Yes" print(ans)
[["+", 15, 666, 0, 657, 12, 657, 12, 23, 0, 24], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 657, 12, 657, 12, 23, 0, 657, 12, 22], ["+", 15, 666, 0, 657, 12, 657, 12, 23, 0, 25]]
5
54
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X; cin >> Y; bool ok = false; for (int i = 0; i <= X; i++) { int turu = i; int kame = (X - i); if (turu * 2 + kame + 4 == Y) { ok = true; break; } } if (ok) { cout << "Yes" << endl; } else { ...
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X; cin >> Y; bool ok = false; for (int i = 0; i <= X; i++) { int turu = i; int kame = (X - i); if (turu * 2 + kame * 4 == Y) { ok = true; break; } } if (ok) { cout << "Yes" << endl; } else { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 48]]
1
105
#!/usr/bin/env python3 # Generated by https://github.com/kyuridenamida/atcoder-tools from typing import * import itertools import math import sys INF = float('inf') YES = "Yes" # type: str NO = "No" # type: str def solve(X: int, Y: int): return [YES, NO][not 2*X <= Y <= 4*X and Y % 2 == 0] def main(): s...
#!/usr/bin/env python3 # Generated by https://github.com/kyuridenamida/atcoder-tools from typing import * import itertools import math import sys INF = float('inf') YES = "Yes" # type: str NO = "No" # type: str def solve(X: int, Y: int): return [YES, NO][not (2*X <= Y <= 4*X and Y % 2 == 0)] def main(): ...
[["+", 0, 37, 0, 206, 206, 681, 28, 23, 0, 24], ["+", 0, 37, 0, 206, 206, 681, 28, 23, 0, 25]]
5
148
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a * 2 <= b && b <= a * 4 && b % 2 == 0) cout << "YES"; else cout << "NO"; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a * 2 <= b && b <= a * 4 && b % 2 == 0) cout << "Yes"; else cout << "No"; }
[["-", 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
56
#include <iostream> using namespace std; int main() { int animals, total; cin >> animals; cin >> total; string ans = "No"; for (int i = 1; i < animals; i++) { if (((i * 2) + ((animals - i) * 4)) == total) { ans = "Yes"; break; } } cout << ans; return 0; }
#include <iostream> using namespace std; int main() { int animals, total; cin >> animals; cin >> total; string ans = "No"; for (int i = 0; i <= animals; i++) { if (((i * 2) + ((animals - i) * 4)) == total) { ans = "Yes"; break; } } cout << ans; return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
87
x, y = input().split() crane = float(x)*2 - float(y)/2 turtle = float(x) - crane if crane.is_integer() == True: if crane > 0 and turtle > 0: print('Yes') else: print('No') else: print('No')
x, y = input().split() crane = float(x)*2 - float(y)/2 turtle = float(x) - crane if crane.is_integer() == True: if crane >= 0 and turtle >= 0: print('Yes') else: print('No') else: print('No')
[["-", 64, 196, 0, 57, 15, 679, 31, 666, 667, 47], ["+", 64, 196, 0, 57, 15, 679, 31, 666, 667, 20], ["-", 64, 196, 0, 57, 15, 679, 12, 666, 667, 47], ["+", 64, 196, 0, 57, 15, 679, 12, 666, 667, 20]]
5
74
#include <bits/stdc++.h> #define endl '\n' #define F first #define S second #define PB push_back #define MP make_pair #define mod 1000000007 #define FASTIO \ ios::sync_with_stdio(0); \ cin.tie(0); #de...
#include <bits/stdc++.h> #define endl '\n' #define F first #define S second #define PB push_back #define MP make_pair #define mod 1000000007 #define FASTIO \ ios::sync_with_stdio(0); \ cin.tie(0); #de...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
128
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int x, y; cin >> x >> y; bool ret = false; for (int i = 0; i < x; i++) { int t = x - i; int total = 2 * i + 4 * t; if (total == y) ret = true; } if (ret) cout << "Yes" << endl; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int x, y; cin >> x >> y; bool ret = false; for (int i = 0; i <= x; i++) { int t = x - i; int total = 2 * i + 4 * t; if (total == y) ret = true; } if (ret) cout << "Yes" << endl; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
101
#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; 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 (a > b) { a =...
#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; 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 (a > b) { a =...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
195
cnt, sum = gets.chomp.split.map(&:to_i) if sum > 4*cnt || sum % 2 != 0 puts "No" else puts "Yes" end
cnt, sum = gets.chomp.split.map(&:to_i) if sum > 4*cnt || sum < 2*cnt || sum % 2 != 0 puts "No" else puts "Yes" end
[["+", 0, 121, 15, 738, 31, 738, 12, 738, 17, 18], ["+", 15, 738, 31, 738, 12, 738, 12, 738, 31, 612], ["+", 15, 738, 31, 738, 12, 738, 12, 738, 17, 48], ["+", 15, 738, 31, 738, 12, 738, 12, 738, 12, 22], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 106], ["+", 0, 121, 15, 738, 12, 738, 31, 738, 31, 22]]
4
37
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; if (2 * X <= Y && Y <= 2 * X && Y % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; if (2 * X <= Y && Y <= 4 * X && Y % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 51, 16, 31, 16, 12, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 16, 12, 16, 12, 16, 31, 13]]
1
67
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int x, y; cin >> x >> y; rep(i, x) { int j = x - i; if ((i * 4) + (j * 2) == y) { cout << "Yes" << '\n'; return 0; } } cout << "No" << '\n'; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i <= (int)(n); i++) int main() { int x, y; cin >> x >> y; rep(i, x) { int j = x - i; if ((i * 2) + (j * 4) == y) { cout << "Yes" << '\n'; return 0; } } cout << "No" << '\n'; }
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 12, 13]]
1
87
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = n...
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = n...
[["-", 3, 4, 0, 23, 0, 510, 64, 5, 0, 491], ["+", 3, 4, 0, 23, 0, 510, 64, 5, 0, 491], ["-", 3, 4, 0, 23, 0, 510, 75, 5, 0, 491], ["+", 3, 4, 0, 23, 0, 510, 75, 5, 0, 491]]
3
177
x,y = int(input().split()) if y % 2 == 1: print("No") elif 2 * x <= y <= 4 * x: print("Yes") else: print("No")
x,y = map(int, input().split()) if y % 2 == 1: print("No") elif 2 * x <= y <= 4 * x: print("Yes") else: print("No")
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
52
def main(): x, y = map(int, input().split()) for i in range(x): j = x - i if i * 2 + j * 4 == y: print("Yes") return print("No") main()
def main(): x, y = map(int, input().split()) for i in range(x+1): j = x - i if i * 2 + j * 4 == y: print("Yes") return print("No") main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
61
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; for (int i = 1; i <= X; i++) { int j = X - i; if (2 * i + 4 * j == Y) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int X, Y; cin >> X >> Y; for (int i = 0; i <= X; i++) { int j = X - i; if (2 * i + 4 * j == Y) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
79
x,y=map(int,input().split()) ans=0 for i in range(1,x+1): if y==i*2+(x-i)*4: ans+=1 break if ans==1: print("Yes") else: print("No")
x,y=map(int,input().split()) ans=0 for i in range(x+1): if y==i*2+(x-i)*4: ans+=1 break if ans==1: print("Yes") else: print("No")
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
69
#include <iostream> int main(void) { int n, m; std::cin >> n >> m; if ((n <= 2 * m) && (m <= 4 * n) && (m % 2 == 0)) std::cout << "Yes"; else std::cout << "No"; }
#include <iostream> int main(void) { int n, m; std::cin >> n >> m; if ((m >= 2 * n) && (m <= 4 * n) && (m % 2 == 0)) std::cout << "Yes"; else std::cout << "No"; }
[["-", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 19], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 17, 20], ["-", 31, 16, 31, 23, 0, 16, 12, 16, 12, 22], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
65
#include <bits/stdc++.h> using namespace std; int main() { int n, value; cin >> n >> value; if (value > n * 4 || value & 1) { cout << "No\n"; } else { cout << "Yes\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, value; cin >> n >> value; if (value > n * 4 || value & 1 || n * 2 > value) { cout << "No\n"; } else { cout << "Yes\n"; } return 0; }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
57
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define pb push_back #define mp make_pair #define F first #define S second /* bool compare (pair<ll,ll> x,pair<ll,ll> y) { if(x.F==y.F)return x.S<y.S; return x.F<y.F; } */ int main() { /* if you are getting wrong on test...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define pb push_back #define mp make_pair #define F first #define S second /* bool compare (pair<ll,ll> x,pair<ll,ll> y) { if(x.F==y.F)return x.S<y.S; return x.F<y.F; } */ int main() { /* if you are getting wrong on test...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
186
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a * 2 <= b && b <= a * 4 && a % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a * 2 <= b && b <= a * 4 && b % 2 == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22]]
1
64
#include <stdio.h> int main(void) { int X, Y; int i; int count = 0; scanf("%d %d", &X, &Y); for (i = 1; i <= X; i++) { int sum = (X - i) * 4 + i * 2; if (sum == Y) { printf("Yes\n"); count++; ; } } if (count == 0) { printf("No\n"); } return 0; }
#include <stdio.h> int main(void) { int X, Y; int i; int count = 0; scanf("%d %d", &X, &Y); for (i = 0; i <= X; i++) { int sum = (X - i) * 4 + i * 2; if (sum == Y) { printf("Yes\n"); count++; ; } } if (count == 0) { printf("No\n"); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
104
X,Y =input().split() if (Y % 2 == 0) and (4*X >= Y >=2*X): print('Yes') else: print('No')
X,Y =map(int,input().split()) if (Y % 2 == 0) and (4*X >= Y >=2*X): 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, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
46
#include <stdio.h> int main(void) { int x, y, i, j; scanf("%d %d", &x, &y); for (i = 0; i < 1000; i++) { for (j = 0; j < 1000; j++) { if (i + j == x && 4 * j + i * 2 == y) { printf("YES\n"); return 0; } } } printf("No"); }
#include <stdio.h> int main(void) { int x, y, i, j; scanf("%d %d", &x, &y); for (i = 0; i < 1000; i++) { for (j = 0; j < 1000; j++) { if (i + j == x && 4 * j + i * 2 == y) { printf("Yes"); return 0; } } } printf("No"); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
99
XY = input().split(" ") X = int(XY[0]) Y = int(XY[1]) ans = "No" for i in range(X): crane = 2 * (X - i) turtle = 4 * i if crane + turtle == Y: ans = "Yes" break print(ans)
XY = input().split(" ") X = int(XY[0]) Y = int(XY[1]) ans = "No" for i in range(X + 1): crane = 2 * (X - i) turtle = 4 * i if crane + turtle == Y: ans = "Yes" break print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
74
inputLine = input().split() X = int(inputLine[0]) Y = int(inputLine[1]) no = "No" yes = "Yes" if Y/2 == 1 : print(no) else : table = [i*2+(X-i)*4 for i in range(X+1)] if Y in table : print(yes) else: print(no)
inputLine = input().split() X = int(inputLine[0]) Y = int(inputLine[1]) no = "No" yes = "Yes" if Y%2 == 1 : print(no) else : table = [i*2+(X-i)*4 for i in range(X+1)] if Y in table : print(yes) else: print(no)
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 85], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109]]
5
89
#include <bits/stdc++.h> #define ll long long #define nl "\n" using namespace std; void solve() { int x, y; scanf("%d %d", &x, &y); if (2 * x > y) printf("NO\n"); else { int r = y - 2 * x; if (r % 2 == 0 && r <= 2 * x) printf("YES\n"); else printf("NO\n"); } } int main() { solve...
#include <bits/stdc++.h> #define ll long long #define nl "\n" using namespace std; void solve() { int x, y; scanf("%d %d", &x, &y); if (2 * x > y) printf("No\n"); else { int r = y - 2 * x; if (r % 2 == 0 && r <= 2 * x) printf("Yes\n"); else printf("No\n"); } } int main() { solve...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
108
#include <bits/stdc++.h> using namespace std; using ll = long long; #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) ...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 109], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 85]]
1
1,050
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = sc.nextInt(); int sum = sc.nextInt(); boolean flg = false; for (int x = 0; x < count; x++) { for (int y = 0; y < count; y++) { if (x + y == count ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = sc.nextInt(); int sum = sc.nextInt(); boolean flg = false; for (int x = 0; x <= count; x++) { for (int y = 0; y <= count; y++) { if (x + y == coun...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 17, 19]]
3
147
x, y = map(int, input().split()) if x * 2 > y: flag = False elif x * 4 < y: flag = False elif (y - x * 2) % 2 == 0: flag = True print('Yes' if flag == True else 'No')
x, y = map(int, input().split()) if x * 2 > y: flag = False elif x * 4 < y: flag = False elif (y - x * 2) % 2 == 0: flag = True else: flag = False print('Yes' if flag == True else 'No')
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 147]]
5
66
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int main(void) { int x, y; bool yes = false; scanf("%d %d", &x, &y); for (int i = 0; i <= x; i++) { if ((2 * i + 4 * (x - i)) == y) { yes = true; } } if (yes) printf("yes"); else printf("no"); return 0;...
#include <iostream> #include <stdio.h> #include <vector> using namespace std; int main(void) { int x, y; bool yes = false; scanf("%d %d", &x, &y); for (int i = 0; i <= x; i++) { if ((2 * i + 4 * (x - i)) == y) { yes = true; } } if (yes) printf("Yes"); else printf("No"); return 0;...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
102
X, Y = map(int, input().split()) for i in range(X): kame = i * 4 tsuru = (X - i) * 2 if kame + tsuru == Y: print("Yes") break else: print("No")
X, Y = map(int, input().split()) for i in range(X+1): kame = i * 4 tsuru = (X - i) * 2 if kame + tsuru == Y: print("Yes") break else: print("No")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
60
L=[] i=0 while i <10000: L.append(0) i+=1 for x0 in range(1,100): for y0 in range(1,100): for z0 in range(1,100): p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0 if p<10001: L[p]+=1 N=int(input()) for i in range(0,N): print(L[i])
L=[] i=0 while i <100001: L.append(0) i+=1 for x0 in range(1,100): for y0 in range(1,100): for z0 in range(1,100): p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0 if p<10001: L[p]+=1 N=int(input()) for i in range(1,N+1): print(L[i])
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
112
n = int(input()) ans = [0 for i in range(n+1)] for x in range(1, 50): for y in range(1, 50): for z in range(1, 50): tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x #print(x, y, z, tmp) if 1 <= tmp and tmp <= n+1: ans[tmp] += 1 for i in range(1, n+1): print(...
n = int(input()) ans = [0 for i in range(n+1)] for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x #print(x, y, z, tmp) if 1 <= tmp and tmp <= n: ans[tmp] += 1 for i in range(1, n+1): print...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 57, 15, 679, 12, 666, 0, 657, 17, 72], ["-", 0, 57, 15, 679, 12, 666, 0, 657, 12, 612]]
5
114
from collections import Counter N=int(input()) A=[] for i in range(1,150): for j in range(1,150): for k in range(1,150): ans=(i**2+j**2+k**2+i*j+j*k+k*i) if ans<=N: A.append(ans) B=Counter(A) print(B) for a in range(1,N+1): if a in B.keys(): print(B[a]) ...
from collections import Counter N=int(input()) A=[] for i in range(1,150): for j in range(1,150): for k in range(1,150): ans=(i**2+j**2+k**2+i*j+j*k+k*i) if ans<=N: A.append(ans) B=Counter(A) for a in range(1,N+1): if a in B.keys(): print(B[a]) else: ...
[["-", 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
128
n = gets.to_i answers = Hash.new { |h, k| h[k] = 0 } 1.upto(50) do |x| 1.upto(50) do |y| 1.upto(50) do |z| answer = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x answers[answer] += 1 end end end (1..n).each do |num| puts answers[num] end
n = gets.to_i answers = Hash.new { |h, k| h[k] = 0 } 1.upto(100) do |x| 1.upto(100) do |y| 1.upto(100) do |z| answer = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x answers[answer] += 1 end end end (1..n).each do |num| puts answers[num] end
[["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 612], ["+", 36, 36, 0, 493, 0, 652, 3, 4, 0, 612], ["-", 196, 737, 8, 736, 0, 652, 3, 4, 0, 612], ["+", 196, 737, 8, 736, 0, 652, 3, 4, 0, 612]]
4
104
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, s, n) for (int i = s; i < (int)(n); i++) int main() { int n; cin >> n; vector<ll> ans(1e4 + 1, 0); rep(z, 1, sqrt(n) + 1) { rep(y, 1, z + 1) { rep(x, 1, y + 1) { ll f = x * x + y * y +...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, s, n) for (int i = s; i < (int)(n); i++) int main() { int n; cin >> n; vector<ll> ans(1e4 + 1, 0); rep(z, 1, sqrt(n) + 1) { rep(y, 1, z + 1) { rep(x, 1, y + 1) { ll f = x * x + y * y +...
[["-", 0, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 75, 76, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 107]]
1
201
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ans = new int[10001]; for (int x = 1; x < 70; x++) { for (int y = 1; y < 70; y++) { for (int z = 1; z < 70; z++) { int next = x * x...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ans = new int[10001]; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { int next = x ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 12, 499], ["-", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 7, 8, 196, 0, 7, 15, 16, 12, 499]]
3
177
N = int(input()) #N = 20 ret = [0 for i in range(N)] for x in range(1,100): for y in range(1,100): for z in range(1,100): a = x**2 + y**2 + z**2 + x*y + y*z + z*x if a < N: ret[a-1] += 1 for i in ret: print(i)
N = int(input()) #N = 20 ret = [0 for i in range(N)] for x in range(1,100): for y in range(1,100): for z in range(1,100): a = x**2 + y**2 + z**2 + x*y + y*z + z*x if a <= N: ret[a-1] += 1 for i in ret: print(i)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
98
#include <bits/stdc++.h> #define debug(a) cout << #a ": " << a << endl #define IOS ios::sync_with_stdio(false), cin.tie(0) using namespace std; typedef long long ll; const int table[] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0,...
#include <bits/stdc++.h> #define debug(a) cout << #a ": " << a << endl #define IOS ios::sync_with_stdio(false), cin.tie(0) using namespace std; typedef long long ll; const int table[] = { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0,...
[["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 21]]
1
20,072
#include <bits/stdc++.h> using namespace std; int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + x * z + y * z; } int main(int argc, char const *argv[]) { int count = 40; map<int, int> ans; for (int x = 1; x < count; ++x) { for (int y = 1; y < count; ++y) { for (int z = 1; z < count; ...
#include <bits/stdc++.h> using namespace std; int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + x * z + y * z; } int main(int argc, char const *argv[]) { int count = 105; map<int, int> ans; for (int x = 1; x < count; ++x) { for (int y = 1; y < count; ++y) { for (int z = 1; z < count;...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
169
from collections import Counter n = int(input()) ans_list = [0]*(10**4) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): ans = i**2 + j**2 + k**2 + i*j + j*k + k*i ans_list[ans-1] += 1 for i in ans_list[:n]: print(i)
from collections import Counter n = int(input()) ans_list = [0]*(10**6) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): ans = i**2 + j**2 + k**2 + i*j + j*k + k*i ans_list[ans-1] += 1 for i in ans_list[:n]: print(i)
[["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612]]
5
99
#include <bits/stdc++.h> using namespace std; long long f(int X, int Y, int Z) { long long af = X * (X + Y) + Y * (Y + Z) + Z * (Z + X); return af; } int main() { int N; cin >> N; vector<int> ans(N + 1, 0); for (int x = 1; x < N; x++) for (int y = x; y < N; y++) for (int z = y; z < N; z++) { ...
#include <bits/stdc++.h> using namespace std; long long f(int X, int Y, int Z) { long long af = X * (X + Y) + Y * (Y + Z) + Z * (Z + X); return af; } int main() { int N; cin >> N; vector<long long> ans(N + 1, 0); for (int x = 1; x < N; x++) for (int y = x; y < N; y++) for (int z = y; z < N; z++)...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
218
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < ll(n); i++) void debug_print(int N, vector<int> &A) { int i; for (i = 1; i < N + 1; i++) { cout << A[i] << endl; } } void tansaku(int ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; #define REP(i, n) for (ll i = 0; i < ll(n); i++) void debug_print(int N, vector<int> &A) { int i; for (i = 1; i < N + 1; i++) { cout << A[i] << endl; } } void tansaku(int ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
334
#include <bits/stdc++.h> #define ull unsigned long long // #define _CRT_DISABLE_PERFCRIT_LOCKS using namespace std; int main(int argc, char const *argv[]) { // ios_base::sync_with_stdio(false); // cin.tie(NULL); // cout.tie(NULL); ull n; std::cin >> n; std::map<int, int> f; double upp = sqrt(n); for (...
#include <bits/stdc++.h> #define ull unsigned long long // #define _CRT_DISABLE_PERFCRIT_LOCKS using namespace std; int main(int argc, char const *argv[]) { // ios_base::sync_with_stdio(false); // cin.tie(NULL); // cout.tie(NULL); ull n; std::cin >> n; std::map<int, int> f; double upp = sqrt(n); for (...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
173
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> num(60010, 0); for (int x = 1; x <= 100; x++) { for (int y = x; y <= 100; y++) { for (int z = y; z <= 100; z++) { int fn = x * x + y *...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> num(60010, 0); for (int x = 1; x <= 100; x++) { for (int y = x; y <= 100; y++) { for (int z = y; z <= 100; z++) { int fn = x * x + y *...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
187
import math import itertools n = int(input()) max = math.floor(n**(1/2)) L = [0 for i in range(n)] l = [] for i in range(1, max+1): l.append(i) for v in itertools.combinations_with_replacement(l, 3): x = v[0] y = v[1] z = v[2] t = x**2 + y**2 + z**2 + x*y + y*z + z*x if t <= n: if x ==...
import math import itertools n = int(input()) max = math.floor(n**(1/2)) L = [0 for i in range(n)] l = [] for i in range(1, max+1): l.append(i) for v in itertools.combinations_with_replacement(l, 3): x = v[0] y = v[1] z = v[2] t = x**2 + y**2 + z**2 + x*y + y*z + z*x if t <= n: if x ==...
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["-", 75, 665, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 665, 64, 196, 0, 1, 0, 677, 17, 107], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 107]]
5
173
import math N = int(input()) ans = 0 num = {i:0 for i in range(1, N+1)} upper = int(math.sqrt(N)) + 1 for x in range(1, upper): for y in range(1, upper): z = 1 v = x**2 + y**2 + z**2 + x*y + y*z + z*x if v > n: break for z in range(1, upper): v = x**2 + y**2 ...
import math N = int(input()) ans = 0 num = {i:0 for i in range(1, N+1)} upper = int(math.sqrt(N)) + 1 for x in range(1, upper): for y in range(1, upper): z = 1 v = x**2 + y**2 + z**2 + x*y + y*z + z*x if v > N: break for z in range(1, upper): v = x**2 + y**2 ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
173
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, x; cin >> n; long long int a[n + 1] = {0}; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { x ...
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, x; cin >> n; long long int a[n + 1] = {0}; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { x ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
164
from collections import deque from copy import copy N = int(input()) result = [0]*N if N < 6: for i in range(N): print(0) exit() result[5] += 1 coord = deque() coord.append([[1, 1, 1], 6, 0]) while len(coord): sol, ans, level = coord.popleft() for i in range(level, 3): new_sol = cop...
from collections import deque from copy import copy N = int(input()) result = [0]*N if N < 6: for i in range(N): print(0) exit() result[5] += 1 coord = deque() coord.append([[1, 1, 1], 6, 0]) while len(coord): sol, ans, level = coord.popleft() for i in range(level, 3): new_sol = cop...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
167
#include "bits/stdc++.h" using namespace std; using ll = long long int; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() #define pi 3.14159265358979323846 template <class T> bool ch1000000(T ...
#include "bits/stdc++.h" using namespace std; using ll = long long int; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() #define pi 3.14159265358979323846 template <class T> bool ch1000000(T ...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]]
1
263
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double int t, n, a[10005]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); t = 1; // cin>>t; while (t--) { cin >> n; for (int i = 1; i <= 41; i++) { for (int j = 1; j <= 41;...
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double int t, n, a[100005]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); t = 1; // cin>>t; while (t--) { cin >> n; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 1...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
171
import sys input = sys.stdin.readline N=int(input()) s= [0 for i in range(10002)] for x in range(1,100): for y in range(1,100): if x*x + y*y>1000:break for z in range(1,100): a = x*x + y*y + z*z +x*y + y*z + z*x if a >10000:break s[a] +=1 for i in range(N): p...
import sys input = sys.stdin.readline N=int(input()) s= [0 for i in range(10002)] for x in range(1,100): for y in range(1,100): if x*x + y*y>10000:break for z in range(1,100): a = x*x + y*y + z*z +x*y + y*z + z*x if a >10000:break s[a] +=1 for i in range(N): ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
123
#include <bits/stdc++.h> using namespace std; const int N = 1000 + 10; int ans[N]; int main() { for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { int t = i * i + j * j + k * k + i * j + j * k + i * k; if (t <= 1000) { ans[t]++; ...
#include <bits/stdc++.h> using namespace std; const int N = 10000 + 10; int ans[N]; int main() { for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { int t = i * i + j * j + k * k + i * j + j * k + i * k; if (t <= 10000) { ans[t]++; ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
162
N = int(input()) import itertools num = [i for i in range(1,42)] comb = list(itertools.combinations_with_replacement(num, 3)) cnt_list = [0] * 10001 for c in comb: x = c[0] y = c[1] z = c[2] n = x**2 + y**2 + z**2 + x*y + y*z + z*x if n <= 10000: if x == y and y == z and z == x: ...
N = int(input()) import itertools num = [i for i in range(1,101)] comb = list(itertools.combinations_with_replacement(num, 3)) cnt_list = [0] * 10001 for c in comb: x = c[0] y = c[1] z = c[2] n = x**2 + y**2 + z**2 + x*y + y*z + z*x if n <= 10000: if x == y and y == z and z == x: ...
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]]
5
162
import math N = int(input()) def xyzTriplets(N): store = {} upTo = math.sqrt(N) for x in range(1, int(upTo) + 1): for y in range(1, int(upTo) + 1): for z in range(1, int(upTo) + 1): res = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x if (res not in st...
import math N = int(input()) def xyzTriplets(N): store = {} upTo = math.sqrt(N) for x in range(1, int(upTo) + 1): for y in range(1, int(upTo) + 1): for z in range(1, int(upTo) + 1): res = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x if (res not in st...
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
152
#include <algorithm> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define DBL_MIN 0.000000000000001 #d...
#include <algorithm> #include <functional> #include <initializer_list> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <regex> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define DBL_MIN 0.000000000000001 #d...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
187
from itertools import combinations_with_replacement N = int(input()) ans = [0] * (N + 1) for x, y, z in combinations_with_replacement(list(range(1, 50)), 3): val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z n_diff = len(set([x, y, z])) if n_diff == 3: cnt = 6 if n_diff == 2: cnt ...
from itertools import combinations_with_replacement N = int(input()) ans = [0] * (N + 1) for x, y, z in combinations_with_replacement(list(range(1, 100)), 3): val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + x * z n_diff = len(set([x, y, z])) if n_diff == 3: cnt = 6 if n_diff == 2...
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612]]
5
141
#include <bits/stdc++.h> using namespace std; // typedef using ll = long long; using str = string; using PL = pair<ll, ll>; using P = pair<int, int>; using VL = vector<ll>; using VI = vector<int>; using VS = vector<str>; using VP = vector<P>; using VPL = vector<PL>; using VVL = vector<VL>; using VVI = vector<VI>; // c...
#include <bits/stdc++.h> using namespace std; // typedef using ll = long long; using str = string; using PL = pair<ll, ll>; using P = pair<int, int>; using VL = vector<ll>; using VI = vector<int>; using VS = vector<str>; using VP = vector<P>; using VPL = vector<PL>; using VVL = vector<VL>; using VVI = vector<VI>; // c...
[["+", 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, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]]
1
306
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <cassert> #include <cfloat> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <regex> #include <set> #...
[["+", 31, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
531
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> p; typedef long long ll; #define F first #define S second #define PB push_back #define MP make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) #define pmod 1000000007 #define INF 1000000000000000000 #define pi atan(1) *...
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> p; typedef long long ll; #define F first #define S second #define PB push_back #define MP make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) #define pmod 1000000007 #define INF 1000000000000000000 #define pi atan(1) *...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
263
//---Vaidik Patel"---//-------------------Proud to be //Indian--------------------------------// #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set,multi multimap, map etc. #include <ext/pb_ds/tree_policy.hpp> //...
//---Vaidik Patel"---//-------------------Proud to be //Indian--------------------------------// #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set,multi multimap, map etc. #include <ext/pb_ds/tree_policy.hpp> //...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
385
N = gets.to_i a = Array.new(10**4+100,0) for x in 1..41 for y in 1..41 for z in 1..41 n = x**2 + y**2 + z**2 + x*y + y*z + z*x a[n] += 1 end end end a.shift a.each_with_index do |n,i| puts n if i <= N - 1 end
N = gets.to_i a = Array.new(10**6,0) for x in 1..100 for y in 1..100 for z in 1..100 n = x**2 + y**2 + z**2 + x*y + y*z + z*x a[n] += 1 end end end a.shift a.each_with_index do |n,i| puts n if i <= N - 1 end
[["-", 12, 652, 3, 4, 0, 738, 31, 738, 12, 612], ["-", 0, 662, 12, 652, 3, 4, 0, 738, 17, 72], ["-", 0, 662, 12, 652, 3, 4, 0, 738, 12, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 738, 12, 612], ["-", 0, 493, 0, 88, 51, 267, 0, 475, 444, 612], ["+", 0, 493, 0, 88, 51, 267, 0, 475, 444, 612], ["-", 8, 170, 0, 88, 51, 267, 0, ...
4
92
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; map<int, int> m; for (int x = 1; x <= 33; x++) { for (int y = 1; y <= 33; y++) { for (int z = 1; z <= 33; z++) { int a = x * x + y * y + z * z + x * y + y * z + z * x; if (a <= n) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; map<int, int> m; for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int a = x * x + y * y + z * z + x * y + y * z + z * x; if (a <= n) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
149
#include <bits/stdc++.h> using namespace std; int main() { long long n, ans[101001] = {0}, x, y, z; cin >> n; for (x = 1; x <= 1000; x++) { for (y = 1; y <= 1000; y++) { for (z = 1; z <= 1000; z++) { long long tmp; tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp <= 1...
#include <bits/stdc++.h> using namespace std; int main() { long long n, ans[101001] = {0}, x, y, z; cin >> n; for (x = 1; x <= 1000; x++) { for (y = 1; y <= 1000; y++) { for (z = 1; z <= 1000; z++) { long long tmp; tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp <= 1...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
154