buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; #define lli long long int #define llu unsigned long long int #define sa(a, n, t) \ for (int ii = 0; ii < n; ii++) \ scanf("%" #t "", &(a)[ii]) #define rep(i, n) for ...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define llu unsigned long long int #define sa(a, n, t) \ for (int ii = 0; ii < n; ii++) \ scanf("%" #t "", &(a)[ii]) #define rep(i, n) for ...
[["+", 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
346
// I make this just for fun because i'm done // Aimi Haraguni >> Konomi Suzuki >> Yui >> Ikimono Gakari >> Garnidelia >> // Kalafina >> Eir Aoi. .. dude? problems that involves any kind of persistent // data structures are the best of the best, are not them? // #pragma GCC optimize ("Ofast,unroll-loops") // #pragma...
// I make this just for fun because i'm done // Aimi Haraguni >> Konomi Suzuki >> Yui >> Ikimono Gakari >> Garnidelia >> // Kalafina >> Eir Aoi. .. dude? problems that involves any kind of persistent // data structures are the best of the best, are not them? // #pragma GCC optimize ("Ofast,unroll-loops") // #pragma...
[["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
678
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() #define mem(x, y) \ memset(x, y, ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() #define mem(x, y) \ memset(x, y, ...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
364
#include <algorithm> #include <complex> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long lon...
#include <algorithm> #include <complex> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long lon...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
250
n = int(input()) f = [0] * (n + 1) t = int(n ** .5) + 3 for i in range(1, t): for j in range(1, t): for k in range(1, t): res = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i if res <= n: f[res] += 1 print('\n'.join(map(str, f)))
n = int(input()) f = [0] * (n + 1) t = int(n ** .5) + 3 for i in range(1, t): for j in range(1, t): for k in range(1, t): res = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i if res <= n: f[res] += 1 print('\n'.join(map(str, f[1:])))
[["+", 3, 4, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["+", 3, 4, 0, 652, 3, 4, 0, 206, 0, 73]]
5
111
#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--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
#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--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 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], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 7, 8, 9,...
1
185
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; ll solve(ll n) { ll x = 1; ll ret = 0;...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; ll solve(ll n) { ll x = 1; ll ret = 0;...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
234
#include <bits/stdc++.h> #define int long long #define mp make_pair #define pb push_back #define ld long double #define pii pair<int, int> #define sz(x) (int)x.size() #define piii pair<pii, pii> #define precise cout << fixed << setprecision(10) #define st first #define nd second #define ins insert #define vi vector<int...
#include <bits/stdc++.h> #define int long long #define mp make_pair #define pb push_back #define ld long double #define pii pair<int, int> #define sz(x) (int)x.size() #define piii pair<pii, pii> #define precise cout << fixed << setprecision(10) #define st first #define nd second #define ins insert #define vi vector<int...
[["-", 31, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 72]]
1
221
/*input 20 */ #include <bits/stdc++.h> using namespace std; const int N = 1e4 + 2; int res[N]; inline int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + x * z; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int m = (int)sqrt...
/*input 20 */ #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 2; int res[N]; inline int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + x * z; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int m = (int)sqrt...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
197
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> Nums(10001); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int n = x * x + y * y + z * z + x * y + y * z + z * x; if (n <= 10000) ...
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> Nums(10001); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int n = x * x + y * y + z * z + x * y + y * z + z * x; if (n <= 10000) ...
[["-", 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
140
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define repd(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, n) repd(i, 0, n) #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr ll INF = 1e16; #...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define repd(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, n) repd(i, 0, n) #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr ll INF = 1e16; #...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
1
1,752
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(1000000); for (int i = 1; i < 30; i++) for (int j = 1; j < 30; j++) for (int k = 1; k < 30; k++) A[i * i + j * j + k * k + i * j + i * k + j * k]++; for (int i = 1; i <= N; i++) cout << A[i] << endl...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(1000000); for (int i = 1; i <= 100; i++) for (int j = 1; j <= 100; j++) for (int k = 1; k <= 100; k++) A[i * i + j * j + k * k + i * j + i * k + j * k]++; for (int i = 1; i <= N; i++) cout << A[i] <...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 8, 7, 15, ...
1
121
N = int(input()) cnt = [0] * N for x in range(1, 50): for y in range(1, 50): for z in range(1, 50): tmp = x * x + y * y + z * z + x * y + y * z + z * x if tmp <= N: cnt[tmp-1] += 1 for i in range(N): print(cnt[i])
N = int(input()) cnt = [0] * N for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): tmp = x * x + y * y + z * z + x * y + y * z + z * x if tmp <= N: cnt[tmp-1] += 1 for i in range(N): print(cnt[i])
[["-", 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]]
5
98
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using ll = long long int; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a...
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using ll = long long int; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]]
1
285
#include <bits/stdc++.h> using ll = long long; using namespace std; const int INFint = 1e9 + 1; const ll INFll = (ll)1e18 + 1; ll MOD = 1e9 + 7; int main() { int N; cin >> N; int cnt[1001] = {0}; for (int i(1); i <= 100; i++) { for (int j(1); j <= 100; j++) { for (int k(1); k <= 100; k++) { ...
#include <bits/stdc++.h> using ll = long long; using namespace std; const int INFint = 1e9 + 1; const ll INFll = (ll)1e18 + 1; ll MOD = 1e9 + 7; int main() { int N; cin >> N; int cnt[10001] = {0}; for (int i(1); i <= 100; i++) { for (int j(1); j <= 100; j++) { for (int k(1); k <= 100; k++) { ...
[["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13]]
1
182
#define INF 10000000000 #define MOD 1000000007 #if 1 // use_templates #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <st...
#define INF 10000000000 #define MOD 1000000007 #if 1 // use_templates #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <st...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
313
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47]]
1
440
#include <bits/stdc++.h> #define inf 0x7fffffff #define eps 1e-12 using namespace std; typedef long long ll; const ll mod = 1e9 + 7; const double pi = acos(-1); inline ll read() { ll x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') { if (ch == '-') f = -1; ch = getchar(); } while ...
#include <bits/stdc++.h> #define inf 0x7fffffff #define eps 1e-12 using namespace std; typedef long long ll; const ll mod = 1e9 + 7; const double pi = acos(-1); inline ll read() { ll x = 0, f = 1; char ch = getchar(); while (ch > '9' || ch < '0') { if (ch == '-') f = -1; ch = getchar(); } while ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
285
n = int(input()) ans = [0 for _ in range(n+1)] for x in range(1,101): for y in range(1,101): for z in range(1,101): a = x**2+y**2+z**2+x*y+y*z+z*x if a <= n: ans[a] += 1 for i in range(n+1): print(ans[i])
n = int(input()) ans = [0 for _ in range(n+1)] for x in range(1,101): for y in range(1,101): for z in range(1,101): a = x**2+y**2+z**2+x*y+y*z+z*x if a <= n: ans[a] += 1 for i in range(1,n+1): print(ans[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
105
<?php $n = fgets(STDIN); $ans = array_fill(0,$n,0); for($x=1;$x<100;$x++) { for($y=1;$y<100;$y++) { for($z=1;$z<100;$z++) { $tmp = $x**2 + $y**2 + $z**2 + $x*$y + $y*$z + $z*$x; if ($tmp <= $n) { $ans[$tmp]++; } } } } echo implode(PHP_EOL,$ans);
<?php $n = fgets(STDIN); $ans = array_fill(1,$n,0); for($x=1;$x<100;$x++) { for($y=1;$y<100;$y++) { for($z=1;$z<100;$z++) { $tmp = $x**2 + $y**2 + $z**2 + $x*$y + $y*$z + $z*$x; if ($tmp <= $n) { $ans[$tmp]++; } } } } echo implode(PHP_EOL,$ans);
[["-", 0, 11, 12, 613, 3, 3, 0, 28, 0, 612], ["+", 0, 11, 12, 613, 3, 3, 0, 28, 0, 612]]
6
139
#include <bits/stdc++.h> #define ll long long #define pb push_back #define clr(a, b) memset((a), (b), sizeof(a)) #define debugs(x) \ cout << "Line" << __LINE__ << " " << #x << "=" << x << endl #define break break #define continue continue #define itn int #d...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define clr(a, b) memset((a), (b), sizeof(a)) #define debugs(x) \ cout << "Line" << __LINE__ << " " << #x << "=" << x << endl #define break break #define continue continue #define itn int #d...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 7, 8, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 7, 8, 7...
1
237
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back using ll = long long; using P = pair<int, int>; #define int long long signed main() { int N; cin >> N; for (int n = 1; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back using ll = long long; using P = pair<int, int>; #define int long long signed main() { int N; cin >> N; for (int n = 1; ...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 16, 12, 16, 31, 22], ["+", 49, 50, 51, 16, 31, 16, 12, 16, 17, 48], ["+", 49, 50, 51, 16, 31, 16, 12, 16, 12, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13],...
1
244
n = int(input()) ans = [0 for i in range(n)] for i in range(100): for j in range(100): for k in range(100): a = (i+1)*(i+1) +(j+1)*(j+1) + (k+1)*(k+1) + (i+1)*(j+1) +(j+1)*(k+1) + (k+1)*(i+1) if a < n: ans[a-1]+=1 for i in ans: print(i)
n = int(input()) ans = [0 for i in range(n)] for i in range(100): for j in range(100): for k in range(100): a = (i+1)*(i+1) +(j+1)*(j+1) + (k+1)*(k+1) + (i+1)*(j+1) +(j+1)*(k+1) + (k+1)*(i+1) if a <= n: ans[a-1]+=1 for i in ans: print(i)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
139
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = 1; i < n; i++) using vi = vector<int>; int main() { int n; cin >> n; int count = 0, sum = 0, m; vector<int> vec(10001); m = sqrt(n); for (int a = 1; a <= m; a++) { for (int b = a;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = 1; i < n; i++) using vi = vector<int>; int main() { int n; cin >> n; int count = 0, sum = 0, m; vector<int> vec(10001); m = sqrt(n); for (int a = 1; a <= m; a++) { for (int b = a;...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
237
n = int(input()) arr = [0]*10100 for i in range(1,110): for j in range(1,110): for k in range(1,110): s = i*i+j*j+k*k+i*j+j*k+k*i; if s<10100: ans[s]+=1 for i in range(n): print(arr[i+1])
n = int(input()) arr = [0]*10100 for i in range(1,110): for j in range(1,110): for k in range(1,110): s = i*i+j*j+k*k+i*j+j*k+k*i; if s<10100: arr[s]+=1 for i in range(n): print(arr[i+1])
[["-", 64, 196, 0, 1, 0, 677, 31, 206, 51, 22], ["+", 64, 196, 0, 1, 0, 677, 31, 206, 51, 22]]
5
99
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> count(N, 0); int max; for (int i = 0; i < N; i++) { if (i * i > N) { max = i - 1; break; } } if (N == 1) { max = 1; } // これでmax求まった int value; for (int i = 1; i <= max; i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> count(N, 0); int max; for (int i = 0; i < N; i++) { if (i * i > N) { max = i - 1; break; } } if (N == 1) { max = 1; } // これでmax求まった int value; for (int i = 1; i <= max; i++) { ...
[["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]]
1
224
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
[["+", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
178
N=int(input()) count=[0]*(10**4+1) for x in range(1,10**2): for y in range(1,10**2): for z in range(1,10**2): n=x**2+y**2+z**2+x*y+y*z+z*x if n<=10**4: count[n]+=1 for i in range(1,N): print(count[i])
N=int(input()) count=[0]*(10**4+1) for x in range(1,10**2): for y in range(1,10**2): for z in range(1,10**2): n=x**2+y**2+z**2+x*y+y*z+z*x if n<=10**4: count[n]+=1 for i in range(1,N+1): print(count[i])
[["+", 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] * (n + 1) loop = int((n/6) ** .5) + 1 def f(i, j, k): return i ** 2 + j ** 2 + k ** 2 + i*j + j*k + k*i for i in range(1, loop+1): for j in range(1, loop+1): for k in range(1, loop+1): res = int(f(i, j, k)) if res <= n: ans[res] += 1 ...
n = int(input()) ans = [0] * (n + 1) loop = int(n ** .5) + 1 def f(i, j, k): return i ** 2 + j ** 2 + k ** 2 + i*j + j*k + k*i for i in range(1, loop+1): for j in range(1, loop+1): for k in range(1, loop+1): res = int(f(i, j, k)) if res <= n: ans[res] += 1 for ...
[["-", 31, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 17, 85], ["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["-", 31, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
140
n = int(input()) dp = [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, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, ...
n = int(input()) dp = [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, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, ...
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 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
22,026
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP2(i, n) for (int i = 1; i <= (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define SORT(x) sort(x.begin(), x.end()) #define REVE(x) reverse(x.begin(), x.end()) #define AL...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define REP2(i, n) for (int i = 1; i <= (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define SORT(x) sort(x.begin(), x.end()) #define REVE(x) reverse(x.begin(), x.end()) #define AL...
[["-", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22]]
1
422
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; int main(void) { int N, ans[10001] = {}; cin >> N; for (int i = 1; i <= sqrt(N); i++) { for (int j = 1; j <= sqrt(N); j++) { for (int k = 1; k <= sqrt(N); k++) { if (i * i + j * j + k * k + i * j + j * k + k * i <= 10...
#include <cmath> #include <iostream> #include <stdio.h> using namespace std; int main(void) { int N, ans[10001] = {}; cin >> N; for (int i = 1; i <= sqrt(N); i++) { for (int j = 1; j <= sqrt(N); j++) { for (int k = 1; k <= sqrt(N); k++) { if (i * i + j * j + k * k + i * j + j * k + k * i <= 10...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
181
#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; cin >> N; vector<int> ans(10050, 0); for (int x = 1; x < 105; x++) { for (int y = 1; y < 105; y++) { for (int z = 1; z < 105; z++) { ...
#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; cin >> N; vector<int> ans(10050, 0); for (int x = 1; x < 105; x++) { for (int y = 1; y < 105; y++) { for (int z = 1; z < 105; z++) { ...
[["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
170
import itertools import math import fractions import functools import copy from collections import deque from functools import reduce from decimal import Decimal def main(): n = int(input()) l = [0]*(n+1) for x in range(101): for y in range(101): for z in range(101): te...
import itertools import math import fractions import functools import copy from collections import deque from functools import reduce from decimal import Decimal def main(): n = int(input()) l = [0]*(n+1) for x in range(1,101): for y in range(1,101): for z in range(1,101): ...
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
135
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a, b) for (int i = (a); i < (b); i++) #define per(i, a, b) for (int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define ...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, a, b) for (int i = (a); i < (b); i++) #define per(i, a, b) for (int i = (b)-1; i >= (a); i--) #define pb push_back #define mp make_pair #define ...
[["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13]]
1
253
# import math N = int(input()) # count = 0 # flag = False # # n = int(math.sqrt(N)) # n = 10000 # for i in range(1, N + 1): # for j in range(1, n): # for l in range(1, n): # for r in range(1, n): # if j + l + r > N // 2: # continue # if j...
# # import math N = int(input()) # # count = 0 # # flag = False # # # n = int(math.sqrt(N)) n = 105 # # for i in range(1, N + 1): # # for j in range(1, n): # # for l in range(1, n): # # for r in range(1, n): # # if j + l + r > N // 2: # # continue # # ...
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
125
N = int(input()) a = [0]*(N+1) for x in range(101): for y in range(101): for z in range(101): d = x*x+y*y+z*z+x*y+y*z+x*z if d <= N: a[d] += 1 for i in range(1, N+1): print(a[i])
N = int(input()) a = [0]*(N+1) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): d = x*x+y*y+z*z+x*y+y*z+x*z if d <= N: a[d] += 1 for i in range(1, N+1): print(a[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
98
#ifdef _MSC_VER #include <__msvc_all_public_headers.hpp> #undef min #undef max #else #define NDEBUG #include <bits/stdc++.h> #endif using namespace std; using large = long long; #define eval() (x * x + y * y + z * z + x * y + y * z + z * x) static large count(large n) { auto cnt = 0LL; for (auto x = 1LL; x <= 10...
#ifdef _MSC_VER #include <__msvc_all_public_headers.hpp> #undef min #undef max #else #define NDEBUG #include <bits/stdc++.h> #endif using namespace std; using large = long long; #define eval() (x * x + y * y + z * z + x * y + y * z + z * x) static large count(large n) { auto cnt = 0LL; for (auto x = 1LL; x <= 10...
[["-", 0, 7, 8, 9, 0, 57, 64, 126, 0, 127], ["-", 0, 7, 8, 9, 0, 57, 64, 126, 128, 129], ["+", 0, 7, 8, 9, 0, 57, 64, 93, 0, 94], ["-", 0, 30, 0, 14, 8, 9, 0, 97, 128, 129], ["-", 0, 30, 0, 14, 8, 9, 0, 97, 0, 102]]
1
202
N=int(input()) a=[0]*N x=1 while x*x<=N: y=1 while x*x+y*y+x*y<=N: z=1 while z*z+x*x+y*y+x*y+z*y+z*x<=N: a[z*z+x*x+y*y+x*y+z*y+z*x]+=1 z+=1 y+=1 x+=1 for n in a: print(n)
N=int(input()) a=[0]*N x=1 while x*x<=N: y=1 while x*x+y*y+x*y<=N: z=1 while z*z+x*x+y*y+x*y+z*y+z*x<=N: a[z*z+x*x+y*y+x*y+z*y+z*x-1]+=1 z+=1 y+=1 x+=1 for n in a: print(n)
[["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]]
5
119
n = int(input()) ans = [0]*(10**4+1) for x in range(10**2+1): for y in range(10**2+1): for z in range(10**2+1): i = x*x + y*y + z*z + x*y + x*z + y*z if i <= 10**4: ans[i] += 1 else: break for i in range(1,n+1): print(ans[i])
n = int(input()) ans = [0]*(10**4+1) for x in range(1,10**2+1): for y in range(1,10**2+1): for z in range(1,10**2+1): i = x*x + y*y + z*z + x*y + x*z + y*z if i <= 10**4: ans[i] += 1 else: break #print(ans) 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, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
117
#include <bits/stdc++.h> #include <cmath> #include <iostream> #include <set> #include <string> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) typedef long long ll; int main() { // A /* int l,r,d; cin>>l>>r>>d; int c=0; rep(i,l,r+1){ if(i%d==0) c++; } ...
#include <bits/stdc++.h> #include <cmath> #include <iostream> #include <set> #include <string> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) typedef long long ll; int main() { // A /* int l,r,d; cin>>l>>r>>d; int c=0; rep(i,l,r+1){ if(i%d==0) c++; } ...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
154
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)...
[["-", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 14, 49, 53, 49, 22]]
1
261
n = int(input()) ans = [0 for i in range(10**5)] for x in range(1,100): for y in range(1,100): for z in range(1,100): ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1 for i in range(n): print(ans[i])
n = int(input()) ans = [0 for i in range(10**5)] for x in range(1,100): for y in range(1,100): for z in range(1,100): ans[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1 for i in range(1,n+1): print(ans[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 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
95
n=int(input()) a = [0]*(10000) for i in range(1,101): for j in range(1,101): for k in range(1,101): if i**2+j**2+k**2 >= n: break a[i**2+j**2+k**2+i*j+j*k+i*k]+=1 for i in range(1,n+1): print(a[i])
n=int(input()) a = [0]*(20000) for i in range(1,101): for j in range(1,101): for k in range(1,101): if i**2+j**2+k**2 >= n: break a[i**2+j**2+k**2+i*j+j*k+i*k]+=1 for i in range(1,n+1): print(a[i])
[["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 612]]
5
110
<?php list($n) = ints(); $max = (int) (sqrt($n / 3) + 1); $ans = array_fill(1, $n, 0); for ($x = 1; $x <= $max; ++$x) { for ($y = $x; $y <= $max; ++$y) { for ($z = $y; $z <= $max; ++$z) { $t = $x ** 2 + $y ** 2 + $z ** 2 + $x * $y + $y * $z + $x * $z; if ($t <= $n) { ...
<?php list($n) = ints(); $max = (int) (sqrt($n) + 1); $ans = array_fill(1, $n, 0); for ($x = 1; $x <= $max; ++$x) { for ($y = $x; $y <= $max; ++$y) { for ($z = $y; $z <= $max; ++$z) { $t = $x ** 2 + $y ** 2 + $z ** 2 + $x * $y + $y * $z + $x * $z; if ($t <= $n) { $c =...
[["-", 31, 613, 3, 3, 0, 28, 0, 16, 17, 85], ["-", 31, 613, 3, 3, 0, 28, 0, 16, 12, 612]]
6
246
N = int(input()) anslist = [0] * (N + 1) for x in range(1,100): for y in range(1,100): for z in range(1,100): temp = x**2 + y**2 + z**2 + x*y + y*z + z*x if temp < N: anslist[temp] += 1 anslist.pop(0) for i in anslist: print(i)
N = int(input()) anslist = [0] * (N + 1) for x in range(1,100): #100demo iikamo? for y in range(1,100): for z in range(1,100): temp = x**2 + y**2 + z**2 + x*y + y*z + z*x if temp <= N: anslist[temp] += 1 anslist.pop(0) for i in anslist: print(i)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
100
from sys import stdin from sys import maxsize def two_div(l): divs = [] if l == 2: return [(1,1)] if l == 3: return [(2,1)] preL = 0 for m in range(l-1,l//2 -1,-1): if preL == l-m: break divs.append((m,l-m)) preL = m return divs def three_d...
from sys import stdin from sys import maxsize def two_div(l): divs = [] if l == 2: return [(1,1)] if l == 3: return [(2,1)] preL = 0 for m in range(l-1,l//2 -1,-1): if preL == l-m: break divs.append((m,l-m)) preL = m return divs def three_d...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
400
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] multi = new int[10000]; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] multi = new int[60000]; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { ...
[["-", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499], ["+", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499]]
3
166
import numpy as np N = int(input()) ans = np.zeros((10**4+5)) for i in range(1,51): for j in range(1,51): for l in range(1,51): f = (i+j)**2+(j+l)**2+(l+i)**2 if((f%2==0) and (f<=2*10**4)): ans[int(f/2)] += 1 for i in range(1,N+1): print(int(ans[i]))
import numpy as np N = int(input()) ans = np.zeros((10**4+5)) for i in range(1,100): for j in range(1,100): for l in range(1,100): f = (i+j)**2+(j+l)**2+(l+i)**2 if((f%2==0) and (f<=2*10**4)): ans[int(f/2)] += 1 for i in range(1,N+1): print(int(ans[i]))
[["-", 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]]
5
135
#include <cmath> #include <iostream> #include <vector> using namespace std; // int func(int x, int y, int n){ // double sq = sqrt( (x+y)*(x+y) - 4 * (x*x + y*y + x*y - n)); // if(ceil(sq) != floor(sq) || sq <= 0){ // return -1; // } // else{ // return (-(x + y) + int(sq)) / 2; // } ...
#include <cmath> #include <iostream> #include <vector> using namespace std; // int func(int x, int y, int n){ // double sq = sqrt( (x+y)*(x+y) - 4 * (x*x + y*y + x*y - n)); // if(ceil(sq) != floor(sq) || sq <= 0){ // return -1; // } // else{ // return (-(x + y) + int(sq)) / 2; // } ...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
223
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int hash[10001]; int sum = 0; for (int i = 1; i < 100; i++) { for (int j = 1; j < 100; j++) { for (int k = 1; k < 100; k++) { sum = i * i + j * j + k * k + i * j + j * k ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int hash[10001] = {}; int sum = 0; for (int i = 1; i < 100; i++) { for (int j = 1; j < 100; j++) { for (int k = 1; k < 100; k++) { sum = i * i + j * j + k * k + i * j + j...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]]
1
160
#include "bits/stdc++.h" using namespace std; int main() { long long N; cin >> N; vector<long long> A(N + 1, 0); for (long long i = 1; i <= 50; i++) { for (long long j = 1; j <= 50; j++) { for (long long k = 1; k <= 50; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i <= N) A...
#include "bits/stdc++.h" using namespace std; int main() { long long N; cin >> N; vector<long long> A(10010, 0); for (long long i = 1; i <= 100; i++) { for (long long j = 1; j <= 100; j++) { for (long long k = 1; k <= 100; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i <= N) ...
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 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,...
1
173
N = int(input()) counts = [0] * 10001 for i in range(1, 31): for j in range(1, i + 1): for k in range(1, j + 1): result = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i if result > 10000: continue if i == j and j == k: counts[result] += ...
N = int(input()) counts = [0] * 10001 for i in range(1, 101): for j in range(1, i + 1): for k in range(1, j + 1): result = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i if result > 10000: continue if i == j and j == k: counts[result] +=...
[["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]]
5
137
import sys def input(): return sys.stdin.readline().strip() def I(): return int(input()) def LI(): return list(map(int, input().split())) def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def S(): return input() def LS(): return input().spl...
import math import sys def input(): return sys.stdin.readline().strip() def I(): return int(input()) def LI(): return list(map(int, input().split())) def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def S(): return input() def LS(): return...
[["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487]]
5
249
l=[0]*10001 1.upto(99) do |x| 1.upto(99) do |y| 1.upto(99) do |z| n=x**2+y**2+z**2+x*y+y*z+z*x if n<=10000 if x==y&&y==z l[n]+=1 elsif x==y||y==z l[n]+=3 else l[n]+=6 end end end end end puts l[1..gets.to_i]
l=[0]*10001 1.upto(100) do |x| 1.upto(x) do |y| 1.upto(y) do |z| n=x**2+y**2+z**2+x*y+y*z+z*x if n<=10000 if x==y&&y==z l[n]+=1 elsif x==y||y==z l[n]+=3 else l[n]+=6 end end end end end puts l[1..gets.to_i]
[["-", 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, 22]]
4
115
# -*- coding: utf-8 -*- import sys import math def main(): input = sys.stdin.readline N = int(input()) result = 0 ans_list = [0]*(N+1) root_n =int(math.sqrt(N))+1 for i in range(1,root_n): for j in range(1,root_n): for k in range(1,root_n): f = i**2+j**2+k...
# -*- coding: utf-8 -*- import sys import math def main(): input = sys.stdin.readline N = int(input()) result = 0 ans_list = [0]*(N+1) root_n =int(math.sqrt(N))+1 for i in range(1,root_n): for j in range(1,root_n): for k in range(1,root_n): f = i**2+j**2+k...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
148
import itertools import math import collections def func(x,y,z): return x**2+y**2+z**2+x*y+y*z+z*x n = int(input()) s = int(math.sqrt(n)) nums = list(range(1,s)) arr = [] com = list(itertools.product(nums, repeat=3)) for i in range(len(com)): # print(com) ans = func(com[i][0],com[i][1],com[i][2]) arr...
import itertools import math import collections def func(x,y,z): return x**2+y**2+z**2+x*y+y*z+z*x n = int(input()) s = int(math.sqrt(n)) nums = list(range(1,s)) arr = [] com = list(itertools.product(nums, repeat=3)) for i in range(len(com)): # print(com) ans = func(com[i][0],com[i][1],com[i][2]) arr...
[["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
158
N = int(input()) ans = [0] * (N + 5) 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 if N >= tmp: ans[tmp] += 1 for i in range(N+1): print(ans[i])
N = int(input()) ans = [0] * (N + 5) 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 if N >= tmp: ans[tmp] += 1 for i in range(1, N+1): print(ans[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
102
n = 10**4 ans = [0]*10**4 for x in range(1,101): for y in range(1,101): for z in range(1,101): a = (x+y+z)**2 -(x*y+y*z+z*x) if a <= N: ans[a-1] += 1 for i in range(int(input())): print(ans[i])
n = 10**4 ans = [0]*10**4 for x in range(1,100): for y in range(1,100): for z in range(1,100): a = (x+y+z)**2 -(x*y+y*z+z*x) if a <= n: ans[a-1] += 1 for i in range(int(input())): print(ans[i])
[["-", 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, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
102
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> ans(N + ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i <= n; i++) #define INF 1e9 #define ALL(v) v.begin(), v.end() using namespace std; typedef long long ll; int main() { int N; cin >> N; vector<int> ans(N + ...
[["-", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 21], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13]]
1
176
// 一回計算した結果を全て持っておく function Main(input) { const N = Number(input); let fn = new Array(N).fill(0); console.log(fn) for (let x = 1; x ** 2 <= N; x++) { for (let y = 1; y ** 2 <= N; y++) { if (x + y > N) break; for (let z = 1; z ** 2 <= N; z++) { const i = x ** 2 + y ** 2 + z ** 2 ...
// 一回計算した結果を全て持っておく function Main(input) { const N = Number(input); let fn = new Array(N).fill(0); for (let x = 1; x ** 2 <= N; x++) { for (let y = 1; y ** 2 <= N; y++) { if (x + y > N) break; for (let z = 1; z ** 2 <= N; z++) { const i = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + ...
[["-", 8, 556, 0, 1, 0, 2, 63, 558, 500, 22], ["-", 8, 556, 0, 1, 0, 2, 63, 558, 0, 131], ["-", 8, 556, 0, 1, 0, 2, 63, 558, 559, 560], ["-", 8, 556, 0, 1, 0, 2, 3, 3, 0, 24], ["-", 8, 556, 0, 1, 0, 2, 3, 3, 0, 22], ["-", 8, 556, 0, 1, 0, 2, 3, 3, 0, 25]]
2
177
import sys def I(): return int(sys.stdin.readline().rstrip()) def f(x,y,z): return x*x+y*y+z*z+x*y+y*z+z*x def Main(): n = I() c = [0]*n fa = True for i in range(1,n+1): if n<f(i,i,i): break for j in range(1,n+1): if n<f(i,j,j): break for k in range(1,n+1)...
import sys def I(): return int(sys.stdin.readline().rstrip()) def f(x,y,z): return x*x+y*y+z*z+x*y+y*z+z*x def Main(): n = I() c = [0]*n fa = True for i in range(1,n+1): if n<f(i,1,1): break for j in range(1,n+1): if n<f(i,j,1): break for k in range(1,n+1)...
[["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 612]]
5
182
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n, 0); for (int i = 1; i * i < n; i++) { int ii = i * i; for (int j = 1; j * j < n; j++) { int jj = j * j; if (ii + jj >= n) continue; for (int k = 1; k * k < n; k++) { int kk ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n, 0); for (int i = 1; i * i < n; i++) { int ii = i * i; for (int j = 1; j * j < n; j++) { int jj = j * j; if (ii + jj >= n) continue; for (int k = 1; k * k < n; k++) { int kk ...
[["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]]
1
178
#pragma warning(disable : 4996) #include <cstdio> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 1; i < (n); i++) int main() { int n; cin >> n; vector<int> ans(n); rep(x, 102) { rep(y, ...
#pragma warning(disable : 4996) #include <cstdio> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 1; i < (n); i++) int main() { int n; cin >> n; vector<int> ans(n); rep(x, 102) { rep(y, ...
[["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]]
1
146
#pragma warning(disable : 4996) #include <cstdio> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 1; i <= (n); i++) int main() { int n, cntx = 0, cnty = 0, cntz = 0; cin >> n; int ans = 0; r...
#pragma warning(disable : 4996) #include <cstdio> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 1; i <= (n); i++) int main() { int n, cntx = 0, cnty = 0, cntz = 0; cin >> n; int ans = 0; r...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
315
#include <algorithm> #include <iostream> using namespace std; int main() { vector<int> X(1000010); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { X.at(x * x + y * y + z * z + x * y + y * z + z * x)++; } } } int N; cin >> N; for...
#include <algorithm> #include <iostream> using namespace std; int main() { vector<int> X(1000010); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { X.at(x * x + y * y + z * z + x * y + y * z + z * x - 1)++; } } } int N; cin >> N; ...
[["+", 0, 27, 28, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 27, 28, 2, 3, 4, 0, 16, 12, 13]]
1
136
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_map> #include <vector> using namespace std; #define ll long long int mai...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <unordered_map> #include <vector> using namespace std; #define ll long long int mai...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
202
import math def main(): N = int(input()) ans = [0]*(N+1) rn = math.ceil(math.sqrt(N)) for x in range(1,rn): for y in range(1,rn): for z in range(1,rn): k = x**2 + y**2 + z**2 + x*y + y*z + z*x if k <= N: ans[k-1] += 1 fo...
import math def main(): N = int(input()) ans = [0]*(N+1) rn = math.ceil(math.sqrt(N)) for x in range(1,rn): for y in range(1,rn): for z in range(1,rn): k = x**2 + y**2 + z**2 + x*y + y*z + z*x if k <= N: ans[k-1] += 1 fo...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
128
N = int(input()) ans = [0] * 100000 for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1 for i in range(N): print(ans[i])
N = int(input()) ans = [0] * 100000 for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1 for i in range(N): print(ans[i])
[["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]]
5
88
import math N=int(input()) anslist=[0]*(N+1) ma=int(math.sqrt(N/2))+1 for x in range(1,ma): for y in range(x,ma): for z in range(y,ma): n=x**2+y**2+z**2+x*y+y*z+z*x if n <=N: if x==y and y==z: anslist[n]+=1 elif x==y or y==z o...
import math N=int(input()) anslist=[0]*(N+1) ma=int(math.sqrt(N))+1 for x in range(1,ma): for y in range(x,ma): for z in range(y,ma): n=x**2+y**2+z**2+x*y+y*z+z*x if n <=N: if x==y and y==z: anslist[n]+=1 elif x==y or y==z or z...
[["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 85], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612]]
5
157
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int hash[n + 1] = {0}, res; for (int i = 1; i * i <= n; i++) { for (int j = 1; j * j <= n; j++) { for (int k = 0; k * k <= n; k++) { res = i * i + j * j + k * k + i * j + j * k + k * i; if (res <= n) ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int hash[n + 1] = {0}, res; for (int i = 1; i * i <= n; i++) { for (int j = 1; j * j <= n; j++) { for (int k = 1; k * k <= n; k++) { res = i * i + j * j + k * k + i * j + j * k + k * i; if (res <= n) ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
152
package main import ( "bufio" "fmt" "io" "os" "sort" "strconv" "strings" ) const N = 41 func main() { n := readi() ans := make([]int, n) for x := 1; x <= N; x++ { for y := 1; y <= N; y++ { for z := 1; z <= N; z++ { tmp := x*x + y*y + z*z + x*y + x*z + y*z if tmp <= n { ans[tmp-1]++ }...
package main import ( "bufio" "fmt" "io" "os" "sort" "strconv" "strings" ) const N = 100 func main() { n := readi() ans := make([]int, n) for x := 1; x <= N; x++ { for y := 1; y <= N; y++ { for z := 1; z <= N; z++ { tmp := x*x + y*y + z*z + x*y + x*z + y*z if tmp <= n { ans[tmp-1]++ ...
[["-", 0, 434, 0, 460, 0, 461, 51, 432, 0, 433], ["+", 0, 434, 0, 460, 0, 461, 51, 432, 0, 433]]
7
1,233
N = int(input()) ans = [0] * (N + 1) for x in range(1, 50): for y in range(1, 50): for z in range(1, 50): num = pow(x, 2) + pow(y, 2) + pow(z, 2) + \ (x * y) + (y * z) + (z * x) if num <= N: ans[num] += 1 for i in ans[1:]: print(i)
N = int(input()) ans = [0] * (N + 1) for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): num = pow(x, 2) + pow(y, 2) + pow(z, 2) + \ (x * y) + (y * z) + (z * x) if num <= N: ans[num] += 1 for i in ans[1:]: print(i)
[["-", 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]]
5
114
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, x, n) for (int i = x; i < (n); ++i) int main() { int n; cin >> n; vector<int> v(n + 1, 0); rep2(i, 1, 101) rep2(j, 1, 101) rep2(k, 1, 101) { int curr...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, x, n) for (int i = x; i < (n); ++i) int main() { int n; cin >> n; vector<int> v(n + 1, 0); rep2(i, 1, 101) rep2(j, 1, 101) rep2(k, 1, 101) { int curr...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
159
n = int(input()) num = [0]*1000 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): a = x**2 + y**2 + z**2 + x*y + y*z + z*x - 1 if a <= 1000: num[a] += 1 num = num[:n] for i in num: print(i)
n = int(input()) num = [0]*10000 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): a = x**2 + y**2 + z**2 + x*y + y*z + z*x - 1 if a <= 9999: num[a] += 1 num = num[:n] for i in num: print(i)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
99
n = int(input()) list_ = [0]*1000000 for i in range(100): for j in range(100): for k in range(100): list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1 for i in range(n): print(list_[i])
n = int(input()) list_ = [0]*1000000 for i in range(1,100): for j in range(1,100): for k in range(1,100): list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1 for i in range(n): print(list_[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]]
5
84
def g(x, y, z): return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x N = int(input()) count = [0] * (N + 1) for x in range(1, 45): for y in range(1, 45): for z in range(1, 45): cur = g(x, y, z) if cur <= N: count[cur] += 1 for i in range(1, N + 1): print(...
def g(x, y, z): return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x N = int(input()) count = [0] * (N + 1) for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): cur = g(x, y, z) if cur <= N: count[cur] += 1 for i in range(1, N + 1): pri...
[["-", 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]]
5
123
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; const ll MOD = 1000000007; // 998244353; int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; const ll MOD = 1000000007; // 998244353; int f(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n;...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
195
#include <bits/stdc++.h> using namespace std; int main() { int n, tmp; cin >> n; vector<int> vec(10002, 0); for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { tmp = i * i + j * j + k * k + i * j + j * k + i * k; if (tmp <= 10000) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n, tmp; cin >> n; vector<int> vec(10010, 0); for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { tmp = i * i + j * j + k * k + i * j + j * k + i * k; if (tmp <= 10000) { ...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
150
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define RREP(...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define RREP(...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
418
#include <bits/stdc++.h> using namespace std; using ll = long long; int f(int a, int b, int c) { int ans = a * a + b * b + c * c + a * b + b * c + c * a; return ans; } int main() { int n; cin >> n; vector<int> ans(1005, 0); for (int i = 1; i < 40; ++i) for (int j = 1; j < 40; ++j) for (int k = 1...
#include <bits/stdc++.h> using namespace std; using ll = long long; int f(int a, int b, int c) { int ans = a * a + b * b + c * c + a * b + b * c + c * a; return ans; } int main() { int n; cin >> n; vector<int> ans(10005, 0); for (int i = 1; i < 101; ++i) for (int j = 1; j < 101; ++j) for (int k ...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 7, 8, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 7, 8, 7, 15, ...
1
181
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(10010); for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { for (int l = 1; l <= 100; l++) { int tmp = j * j + k * k + l * l + j * k + k * l + l * j; if (tmp <= 10000) { ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(10010); for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { for (int l = 1; l <= 100; l++) { int tmp = j * j + k * k + l * l + j * k + k * l + l * j; if (tmp <= 10000) { ...
[["-", 64, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["-", 64, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 64, 9, 0, 57, 64, 1, 0, 27, 17, 29], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 1, 0, 27, 17, 29]]
1
171
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict def main(): n_in = int(input().strip()) n_to_xyz = defaultdict(set) for x in range(1, 70): for y in range(1, 70): for z in range(1, 70): n = x * x + y * y + z * z + x * y + y * z + z * x...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict def main(): n_in = int(input().strip()) n_to_xyz = defaultdict(set) for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): n = x * x + y * y + z * z + x * y + y * z + z ...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
131
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> d(n + 1, 0); for (int x = 1; x < 40; x++) for (int y = 1; y < 40; y++) for (int z = 1; z < 40; z++) { int t = x * x + y * y + z * z + x * y + y * z + z * x; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> d(n + 1, 0); for (int x = 1; x < 100; x++) for (int y = 1; y < 100; y++) for (int z = 1; z < 100; z++) { int t = x * x + y * y + z * z + x * y + y * z + z * ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 7, 8, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 7, 8, 7, 15, 16, 12, 13]]
1
159
#include <iostream> int main(int argc, char *argv[]) { int n; std::cin >> n; for (int i = 1; i <= n; ++i) { int fx = 0; for (int x = 1; x * x <= i; ++x) { int xx = x * x; for (int y = 1; xx + y * y <= i; ++y) { int yy = y * y; int xy = x * y; for (int z = 1; xx + yy +...
#include <iostream> int main(int argc, char *argv[]) { int n; std::cin >> n; for (int i = 1; i <= n; ++i) { int fx = 0; for (int x = 1; x * x <= i; ++x) { int xx = x * x; for (int y = 1; xx + y * y <= i; ++y) { int yy = y * y; int xy = x * y; for (int z = 1; xx + yy +...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
176
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; const int MOD = 1000000007; const ll INF = 1LL << 60; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; map<int, int> m; for (int i = 1; i <= 50; i++) { for (int j = 1; j <=...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; const int MOD = 1000000007; const ll INF = 1LL << 60; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; map<int, int> m; for (int i = 1; i <= 100; i++) { for (int j = 1; j <...
[["-", 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
170
N = int(input()) from math import sqrt from collections import defaultdict ans = defaultdict(int) k = int(sqrt(N)) + 5 for x in range(1, k): for y in range(1, k): for z in range(1, k): ans[x**2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1 for i in range(1, N): print(ans[i])
N = int(input()) from math import sqrt from collections import defaultdict ans = defaultdict(int) k = int(sqrt(N)) + 5 for x in range(1, k): for y in range(1, k): for z in range(1, k): ans[x**2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1 for i in range(1, N+1): print(ans[i])
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
108
#include <bits/stdc++.h> #include <iostream> using namespace std; /* sort(a,a+n,[](int x,int y){ return x<y; }); */ void solve() { int n; cin >> n; unordered_map<int, int> mp; for (int i = 1; i < sqrt(n); i++) { for (int j = 1; j < sqrt(n); j++) { for (int k = 1; k < sqrt(n); k++) { i...
#include <bits/stdc++.h> #include <iostream> using namespace std; /* sort(a,a+n,[](int x,int y){ return x<y; }); */ void solve() { int n; cin >> n; unordered_map<int, int> mp; for (int i = 1; i <= sqrt(n); i++) { for (int j = 1; j <= sqrt(n); j++) { for (int k = 1; k <= sqrt(n); k++) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
174
#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>; const int INF = 1001001001; int main() { int n; cin >> n; vector<int> res(n + 1); ll now; int m = (int)sqrt(2 * n) + 1; for (int i = 1; i <= m; ++i) { for (int j...
#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>; const int INF = 1001001001; int main() { int n; cin >> n; vector<int> res(n + 1); ll now; int m = (int)sqrt(2 * n) + 1; for (int i = 1; i <= m; ++i) { for (int j...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19]]
1
217
#include <bits/stdc++.h> using namespace std; int n, f[1010]; int main() { for (int i = 1; i <= 45; ++i) { for (int j = 1; j <= 45; ++j) { for (int k = 1; k <= 45; ++k) { int ans = i * i + j * j + k * k + i * k + j * k + i * j; if (ans <= 1000) f[ans] += 1; } } } i...
#include <bits/stdc++.h> using namespace std; int n, f[10100]; int main() { for (int i = 1; i <= 100; ++i) { for (int j = 1; j <= 100; ++j) { for (int k = 1; k <= 100; ++k) { int ans = i * i + j * j + k * k + i * k + j * k + i * j; if (ans <= 10000) f[ans] += 1; } } ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 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], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57,...
1
141
import sys def rs(): return sys.stdin.readline().rstrip() def ri(): return int(rs()) def rs_(): return [_ for _ in rs().split()] def ri_(): return [int(_) for _ in rs().split()] N = ri() f = [0] * N for x in range(1,100+1): for y in range(1, 100+1): for z in range(1, 100+1): h = x**2 + y**2 + z...
import sys def rs(): return sys.stdin.readline().rstrip() def ri(): return int(rs()) def rs_(): return [_ for _ in rs().split()] def ri_(): return [int(_) for _ in rs().split()] N = ri() f = [0] * N for x in range(1,100+1): for y in range(1, 100+1): for z in range(1, 100+1): h = x**2 + y**2 + z...
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]]
5
176
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 100005 #define PI acosl(-1) // 3.14159265358979323846264338327950L #define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転 #define array(N, t) ...
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 100005 #define PI acosl(-1) // 3.14159265358979323846264338327950L #define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転 #define array(N, t) ...
[["-", 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]]
0
999
n = int(input()) ans = [0 for _ in range(n)] for i in range(1,32): for j in range(1,32): for k in range(1,32): s = i**2 + j**2 + k**2 +i*j + j*k + k*i if s <= n: ans[s-1] += 1 for i in range(n): print(ans[i])
n = int(input()) ans = [0 for _ in range(n)] for i in range(1,100): for j in range(1,100): for k in range(1,100): s = i**2 + j**2 + k**2 +i*j + j*k + k*i if s <= n: ans[s-1] += 1 for i in range(n): print(ans[i])
[["-", 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]]
5
103
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; cin >> n; vector<int> a(n + 1); ...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n; cin >> n; vector<int> a(n + 1); ...
[["-", 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
171
n = int(input()) ans = [0 for i in range(1000)] for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): if x*x+y*y+z*z+x*y+y*z+z*x < 1000: ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1 for i in range(n): print(ans[i])
n = int(input()) ans = [0 for i in range(10100)] for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): if x*x+y*y+z*z+x*y+y*z+z*x < 10001: ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1 for i in range(n): print(ans[i])
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 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, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+"...
5
122
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i i...
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i i...
[["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
636
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> ans(n + 1, 0); for (int x = 1; x <= n; x++) { for (int y = 1; y <= n; y++) { if (x * x + y * y + x * y > n) break; for (int z = 1; z <= n; z++) { ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> ans(n + 1, 0); for (int x = 1; x <= n; x++) { for (int y = 1; y <= n; y++) { if (x * x + y * y + x * y > n) break; for (int z = 1; z <= n; z++) { ...
[["-", 51, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72]]
1
195
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, k, f; vector<int> a(10001); cin >> n; for (i = 1; i <= 50; i++) { for (j = 1; j <= 50; j++) { for (k = 1; k <= 50; k++) { f = i * i + j * j + k * k + i * j + j * k + k * i; if (f <= 10000) a.at(f)++; ...
#include <bits/stdc++.h> using namespace std; int main() { int n, i, j, k, f; vector<int> a(10001); cin >> n; for (i = 1; i <= 100; i++) { for (j = 1; j <= 100; j++) { for (k = 1; k <= 100; k++) { f = i * i + j * j + k * k + i * j + j * k + k * i; if (f <= 10000) a.at(f)++; ...
[["-", 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
145
#include <bits/stdc++.h> #include <random> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; using ull = unsigned long long; const ll K_MAX = 1e5 + 5; const ll Lmax = ll(1e18); const ll INF = 1e9; int ...
#include <bits/stdc++.h> #include <random> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; using ull = unsigned long long; const ll K_MAX = 1e5 + 5; const ll Lmax = ll(1e18); const ll INF = 1e9; int ...
[["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
276
#include <bits/stdc++.h> using namespace std; #define hyperspeed \ ios::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long #define ull unsigned long long #define ui unsigned int #define li long int...
#include <bits/stdc++.h> using namespace std; #define hyperspeed \ ios::sync_with_stdio(false); \ cin.tie(NULL); #define ll long long #define ull unsigned long long #define ui unsigned int #define li long int...
[["-", 49, 50, 51, 16, 31, 16, 31, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 16, 31, 16, 17, 33], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 72], ["-", 0, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 72]]
1
248