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 REP(i, s, n) for (int i = s; i < n; i++) #define NUM 2520 #define INF (1LL << 50) #define DEBUG 0 #define mp(a, b) make_pair(a, b) #define SORT(V) sort(V.begin(), V.end()) #define PI (3.141592653589794) #define TO_STRING(VariableName) #Var...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define REP(i, s, n) for (int i = s; i < n; i++) #define NUM 2520 #define INF (1LL << 50) #define DEBUG 0 #define mp(a, b) make_pair(a, b) #define SORT(V) sort(V.begin(), V.end()) #define PI (3.141592653589794) #define TO_STRING(VariableName) #Var...
[["+", 64, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["+", 64, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,122
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_...
[["-", 0, 1, 0, 2, 3, 4, 0, 83, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 83, 0, 13], ["-", 63, 118, 28, 69, 28, 69, 341, 342, 0, 13], ["+", 63, 118, 28, 69, 28, 69, 341, 342, 0, 13]]
1
885
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, a, b) for (auto i = (a); i < (b); ++i) #define trav(e, x) for (auto &e : x) #define eb(x...) emplace_back(x) #define all(x) begin(x), end(x) #define sz(x) int((x).size()) template <class T> bool ckmin(T &a, con...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, a, b) for (auto i = (a); i < (b); ++i) #define trav(e, x) for (auto &e : x) #define eb(x...) emplace_back(x) #define all(x) begin(x), end(x) #define sz(x) int((x).size()) template <class T> bool ckmin(T &a, con...
[["-", 0, 14, 8, 9, 0, 9, 0, 43, 0, 21], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40]]
1
924
from collections import defaultdict N=int(input()) uddic=defaultdict(list) lrdic=defaultdict(list) uldic=defaultdict(list) urdic=defaultdict(list) dldic=defaultdict(list) drdic=defaultdict(list) for _ in range(N): XS,YS,U=input().split() x=int(XS) y=int(YS) if U=="U": uddic[x].append((y,U)) uldic[x-y]...
from collections import defaultdict N=int(input()) uddic=defaultdict(list) lrdic=defaultdict(list) uldic=defaultdict(list) urdic=defaultdict(list) dldic=defaultdict(list) drdic=defaultdict(list) for _ in range(N): XS,YS,U=input().split() x=int(XS) y=int(YS) if U=="U": uddic[x].append((y,U)) uldic[x-y]...
[["-", 0, 662, 12, 652, 3, 4, 0, 206, 51, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 206, 51, 22]]
5
744
package main // Solution for https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_f import ( "bufio" "fmt" "io" "os" "sort" ) type contest struct { in io.Reader out io.Writer } func (con *contest) Scan(a ...interface{}) (int, error) { return fmt.Fscan(con.in, a...) } func (con *contest) Scanln...
package main // Solution for https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_f import ( "bufio" "fmt" "io" "os" "sort" ) type contest struct { in io.Reader out io.Writer } func (con *contest) Scan(a ...interface{}) (int, error) { return fmt.Fscan(con.in, a...) } func (con *contest) Scanln...
[["-", 75, 196, 0, 37, 0, 432, 0, 16, 17, 47], ["+", 75, 196, 0, 37, 0, 432, 0, 16, 17, 18]]
7
2,431
#include <bits/stdc++.h> #define inf (int)(1e8) using namespace std; int len = 200000; long long n; string sd = "RLUD"; vector<vector<vector<int>>> v, pl, mn; int solve(); int main() { cin >> n; v.resize(4, vector(len + 1, vector<int>())); pl.resize(4, vector(2 * len + 1, vector<int>())); mn.resize(4, vector...
#include <bits/stdc++.h> #define inf (int)(1e8) using namespace std; int len = 200000; long long n; string sd = "RLUD"; vector<vector<vector<int>>> v, pl, mn; int solve(); int main() { cin >> n; v.resize(4, vector(len + 1, vector<int>())); pl.resize(4, vector(2 * len + 1, vector<int>())); mn.resize(4, vector...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 48], ["-", 8, 9, 0, 52, 8, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 52, 8, 1, 0, 27, 28, 22]]
1
1,075
#include <bits/stdc++.h> //#define int long long using namespace std; const int N = 1e6 + 7, offset = 2e5; vector<int> up[2][N], down[2][N], U[N], D[N], L[N], R[N]; char typ[N]; int xx[N], yy[N]; int32_t main() { ios_base ::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, ptr = 0; cin >> n; for (int...
#include <bits/stdc++.h> //#define int long long using namespace std; const int N = 1e6 + 7, offset = 2e5; vector<int> up[2][N], down[2][N], U[N], D[N], L[N], R[N]; char typ[N]; int xx[N], yy[N]; int32_t main() { ios_base ::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, ptr = 0; cin >> n; for (int...
[["-", 0, 2, 63, 118, 28, 69, 341, 342, 0, 22], ["+", 0, 2, 63, 118, 28, 69, 341, 342, 0, 22]]
1
1,101
#include <bits/stdc++.h> using namespace std; typedef long long lint; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<lint> vl; typedef pair<lint, lint> pll; #define mpr make_pair void solve() { int n; cin >> n; vl a(n); lint xand = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; xa...
#include <bits/stdc++.h> using namespace std; typedef long long lint; typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<lint> vl; typedef pair<lint, lint> pll; #define mpr make_pair void solve() { int n; cin >> n; vl a(n); lint xand = 0; for (int i = 0; i < n; ++i) { cin >> a[i]; xa...
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
849
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> a[4]; for (int i = 0; i < n; i++) { int x, y; char u; cin >> x >> y >> u; if (u == 'U') a[0].push_back(make_pair(x, y)); if (u == 'R') a[1].push_back(make_pair(x, y)); if (u =...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> a[4]; for (int i = 0; i < n; i++) { int x, y; char u; cin >> x >> y >> u; if (u == 'U') a[0].push_back(make_pair(x, y)); if (u == 'R') a[1].push_back(make_pair(x, y)); if (u =...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
1,650
from collections import deque, Counter, defaultdict from itertools import chain, combinations import json # import numpy as np import bisect import sys import math import bisect from functools import lru_cache import itertools sys.setrecursionlimit(10 ** 8) M = 10 ** 9 + 7 INF = 10 ** 17 def main(): N = int(inp...
from collections import deque, Counter, defaultdict from itertools import chain, combinations import json # import numpy as np import bisect import sys import math import bisect from functools import lru_cache import itertools sys.setrecursionlimit(10 ** 8) M = 10 ** 9 + 7 INF = 10 ** 17 def main(): N = int(inp...
[["+", 0, 1, 0, 662, 12, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 206, 206, 657, 12, 612]]
5
891
#include <bits/stdc++.h> using namespace std; #define LOCAL #pragma region Macros typedef long long ll; #define ALL(x) (x).begin(), (x).end() const long long MOD = 1e9 + 7; // const long long MOD=998244353; const int INF = 1e9; const long long IINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const c...
#include <bits/stdc++.h> using namespace std; #define LOCAL #pragma region Macros typedef long long ll; #define ALL(x) (x).begin(), (x).end() const long long MOD = 1e9 + 7; // const long long MOD=998244353; const int INF = 1e9; const long long IINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const c...
[["-", 49, 50, 51, 69, 28, 69, 341, 342, 0, 13], ["+", 49, 50, 51, 69, 28, 69, 341, 342, 0, 13]]
1
1,640
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; #define f first #define s second #define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i) #define DEC(i, s, e) for (ll i = s; i >= ll(e); --i) #define pb push_back #define all(x) (x)....
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pi; typedef vector<ll> vi; typedef vector<pi> vpi; #define f first #define s second #define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i) #define DEC(i, s, e) for (ll i = s; i >= ll(e); --i) #define pb push_back #define all(x) (x)....
[["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 57, 64, 9, 0, 57, 75, 76, 0, 95], ["-", 64, 9, 0, 57, 75, 76, 0, 116, 0, 117], ["-", 64, 9, 0, 57, 75, 76, 0, 116, 0, 35], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46]]
1
1,272
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; /* vector<vector<int> > ux(200001,vector<int>(0)) ; vector<vector<int> > dx(200001,vector<int>(0)) ; vector<vector<int> > ...
#include <algorithm> #include <cmath> #include <iostream> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; /* vector<vector<int> > ux(200001,vector<int>(0)) ; vector<vector<int> > dx(200001,vector<int>(0)) ; vector<vector<int> > ...
[["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
985
#include <bits/stdc++.h> using namespace std; using ll = int; using point = pair<int, int>; constexpr int CMAX = 200010; constexpr int INF = 1000000000; vector<point> yxMirror(vector<point> pts) { vector<point> ans = pts; for (point &x : ans) swap(x.first, x.second); return ans; } vector<point> xaMirror(ve...
#include <bits/stdc++.h> using namespace std; using ll = int; using point = pair<int, int>; constexpr int CMAX = 200010; constexpr int INF = 1000000000; vector<point> yxMirror(vector<point> pts) { vector<point> ans = pts; for (point &x : ans) swap(x.first, x.second); return ans; } vector<point> xaMirror(ve...
[["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22], ["-", 12, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 21], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
1,017
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
#include <bits/stdc++.h> const long long INF = 1LL << 60; const long long MOD = 1000000007; const double PI = acos(-1.0); #define rep(i, n) for (ll i = 0; i < (n); ++i) #define rep1(i, n) for (ll i = 1; i <= (n); ++i) #define rrep(i, n) for (ll i = (n - 1); i >= 0; --i) #define perm(c) ...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["-", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 338, 12, 22]]
1
1,911
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; ll power(ll x, ll y); #define repp(I, A, B) for (int I = A; I <= B; I++) #define rep(I, A, B) for (int I = A; I < B; I++) #define rrep(I, B, A) for (int I = B; I >= A; I--) #define pb emplace_back #define ff first #define ss se...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; ll power(ll x, ll y); #define repp(I, A, B) for (int I = A; I <= B; I++) #define rep(I, A, B) for (int I = A; I < B; I++) #define rrep(I, B, A) for (int I = B; I >= A; I--) #define pb emplace_back #define ff first #define ss se...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
1,098
#include <bits/stdc++.h> #include <unordered_map> //#define int ll #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define eb emplace_back using namespace std; using ll = long long; using P = pair<int, int>; using LP = pair...
#include <bits/stdc++.h> #include <unordered_map> //#define int ll #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(a) (a).begin(), (a).end() #define eb emplace_back using namespace std; using ll = long long; using P = pair<int, int>; using LP = pair...
[["-", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["-", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22]]
1
3,443
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x).begin(), (x).end() #define rwhole(x) (x).rbegin(), (x...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rep1(i, n) FOR(i, 1, n + 1) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x).begin(), (x).end() #define rwhole(x) (x).rbegin(), (x...
[["-", 51, 16, 12, 16, 12, 118, 28, 69, 28, 22], ["+", 51, 16, 12, 16, 12, 118, 28, 69, 28, 22]]
1
1,072
#include <stdio.h> #include <stdlib.h> #define MAX 200000 #define INF 1010101010 struct hikouki_t { int zahyo; int dir; }; int sumipe(const void *x, const void *y) { struct hikouki_t a = *(const struct hikouki_t *)x, b = *(const struct hikouki_t *)y; return a.zahyo < b.zahyo ? -1 : a.zahyo...
#include <stdio.h> #include <stdlib.h> #define MAX 200000 #define INF 1010101010 struct hikouki_t { int zahyo; int dir; }; int sumipe(const void *x, const void *y) { struct hikouki_t a = *(const struct hikouki_t *)x, b = *(const struct hikouki_t *)y; return a.zahyo < b.zahyo ? -1 : a.zahyo...
[["-", 0, 11, 12, 16, 31, 16, 31, 69, 28, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 69, 28, 22]]
0
2,201
#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> ans(N); for (int x = 1; x * x <= N; x++) { for (int y = 1; y * y <= N; y++) { for (int z = 1; z * z <= N; z++) { int calc = 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> ans(N); for (int x = 1; x * x <= N; x++) { for (int y = 1; y * y <= N; y++) { for (int z = 1; z * z <= N; z++) { int calc = x * x + y *...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
157
def main(): n = int(input()) count_list = [0] * n upper = int(n**0.5) + 2 for x in range(1, upper): for y in range(1, upper): for z in range(1, upper): num = x**2 + y**2 + z**2 + x*y + y*z + z*x if num < n: count_list[num-1] += 1 ...
def main(): n = int(input()) count_list = [0] * n upper = int(n**0.5) + 2 for x in range(1, upper): for y in range(1, upper): for z in range(1, upper): num = x**2 + y**2 + z**2 + x*y + y*z + z*x if num <= n: count_list[num-1] += 1 ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
117
// AC #include <stdio.h> int main(void) { int N; scanf("%d", &N); for (int n = 1; n <= N; n++) { int count = 0; for (int i = 1; i * i + 2 * i <= n; i++) { for (int j = 1; j * j + 2 * j <= n && j <= i; j++) { for (int k = 1; k * k + 2 * k <= n && k <= j; k++) { if (i * i + j * j...
// AC #include <stdio.h> int main(void) { int N; scanf("%d", &N); for (int n = 1; n <= N; n++) { int count = 0; for (int i = 1; i * i + 2 * i <= n; i++) { for (int j = 1; j * j + 2 * j <= n && j <= i; j++) { for (int k = 1; k * k + 2 * k <= n && k <= j; k++) { if (i * i + j * j...
[["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]]
0
201
n = int(input()) ans = [0] * (n+1) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): tmp = i*i + j*j * k*k + i*j + j*k + i*k if tmp <= n: ans[tmp] += 1 for i in range(1, n+1): print(ans[i])
n = int(input()) ans = [0] * (n+1) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): tmp = i*i + j*j + k*k + i*j + j*k + i*k if tmp <= n: ans[tmp] += 1 for i in range(1, n+1): print(ans[i])
[["-", 31, 657, 31, 657, 12, 657, 31, 657, 17, 48], ["+", 12, 657, 31, 657, 31, 657, 31, 657, 17, 72]]
5
104
# @uthor : Kaleab Asfaw from sys import stdin, stdout # Fast IO def input(): a = stdin.readline() if a[-1] == "\n": a = a[:-1] return a def print(*argv, end="\n", sep=" "): n = len(argv) for i in range(n): if i == n-1: stdout.write(str(argv[i])) else: stdout.write(str(argv[i]) + sep) stdout.write(end) # Other...
# @uthor : Kaleab Asfaw from sys import stdin, stdout # Fast IO def input(): a = stdin.readline() if a[-1] == "\n": a = a[:-1] return a def print(*argv, end="\n", sep=" "): n = len(argv) for i in range(n): if i == n-1: stdout.write(str(argv[i])) else: stdout.write(str(argv[i]) + sep) stdout.write(end) # Other...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 8, 196, 0, 57, 15, 679, 12, 666, 0, 612]]
5
441
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 1; i < (int)(n); i++) #define intll int long long const int INF = 1e9; const int MOD = 1e9 + 7; int main() { int n; cin >> n; vector<int> v(n + 1); rep(i, 105) { rep(j, 105) { rep(k, 105) ...
#include <bits/stdc++.h> using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 1; i < (int)(n); i++) #define intll int long long const int INF = 1e9; const int MOD = 1e9 + 7; int main() { int n; cin >> n; vector<int> v(n + 1); rep(i, 105) { rep(j, 105) { rep(k, 105) ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
148
#include <stdio.h> int main() { int n; scanf("%d", &n); int ctr[1001] = {0}; for (int i = 1; i <= 50; i++) { for (int j = 1; j <= 50; j++) { for (int k = 1; k <= 50; k++) { int temp = i * i + j * j + k * k + i * j + j * k + i * k; if (temp <= 1000) { ctr[temp]++; } ...
#include <stdio.h> int main() { int n; scanf("%d", &n); int ctr[10001] = {0}; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { int temp = i * i + j * j + k * k + i * j + j * k + i * k; if (temp <= 10000) { ctr[temp]++; ...
[["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 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...
1
152
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 1; i <= (int)(n); i++) int main() { int n, fx; cin >> n; vector<int> f(10001); rep(i, 50) { rep(j, 50) { rep(k, 50) { fx = i * i + j * j + k * k + i * j + j * k + k * i; if (fx <= 10000)...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 1; i <= (int)(n); i++) int main() { int n, fx; cin >> n; vector<int> f(10001); rep(i, 100) { rep(j, 100) { rep(k, 100) { fx = i * i + j * j + k * k + i * j + j * k + k * i; if (fx <= 100...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 42, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
125
N = int(input()) L = [0] * N for x in range(1,101): for y in range(1,101): for z in range(1,101): n = ((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 if n <= N: L[n - 1] += 1 print(*L, sep='\n')
N = int(input()) L = [0] * N for x in range(1,101): for y in range(1,101): for z in range(1,101): n = int(((x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2)/ 2 ) if n <= N: L[n - 1] += 1 print(*L, sep='\n')
[["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 657, 31, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
98
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <sstream> #include <string> #include <map> #include <set> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <sstream> #include <string> #include <map> #include <set> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(...
[["-", 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
209
# ans N = int(input()) ans = [0] * (N + 1) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): n = x * x + y * y + z * z + x * y + y * z + z * x if n <= N: ans[n] += 1 for i in range(len(ans)): print(ans[i])
# ans N = int(input()) ans = [0] * (N + 1) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): n = x * x + y * y + z * z + x * y + y * z + z * x if n <= N: ans[n] += 1 for i in range(1, len(ans)): print(ans[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
104
n=int(input()) a=[0 for i in range(100001)] for i in range(1,41): a[6*(i**2)]+=1 for i in range(1,99): for j in range(1,i): if 3*(i**2)+j**2+2*i*j<=10000: a[3*(i**2)+j**2+2*i*j]+=3 if 3*(j**2)+i**2+2*i*j <=10000: a[3*(j**2)+i**2+2*i*j]+=3 for i in range(1,100): for j ...
n=int(input()) a=[0 for i in range(100001)] for i in range(1,41): a[6*(i**2)]+=1 for i in range(1,99): for j in range(1,i): if 3*(i**2)+j**2+2*i*j<=10000: a[3*(i**2)+j**2+2*i*j]+=3 if 3*(j**2)+i**2+2*i*j <=10000: a[3*(j**2)+i**2+2*i*j]+=3 for i in range(1,100): for j ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
273
N=int(input()) Z=[0]*10005 for i in range(1,102): for j in range(1,102): for k in range(1,102): n=i**2+j**2+k**2+i*j+j*k+k*i if n<=N: Z[n]+=1 for i in range(N+1): print(Z[i])
N=int(input()) Z=[0]*10005 for i in range(1,102): for j in range(1,102): for k in range(1,102): n=i**2+j**2+k**2+i*j+j*k+k*i if n<=N: Z[n-1]+=1 for i in range(N): print(Z[i])
[["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
98
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[10001] = {0}; int m = min(n, 98); for (int i = 1; i <= m; i++) { for (int j = 1; j <= m; j++) { for (int z = 1; z <= m; z++) { if (i * i + j * j + z * z + i * j + i * z + j * z <= 1000) arr[i * i + j *...
#include <iostream> using namespace std; int main() { int n; cin >> n; int arr[10001] = {0}; int m = min(n, 99); for (int i = 1; i <= m; i++) { for (int j = 1; j <= m; j++) { for (int z = 1; z <= m; z++) { if (i * i + j * j + z * z + i * j + i * z + j * z <= 10000) arr[i * i + j ...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
171
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define reps(i, n) for (int i = 1; i <=...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define reps(i, n) for (int i = 1; i <=...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 17, 33], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22]]
1
384
#include <bits/stdc++.h> #include <iostream> using namespace std; int f(int x, int y, int z) { return (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x); } int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) arr[i] = 0; for (int x = 1; (x * x) <= n; x++) { for (int y = 1;...
#include <bits/stdc++.h> #include <iostream> using namespace std; int f(int x, int y, int z) { return (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x); } int main() { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) arr[i] = 0; for (int x = 1; (x * x) <= n; x++) { for (int y = 1;...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
228
n = int(input()) L = [0 for i in range(10**4+1)] for x in range(1, 45): for y in range(1, 45): for z in range(1, 45): r = x**2 + y**2 + z**2 + x*z + x*y + z*y if r <= 10000: L[r] += 1 for i in range(1, n+1): print(L[i])
n = int(input()) L = [0 for i in range(10**4+1)] for x in range(1, 100): for y in range(1, 100): for z in range(1, 100): r = x**2 + y**2 + z**2 + x*z + x*y + z*y if r <= 10000: L[r] += 1 for i in range(1, n+1): print(L[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
109
#include <bits/stdc++.h> using namespace std; int main() { int N, a, b; cin >> N; vector<int> ans(N); for (int x = 1; x < N; x++) { for (int y = 1; y < N; y++) { for (int z = 1; z < N; z++) { int q = x * (x + y) + y * (y + z) + z * (z + x); if (q > N) { a = y; b = ...
#include <bits/stdc++.h> using namespace std; int main() { int N, a, b; cin >> N; vector<int> ans(N); for (int x = 1; x < N; x++) { for (int y = 1; y < N; y++) { for (int z = 1; z < N; z++) { int q = x * (x + y) + y * (y + z) + z * (z + x); if (q > N) { a = y; b = ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
164
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> #include <time.h> #include <vector> using...
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> #include <time.h> #include <vector> using...
[["-", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 31, 16, 31, 2, 3, 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
1,443
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i <= (int)(n); i++) int main() { int N; cin >> N; vector<int> ans(10001); int v; rep(x, 41) { rep(y, 41) { rep(z, 41) { v = x * x + y * y + z * z + x * y + y * z + z * x; if (v <= 10000) ans.at...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 1; i <= (int)(n); i++) int main() { int N; cin >> N; vector<int> ans(10050); int v; rep(x, 105) { rep(y, 105) { rep(z, 105) { v = x * x + y * y + z * z + x * y + y * z + z * x; if (v < 10050) ans....
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 42, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]...
1
123
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; const double PI = 3.141592653589793238463; #define pb push_back #define pf push_front #define sz(v) ((int)(v).si...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; const double PI = 3.141592653589793238463; #define pb push_back #define pf push_front #define sz(v) ((int)(v).si...
[["-", 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
298
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> s(10005); for (long long int x = 1; x < 100; x++) { for (long long int y = 1; y < 100; y++) { for (long long int z = 1; z < 100; z++) { int a = x * x + y * y + z * z + x * y + y * z + z * x; if (a >...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> s(10005); for (long long int x = 1; x < 100; x++) { for (long long int y = 1; y < 100; y++) { for (long long int z = 1; z < 100; z++) { int a = x * x + y * y + z * z + x * y + y * z + z * x; if (a >...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
148
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<P, ll> PLL; typedef pair<P, P> PP; typedef vector<ll> VECLL; typedef vector<P> VECP; typedef priority_queue<P, VECP, greater<P>> PQP; typedef priority_queue<ll, VECLL, greater<ll>> PQll; #define rep(i, a, n) for (...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<P, ll> PLL; typedef pair<P, P> PP; typedef vector<ll> VECLL; typedef vector<P> VECP; typedef priority_queue<P, VECP, greater<P>> PQP; typedef priority_queue<ll, VECLL, greater<ll>> PQll; #define rep(i, a, n) for (...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
282
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> 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 = b; return 1; } return 0; } const int INF = 10010...
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> 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 = b; return 1; } return 0; } const int INF = 10010...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
331
n = int(input()) cnt = [0] * 11000 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): value = x*x + y*y + z*z + x*y + y*z + z*x if value <= n: cnt[value] += 1 for i in range(n+1): print(cnt[i])
n = int(input()) cnt = [0] * 11000 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): value = x*x + y*y + z*z + x*y + y*z + z*x if value <= n: cnt[value] += 1 for i in range(1,n+1): print(cnt[i])
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
98
import collections import sys input = sys.stdin.readline n= int(input()) # ans = [0]*n tmp = [] for x in range(1, int(n**0.5)+1): for y in range(1, int(n**0.5)+1): for z in range(1, int(n**0.5)+1): tmp.append(x**2+y**2+z**2+x*y+y*z+z*x) cnt = collections.Counter(tmp) for i in range(n): p...
import collections import sys input = sys.stdin.readline n= int(input()) # ans = [0]*n tmp = [] for x in range(1, int(n**0.5)+1): for y in range(1, int(n**0.5)+1): for z in range(1, int(n**0.5)+1): tmp.append(x**2+y**2+z**2+x*y+y*z+z*x) cnt = collections.Counter(tmp) for i in range(1,n+1): ...
[["+", 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
126
N = int(input()) #N,K,d= map(int,input().split()) #A = list(map(int,input().split())) #S = str(input()) #T = str(input()) num=np.zeros(10**4+1) 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 if ans < 10**4+1: ...
import numpy as np N = int(input()) #N,K,d= map(int,input().split()) #A = list(map(int,input().split())) #S = str(input()) #T = str(input()) num=np.zeros(10**4+1) 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 if ans ...
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 0, 656, 0, 596, 141, 704, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 596, 141, 704, 0, 272], ["+", 36, 36, 0, 656, 0, 596, 141, 704, 705, 22]]
5
114
n = int(input()) ans = [0] * n 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 + z * x if d < n: ans[d - 1] += 1 for i in ans: print(i)
n = int(input()) ans = [0] * n 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 + z * x if d <= n: ans[d - 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
92
N = int(input()) def calc(n): ans = [0 for i in range(n+1)] for x in range(1,n+1): a = x**2 if a>=n: break for y in range(1,1+n): b = y**2 if b>=n: break for z in range(1,1+n): c = z**2 if c>...
N = int(input()) def calc(n): ans = [0 for i in range(n+1)] for x in range(1,n+1): a = x**2 if a>=n: break for y in range(1,1+n): b = y**2 if b>=n: break for z in range(1,1+n): c = z**2 if c>...
[["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
151
N = int(input()) ans=[0]*(N+1) t=int(N**0.5+1) for x in range(1, t): for y in range(1, t): for z in range(1, t): v=x*x+y*y+z*z+x*y+y*z+z*x if v<=N+1: ans[v]+=1 for i in range(1,N+1): print(ans[i])
N = int(input()) ans=[0]*(N+1) t=int(N**0.5+1) for x in range(1, t): for y in range(1, t): for z in range(1, t): v=x*x+y*y+z*z+x*y+y*z+z*x if v<=N: ans[v]+=1 for i in range(1,N+1): print(ans[i])
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]]
5
116
//#include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; const int MAX = 50; const int SIZE = 1e6; int main() { int n; cin >> n; vector<int> v(SIZE, 0); for (int i = 1; i <= MAX; ++i) { for (int j = ...
//#include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; const int MAX = 101; const int SIZE = 1e6; int main() { int n; cin >> n; vector<int> v(SIZE, 0); for (int i = 1; i <= MAX; ++i) { for (int j =...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
185
n = int(input()) table = [0] * 1001 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x) if k < 1001: table[k] += 1 for i in range(1, n + 1): print(table[i])
n = int(input()) table = [0] * 10001 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x) if k < 10001: table[k] += 1 for i in range(1, n + 1): print(table[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
112
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def checker(): ans = [0] * 10000 for a in range(1, 101): for b in range(1, 101): for c in range(1, 101): n = a * a + b * b + c * c + a * b + b * c + c * a if n > 10000: ...
import sys input = sys.stdin.readline # sys.setrecursionlimit(100000) def checker(): ans = [0] * 10001 for a in range(1, 101): for b in range(1, 101): for c in range(1, 101): n = a * a + b * b + c * c + a * b + b * c + c * a if n > 10000: ...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
145
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<int, int> f; for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { for (int k = 0; k <= 100; k++) { f[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <= n; i++) {...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<int, int> f; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { f[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <= n; i++) {...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
128
#include "bits/stdc++.h" typedef long long ll; #define all(x) (x).begin(), (x).end() // sortなどの引数を省略 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define max3(x, y, z) max(x, max(y, z)) #define min3(x, y, z) min(x, min(y, z)) #ifdef _MSC_FULL_VER //デバッグ出力 #define dout cout #define debug() if (true) #define chec...
#include "bits/stdc++.h" typedef long long ll; #define all(x) (x).begin(), (x).end() // sortなどの引数を省略 #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define max3(x, y, z) max(x, max(y, z)) #define min3(x, y, z) min(x, min(y, z)) #ifdef _MSC_FULL_VER //デバッグ出力 #define dout cout #define debug() if (true) #define chec...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
219
N=int(input()) ans=[0 for a in range(1000)] for i in range(1,101): for x in range(1,101): for y in range(1,101): v=x*x+y*y+i*i+x*y+y*i+i*x if v<=N: ans[v]+=1 for b in range(1,N+1): print(ans[b])
N=int(input()) ans=[0 for a in range(11000)] for i in range(1,101): for x in range(1,101): for y in range(1,101): v=x*x+y*y+i*i+x*y+y*i+i*x if v<=N: ans[v]+=1 for b in range(1,N+1): print(ans[b])
[["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]]
5
105
#include <iostream> using namespace std; int main() { int N; cin >> N; int ans; ans = 0; int AK[10001]; for (int i = 0; i < 10001; i++) { AK[i] = 0; } for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { AK[i * i + j * j + k * k + i * k...
#include <iostream> using namespace std; int main() { int N; cin >> N; int ans; ans = 0; int AK[1000001]; for (int i = 0; i < 1000001; i++) { AK[i] = 0; } for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { AK[i * i + j * j + k * k + i...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 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]]
1
156
#include <stdio.h> int main(void) { int N; int i, x, y, z; if (scanf("%d", &N) == 1) ; int a[10002]; for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { int s; s = x * x + y * y + z * z + x * y + y * z + z * x; if (s > N) { bre...
#include <stdio.h> int main(void) { int N; int i, x, y, z; if (scanf("%d", &N) == 1) ; int a[100000]; for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { int s; s = x * x + y * y + z * z + x * y + y * z + z * x; if (s > N) { br...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
0
163
#include <stdio.h> int main(void) { int N; int i, x, y, z; if (scanf("%d", &N) == 1) ; int a[10002]; for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { int s; s = x * x + y * y + z * z + x * y + y * z + z * x; if (s > N) { bre...
#include <stdio.h> int main(void) { int N; int i, x, y, z; if (scanf("%d", &N) == 1) ; int a[100000]; for (x = 1; x <= 100; x++) { for (y = 1; y <= 100; y++) { for (z = 1; z <= 100; z++) { int s; s = x * x + y * y + z * z + x * y + y * z + z * x; if (s > N) { br...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 17, 33], ["+", 0, 1, 0, 27, 28, 69, 71, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, ...
0
163
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int len = Integer.parseInt(sc.nextLine()); int[] ans = new int[len]; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100;...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int len = Integer.parseInt(sc.nextLine()); int[] ans = new int[len + 1]; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <=...
[["+", 49, 200, 51, 227, 497, 505, 0, 16, 17, 72], ["+", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499], ["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
179
N = int(input()) n_list = [] count = 1 max_val = 1 res = 0 for x in range(1,42): for y in range(x,42): for z in range(y,42): res = x**2 +y**2 + z**2 + x*y + y*z + z*x for i in range(int(x!=y) + int(y!=z) + int(z!=x)-1): count *= 3-i if max_val < res: ...
N = int(input()) n_list = [] count = 1 max_val = 1 res = 0 for x in range(1,100): for y in range(x,100): for z in range(y,100): res = x**2 +y**2 + z**2 + x*y + y*z + z*x for i in range(int(x!=y) + int(y!=z) + int(z!=x)-1): count *= 3-i if max_val < res: ...
[["-", 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
179
#include <math.h> #include <stdio.h> int g(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int h(int x, int y, int z) { return x == y ? (y == z ? 1 : 3) : (y == z ? 3 : 6); } int main(void) { int a[1001] = {0}; int n; scanf("%d", &n); for (int x = 1;; x++) { int k = 6 ...
#include <math.h> #include <stdio.h> int g(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int h(int x, int y, int z) { return x == y ? (y == z ? 1 : 3) : (y == z ? 3 : 6); } int main(void) { int a[10001] = {0}; int n; scanf("%d", &n); for (int x = 1;; x++) { int k = 6...
[["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13]]
0
264
// Radhe Radhe #include <bits/stdc++.h> #define godspeed \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define mod 100000000...
// Radhe Radhe #include <bits/stdc++.h> #define godspeed \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define mod 100000000...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
196
#include <bits/stdc++.h> using namespace std; #define ll long long int #define cs(ele) cout << ele << '\n' int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> d(10050, 0); for (int i = 1; i <= 105; i++) { for (int j = 1; j <= 105; j++) { for (int k = 1; k <= 105; k++) {...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define cs(ele) cout << ele << '\n' int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> d(10050, 0); for (int i = 1; i <= 105; i++) { for (int j = 1; j <= 105; j++) { for (int k = 1; k <= 105; k++) {...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
172
n=int(input()) j=10501 l=[0 for i in range(j)] for x in range(1,101): for y in range(1,101): for z in range(1,101): v=x*x+y*y+z*z+y*x+x*z+z*y if(v<j): l[v]+=1 for i in range(n+1): print(l[i+1])
n=int(input()) j=10501 l=[0 for i in range(j)] for x in range(1,101): for y in range(1,101): for z in range(1,101): v=x*x+y*y+z*z+y*x+x*z+z*y if(v<j): l[v]+=1 for i in range(n): print(l[i+1])
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
110
#include <algorithm> #include <iostream> #include <vector> #define rep(i, a, b) for (int i = a; i < b; i++) #define ll long long using namespace std; int main() { int n; cin >> n; vector<int> v(1001, 0); rep(x, 1, 101) { rep(y, 1, 101) { rep(z, 1, 101) { if (x * x + y * y + z * z + x * y + y ...
#include <algorithm> #include <iostream> #include <vector> #define rep(i, a, b) for (long long i = a; i < b; i++) #define ll long long using namespace std; int main() { int n; cin >> n; vector<ll> v(10000, 0); rep(x, 1, 101) { rep(y, 1, 101) { rep(z, 1, 101) { if (x * x + y * y + z * z + x * ...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 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], ["+", ...
1
162
import sys def input(): return sys.stdin.readline().rstrip() def tc(): N = int(input()) def main(): N = int(input()) dp = [0]*(N+1) rt = int(N **0.5) +1 for i in range(1,rt): ii = i**2 for j in range(1,rt): jj = j**2 ij = i*j if ii + jj...
import sys def input(): return sys.stdin.readline().rstrip() def tc(): N = int(input()) def main(): N = int(input()) dp = [0]*(N+1) rt = int(N **0.5) +1 for i in range(1,rt): ii = i**2 for j in range(1,rt): jj = j**2 ij = i*j if ii + jj...
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 33], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
194
#! python3 # coding:utf-8 def main(): n = int(input()) ans = [0 for _ in range(n+1)] for x in range(1,100): for y in range(1,100): for z in range(1,100): eq = x**2 + y**2 + z**2 + x*y + y*z + z*x if eq < n+1: ans[eq]+=1 for i in...
#! python3 # coding:utf-8 def main(): n = int(input()) ans = [0 for _ in range(n)] for x in range(1,100): for y in range(1,100): for z in range(1,100): eq = x**2 + y**2 + z**2 + x*y + y*z + z*x if eq < n+1: ans[eq-1]+=1 for i in a...
[["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]]
5
116
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; for (int x = 1; x * x + x < i; x++) for (int y = 1; x * x + y * y + x * y + y + x + 1 < i; y++) for (int z = 1; x * x + y * y + z * z + x * (y + z) + y * z < i; z++) ...
#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; for (int x = 1; x * x + x <= i; x++) for (int y = 1; x * x + y * y + x * y + y + x + 1 <= i; y++) for (int z = 1; x * x + y * y + z * z + x * (y + z) + y * z <= i; z++) ...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 7, 8, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 7, 8, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 7, 8, 7, 15, 16, 17, 19]]
1
171
N = int(input()) arr = [0]*(N) lim = int(N**0.5 + 1) for i in range(1,lim): for j in range(1,lim): for k in range(1,lim): num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1 if num <= N: arr[num] += 1 print(*arr, sep='\n')
N = int(input()) arr = [0]*(N) lim = int(N**0.5 + 1) for i in range(1,lim): for j in range(1,lim): for k in range(1,lim): num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1 if num <= N-1: arr[num] += 1 print(*arr, sep='\n')
[["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]]
5
106
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = b - 1; i >= a; i--) #define mod 1000000007 #define pb push_back #define son \ ll t; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define int ll #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = b - 1; i >= a; i--) #define mod 1000000007 #define pb push_back #define son \ ll t; ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
225
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ // Created by White Knife on 15/04/20. // doot diddly donger cuckerino Hahahahahah #pragma GCC optimize("O3") #pragma GCC target("sse4") #pragma GCC target("popcnt") #include <bits/stdc++.h> #include <ext/pb_ds/as...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author */ // Created by White Knife on 15/04/20. // doot diddly donger cuckerino Hahahahahah #pragma GCC optimize("O3") #pragma GCC target("sse4") #pragma GCC target("popcnt") #include <bits/stdc++.h> #include <ext/pb_ds/as...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
960
n = int(input()) ans = [0] * 10010 def get_ans(n): cnt = 0 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): k = x**2 + y**2 + z**2 + x*y + y*z + z*x if(k <= 10000): ans[k] += 1 return ans ans = get_ans(n) for i in range(n+1): print(ans[i])
n = int(input()) ans = [0] * 10010 def get_ans(n): cnt = 0 for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): k = x**2 + y**2 + z**2 + x*y + y*z + z*x if(k <= 10000): ans[k] += 1 return ans ans = get_ans(n) 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
117
#include <stdio.h> int main() { long long n; scanf("%lld", &n); long long ans[n + 1]; for (long long i = 1; i <= n; i++) ans[i] = 0; for (long long a = 1; a <= 40; a++) { for (long long b = a; b <= 60; b++) { for (long long c = b; c <= 85; c++) { if ((a + b) * (a + b) + (c + b) * (c + ...
#include <stdio.h> int main() { long long n; scanf("%lld", &n); long long ans[n + 1]; for (long long i = 1; i <= n; i++) ans[i] = 0; for (long long a = 1; a <= 100; a++) { for (long long b = a; b <= 100; b++) { for (long long c = b; c <= 100; c++) { if ((a + b) * (a + b) + (c + b) * (c...
[["-", 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
354
def main(): 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): s = x**2 + y**2 + z**2 + x*y + y*z + z*x if 1 <= s <= N: ans[s] += 1 for i in range(1, N + 1): ...
def main(): 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): s = x**2 + y**2 + z**2 + x*y + y*z + z*x if 1 <= s <= N: ans[s] += 1 for i in range(1, N + 1): ...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
124
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define MOD 1000000007 #define ll long long int #define pair <ll, ll> pi //#define vector <ll> vi #define F first #define S second #define PB push_back #define MP make_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define MOD 1000000007 #define ll long long int #define pair <ll, ll> pi //#define vector <ll> vi #define F first #define S second #define PB push_back #define MP make_...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
235
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n; cin >> n; vector<int> ans(n + 1); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int s = x * x + y * y + z * z + x * y + y * z + z...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n; cin >> n; vector<int> ans(n + 1); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int s = x * x + y * y + z * z + x * y + y * z + z...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
152
# -*- coding: utf-8 -*- import numpy as np import sys from collections import deque from collections import defaultdict import heapq import collections import itertools import bisect from itertools import accumulate import copy def zz(): return list(map(int, sys.stdin.readline().split())) def z(): return in...
# -*- coding: utf-8 -*- import numpy as np import sys from collections import deque from collections import defaultdict import heapq import collections import itertools import bisect from itertools import accumulate import copy def zz(): return list(map(int, sys.stdin.readline().split())) def z(): return in...
[["-", 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
221
N = gets.to_i count = Array.new(N+1, 0) #puts count (1..32).each { |x| (1..32).each { |y| (1..32).each { |z| sum = x*x + y*y + z*z + x*y + y*z + z*x break if sum > N count[sum] += 1 } } } puts count[1,N]
N = gets.to_i count = Array.new(N+1, 0) #puts count (1..100).each { |x| (1..100).each { |y| (1..100).each { |z| sum = x*x + y*y + z*z + x*y + y*z + z*x break if sum > N count[sum] += 1 } } } puts count[1,N]
[["-", 0, 493, 0, 652, 486, 739, 0, 475, 444, 612], ["+", 0, 493, 0, 652, 486, 739, 0, 475, 444, 612], ["-", 8, 734, 0, 652, 486, 739, 0, 475, 444, 612], ["+", 8, 734, 0, 652, 486, 739, 0, 475, 444, 612]]
4
97
#include <iostream> using namespace std; int main() { int N, x, y, z, i; cin >> N; int count[1000000]; for (i = 1; i <= N; i++) { count[i] = 0; } for (x = 1; x <= N; ++x) { for (y = 1; y <= N; ++y) { for (z = 1; z <= N; ++z) { count[x * x + y * y + z * z + x * y + x * z + y * z]++; ...
#include <iostream> using namespace std; int main() { int N, x, y, z, i; cin >> N; int count[1000000]; for (i = 1; i <= N; i++) { count[i] = 0; } for (x = 1; x <= 100; ++x) { for (y = 1; y <= 100; ++y) { for (z = 1; z <= 100; ++z) { count[x * x + y * y + z * z + x * y + x * z + y * z]...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
155
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(n + 1); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int m = x * x + y ...
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(n + 1); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { int m = x * x + y ...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
151
#import sys #input = sys.stdin.readline import math from collections import defaultdict,deque ml=lambda:map(int,input().split()) ll=lambda:list(map(int,input().split())) ii=lambda:int(input()) ip=lambda:list(input()) ips=lambda:input().split() """========main code===============""" n=ii() d=defaultdict(int) for i in ...
#import sys #input = sys.stdin.readline import math from collections import defaultdict,deque ml=lambda:map(int,input().split()) ll=lambda:list(map(int,input().split())) ii=lambda:int(input()) ip=lambda:list(input()) ips=lambda:input().split() """========main code===============""" n=ii() d=defaultdict(int) for i in ...
[["-", 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
170
#include <bits/stdc++.h> #include <iostream> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define yesno(flg) \ if (flg) { \ cout << "YE...
#include <bits/stdc++.h> #include <iostream> #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, n) for (int i = n - 1; i >= 0; --i) #define yesno(flg) \ if (flg) { \ cout << "YE...
[["-", 0, 30, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 0, 30, 0, 43, 49, 50, 49, 80, 81, 13]]
1
303
#include <bits/stdc++.h> using namespace std; #define ALL(v) v.begin(), v.end() #define V vector #define P pair typedef long double ld; typedef long long ll; const int MOD = 1000000007; const int IINF = INT_MAX; const ll INF = 1LL << 60; int main() { int n; cin >> n; V<int> ans(1050); for (int x = 1; x <= 10...
#include <bits/stdc++.h> using namespace std; #define ALL(v) v.begin(), v.end() #define V vector #define P pair typedef long double ld; typedef long long ll; const int MOD = 1000000007; const int IINF = INT_MAX; const ll INF = 1LL << 60; int main() { int n; cin >> n; V<int> ans(10050); for (int x = 1; x <= 1...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
185
# this is the third task from collections import defaultdict N=int(input()) n=1 s=3 brkLoop=False while True : r=(s)**2-(1)-(1)-(n) if ( r >= N ): break; else: n=n+1 s=s+1 out=defaultdict(list) for (x,y,z) in tuple((i,j,k) for i in range(1, n+1) for j in range (1,n+1) for k in ...
# this is the third task from collections import defaultdict N=int(input()) n=1 s=3 brkLoop=False while True : r=(s)**2-(1)-(1)-(n) if ( r >= N ): break; else: n=n+1 s=s+1 out=defaultdict(list) for (x,y,z) in tuple((i,j,k) for i in range(1, n+1) for j in range (1,n+1) for k in ...
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 19]]
5
210
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map...
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map...
[["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
1
220
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <stdio.h> #include <string> #include <vector> int main(void) { int n; long long s; std::cin >> n; std::vector<int> f(10010); for (int x = 1; x <= n; x++) { for (int y = 1; y <= n; y++) { for (int z ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <stdio.h> #include <string> #include <vector> int main(void) { int n; long long s; std::cin >> n; std::vector<int> f(1000500); for (int x = 1; x <= 102; x++) { for (int y = 1; y <= 102; y++) { for (...
[["-", 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, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]]
1
166
#include <bits/stdc++.h> #include <cmath> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPS(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() #define sz(x) (int)(x).size() #define v(T) vector<T> #define VEC vecto...
#include <bits/stdc++.h> #include <cmath> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REPS(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i) #define ALL(obj) (obj).begin(), (obj).end() #define sz(x) (int)(x).size() #define v(T) vector<T> #define VEC vecto...
[["-", 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], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
383
N = int(input()) lis = [0]*N 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 if ans > N: pass else: lis[ans] += 1 for i in range(N): print(lis[i])
N = int(input()) lis = [0]*N 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 if ans >= N: pass else: lis[ans] += 1 for i in range(N): print(lis[i])
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
101
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 = x*x + y*y + z*z + x*y + y*z + z*x if num>N: break ans[num] = ans[num] + 1 for m in ans: print(m)
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 = x*x + y*y + z*z + x*y + y*z + z*x if num>N: break ans[num] = ans[num] + 1 for m in ans[1:]: print(m)
[["+", 36, 36, 0, 656, 0, 7, 12, 206, 0, 70], ["+", 0, 656, 0, 7, 12, 206, 206, 663, 0, 612], ["+", 0, 656, 0, 7, 12, 206, 206, 663, 0, 102], ["+", 36, 36, 0, 656, 0, 7, 12, 206, 0, 73]]
5
100
#include <bits/stdc++.h> using namespace std; const int N = 1e4 + 5; int frr[N]; int main() { int n; cin >> n; int cnt = 0; for (int i = 1; i <= 50; i++) { for (int j = 1; j <= 50; j++) { for (int k = 1; k <= 50; k++) { long long p = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (k * i...
#include <bits/stdc++.h> using namespace std; const int N = 1e4 + 5; int frr[N]; int main() { int n; cin >> n; int cnt = 0; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { long long p = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (k ...
[["-", 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
163
N = gets.chomp.to_i ans = Array.new(10_000, 0) n = Math.sqrt(1000) (1..n).each do |x| (1..n).each do |y| (1..n).each do |z| v = x**2 + y**2 + z**2 + x * y + y * z + x * z ans[v] += 1 if v < 10_000 end end end (1..N).each do |i| puts ans[i] end
N = gets.chomp.to_i ans = Array.new(10_050, 0) n = Math.sqrt(10_050) (1..n).each do |x| (1..n).each do |y| (1..n).each do |z| v = x**2 + y**2 + z**2 + x * y + y * z + x * z ans[v] += 1 if v < 10_050 end end end (1..N).each do |i| puts ans[i] end
[["-", 0, 493, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 493, 0, 662, 12, 652, 3, 4, 0, 612], ["-", 196, 737, 8, 736, 0, 751, 15, 738, 12, 612], ["+", 196, 737, 8, 736, 0, 751, 15, 738, 12, 612]]
4
113
import math def calc(x, y, z): return x * x + y * y + z * z + x * y + y * z + z * x def calc_combination_num(x, y, z): if x == y and y == z: # 全部同じ数字なら組み合わせの個数は1個 return 1 if x == y or y == z: # どれか2つが同じ数字なら組み合わせの個数は3C2 = 3個 return 3 # 全部違う数字なら組み合わせの個数は3P2 = 6個 retur...
import math def calc(x, y, z): return x * x + y * y + z * z + x * y + y * z + z * x def calc_combination_num(x, y, z): if x == y and y == z: # 全部同じ数字なら組み合わせの個数は1個 return 1 if x == y or y == z: # どれか2つが同じ数字なら組み合わせの個数は3C2 = 3個 return 3 # 全部違う数字なら組み合わせの個数は3P2 = 6個 retur...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
218
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using namespace std; using ll = long long; using P = pair<ll, ll>; const string ln = "\n"; constexpr int INF = 1001001001; constexpr int MOD = 1000000007; vector<ll> d(1000000); void prep() { for (int x = 1; x <= ...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using namespace std; using ll = long long; using P = pair<ll, ll>; const string ln = "\n"; constexpr int INF = 1001001001; constexpr int MOD = 1000000007; vector<ll> d(1000000); void prep() { for (int x = 1; x <= ...
[["-", 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, 15, 339, 51, 16, 12, 13]]
1
217
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long int; const ll MOD = 1e9 + 5; ll mod_pow(ll k, ll p) { if (k == 0) { return 1 % p; } if (k == 1) { return 2 % p; } if (k % 2 == 0...
#include <algorithm> #include <bitset> #include <climits> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; using ll = long long int; const ll MOD = 1e9 + 5; ll mod_pow(ll k, ll p) { if (k == 0) { return 1 % p; } if (k == 1) { return 2 % p; } if (k % 2 == 0...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
350
from collections import defaultdict ans = defaultdict(int) N = int(input()) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1 for i in range(N): print(ans[i])
from collections import defaultdict ans = defaultdict(int) N = int(input()) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1 for i in range(N): print(ans[i+1])
[["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]]
5
91
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using i64 = int64_t; using u64 = uint64_t; using u32 = uint32_t; #define CPP_STR(x) CPP_STR_I(x) #define CPP_CAT(x, y) CPP_CAT_I(x, y) #define CPP_STR_I(args...) #args #define CPP_CAT_I(x, y) x##y constexpr int64_t MOD = 1000000007LL; #def...
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using i64 = int64_t; using u64 = uint64_t; using u32 = uint32_t; #define CPP_STR(x) CPP_STR_I(x) #define CPP_CAT(x, y) CPP_CAT_I(x, y) #define CPP_STR_I(args...) #args #define CPP_CAT_I(x, y) x##y constexpr int64_t MOD = 1000000007LL; #def...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
443
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int n; cin >> n; vector<int> dp(10050, 0); for (int i = 1; i < 106; i++) { for (int j = 1; j < 106; j++) { for (int k = 1; k < 106; k++) { int temp = i * i + j * j + k * k + i * j + j * k + k * i; i...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int n; cin >> n; vector<int> dp(10050, 0); for (int i = 1; i < 106; i++) { for (int j = 1; j < 106; j++) { for (int k = 1; k < 106; k++) { int temp = i * i + j * j + k * k + i * j + j * k + k * i; i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 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, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
150
#include <bits/stdc++.h> #define ll long long #define ld long double #define dbg(x) cout << #x << ": " << x << "\n"; using namespace std; #define inf 1e9 + 7 #define PI 3.14159265358979323846264338327950L #define pii pair<ll, ll> const int mx = 1e4 + 2; int ans[mx]; int main() { ios_base::sync_with_stdio(0); cin.t...
#include <bits/stdc++.h> #define ll long long #define ld long double #define dbg(x) cout << #x << ": " << x << "\n"; using namespace std; #define inf 1e9 + 7 #define PI 3.14159265358979323846264338327950L #define pii pair<ll, ll> const int mx = 1e4 + 2; int ans[mx]; int main() { ios_base::sync_with_stdio(0); cin.t...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
199
#include <bits/stdc++.h> using namespace std; #define MN 10001 int arr[MN]; int main() { int n; cin >> n; for (int i = 1; i < MN; i++) { int r = i * i; if (r > n) break; for (int j = 1; j <= i; j++) { int r1 = r + j * j; if (r1 > n) break; for (int k = 1; k <= j; k+...
#include <bits/stdc++.h> using namespace std; #define MN 10001 int arr[MN]; int main() { int n; cin >> n; for (int i = 1; i < MN; i++) { int r = i * i; if (r > n) break; for (int j = 1; j <= i; j++) { int r1 = r + j * j; if (r1 > n) break; for (int k = 1; k <= j; k+...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107]]
1
212
<?php fscanf(STDIN, "%d", $a); $arr = []; for($x = 0; $x < 100 ; $x++){ for($y = 0; $y < 100 ; $y++){ for($z = 0; $z < 100 ; $z++){ $ans = ($x * $x) + ($y * $y) + ($z * $z) +($x * $y) + ($y * $z) + ($x * $z); if(isset($arr[$ans])){ $arr[$ans]++; }else{ ...
<?php fscanf(STDIN, "%d", $a); $arr = []; for($x = 1; $x < 100 ; $x++){ for($y = 1; $y < 100 ; $y++){ for($z = 1; $z < 100 ; $z++){ $ans = ($x * $x) + ($y * $y) + ($z * $z) +($x * $y) + ($y * $z) + ($x * $z); if(isset($arr[$ans])){ $arr[$ans]++; }else{ ...
[["-", 36, 36, 0, 493, 0, 7, 0, 11, 12, 612], ["+", 36, 36, 0, 493, 0, 7, 0, 11, 12, 612], ["-", 0, 7, 0, 9, 0, 7, 0, 11, 12, 612], ["+", 0, 7, 0, 9, 0, 7, 0, 11, 12, 612], ["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 611]]
6
213