Datasets:

problem_id
stringlengths
6
6
buggy_code
stringlengths
8
526k
fixed_code
stringlengths
12
526k
labels
listlengths
0
15
buggy_submission_id
int64
1
1.54M
fixed_submission_id
int64
2
1.54M
user_id
stringlengths
10
10
language
stringclasses
9 values
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, norm, sum = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int k = 0; k < D; k++) { cin >> X[i][k]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { norm = 0; for (int k = 0; k < D; k++) { norm += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } bool sq = false; for (int l = 0; l < norm; l++) { if (norm == l * l) { sq = true; } } if (sq) { sum++; } } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, norm, sum = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int k = 0; k < D; k++) { cin >> X[i][k]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { norm = 0; for (int k = 0; k < D; k++) { norm += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } bool sq = false; for (int l = 0; l <= norm; l++) { if (norm == l * l) { sq = true; } } if (sq) { sum++; } } } cout << sum << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,015
786,016
u410888565
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, norm, sum = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int k = 0; k < D; k++) { cin >> X[i][k]; } } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { norm = 0; for (int k = 0; k < D; k++) { norm += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } bool sq = false; for (int l = 0; l < norm; l++) { if (norm == l * l) { sq = true; } } if (sq) { sum++; } } } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, norm, sum = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int k = 0; k < D; k++) { cin >> X[i][k]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { norm = 0; for (int k = 0; k < D; k++) { norm += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } bool sq = false; for (int l = 0; l <= norm; l++) { if (norm == l * l) { sq = true; } } if (sq) { sum++; } } } cout << sum << endl; return 0; }
[ "identifier.replace.add", "literal.replace.remove", "control_flow.loop.for.initializer.change", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,017
786,016
u410888565
cpp
p02982
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* clang-format off */ #define INF (INT_MAX / 4) #define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() // #define __DEBUG__ #ifdef __DEBUG__ #define CH_P(a) cout <<"check_point("<<#a<<")" << "\n"; #define DEBUG(x) cout<<#x<<":"<<x<<"\n" #define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n" #endif #ifndef __DEBUG__ #define CH_P(a) #define DEBUG(x) #define DEBUGS(v) #endif #define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now(); #define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now(); #define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n"; /* clang-format on */ int main() { int n, d, ans = 0; cin >> n >> d; int x[n][d]; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; REP(k, d) { dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } REP(l, 64) { if (l * l == dist) ans++; } } } cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* clang-format off */ #define INF (INT_MAX / 4) #define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i) #define ALL(a) (a).begin(), (a).end() // #define __DEBUG__ #ifdef __DEBUG__ #define CH_P(a) cout <<"check_point("<<#a<<")" << "\n"; #define DEBUG(x) cout<<#x<<":"<<x<<"\n" #define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n" #endif #ifndef __DEBUG__ #define CH_P(a) #define DEBUG(x) #define DEBUGS(v) #endif #define TIMER_S(start) chrono::system_clock::time_point start = chrono::system_clock::now(); #define TIMER_E(end) chrono::system_clock::time_point end = chrono::system_clock::now(); #define TIME(start, end) cout << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count()) << "ms" << "\n"; /* clang-format on */ int main() { int n, d, ans = 0; cin >> n >> d; int x[n][d]; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; REP(k, d) { dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } REP(l, 128) { if (l * l == dist) ans++; } } } cout << ans << "\n"; return 0; }
[ "literal.number.change", "call.arguments.change" ]
786,020
786,021
u517348254
cpp
p02982
#include <stdio.h> int N, M, A[11][11]; bool cnt[20000]; int main() { scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) for (int j = 0; j < M; j++) scanf("%d", &A[i][j]); for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) { int s = 0; for (int k = 0; k < M; k++) s += (A[i][k] - A[j][k]) * (A[i][k] - A[j][k]); cnt[s]++; } int ans = 0; for (int i = 0; i <= 140; i++) ans += cnt[i * i]; printf("%d\n", ans); return 0; }
#include <stdio.h> int N, M, A[11][11], cnt[20000]; int main() { scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) for (int j = 0; j < M; j++) scanf("%d", &A[i][j]); for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) { int s = 0; for (int k = 0; k < M; k++) s += (A[i][k] - A[j][k]) * (A[i][k] - A[j][k]); cnt[s]++; } int ans = 0; for (int i = 0; i <= 140; i++) ans += cnt[i * i]; printf("%d\n", ans); return 0; }
[]
786,051
786,052
u233632872
cpp
p02982
#include <stdio.h> int N, M, A[11][11]; bool cnt[5000]; int main() { scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) for (int j = 0; j < M; j++) scanf("%d", &A[i][j]); for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) { int s = 0; for (int k = 0; k < M; k++) s += (A[i][k] - A[j][k]) * (A[i][k] - A[j][k]); cnt[s]++; } int ans = 0; for (int i = 0; i <= 70; i++) ans += cnt[i * i]; printf("%d\n", ans); return 0; }
#include <stdio.h> int N, M, A[11][11], cnt[20000]; int main() { scanf("%d %d", &N, &M); for (int i = 0; i < N; i++) for (int j = 0; j < M; j++) scanf("%d", &A[i][j]); for (int i = 0; i < N; i++) for (int j = i + 1; j < N; j++) { int s = 0; for (int k = 0; k < M; k++) s += (A[i][k] - A[j][k]) * (A[i][k] - A[j][k]); cnt[s]++; } int ans = 0; for (int i = 0; i <= 140; i++) ans += cnt[i * i]; printf("%d\n", ans); return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
786,053
786,052
u233632872
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int i, j; int s[n][d]; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> s[i][j]; } } int count = 0, x; for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { int sum = 0; for (int k = 0; k < d; k++) { sum += (s[i][k] - s[j][k]) * (s[i][k] - s[j][k]); } for (x = 0; x < sum; x++) { if (x * x == sum) { count++; break; } } } } cout << count; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int i, j; int s[n][d]; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> s[i][j]; } } int count = 0, x; for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { int sum = 0; for (int k = 0; k < d; k++) { sum += (s[i][k] - s[j][k]) * (s[i][k] - s[j][k]); } for (x = 0; x <= sum; x++) { if (x * x == sum) { count++; break; } } } } cout << count; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,098
786,099
u130651752
cpp
p02982
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) int main() { int n, d; cin >> n >> d; int x[n][d]; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } int dist[50][50]; rep(i, 50) { rep(j, 50) { dist[i][j] = 0; } } rep(i, n) { rep(j, n) { rep(k, d) { int dx = (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); dist[i][j] = dist[i][j] + dx; } } } int ans = 0; rep(i, n) { rep(j, n) { REP(k, 40) { if (i != j && k * k == dist[i][j]) { ans++; } } } } cout << ans / 2 << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 1; i <= n; i++) int main() { int n, d; cin >> n >> d; int x[n][d]; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } int dist[50][50]; rep(i, 50) { rep(j, 50) { dist[i][j] = 0; } } rep(i, n) { rep(j, n) { rep(k, d) { int dx = (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); dist[i][j] = dist[i][j] + dx; } } } int ans = 0; rep(i, n) { rep(j, n) { REP(k, 1000) { if (i < j && k * k == dist[i][j]) { ans++; } } } } cout << ans << endl; }
[ "literal.number.change", "call.arguments.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "expression.operation.binary.remove" ]
786,107
786,105
u821071900
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d, a[11][11], i, j, k, count = 0, ans = 0; double s[50] = {0}, b[i][j]; cin >> n >> d; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> a[i][j]; b[i][j] = a[i][j]; } } for (i = 0; i < n - 1; i++) { for (j = i + 1; j < n; j++) { for (k = 0; k < d; k++) { s[ans] = s[ans] + (pow((b[i][k] - b[j][k]), 2)); } s[ans] = sqrt(s[ans]); if ((round(s[ans]) - (s[ans])) == 0) { count++; } ans++; } } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d, a[11][11], i, j, k, count = 0, ans = 0; double s[50] = {0}, b[11][11]; cin >> n >> d; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> a[i][j]; b[i][j] = a[i][j]; } } for (i = 0; i < n - 1; i++) { for (j = i + 1; j < n; j++) { for (k = 0; k < d; k++) { s[ans] = s[ans] + (pow((b[i][k] - b[j][k]), 2)); } s[ans] = sqrt(s[ans]); if ((round(s[ans]) - (s[ans])) == 0) { count++; } ans++; } } cout << count << endl; return 0; }
[ "identifier.replace.remove", "literal.replace.add", "variable_declaration.array_dimensions.change" ]
786,110
786,111
u317148714
cpp
p02982
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <vector> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) #define drep(i, cc, n) for (int i = cc; i >= n; --i) typedef long long ll; using namespace std; int main() { int n, d; cin >> n >> d; int x[n][d]; int ans = 0; rep(i, 0, n - 1) { rep(j, 0, d - 1) { cin >> x[i][j]; } } int diff; int hoge = 0; rep(i, 0, n - 1) { rep(j, i + 1, n - 1) { rep(k, 0, d - 1) { diff = abs(x[i][k] - x[j][k]); hoge += diff * diff; } bool flag = false; rep(k, 1, hoge) { if (k * k == hoge) { flag = true; break; } } if (flag == true) ans++; } } cout << ans << endl; return 0; }
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <vector> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) #define drep(i, cc, n) for (int i = cc; i >= n; --i) typedef long long ll; using namespace std; int main() { int n, d; cin >> n >> d; int x[n][d]; int ans = 0; rep(i, 0, n - 1) { rep(j, 0, d - 1) { cin >> x[i][j]; } } int diff; int hoge = 0; rep(i, 0, n - 1) { rep(j, i + 1, n - 1) { hoge = 0; rep(k, 0, d - 1) { diff = abs(x[i][k] - x[j][k]); hoge += diff * diff; } bool flag = false; rep(k, 0, hoge) { if (k * k == hoge) { flag = true; break; } } if (flag == true) ans++; } } cout << ans << endl; return 0; }
[ "assignment.add", "literal.number.change", "call.arguments.change" ]
786,273
786,274
u374678351
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int N, D, x, y; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int r = 0, d = 0, p = 0; ; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { r = abs(X[i][k] - X[j][k]); d += r * r; } for (int k = 0; k < d; k++) { if (k * k == d) { p++; } } d = 0; } } cout << p << endl; }
#include <cmath> #include <iostream> using namespace std; int main() { int N, D, x, y; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int r = 0, d = 0, p = 0; ; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { r = abs(X[i][k] - X[j][k]); d += r * r; } for (int k = 0; k <= d; k++) { if (k * k == d) { p++; } } d = 0; } } cout << p << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,311
786,312
u627821211
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int N, D, x, y; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int r = 0, d = 0, p = 0; ; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { r = abs(X[i][k] - X[j][k]); d += r * r; } for (int k = 0; k < d; k++) { if (k * k == d) { p++; } } } } cout << p << endl; }
#include <cmath> #include <iostream> using namespace std; int main() { int N, D, x, y; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int r = 0, d = 0, p = 0; ; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { r = abs(X[i][k] - X[j][k]); d += r * r; } for (int k = 0; k <= d; k++) { if (k * k == d) { p++; } } d = 0; } } cout << p << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "assignment.add" ]
786,313
786,312
u627821211
cpp
p02982
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define print(n) std::cout << n << std::endl using namespace std; int main() { int n, d; cin >> n >> d; int x[n][d]; rep(i, n) rep(j, d) cin >> x[i][j]; int count = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { double norm = 0; double length = 0; for (int k = 0; k < d; ++k) { int diff = abs(x[i][k] - x[j][k]); norm += pow(diff, 2); } length = pow(norm, 0.5); print(length); if (fmod(length, 1) == 0) count++; } } print(count); }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define print(n) std::cout << n << std::endl using namespace std; int main() { int n, d; cin >> n >> d; int x[n][d]; rep(i, n) rep(j, d) cin >> x[i][j]; int count = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { double norm = 0; double length = 0; for (int k = 0; k < d; ++k) { int diff = abs(x[i][k] - x[j][k]); norm += pow(diff, 2); } length = pow(norm, 0.5); // print(length); if (fmod(length, 1) == 0) count++; } } print(count); }
[ "call.remove" ]
786,375
786,376
u999788719
cpp
p02982
// B - Good Distance #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const int MOD = 1e9 + 7; vector<int> X[10]; int calc_dist_sq(int D, vector<int> A, vector<int> B) { int res = 0; for (int i = 0; i < D; i++) { res += (A[i] - B[i]) * (A[i] - B[i]); } return res; } int main() { int N, D; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { int x; cin >> x; X[i].push_back(x); } } int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { int dist_sq = calc_dist_sq(D, X[i], X[j]); if (sqrt(dist_sq) * sqrt(dist_sq) == dist_sq) ans++; } } cout << ans << endl; return 0; }
// B - Good Distance #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; // const int MOD = 1e9 + 7; vector<int> X[10]; int calc_dist_sq(int D, vector<int> A, vector<int> B) { int res = 0; for (int i = 0; i < D; i++) { res += (A[i] - B[i]) * (A[i] - B[i]); } return res; } int main() { int N, D; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { int x; cin >> x; X[i].push_back(x); } } int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { int dist_sq = calc_dist_sq(D, X[i], X[j]); if ((int)sqrt(dist_sq) * (int)sqrt(dist_sq) == dist_sq) ans++; } } cout << ans << endl; return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
786,383
786,384
u790272146
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a[i][j]; } } int c = 0; for (int i = 0; i < n - 1; i++) { for (int g = i + 1; g < n; g++) { int sum = 0; for (int j = 0; j < d; j++) { sum += (a[i][j] - a[g][j]) * (a[i][j] - a[g][j]); } double sq = sqrt(sum); if (sq * sq == sum) c++; } } cout << c; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a[i][j]; } } int c = 0; for (int i = 0; i < n - 1; i++) { for (int g = i + 1; g < n; g++) { double sum = 0; for (int j = 0; j < d; j++) { sum += (a[i][j] - a[g][j]) * (a[i][j] - a[g][j]); } int sq = (int)sqrt(sum); if (sq * sq == sum) c++; } } cout << c; return 0; }
[ "variable_declaration.type.primitive.change" ]
786,395
786,396
u866310595
cpp
p02982
/*{{{*/ #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define REP(I, N) for (int I = 0; I < (N); ++I) #define REPP(I, A, B) for (int I = (A); I < (B); ++I) #define FOR(I, A, B) for (int I = (A); I <= (B); ++I) #define FORS(I, S) for (int I = 0; S[I]; ++I) #define RS(X) scanf("%s", (X)) #define SORT_UNIQUE(c) \ (sort(c.begin(), c.end()), \ c.resize(distance(c.begin(), unique(c.begin(), c.end())))) #define GET_POS(c, x) (lower_bound(c.begin(), c.end(), x) - c.begin()) #define CASET \ int ___T; \ scanf("%d", &___T); \ for (int cs = 1; cs <= ___T; cs++) #define MP make_pair #define PB push_back #define MS0(X) memset((X), 0, sizeof((X))) #define MS1(X) memset((X), -1, sizeof((X))) #define LEN(X) strlen(X) #define F first #define S second using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef long double LD; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<PII> VPII; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; template <class T> void _R(T &x) { cin >> x; } void _R(int &x) { scanf("%d", &x); } void _R(LL &x) { scanf("%lld", &x); } void _R(double &x) { scanf("%lf", &x); } void _R(char &x) { scanf(" %c", &x); } void _R(char *x) { scanf("%s", x); } void R() {} template <class T, class... U> void R(T &head, U &...tail) { _R(head); R(tail...); } template <class T> void _W(const T &x) { cout << x; } void _W(const int &x) { printf("%d", x); } void _W(const LL &x) { printf("%lld", x); } void _W(const double &x) { printf("%.16f", x); } void _W(const char &x) { putchar(x); } void _W(const char *x) { printf("%s", x); } template <class T, class U> void _W(const pair<T, U> &x) { _W(x.F); putchar(' '); _W(x.S); } template <class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); } void W() {} template <class T, class... U> void W(const T &head, const U &...tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); } #ifdef HOME #define DEBUG(...) \ { \ printf("# "); \ printf(__VA_ARGS__); \ puts(""); \ } #else #define DEBUG(...) #endif int MOD = 1e9 + 7; void ADD(LL &x, LL v) { x = (x + v) % MOD; if (x < 0) x += MOD; } /*}}}*/ const int SIZE = 1e6 + 10; int X[10][10]; int sqr(int x) { return x * x; } bool dis(int x, int y, int D) { int v = 0; REP(i, D) { v += sqr(X[x][i] - X[y][i]); } double u = sqrt(v); return u * u == v; } int main() { int N, D; R(N, D); REP(i, N) REP(j, D) R(X[i][j]); int an = 0; REP(i, N) REP(j, i) { if (dis(i, j, D)) an++; } W(an); return 0; }
/*{{{*/ #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <limits.h> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define REP(I, N) for (int I = 0; I < (N); ++I) #define REPP(I, A, B) for (int I = (A); I < (B); ++I) #define FOR(I, A, B) for (int I = (A); I <= (B); ++I) #define FORS(I, S) for (int I = 0; S[I]; ++I) #define RS(X) scanf("%s", (X)) #define SORT_UNIQUE(c) \ (sort(c.begin(), c.end()), \ c.resize(distance(c.begin(), unique(c.begin(), c.end())))) #define GET_POS(c, x) (lower_bound(c.begin(), c.end(), x) - c.begin()) #define CASET \ int ___T; \ scanf("%d", &___T); \ for (int cs = 1; cs <= ___T; cs++) #define MP make_pair #define PB push_back #define MS0(X) memset((X), 0, sizeof((X))) #define MS1(X) memset((X), -1, sizeof((X))) #define LEN(X) strlen(X) #define F first #define S second using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef long double LD; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<PII> VPII; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; template <class T> void _R(T &x) { cin >> x; } void _R(int &x) { scanf("%d", &x); } void _R(LL &x) { scanf("%lld", &x); } void _R(double &x) { scanf("%lf", &x); } void _R(char &x) { scanf(" %c", &x); } void _R(char *x) { scanf("%s", x); } void R() {} template <class T, class... U> void R(T &head, U &...tail) { _R(head); R(tail...); } template <class T> void _W(const T &x) { cout << x; } void _W(const int &x) { printf("%d", x); } void _W(const LL &x) { printf("%lld", x); } void _W(const double &x) { printf("%.16f", x); } void _W(const char &x) { putchar(x); } void _W(const char *x) { printf("%s", x); } template <class T, class U> void _W(const pair<T, U> &x) { _W(x.F); putchar(' '); _W(x.S); } template <class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); } void W() {} template <class T, class... U> void W(const T &head, const U &...tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); } #ifdef HOME #define DEBUG(...) \ { \ printf("# "); \ printf(__VA_ARGS__); \ puts(""); \ } #else #define DEBUG(...) #endif int MOD = 1e9 + 7; void ADD(LL &x, LL v) { x = (x + v) % MOD; if (x < 0) x += MOD; } /*}}}*/ const int SIZE = 1e6 + 10; int X[10][10]; int sqr(int x) { return x * x; } bool dis(int x, int y, int D) { int v = 0; REP(i, D) { v += sqr(X[x][i] - X[y][i]); } int u = sqrt(v); return u * u == v; } int main() { int N, D; R(N, D); REP(i, N) REP(j, D) R(X[i][j]); int an = 0; REP(i, N) REP(j, i) { if (dis(i, j, D)) an++; } W(an); return 0; }
[ "variable_declaration.type.primitive.change" ]
786,452
786,453
u284124505
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, X[10][10]; int num = 0; cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 1; j <= D; j++) cin >> X[i][j]; } for (int n = 1; n <= N; n++) { for (int i = 1; i <= N; i++) { int a = 0; for (int j = 1; j <= D; j++) { a += (X[n][j] - X[i][j]) * (X[n][j] - X[i][j]); } int temp = sqrt(a); if (temp * temp == a) num++; } } cout << num << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, X[10][10]; int num = 0; cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 1; j <= D; j++) cin >> X[i][j]; } for (int n = 1; n < N; n++) { for (int i = n + 1; i <= N; i++) { int a = 0; for (int j = 1; j <= D; j++) { a += (X[n][j] - X[i][j]) * (X[n][j] - X[i][j]); } int temp = sqrt(a); if (temp * temp == a) num++; } } cout << num << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "control_flow.loop.for.initializer.change" ]
786,454
786,455
u163149221
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, X[10][10]; int num = 0; cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 0; j <= D; j++) cin >> X[i][j]; } for (int n = 1; n <= N; n++) { for (int i = 1; i <= N; i++) { int a = 0; for (int j = 1; j <= D; j++) { a += (X[n][j] - X[i][j]) * (X[n][j] - X[i][j]); } int temp = sqrt(a); if (temp * temp == a) num++; } } cout << num << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, X[10][10]; int num = 0; cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 1; j <= D; j++) cin >> X[i][j]; } for (int n = 1; n < N; n++) { for (int i = n + 1; i <= N; i++) { int a = 0; for (int j = 1; j <= D; j++) { a += (X[n][j] - X[i][j]) * (X[n][j] - X[i][j]); } int temp = sqrt(a); if (temp * temp == a) num++; } } cout << num << endl; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
786,456
786,455
u163149221
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main(void) { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) cin >> a[i][j]; } int count = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int c = 0; for (int k = 0; k < d; k++) { int b = 0; b = abs(a[i][k] - a[j][k]); c += b * b; } bool check = false; for (int k = 1; k < c; k++) { if (k * k == c) check = true; } if (check == true) count++; } } cout << count; }
#include <bits/stdc++.h> using namespace std; int main(void) { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) cin >> a[i][j]; } int count = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int c = 0; for (int k = 0; k < d; k++) { int b = 0; b = abs(a[i][k] - a[j][k]); c += b * b; } bool check = false; for (int k = 0; k <= c; k++) { if (k * k == c) check = true; } if (check == true) count++; } } cout << count; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
786,466
786,467
u512624048
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int d[15][15]; int main(void) { int n, m, sum = 0, cnt = 0; double temp; cin >> n >> m; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> d[i][j]; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { sum = 0; for (int k = 0; k < m; k++) { sum += (d[i][k] - d[j][k]) * (d[i][k] - d[j][k]); } temp = sqrt((double)sum); if (temp * temp == sum) cnt++; } cout << cnt; return 0; }
#include <cmath> #include <iostream> using namespace std; int d[15][15]; int main(void) { int n, m, sum = 0, cnt = 0; int temp; cin >> n >> m; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> d[i][j]; for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) { sum = 0; for (int k = 0; k < m; k++) { sum += (d[i][k] - d[j][k]) * (d[i][k] - d[j][k]); } temp = sqrt((double)sum); if (temp * temp == sum) cnt++; } cout << cnt; return 0; }
[ "variable_declaration.type.primitive.change" ]
786,476
786,477
u959634984
cpp
p02982
#include <bits/stdc++.h> using namespace std; #define ll long long // long long省略 #define pb push_back // push_back省略 #define mp make_pair // make_pair省略 #define fi first // first省略 #define se second // second省略 #define itn int // int誤字保険 #define count cout // cout誤字保険 #define vecotr vector // vector誤字保険 #define ednl endl // endl誤字保険 #define opt() \ cin.tie(0); \ ios::sync_with_stdio(false) // 入出力速度改善 #define rep(i, l, r) \ for (ll i = (l); i < (r); i++) // 範囲[l, r)で刻み1のfor文(順方向) #define repp(i, l, r, k) \ for (ll i = (l); i < (r); i += (k)) // 範囲[l, r)で刻みkのfor文(順方向) #define rrep(i, l, r) \ for (ll i = (r - 1); i >= (l); i--) // 範囲[l, r)で刻み1のfor文(逆方向) #define rrepp(i, l, r, k) \ for (ll i = (r - 1); i >= (l); i -= (k)) // 範囲[l, r)で刻みkのfor文(逆方向) #define all(x) (x).begin(), (x).end() // vectorのポインタ位置指定用 #define max(p, q) ((p) > (q) ? (p) : (q)) // max拡張 #define min(p, q) ((p) < (q) ? (p) : (q)) // min拡張 #define bit(n, m) (((n) >> (m)) & 1) // 変数nのm番目のbitを取り出す template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } int dy[] = {0, 1, 0, -1}; // 4方向近傍 int dx[] = {1, 0, -1, 0}; // 4方向近傍 int main() { ll n, d; cin >> n >> d; double x[n][d]; rep(i, 0, n) rep(j, 0, d) cin >> x[i][j]; ll ans = 0; rep(i, 0, n) { rep(j, i + 1, n) { ll d2 = 0; rep(k, 0, d) d2 += pow(x[i][k] - x[j][k], 2); if (d2 == sqrt(d2) * sqrt(d2)) ans++; } } cout << ans << ednl; }
#include <bits/stdc++.h> using namespace std; #define ll long long // long long省略 #define pb push_back // push_back省略 #define mp make_pair // make_pair省略 #define fi first // first省略 #define se second // second省略 #define itn int // int誤字保険 #define count cout // cout誤字保険 #define vecotr vector // vector誤字保険 #define ednl endl // endl誤字保険 #define opt() \ cin.tie(0); \ ios::sync_with_stdio(false) // 入出力速度改善 #define rep(i, l, r) \ for (ll i = (l); i < (r); i++) // 範囲[l, r)で刻み1のfor文(順方向) #define repp(i, l, r, k) \ for (ll i = (l); i < (r); i += (k)) // 範囲[l, r)で刻みkのfor文(順方向) #define rrep(i, l, r) \ for (ll i = (r - 1); i >= (l); i--) // 範囲[l, r)で刻み1のfor文(逆方向) #define rrepp(i, l, r, k) \ for (ll i = (r - 1); i >= (l); i -= (k)) // 範囲[l, r)で刻みkのfor文(逆方向) #define all(x) (x).begin(), (x).end() // vectorのポインタ位置指定用 #define max(p, q) ((p) > (q) ? (p) : (q)) // max拡張 #define min(p, q) ((p) < (q) ? (p) : (q)) // min拡張 #define bit(n, m) (((n) >> (m)) & 1) // 変数nのm番目のbitを取り出す template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } int dy[] = {0, 1, 0, -1}; // 4方向近傍 int dx[] = {1, 0, -1, 0}; // 4方向近傍 int main() { ll n, d; cin >> n >> d; double x[n][d]; rep(i, 0, n) rep(j, 0, d) cin >> x[i][j]; ll ans = 0; rep(i, 0, n) { rep(j, i + 1, n) { ll d2 = 0; rep(k, 0, d) d2 += pow(x[i][k] - x[j][k], 2); if (d2 == (ll)sqrt(d2) * (ll)sqrt(d2)) ans++; } } cout << ans << ednl; }
[ "control_flow.branch.if.condition.change" ]
786,517
786,518
u547754910
cpp
p02982
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N, D, ans = 0, cnt = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) cin >> X[i][j]; } for (int i = 0; i < N; i++) { for (int l = i + 1; l < N; l++) { for (int j = 0; j < D; j++) { ans += (X[i][j] - X[l][j]) * (X[i][j] - X[l][j]); } for (int k = 0; k < 100; k++) { if (ans == k * k) cnt++; } ans = 0; } } cout << cnt << endl; }
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N, D, ans = 0, cnt = 0; cin >> N >> D; int X[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) cin >> X[i][j]; } for (int i = 0; i < N; i++) { for (int l = i + 1; l < N; l++) { for (int j = 0; j < D; j++) { ans += (X[i][j] - X[l][j]) * (X[i][j] - X[l][j]); } for (int k = 0; k < 10000; k++) { if (ans == k * k) cnt++; } ans = 0; } } cout << cnt << endl; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
786,525
786,526
u937275419
cpp
p02982
#include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { int a, b, c[110][110], e, f; cin >> a >> b; for (int i = 0; i < a; i++) { for (int j = 0; j < b; j++) cin >> c[i][j]; } f = 0; for (int i = 0; i < a; i++) { for (int j = 0; j < a; j++) { for (int l = 0; l < 140; l++) { e = 0; for (int k = 0; k < b; k++) { e += (c[i][k] - c[j][k]) * (c[i][k] - c[j][k]); } if (e == l * l) { f++; } } } } cout << f << endl; return 0; }
#include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { int a, b, c[110][110], e, f; cin >> a >> b; for (int i = 0; i < a; i++) { for (int j = 0; j < b; j++) cin >> c[i][j]; } f = 0; for (int i = 0; i < a; i++) { for (int j = 0; j < i; j++) { for (int l = 0; l < 140; l++) { e = 0; for (int k = 0; k < b; k++) { e += (c[i][k] - c[j][k]) * (c[i][k] - c[j][k]); } if (e == l * l) { f++; } } } } cout << f << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
786,533
786,534
u530329977
cpp
p02982
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define long long ll; int main(void) { int n, d; cin >> n >> d; double x[n][d]; double sum = 0; int ans = 0; rep(i, n) { rep(j, d) { int a; cin >> a; x[i][j] = a; } } rep(i, n) { for (int j = i + 1; j < n; j++) { sum = 0; rep(z, d) { sum += (x[i][z] - x[j][z]) * (x[i][z] - x[j][z]); } int num = sum; sum = sqrt(sum); if ((sum * sum) == num) { ans += 1; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define long long ll; int main(void) { int n, d; cin >> n >> d; double x[n][d]; double sum = 0; int ans = 0; rep(i, n) { rep(j, d) { int a; cin >> a; x[i][j] = a; } } rep(i, n) { for (int j = i + 1; j < n; j++) { sum = 0; rep(z, d) { sum += (x[i][z] - x[j][z]) * (x[i][z] - x[j][z]); } int num = sum; num = sqrt(num); if ((num * num) == sum) { ans += 1; } } } cout << ans << endl; return 0; }
[ "assignment.variable.change", "identifier.change", "assignment.value.change", "call.arguments.change", "control_flow.branch.if.condition.change" ]
786,563
786,564
u905170328
cpp
p02982
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define long long ll; int main(void) { int n, d; cin >> n >> d; double x[n][d]; double sum = 0; int ans = 0; rep(i, n) { rep(j, d) { int a; cin >> a; x[i][j] = a; } } rep(i, n) { for (int j = i + 1; j < d; j++) { sum = 0; rep(z, d) { sum += (x[i][z] - x[j][z]) * (x[i][z] - x[j][z]); } int num = sum; sum = sqrt(sum); if ((sum * sum) == num) { ans += 1; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define long long ll; int main(void) { int n, d; cin >> n >> d; double x[n][d]; double sum = 0; int ans = 0; rep(i, n) { rep(j, d) { int a; cin >> a; x[i][j] = a; } } rep(i, n) { for (int j = i + 1; j < n; j++) { sum = 0; rep(z, d) { sum += (x[i][z] - x[j][z]) * (x[i][z] - x[j][z]); } int num = sum; num = sqrt(num); if ((num * num) == sum) { ans += 1; } } } cout << ans << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change", "assignment.variable.change", "assignment.value.change", "call.arguments.change", "control_flow.branch.if.condition.change" ]
786,565
786,564
u905170328
cpp
p02982
#include "bits/stdc++.h" using namespace std; using LL = long long; using ULL = unsigned long long; const double PI = acos(-1); template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); } template <class T> constexpr T HINF() { return INF<T>() / 2; } template <typename T_char> T_char TL(T_char cX) { return tolower(cX); }; template <typename T_char> T_char TU(T_char cX) { return toupper(cX); }; const int vy[] = {-1, -1, -1, 0, 1, 1, 1, 0}, vx[] = {-1, 0, 1, 1, 1, 0, -1, -1}; const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++) if ((n >> i) & 1) cnt++; return cnt; } int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; } return ret; } int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; } return ret; } LL gcd(LL a, LL b) { if (b == 0) return a; return gcd(b, a % b); }; LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g * b; }; #define ALL(qpqpq) (qpqpq).begin(), (qpqpq).end() #define UNIQUE(wpwpw) \ sort(ALL((wpwpw))); \ (wpwpw).erase(unique(ALL((wpwpw))), (wpwpw).end()) #define LOWER(epepe) transform(ALL((epepe)), (epepe).begin(), TL<char>) #define UPPER(rprpr) transform(ALL((rprpr)), (rprpr).begin(), TU<char>) #define FOR(i, tptpt, ypypy) for (LL i = (tptpt); i < (ypypy); i++) #define REP(i, upupu) FOR(i, 0, upupu) #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0) int n, d; int x[11][11]; int main() { cin >> n >> d; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } int ans = 0; REP(i, n) { for (int j = i + 1; j < n; j++) { int di = 0; REP(k, d) { di += abs(x[i][k] - x[j][k]) * abs(x[i][k] - x[j][k]); } if (sqrt(di) * sqrt(di) == di) ans++; } } cout << ans << endl; }
#include "bits/stdc++.h" using namespace std; using LL = long long; using ULL = unsigned long long; const double PI = acos(-1); template <class T> constexpr T INF() { return ::std::numeric_limits<T>::max(); } template <class T> constexpr T HINF() { return INF<T>() / 2; } template <typename T_char> T_char TL(T_char cX) { return tolower(cX); }; template <typename T_char> T_char TU(T_char cX) { return toupper(cX); }; const int vy[] = {-1, -1, -1, 0, 1, 1, 1, 0}, vx[] = {-1, 0, 1, 1, 1, 0, -1, -1}; const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++) if ((n >> i) & 1) cnt++; return cnt; } int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; } return ret; } int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; } return ret; } LL gcd(LL a, LL b) { if (b == 0) return a; return gcd(b, a % b); }; LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g * b; }; #define ALL(qpqpq) (qpqpq).begin(), (qpqpq).end() #define UNIQUE(wpwpw) \ sort(ALL((wpwpw))); \ (wpwpw).erase(unique(ALL((wpwpw))), (wpwpw).end()) #define LOWER(epepe) transform(ALL((epepe)), (epepe).begin(), TL<char>) #define UPPER(rprpr) transform(ALL((rprpr)), (rprpr).begin(), TU<char>) #define FOR(i, tptpt, ypypy) for (LL i = (tptpt); i < (ypypy); i++) #define REP(i, upupu) FOR(i, 0, upupu) #define INIT \ std::ios::sync_with_stdio(false); \ std::cin.tie(0) int n, d; int x[11][11]; int main() { cin >> n >> d; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } int ans = 0; REP(i, n) { for (int j = i + 1; j < n; j++) { int di = 0; REP(k, d) { di += abs(x[i][k] - x[j][k]) * abs(x[i][k] - x[j][k]); } if ((int)sqrt(di) * (int)sqrt(di) == di) ans++; } } cout << ans << endl; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
786,576
786,577
u093922224
cpp
p02982
#include <cmath> #include <iostream> using namespace std; static const int max_n = 10; static const int max_d = 10; bool is_integer(double x) { return floor(x) == x; } int main(void) { int n, d, ans = 0; double XX[max_n][max_d]; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> XX[i][j]; } } //全通り比較 for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { double dist = 0; //ここをintにするといけない for (int k = 0; k < n; k++) { dist += pow((XX[i][k] - XX[j][k]), 2); } dist = sqrt(dist); if (is_integer(dist)) ans += 1; } } cout << ans; return 0; }
#include <cmath> #include <iostream> using namespace std; static const int max_n = 10; static const int max_d = 10; bool is_integer(double x) { return floor(x) == x; } int main(void) { int n, d, ans = 0; double XX[max_n][max_d]; //ここをintにするといけない cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> XX[i][j]; } } //全通り比較 for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { double dist = 0; //ここをintにするといけない for (int k = 0; k < d; k++) { dist += pow(abs(XX[i][k] - XX[j][k]), 2); } dist = sqrt(dist); if (is_integer(dist)) ans += 1; } } cout << ans; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change", "call.add", "call.arguments.change" ]
786,585
786,586
u900688325
cpp
p02982
#include "bits/stdc++.h" using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((int)(x).size()) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define repf(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repfr(i, x, n) for (int i = (int)(x)-1; i >= (int)(n); i--) #define INF 1e9 using ll = int64_t; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define waru 1000000007 std::int64_t gcd(std::int64_t a, std::int64_t b) { // a >= b && b != 0 std::int64_t c; do { c = a % b; a = b; b = c; } while (c); return a; } std::int64_t gcd_s(std::int64_t aa, std::int64_t bb) { std::int64_t a = max(aa, bb); std::int64_t b = min(aa, bb); std::int64_t c; if (b == 0) { return -1; } do { c = a % b; a = b; b = c; } while (c); return a; } void rle(std::vector<std::pair<char, std::int64_t>> &data, std::string str) { char now = str[0]; std::int64_t count = 0; for (std::int64_t i = 0; i < str.size() + 1; i++) { if (i == str.size()) { data.push_back(make_pair(str[i - 1], count)); break; } else if (now != str[i]) { data.push_back(make_pair(now, count)); now = str[i]; count = 0; } count++; } return; } #define MAX_NUM 1001 void Main() { //自動整形防止用コメント int n, d; int x[20][20]; int ans = 0; cin >> n >> d; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { repf(j, i, n) { if (i == j) { continue; } int sum = 0; rep(k, d) { int tmp = abs(x[i][k] - x[j][k]); sum += tmp * tmp; } rep(k, sum) { if (k * k == sum) { ans++; } } } } std::cout << ans << std::endl; return; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(15); Main(); return 0; }
#include "bits/stdc++.h" using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) ((int)(x).size()) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define repf(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define repfr(i, x, n) for (int i = (int)(x)-1; i >= (int)(n); i--) #define INF 1e9 using ll = int64_t; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define waru 1000000007 std::int64_t gcd(std::int64_t a, std::int64_t b) { // a >= b && b != 0 std::int64_t c; do { c = a % b; a = b; b = c; } while (c); return a; } std::int64_t gcd_s(std::int64_t aa, std::int64_t bb) { std::int64_t a = max(aa, bb); std::int64_t b = min(aa, bb); std::int64_t c; if (b == 0) { return -1; } do { c = a % b; a = b; b = c; } while (c); return a; } void rle(std::vector<std::pair<char, std::int64_t>> &data, std::string str) { char now = str[0]; std::int64_t count = 0; for (std::int64_t i = 0; i < str.size() + 1; i++) { if (i == str.size()) { data.push_back(make_pair(str[i - 1], count)); break; } else if (now != str[i]) { data.push_back(make_pair(now, count)); now = str[i]; count = 0; } count++; } return; } #define MAX_NUM 1001 void Main() { //自動整形防止用コメント int n, d; int x[20][20]; int ans = 0; cin >> n >> d; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { repf(j, i, n) { if (i == j) { continue; } int sum = 0; rep(k, d) { int tmp = abs(x[i][k] - x[j][k]); sum += tmp * tmp; } rep(k, sum + 1) { if (k * k == sum) { ans++; } } } } std::cout << ans << std::endl; return; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(15); Main(); return 0; }
[ "expression.operation.binary.add" ]
786,602
786,603
u395846213
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; vector<vector<int>> vec; int x; vector<int> v; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x; v.push_back(x); } vec.push_back(v); v.clear(); } int temp = 0, diff, value, cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = 0; k < d; k++) { temp = vec[i][k] - vec[j][k]; diff += temp * temp; } value = sqrt(diff); if (value * value == diff) cnt++; diff = 0; } } cout << cnt + 1; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; vector<vector<int>> vec; int x; vector<int> v; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x; v.push_back(x); } vec.push_back(v); v.clear(); } int temp = 0, diff = 0, value, cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = 0; k < d; k++) { temp = vec[i][k] - vec[j][k]; diff += temp * temp; } value = sqrt(diff); if (value * value == diff) cnt++; diff = 0; } } cout << cnt; }
[ "variable_declaration.value.change", "expression.operation.binary.remove" ]
786,610
786,611
u910994303
cpp
p02982
#include <bits/stdc++.h> using namespace std; #define Mset(s, n) memset(s, n, sizeof(s)) #define Rp0(i, m) for (int i = 0; i < m; ++i) #define Rpd(i, m, l) for (int i = l; i >= m; --i) #define Rp1(i, m) for (int i = 1; i <= m; i++) #define All(a) (a).begin(), (a).end() #define Lwb lower_bound #define Upb upper_bound #define Sz(a) int((a).size()) #define u_map unordered_map #define fi first #define se second #define pb push_back #define pf push_front #define is insert #define ooi INT_MAX #define ool LLONG_MAX #define ll long long #define ull unsigned ll #define ld long double #define pii pair<int, int> #define vi vector<int> #define vpii vector<pii> const ll MOD = (ll)1e9 + 7; const ld PI = acos((ld)-1); inline int Get_bit(int x, int k) { return (x >> (k - 1)) & 1; } inline ll Gcd(ll a, ll b) { ll r; while (b) { r = a % b; a = b; b = r; } return a; } inline ll Lcm(ll a, ll b) { return a / Gcd(a, b) * b; } inline ll Pow(ll n, ll k) { ll r = 1; for (; k; k >>= 1, n = n * n % MOD) { if (k & 1) r = r * n % MOD; } return r; } const int base = 311; const int N = 1e6 + 10; /* @ Copyright belong to Shadow4207 */ ll n, m, k, ans, a[22][22]; void Solve() { cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> a[i][j]; } } for (int i = 1; i < n; i++) { for (int j = i + 1; j <= n; j++) { int res = 0; for (int k = 1; k <= m; k++) { res += (a[i][k] - a[j][k]) * (a[i][k] - a[j][k]); } if (res == sqrt(res) * sqrt(res)) ans++; } } cout << ans; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << fixed << setprecision(10); Solve(); return 0; }
#include <bits/stdc++.h> using namespace std; #define Mset(s, n) memset(s, n, sizeof(s)) #define Rp0(i, m) for (int i = 0; i < m; ++i) #define Rpd(i, m, l) for (int i = l; i >= m; --i) #define Rp1(i, m) for (int i = 1; i <= m; i++) #define All(a) (a).begin(), (a).end() #define Lwb lower_bound #define Upb upper_bound #define Sz(a) int((a).size()) #define u_map unordered_map #define fi first #define se second #define pb push_back #define pf push_front #define is insert #define ooi INT_MAX #define ool LLONG_MAX #define ll long long #define ull unsigned ll #define ld long double #define pii pair<int, int> #define vi vector<int> #define vpii vector<pii> const ll MOD = (ll)1e9 + 7; const ld PI = acos((ld)-1); inline int Get_bit(int x, int k) { return (x >> (k - 1)) & 1; } inline ll Gcd(ll a, ll b) { ll r; while (b) { r = a % b; a = b; b = r; } return a; } inline ll Lcm(ll a, ll b) { return a / Gcd(a, b) * b; } inline ll Pow(ll n, ll k) { ll r = 1; for (; k; k >>= 1, n = n * n % MOD) { if (k & 1) r = r * n % MOD; } return r; } const int base = 311; const int N = 1e6 + 10; /* @ Copyright belong to Shadow4207 */ ll n, m, k, ans, a[22][22]; void Solve() { cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> a[i][j]; } } for (int i = 1; i < n; i++) { for (int j = i + 1; j <= n; j++) { int res = 0; for (int k = 1; k <= m; k++) { res += (a[i][k] - a[j][k]) * (a[i][k] - a[j][k]); } if (res == int(sqrt(res)) * sqrt(res)) ans++; } } cout << ans; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << fixed << setprecision(10); Solve(); return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "call.add" ]
786,621
786,622
u671291651
cpp
p02982
#include <iostream> #include <math.h> using namespace std; int main() { double ND[10][10]; int n, d, check, count; double sum, root; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> ND[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { sum = 0; for (int k = 0; k < d; k++) { sum += (ND[i][k] - ND[j][k]) * (ND[i][k] - ND[j][k]); } root = sqrt(sum); check = root; if (check == root) { count++; } } } cout << count << endl; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { double ND[10][10]; int n, d, check, count = 0; double sum, root; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> ND[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { sum = 0; for (int k = 0; k < d; k++) { sum += (ND[i][k] - ND[j][k]) * (ND[i][k] - ND[j][k]); } root = sqrt(sum); check = root; if (check == root) { count++; } } } cout << count << endl; return 0; }
[ "variable_declaration.value.change" ]
786,639
786,640
u647653350
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main(void) { int n, dim; cin >> n >> dim; double x[n][dim]; for (int i = 0; i < n; i++) { for (int j = 0; j < dim; j++) { cin >> x[i][j]; } } int sum = 0, count = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { for (int k = 0; k < dim; k++) { sum += pow(x[i][k] - x[j][k], 2.0); } for (int check = 1; check < sum; check++) { if (check * check == sum) count++; } sum = 0; } } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int n, dim; cin >> n >> dim; double x[n][dim]; for (int i = 0; i < n; i++) { for (int j = 0; j < dim; j++) { cin >> x[i][j]; } } int sum = 0, count = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { for (int k = 0; k < dim; k++) { sum += pow(x[i][k] - x[j][k], 2.0); } for (int check = 1; check <= sum; check++) { // root 1になる場合のためにイコールが必要 if (check * check == sum) count++; } sum = 0; } } cout << count << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,670
786,671
u962680761
cpp
p02982
#define rep(i, n) for (int i = 0; i < (int)n; i++) #include <bits/stdc++.h> using namespace std; int main() { #ifdef LOCAL // 以降 cin の入力元が 'xxx.txt' になる std::ifstream in("b.txt"); std::cin.rdbuf(in.rdbuf()); #endif int N, D; cin >> N >> D; int X[10][10]; rep(i, N) { rep(j, D) { cin >> X[i][j]; } } int cnt = 0; rep(i, N - 1) { for (int j = i + 1; j < N; j++) { int dis = 0; rep(k, D) { dis += std::pow(X[j][k] - X[i][k], 2); } // cout << dis << endl; rep(m, dis) { if (dis == m * m) { cnt++; } } } } cout << cnt; return 0; }
#define rep(i, n) for (int i = 0; i < (int)n; i++) #include <bits/stdc++.h> using namespace std; int main() { #ifdef LOCAL // 以降 cin の入力元が 'xxx.txt' になる std::ifstream in("b.txt"); std::cin.rdbuf(in.rdbuf()); #endif int N, D; cin >> N >> D; int X[10][10]; rep(i, N) { rep(j, D) { cin >> X[i][j]; } } int cnt = 0; rep(i, N) { for (int j = i + 1; j < N; j++) { int dis = 0; rep(k, D) { dis += std::pow(X[j][k] - X[i][k], 2); } // cout << i << " " << j << " " << dis << endl; rep(m, dis + 1) { if (dis == m * m) { cnt++; } } } } cout << cnt; return 0; }
[ "expression.operation.binary.remove" ]
786,692
786,693
u234248338
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int n, d; int X[10][10]; cin >> n >> d; for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { cin >> X[i][j]; } } int cnt = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int temp = 0; for (int k = 0; k < d; ++k) { temp += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } // cout << temp << endl; for (int k = 0; k < temp; ++k) { if ((k * k) == temp) { cnt++; } } } } cout << cnt << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int n, d; int X[10][10]; cin >> n >> d; for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { cin >> X[i][j]; } } int cnt = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int temp = 0; for (int k = 0; k < d; ++k) { temp += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } // cout << temp << endl; for (int k = 0; k <= temp; ++k) { if ((k * k) == temp) { cnt++; // cout << "a"; } } } } cout << cnt << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,716
786,717
u352969025
cpp
p02982
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 100000000; int main() { int n, d; cin >> n >> d; int x[n][d]; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } int ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int norm = 0; for (int k = 0; k < d; k++) { int diff = abs(x[i][k] - x[j][k]); norm += diff * diff; } for (int l = 0; l < norm; l++) { if (norm == l * l) { ans++; } } } } cout << ans << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <functional> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; const int INF = 100000000; int main() { int n, d; cin >> n >> d; int x[n][d]; REP(i, n) { REP(j, d) { cin >> x[i][j]; } } int ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int norm = 0; for (int k = 0; k < d; k++) { int diff = abs(x[i][k] - x[j][k]); norm += diff * diff; } for (int l = 0; l <= norm; l++) { if (norm == l * l) { ans++; } } } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
786,722
786,723
u489117389
cpp
p02982
#include <algorithm> #include <climits> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> // using using namespace std; // typedef typedef long long ll; // define #define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c)) #define REP(i, n) FOR(i, 0, n, 1) #define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c)) #define RREP(i, n) RFOR(i, n, 0, 1) #define ALL(c) (c).begin(), (c).end() #define SORT(c) sort(ALL(c)) #define REVERSE(c) reverse(ALL(c)) #define UNIQ(c) unique(ALL(c)) #define LB(c, x) lower_bound(c.begin(), c.end(), x) #define UB(c, x) upper_bound(c.begin(), c.end(), x) #define LI(c, x) distance(c.begin(), LB(c, x)) #define UI(c, x) distance(c.begin(), UB(c, x)) // functions template <class T> T ceil(T a, T b) { return (a + b - 1) / b; } template <class T> T round(T a, T b) { return (a + b / 2) / b; } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; } template <class T> bool amax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool amin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } ll modpow(ll a, ll b, ll m) { if (b == 0) { return 1; } else if (b % 2 == 0) { ll h = modpow(a, b / 2, m); return h * h % m; } else { return a * modpow(a, b - 1, m) % m; } } ll comb(ll a, ll b, ll m) { if (b > a - b) { return comb(a, a - b, m); } ll c = 1, d = 1; REP(i, b) { c *= (a - i); d *= (b - i); c %= m; d %= m; } return c * modpow(d, m - 2, m) % m; } // main int main() { cin.tie(0); ios::sync_with_stdio(false); int N, D, X[10][10]; cin >> N >> D; REP(i, N) { REP(j, D) { cin >> X[i][j]; } } int res = 0; REP(i, N - 1) { FOR(j, i + 1, N, 1) { int sum = 0; REP(k, D) { int d = X[i][k] - X[j][k]; sum += d * d; } double sq = sqrt(sum); if (sum == sq * sq) { res++; } } } cout << res << endl; return 0; }
#include <algorithm> #include <climits> #include <complex> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> // using using namespace std; // typedef typedef long long ll; // define #define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c)) #define REP(i, n) FOR(i, 0, n, 1) #define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c)) #define RREP(i, n) RFOR(i, n, 0, 1) #define ALL(c) (c).begin(), (c).end() #define SORT(c) sort(ALL(c)) #define REVERSE(c) reverse(ALL(c)) #define UNIQ(c) unique(ALL(c)) #define LB(c, x) lower_bound(c.begin(), c.end(), x) #define UB(c, x) upper_bound(c.begin(), c.end(), x) #define LI(c, x) distance(c.begin(), LB(c, x)) #define UI(c, x) distance(c.begin(), UB(c, x)) // functions template <class T> T ceil(T a, T b) { return (a + b - 1) / b; } template <class T> T round(T a, T b) { return (a + b / 2) / b; } template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; } template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; } template <class T> bool amax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool amin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } ll modpow(ll a, ll b, ll m) { if (b == 0) { return 1; } else if (b % 2 == 0) { ll h = modpow(a, b / 2, m); return h * h % m; } else { return a * modpow(a, b - 1, m) % m; } } ll comb(ll a, ll b, ll m) { if (b > a - b) { return comb(a, a - b, m); } ll c = 1, d = 1; REP(i, b) { c *= (a - i); d *= (b - i); c %= m; d %= m; } return c * modpow(d, m - 2, m) % m; } // main int main() { cin.tie(0); ios::sync_with_stdio(false); int N, D, X[10][10]; cin >> N >> D; REP(i, N) { REP(j, D) { cin >> X[i][j]; } } int res = 0; REP(i, N - 1) { FOR(j, i + 1, N, 1) { int sum = 0; REP(k, D) { int d = X[i][k] - X[j][k]; sum += d * d; } int sq = sqrt(sum); if (sum == sq * sq) { res++; } } } cout << res << endl; return 0; }
[ "variable_declaration.type.primitive.change" ]
786,753
786,754
u164300951
cpp
p02982
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int N, D; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int ans = 0; double dist_abs; for (int k = 0; k < N - 1; k++) { for (int l = k + 1; l < N; l++) { dist_abs = 0; for (int z = 0; z < D; z++) { dist_abs += abs(X[k][z] - X[k + 1][z]) * abs(X[k][z] - X[k + 1][z]); } dist_abs = sqrt(dist_abs); if (dist_abs == int(dist_abs)) ans++; } } cout << ans << endl; }
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int N, D; cin >> N >> D; int X[20][20]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } int ans = 0; double dist_abs; for (int k = 0; k < N - 1; k++) { for (int l = k + 1; l < N; l++) { dist_abs = 0; for (int z = 0; z < D; z++) { dist_abs += abs(X[k][z] - X[l][z]) * abs(X[k][z] - X[l][z]); } dist_abs = sqrt(dist_abs); if (dist_abs == int(dist_abs)) ans++; } } cout << ans << endl; }
[ "assignment.value.change", "variable_access.subscript.index.change", "call.arguments.change", "expression.operation.binary.change", "expression.operation.binary.remove" ]
786,759
786,760
u964726243
cpp
p02982
/* ID: flashysport101 LANG: C++ TASK: */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; typedef vector<pd> vpd; #define F0R(i, a, b) for (int i = (a); i < (b); i++) #define FOR(i, a) for (int i = 0; i < (a); i++) #define F0RR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define FORR(i, a) for (int i = (a)-1; i >= 0; i--) #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define f first #define s second #define lb lower_bound #define ub upper_bound #define n << "\n" #define k << " " << const int MOD = 1000000007; const ll INF = 1e18; const int MAXN = 1e5; const string name = "paintbarn"; int N, D; bool square[1000001], points[10][10]; bool dist(int i, int j) { int sum = 0; FOR(l, D) { sum += (points[i][l] - points[j][l]) * (points[i][l] - points[j][l]); } return square[sum]; } int main() { // ifstream cin(name + ".in"); ofstream fout(name + ".out"); cin >> N >> D; FOR(i, 1001) { square[i * i] = true; } FOR(i, N) FOR(j, D) cin >> points[i][j]; int res = 0; FOR(i, N) FOR(j, i) if (dist(i, j)) res++; cout << res n; }
/* ID: flashysport101 LANG: C++ TASK: */ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; typedef vector<pd> vpd; #define F0R(i, a, b) for (int i = (a); i < (b); i++) #define FOR(i, a) for (int i = 0; i < (a); i++) #define F0RR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define FORR(i, a) for (int i = (a)-1; i >= 0; i--) #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define f first #define s second #define lb lower_bound #define ub upper_bound #define n << "\n" #define k << " " << const int MOD = 1000000007; const ll INF = 1e18; const int MAXN = 1e5; const string name = "paintbarn"; int N, D; bool square[1000001]; int points[10][10]; bool dist(int i, int j) { int sum = 0; FOR(l, D) { sum += (points[i][l] - points[j][l]) * (points[i][l] - points[j][l]); } return square[sum]; } int main() { // ifstream cin(name + ".in"); ofstream fout(name + ".out"); // ifstream cin("a.in"); cin >> N >> D; FOR(i, 1001) { square[i * i] = true; } FOR(i, N) FOR(j, D) cin >> points[i][j]; int res = 0; FOR(i, N) FOR(j, i) if (dist(i, j)) res++; cout << res n; }
[ "variable_declaration.type.change" ]
786,799
786,800
u758353376
cpp
p02982
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int f[11][11]; int main() { int n, d, cnt = 0, t = 0; cin >> n >> d; for (int i = 1; i <= n; i++) { for (int j = 1; j <= d; j++) { cin >> f[i][j]; } } //+return 0; for (int i = 1; i <= n - 1; i++) { for (int j = i + 1; j <= n; j++) { for (int k = 1; k <= d; k++) { t += (f[i][k] - f[j][k]) * (f[i][k] - f[j][k]); } int td = floor(sqrt(t)); if (td * td == t) cnt++; } } cout << cnt << endl; return 0; }
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int f[11][11]; int main() { int n, d, cnt = 0, t = 0; cin >> n >> d; for (int i = 1; i <= n; i++) { for (int j = 1; j <= d; j++) { cin >> f[i][j]; } } //+return 0; for (int i = 1; i <= n - 1; i++) { for (int j = i + 1; j <= n; j++) { for (int k = 1; k <= d; k++) { t += (f[i][k] - f[j][k]) * (f[i][k] - f[j][k]); } int td = floor(sqrt(t)); if (td * td == t) cnt++; t = 0; } } cout << cnt << endl; return 0; }
[ "assignment.add" ]
786,833
786,834
u337355231
cpp
p02982
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, d, i, j, k, sum, count; double dis; cin >> n >> d; int point[n][d]; for (i = 0; i < n; i++) for (j = 0; j < d; j++) cin >> point[i][j]; for (i = 0; i < n; i++) for (j = i + 1; j < n; j++) { sum = 0; for (k = 0; k < d; k++) { sum += pow(point[i][k] - point[j][k], 2); } dis = sqrt(sum); if (dis - (int)dis == 0) count++; } cout << count << endl; }
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int n, d, i, j, k, sum, count = 0; double dis; cin >> n >> d; int point[n][d]; for (i = 0; i < n; i++) for (j = 0; j < d; j++) cin >> point[i][j]; for (i = 0; i < n; i++) for (j = i + 1; j < n; j++) { sum = 0; for (k = 0; k < d; k++) { sum += pow(point[i][k] - point[j][k], 2); } dis = sqrt(sum); if (dis - (int)dis == 0) count++; } cout << count << endl; }
[ "variable_declaration.value.change" ]
786,837
786,838
u067840456
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int get_distance(int *a, int *b, int length) { double res = 0; for (int i = 0; i < length; i++) { res += pow(a[i] - b[i], 2.0); } res = sqrt(res); return res; } int main() { int N, D; int i, j; cin >> N >> D; int arr[N][D]; for (i = 0; i < N; i++) { for (j = 0; j < D; j++) { cin >> arr[i][j]; } } int count = 0; double temp; for (i = 0; i < N; i++) { for (j = i + 1; j < N; j++) { temp = get_distance(arr[i], arr[j], D); if (temp - floor(temp) == 0) { count++; } } } cout << count << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; double get_distance(int *a, int *b, int length) { double res = 0; for (int i = 0; i < length; i++) { res += pow(a[i] - b[i], 2.0); } res = sqrt(res); return res; } int main() { int N, D; int i, j; cin >> N >> D; int arr[N][D]; for (i = 0; i < N; i++) { for (j = 0; j < D; j++) { cin >> arr[i][j]; } } int count = 0; double temp; for (i = 0; i < N; i++) { for (j = i + 1; j < N; j++) { temp = get_distance(arr[i], arr[j], D); if (temp - floor(temp) == 0) { count++; } } } cout << count << endl; return 0; }
[ "function.return_type.change" ]
786,854
786,855
u345716368
cpp
p02982
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); const int MAX_N = (int)(1e1 + 5); const int MAX_D = (int)(1e1 + 5); int n, d; int x[MAX_N][MAX_D]; int ans; bool check(int i, int j) { int base = 0; for (int k = 0; k < d; ++k) { base += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } int tmp = (int)(sqrt(base)); return (base % tmp == 0); } int main(void) { // Here your code ! scanf("%d %d", &n, &d); for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { scanf("%d", &(x[i][j])); } } ans = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { if (check(i, j)) ans += 1; } } printf("%d\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); const int MAX_N = (int)(1e1 + 5); const int MAX_D = (int)(1e1 + 5); int n, d; int x[MAX_N][MAX_D]; int ans; bool check(int i, int j) { int base = 0; for (int k = 0; k < d; ++k) { base += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } int tmp = (int)(sqrt(base)); return (tmp * tmp == base); } int main(void) { // Here your code ! scanf("%d %d", &n, &d); for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { scanf("%d", &(x[i][j])); } } ans = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { if (check(i, j)) ans += 1; } } printf("%d\n", ans); return 0; }
[ "identifier.replace.add", "literal.replace.remove", "function.return_value.change", "expression.operation.binary.change" ]
786,880
786,881
u497422208
cpp
p02982
#include <iostream> #include <math.h> using namespace std; int main() { // 整数の入力 int n; cin >> n; // スペース区切りの整数の入力 int d; cin >> d; int data[n][d]; int a; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a; data[i][j] = a; } } int count = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int sum = 0; for (int m = 0; m < d; m++) { sum = (data[i][m] - data[j][m]) * (data[i][m] - data[j][m]); } bool flag = false; for (int k = 0; k <= sum; ++k) { if (k * k == sum) { flag = true; } } if (flag) ++count; } } cout << count; return 0; }
#include <iostream> #include <math.h> using namespace std; int main() { // 整数の入力 int n; cin >> n; // スペース区切りの整数の入力 int d; cin >> d; int data[n][d]; int a; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a; data[i][j] = a; } } int count = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int sum = 0; for (int m = 0; m < d; m++) { sum += (data[i][m] - data[j][m]) * (data[i][m] - data[j][m]); } bool flag = false; for (int k = 0; k <= sum; ++k) { if (k * k == sum) { flag = true; } } if (flag) ++count; } } cout << count; return 0; }
[ "assignment.value.change" ]
786,896
786,897
u593778400
cpp
p02982
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) using namespace std; int ans, cnt1; int main() { int n, d; cin >> n >> d; int x[10][10]; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { REP(j, i + 1, d) { rep(k, d) { cnt1 += pow(x[i][k] - x[j][k], 2); } rep(k, cnt1 + 1) { if (k * k == cnt1) { ans++; } } cnt1 = 0; } } cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) using namespace std; int ans, cnt1; int main() { int n, d; cin >> n >> d; int x[10][10]; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { REP(j, i + 1, n) { rep(k, d) { cnt1 += pow(x[i][k] - x[j][k], 2); } rep(k, cnt1 + 1) { if (k * k == cnt1) { ans++; } } cnt1 = 0; } } cout << ans << endl; return 0; }
[ "identifier.change", "call.arguments.change" ]
786,900
786,901
u294829559
cpp
p02982
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <string.h> #include <utility> using namespace std; int N, D, x[11][11] = {0}; int check(int a, int b) { int dis = 0; for (int i = 1; i <= D; i++) { dis = dis + (x[a][i] - x[b][i]) * (x[a][i] - x[b][i]); } double x, y; int z; x = (double)dis; y = sqrt(a); z = (int)y; if (z * z == dis) return 1; return 0; } int main() { cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 1; j <= D; j++) { scanf("%d", &x[i][j]); } } int ans = 0; for (int i = 1; i <= N; i++) for (int j = i; j <= N; j++) ans = ans + check(i, j); cout << ans; return 0; }
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <string.h> #include <utility> using namespace std; int N, D, x[11][11] = {0}; int check(int a, int b) { int dis = 0; for (int i = 1; i <= D; i++) { dis = dis + (x[a][i] - x[b][i]) * (x[a][i] - x[b][i]); } double x, y; int z; x = (double)dis; y = sqrt(x); z = (int)y; // cout<<x<<" "<<y<<" "<<z<<endl; if (z * z == dis) return 1; return 0; } int main() { cin >> N >> D; for (int i = 1; i <= N; i++) { for (int j = 1; j <= D; j++) { scanf("%d", &x[i][j]); } } int ans = 0; for (int i = 1; i <= N; i++) for (int j = i + 1; j <= N; j++) { ans = ans + check(i, j); } cout << ans; return 0; }
[ "assignment.value.change", "identifier.change", "call.arguments.change", "control_flow.loop.for.initializer.change" ]
786,933
786,934
u466318894
cpp
p02982
#include <math.h> #include <stdio.h> int main() { int p[10][10]; int N, D, i, j, k, count; scanf("%d%d", &N, &D); for (i = 0; i < N; i++) { for (j = 0; j < D; j++) { scanf("%d", &p[i][j]); } } for (i = 0; i < N - 1; i++) { for (j = i + 1; j < N; j++) { double dist = 0; for (k = 0; k < D; k++) dist += pow(p[i][k] - p[j][k], 2); dist = sqrt(dist); if (ceil(dist) == floor(dist)) count++; } } printf("%d", count); }
#include <math.h> #include <stdio.h> int main() { int p[10][10]; int N, D, i, j, k; int count = 0; scanf("%d%d", &N, &D); for (i = 0; i < N; i++) { for (j = 0; j < D; j++) { scanf("%d", &p[i][j]); } } for (i = 0; i < N - 1; i++) { for (j = i + 1; j < N; j++) { double dist = 0; for (k = 0; k < D; k++) dist += pow(p[i][k] - p[j][k], 2); dist = sqrt(dist); if (ceil(dist) == floor(dist)) count++; } } printf("%d", count); }
[ "variable_declaration.remove", "variable_declaration.add" ]
786,935
786,936
u038803010
cpp
p02982
#include <iostream> #include <math.h> using namespace std; int main() { int n, d, sum = 0, count = 0; cin >> n >> d; int x[10][20]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int point = 0; point < n; point++) { for (int i = point + 1; i < n; i++) { for (int j = 0; j < d; j++) { sum += (x[i][j] - x[point][j]) * (x[i][j] - x[point][j]); } if ((double)sqrt(sum) == (int)sqrt(sum)) count += 1; } } cout << count << endl; }
#include <iostream> #include <math.h> using namespace std; int main() { int n, d, sum = 0, count = 0; cin >> n >> d; int x[10][20]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int point = 0; point < n - 1; point++) { for (int i = point + 1; i < n; i++) { for (int j = 0; j < d; j++) { sum += (x[i][j] - x[point][j]) * (x[i][j] - x[point][j]); } if ((double)sqrt(sum) == (int)sqrt(sum)) count += 1; sum = 0; } } cout << count << endl; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "assignment.add" ]
786,937
786,938
u805227991
cpp
p02982
#include <cmath> #include <iostream> using namespace std; bool calc(int a[], int b[], int d) { float t = 0; for (int di = 0; di < d; di++) t += pow(a[di] + b[di], 2.0); t = sqrt(t); return t == (int)t; } int main() { int n, d, count = 0; cin >> n >> d; int points[n][d]; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> points[i][j]; for (int i = 0; i < n - 1; i++) for (int j = 0; j < n; j++) { if (i >= j) continue; bool isInteger = calc(points[i], points[j], d); if (isInteger) { count++; } } cout << count << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; bool calc(int a[], int b[], int d) { float t = 0; for (int di = 0; di < d; di++) t += pow(a[di] - b[di], 2.0); t = sqrt(t); return t == (int)t; } int main() { int n, d, count = 0; cin >> n >> d; int points[n][d]; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> points[i][j]; for (int i = 0; i < n - 1; i++) for (int j = 0; j < n; j++) { if (i >= j) continue; bool isInteger = calc(points[i], points[j], d); if (isInteger) { count++; } } cout << count << endl; return 0; }
[ "misc.opposites", "expression.operator.arithmetic.change", "assignment.value.change", "call.arguments.change", "expression.operation.binary.change" ]
786,941
786,942
u525522160
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, cnt = 0; double T; cin >> N >> D; int x[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> x[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { int T = 0; for (int k = 1; k < D + 1; k++) { T += pow(x[i][k] - x[j][k], 2); } double ans = pow((double)T, 0.5); if (ans == (int)ans) cnt++; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, cnt = 0; double T; cin >> N >> D; int x[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> x[i][j]; } } for (int i = 0; i < N - 1; i++) { for (int j = i + 1; j < N; j++) { int T = 0; for (int k = 0; k < D; k++) { T += pow(x[i][k] - x[j][k], 2); } double ans = pow((double)T, 0.5); if (ans == (int)ans) cnt++; } } cout << cnt << endl; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operation.binary.remove" ]
786,965
786,966
u515116926
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int N, D, cnt = 0; double T; cin >> N >> D; int x[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> x[i][j]; } } for (int i = 0; i < N + 1; i++) { for (int j = i + 1; j < N; j++) { int T = 0; for (int k = 1; k < D + 1; k++) { T += pow(x[i][k] - x[j][k], 2); } double ans = pow((double)T, 0.5); if (ans == (int)ans) cnt++; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D, cnt = 0; double T; cin >> N >> D; int x[N][D]; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> x[i][j]; } } for (int i = 0; i < N - 1; i++) { for (int j = i + 1; j < N; j++) { int T = 0; for (int k = 0; k < D; k++) { T += pow(x[i][k] - x[j][k], 2); } double ans = pow((double)T, 0.5); if (ans == (int)ans) cnt++; } } cout << cnt << endl; }
[ "misc.opposites", "expression.operator.arithmetic.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change", "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operation.binary.r...
786,967
786,966
u515116926
cpp
p02982
#include <cmath> #include <iostream> using namespace std; bool isint(int x) { int root = sqrt(x); if (x / root == root) return true; else return false; } int main() { int n, d; cin >> n >> d; int point[n][d]; int count = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> point[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; for (int k = 0; k < d; k++) dist += (point[i][k] - point[j][k]) * (point[i][k] - point[j][k]); if (isint(dist)) count++; } } cout << count; return 0; }
#include <cmath> #include <iostream> using namespace std; bool isint(int x) { int root = sqrt(x); if (x == root * root) return true; else return false; } int main() { int n, d; cin >> n >> d; int point[n][d]; int count = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> point[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; for (int k = 0; k < d; k++) dist += (point[i][k] - point[j][k]) * (point[i][k] - point[j][k]); if (isint(dist)) count++; } } cout << count; return 0; }
[ "expression.operation.binary.remove", "control_flow.branch.if.condition.change" ]
786,980
786,981
u387480576
cpp
p02982
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int MOD = 1000000007; int main() { int N, D; int ans = 0, co = 0; cin >> N >> D; int X[N + 10][D + 10] = {}; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { co = 0; for (int k = 0; k < D; k++) { co += pow(X[i][k] - X[j][k], 2); } for (int k = 0; k < 1000; k++) { if (co = k * k) { ans += 1; break; } } } } cout << ans << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; int MOD = 1000000007; int main() { int N, D; int ans = 0, co = 0; cin >> N >> D; int X[N + 10][D + 10] = {}; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { co = 0; for (int k = 0; k < D; k++) { co += pow(X[i][k] - X[j][k], 2); } for (int k = 1; k < 1000; k++) { if (co == k * k) { ans += 1; break; } } } } cout << ans << endl; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operation.compare.replace.add", "assignment.replace.remove", "misc.typo" ]
786,984
786,985
u500026208
cpp
p02982
#include <bits/stdc++.h> #define endl "\n" using namespace std; int a[11][11]; int main() { int n, d; cin >> n >> d; // cout << n << d << endl; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a[i][j]; } } /* for(int i=0; i<n; i++){ for(int j=0; j<d; j++){ cout << a[i][j] << " "; } cout << endl; } */ int cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int tmp = 0; for (int k = 0; k < d; k++) { // cout << i << " " << j << " " << k << endl; tmp += pow((a[i][k] - a[j][k]), 2); // cout << a[i][k] << " " << a[j][k] << endl; // cout <<"tmp : " << tmp << endl; } if (sqrt(tmp) * sqrt(tmp) == tmp) cnt++; } } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> #define endl "\n" using namespace std; int a[11][11]; int main() { int n, d; cin >> n >> d; // cout << n << d << endl; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> a[i][j]; } } /* for(int i=0; i<n; i++){ for(int j=0; j<d; j++){ cout << a[i][j] << " "; } cout << endl; } */ int cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int tmp = 0; for (int k = 0; k < d; k++) { // cout << i << " " << j << " " << k << endl; tmp += pow((a[i][k] - a[j][k]), 2); // cout << a[i][k] << " " << a[j][k] << endl; // cout <<"tmp : " << tmp << endl; } if ((int)sqrt(tmp) * (int)sqrt(tmp) == tmp) cnt++; // cout <<(int)sqrt(tmp)<< " " << (int)sqrt(tmp)*(int)sqrt(tmp) << " " << // tmp << " " << cnt << endl; } } cout << cnt << endl; return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
786,996
786,997
u597953074
cpp
p02982
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 int n, d; int x[101][101]; int main() { set<int> S; for (int i = 0; i <= 1010; i++) S.insert(i * i); cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } int ret = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int val = 0; for (int k = 0; k < d; k++) { val += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); if (S.count(val)) ret++; } } } cout << ret << endl; }
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 int n, d; int x[101][101]; int main() { set<int> S; for (int i = 0; i <= 1010; i++) S.insert(i * i); cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } int ret = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int val = 0; for (int k = 0; k < d; k++) { val += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } if (S.count(val)) ret++; } } cout << ret << endl; }
[]
787,002
787,003
u874996917
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int n, d; int points[10][10]; int pairs = 0; int main() { cin >> n >> d; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> points[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; for (int k = 0; k < d; k++) { dist += (points[i][k] - points[j][k]) * (points[i][k] - points[j][k]); } if ((int)sqrt(dist) * (int)sqrt(dist) == dist) pairs++; } } }
#include <cmath> #include <iostream> using namespace std; int n, d; int points[10][10]; int pairs = 0; int main() { cin >> n >> d; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> points[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int dist = 0; for (int k = 0; k < d; k++) { dist += (points[i][k] - points[j][k]) * (points[i][k] - points[j][k]); } if ((int)sqrt(dist) * (int)sqrt(dist) == dist) pairs++; } } cout << pairs; }
[]
787,008
787,009
u683313061
cpp
p02982
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { int n, t, a[111][111], cnt = 0, b; double s; cin >> n >> t; for (int i = 0; i < n; i++) { for (int j = 0; j < t; j++) { cin >> a[i][j]; } } for (int i = 0; i < n - 1; i++) { for (int z = i + 1; z < n; z++) { s = 0; for (int j = 0; j < t; j++) { s += (a[i][j] - a[i + 1][j]) * (a[i][j] - a[i + 1][j]); } s = sqrt(s); if (s == int(s)) cnt++; } } cout << cnt << endl; }
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> using namespace std; int main() { int n, t, a[111][111], cnt = 0, b; double s; cin >> n >> t; for (int i = 0; i < n; i++) { for (int j = 0; j < t; j++) { cin >> a[i][j]; } } for (int i = 0; i < n - 1; i++) { for (int z = i + 1; z < n; z++) { s = 0; for (int j = 0; j < t; j++) { s += (a[i][j] - a[z][j]) * (a[i][j] - a[z][j]); } s = sqrt(s); if (s == int(s)) cnt++; } } cout << cnt << endl; }
[ "assignment.value.change", "expression.operation.binary.change" ]
787,043
787,044
u288257826
cpp
p02982
#include <bits/stdc++.h> using namespace std; int n, m, a[111][111], t; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]); for (int i = 1; i < n; i++) for (int j = i + 1; j <= n; j++) { double s = 0; for (int k = 1; k <= m; k++) s += (double)sqrt((double)((double)(a[i][k] - a[j][k]) * (double)(a[i][k] - a[j][k]))); if (int(sqrt(s)) == sqrt(s)) t++; } cout << t; }
#include <bits/stdc++.h> using namespace std; int n, m, a[111][111], t; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]); for (int i = 1; i < n; i++) for (int j = i + 1; j <= n; j++) { double s = 0; for (int k = 1; k <= m; k++) s += (double)((double)(a[i][k] - a[j][k]) * (double)(a[i][k] - a[j][k])); if (int(sqrt(s)) == sqrt(s)) t++; } cout << t; }
[ "call.arguments.change" ]
787,049
787,050
u727652622
cpp
p02982
#include <math.h> #include <stdio.h> int dp[100][100]; int n, d; int main() { scanf("%d%d", &n, &d); int counter = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { scanf("%d", &dp[i][j]); } } for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int su = 0; for (int k = 0; k < d; k++) { su += ((dp[i][k] - dp[j][k]) * (dp[i][k] - dp[j][k])); // printf("su: %d\n", su); } if (sqrt(su) * sqrt(su) == su) { counter++; // printf("%d %d %d\n", i, j, su); } } } printf("%d\n", counter); return 0; }
#include <math.h> #include <stdio.h> int dp[100][100]; int n, d; int main() { scanf("%d%d", &n, &d); int counter = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { scanf("%d", &dp[i][j]); } } for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { int su = 0; for (int k = 0; k < d; k++) { su += ((dp[i][k] - dp[j][k]) * (dp[i][k] - dp[j][k])); // printf("su: %d\n", su); } if ((int)sqrt(su) * (int)sqrt(su) == su) { counter++; // printf("%d %d %d\n", i, j, su); } } } printf("%d\n", counter); return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
787,096
787,097
u708067384
cpp
p02982
#include <iostream> using namespace std; int x[12][12]; bool integer(int a) { int b = 1; while (b * b < a) { b++; if (b * b == a) return true; } return false; } int main() { int n, d; cin >> n >> d; for (int i = 1; i <= n; i++) { for (int j = 1; j <= d; j++) { cin >> x[i][j]; } } int ans = 0, sum = 0; for (int i = 1; i < n; i++) { for (int j = i + 1; j <= n; j++) { for (int k = 1; k <= d; k++) { sum += ((x[i][k] - x[j][k]) * (x[i][k] - x[j][k])); } // cout<<sum<<endl; if (integer(sum)) { ans++; } sum = 0; } } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int x[12][12]; bool integer(int a) { int b = 0; while (b * b < a) { b++; if (b * b == a) return true; } return false; } int main() { int n, d; cin >> n >> d; for (int i = 1; i <= n; i++) { for (int j = 1; j <= d; j++) { cin >> x[i][j]; } } int ans = 0, sum = 0; for (int i = 1; i < n; i++) { for (int j = i + 1; j <= n; j++) { for (int k = 1; k <= d; k++) { sum += ((x[i][k] - x[j][k]) * (x[i][k] - x[j][k])); } // cout<<sum<<endl; if (integer(sum)) { ans++; } sum = 0; } } cout << ans << endl; return 0; }
[ "literal.number.change", "variable_declaration.value.change" ]
787,102
787,103
u425858059
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int N, D; int X[10][10]; int sum; int count = 0; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { sum = 0; for (int k = 0; k < D; k++) { sum += pow((X[i][k] - X[j][k]), 2); } } int a = pow(sum, 0.5); if (pow(sum, 0.5) - a == 0) { count++; } } cout << count; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int N, D; int X[10][10]; int sum = 0; int count = 0; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { sum = 0; for (int k = 0; k < D; k++) { sum += pow((X[i][k] - X[j][k]), 2); } int a = pow(sum, 0.5); if (pow(sum, 0.5) - a == 0) { count++; } } } cout << count; return 0; }
[ "variable_declaration.value.change" ]
787,118
787,119
u234973476
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int N, D; int X[10][10]; int sum = 0; int count = 0; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { sum += pow((X[i][k] - X[j][k]), 2); } } int a = pow(sum, 0.5); if (pow(sum, 0.5) - a == 0) { count++; } } cout << count; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int N, D; int X[10][10]; int sum = 0; int count = 0; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { sum = 0; for (int k = 0; k < D; k++) { sum += pow((X[i][k] - X[j][k]), 2); } int a = pow(sum, 0.5); if (pow(sum, 0.5) - a == 0) { count++; } } } cout << count; return 0; }
[ "assignment.add" ]
787,120
787,119
u234973476
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d, s = 0, c = 0; double d1; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> a[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { for (int k = 0; k < d; k++) s += (a[j][k] - a[i][k]) * (a[j][k] - a[i][k]); d1 = sqrt(s); if (d1 - (int)d1 == 0.0) c++; } } cout << c << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d, s, c = 0; double d1; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; i++) for (int j = 0; j < d; j++) cin >> a[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { s = 0; for (int k = 0; k < d; k++) s += (a[j][k] - a[i][k]) * (a[j][k] - a[i][k]); d1 = sqrt(s); if (d1 - (int)d1 == 0.0) c++; } } cout << c << endl; return 0; }
[ "assignment.add" ]
787,121
787,122
u997340502
cpp
p02982
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) using ll = long long; const int inf = 1e9 + 7; const ll longinf = 1LL << 60; const ll mod = 1e9 + 7; int n, d, cnt; double x[10][10]; double tmp, tmp1; int main() { cin >> n >> d; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { REP(j, i + 1, n) { rep(k, d) { tmp += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } rep(k, tmp) { if (k * k == tmp) cnt++; } } } cout << cnt << endl; return 0; }
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstdint> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> using namespace std; #define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define rep(i, n) REP(i, 0, n) using ll = long long; const int inf = 1e9 + 7; const ll longinf = 1LL << 60; const ll mod = 1e9 + 7; int n, d, cnt; double x[10][10]; double tmp, tmp1; int main() { cin >> n >> d; rep(i, n) { rep(j, d) { cin >> x[i][j]; } } rep(i, n) { REP(j, i + 1, n) { rep(k, d) { tmp += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } rep(k, tmp + 1) { if (k * k == tmp) cnt++; } tmp = 0; } } cout << cnt << endl; return 0; }
[ "assignment.add" ]
787,132
787,133
u519950235
cpp
p02982
#include <cmath> #include <iostream> using namespace std; int main() { int n, d; cin >> n >> d; int x[d][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[j][i]; } } int h, cnt = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { h = 0; for (int k = 0; k < d; k++) { h += (x[k][i] - x[k][j]) * (x[k][i] - x[k][j]); if (((int)(pow(h, 0.5))) * ((int)(pow(h, 0.5))) == h) cnt++; } } } cout << cnt << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int n, d; cin >> n >> d; int x[d][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[j][i]; } } int h, cnt = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { h = 0; for (int k = 0; k < d; k++) { h += (x[k][i] - x[k][j]) * (x[k][i] - x[k][j]); } if (((int)(pow(h, 0.5))) * ((int)(pow(h, 0.5))) == h) cnt++; } } cout << cnt << endl; return 0; }
[]
787,157
787,158
u054798759
cpp
p02982
#include <iostream> using namespace std; int main() { int ans = 0, c, p; int n, d, x[10][10]; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n - 1; j++) { c = 0; for (int k = 0; k < d; k++) { p = x[i][k] - x[j][k]; c += p * p; } for (int k = 0; k < 50; k++) { if (k * k == c) { ans++; break; } } } } cout << ans; }
#include <iostream> using namespace std; int main() { int ans = 0, c, p; int n, d, x[10][10]; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { c = 0; for (int k = 0; k < d; k++) { p = x[i][k] - x[j][k]; c += p * p; } for (int k = 0; k < 130; k++) { if (k * k == c) { ans++; break; } } } } cout << ans; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one", "expression.operation.binary.remove", "literal.number.change", "expression.operation.binary.change" ]
787,168
787,166
u527984786
cpp
p02982
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define inf (ll)1e9 #define mod (ll)(1e9 + 7) #define d(x) cerr << #x << "=" << x << endl; #define p(x) cout << (x) << endl #define ps(x) cout << (x); #define pfix(d, x) cout << fixed << setprecision(d) << x << endl; #define pb push_back #define all(v) (v).begin(), (v).end() #define minel(v) *min_element(all(v)) #define minind(v) distance((v).begin(), min_element(all(v))) #define maxel(v) *max_element(all(v)) #define maxind(v) distance((v).begin(), max_element(all(v))) #define fi first #define se second ll a[101][101], b, c, d, n, m, x, y, z, k, h, w, sum, mi, ma, ans, s, t, l, r, res, tmp, itr, p, q; bool flag; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1}; char cha; string st; typedef map<int, int> imap; typedef pair<ll, ll> P; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<pair<ll, ll>> VP; double dist(int i, int j) { long double sum = 0; rep(k, d) sum += pow(abs(a[i][k] - a[j][k]), 2.0); return sqrt(sum); } int main() { cin >> n >> d; rep(i, d) rep(j, d) { cin >> a[i][j]; } rep(i, n) rep(j, i + 1, n) { long double x = dist(i, j); if (ceil(x) == x) ans++; } p(ans); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define inf (ll)1e9 #define mod (ll)(1e9 + 7) #define d(x) cerr << #x << "=" << x << endl; #define p(x) cout << (x) << endl #define ps(x) cout << (x); #define pfix(d, x) cout << fixed << setprecision(d) << x << endl; #define pb push_back #define all(v) (v).begin(), (v).end() #define minel(v) *min_element(all(v)) #define minind(v) distance((v).begin(), min_element(all(v))) #define maxel(v) *max_element(all(v)) #define maxind(v) distance((v).begin(), max_element(all(v))) #define fi first #define se second ll a[101][101], b, c, d, n, m, x, y, z, k, h, w, sum, mi, ma, ans, s, t, l, r, res, tmp, itr, p, q; bool flag; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1}; char cha; string st; typedef map<int, int> imap; typedef pair<ll, ll> P; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<pair<ll, ll>> VP; long double dist(int i, int j) { long double sum = 0; rep(k, d) sum += pow(abs(a[i][k] - a[j][k]), 2.0); return sqrt(sum); } int main() { cin >> n >> d; rep(i, n) rep(j, d) { cin >> a[i][j]; } rep(i, n) rep(j, i + 1, n) { long double x = dist(i, j); if (ceil(x) == x) ans++; } p(ans); return 0; }
[ "variable_declaration.type.widen.change", "identifier.change", "call.arguments.change" ]
787,170
787,171
u001566280
cpp
p02982
#include <stdio.h> using namespace std; int check(int a) { int s = 0; int P[10000]; for (int i = 1; i <= 200; i++) { P[i - 1] = i * i; if (P[i - 1] == a) { s++; } } return s; } int main(void) { int N, D; int count = 0; int X[20][20]; scanf("%d%d", &N, &D); for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { scanf("%d", &X[i][j]); } } int sum = 0; int q = 0; int r = 1; for (int i = 0; i < (N * (N - 1)) / 2; i++) { for (int j = 0; j < D; j++) { sum += (X[q][j] - X[q + r][j]) * (X[q][j] - X[q + r][j]); // printf("%d\n", sum); } // printf("%d %d %d\n", sum,q,r); if (check(sum) == 1) { count++; } if (r == N - 1 - q) { q++; r = 0; } else r++; } printf("%d", count); return 0; }
#include <stdio.h> using namespace std; int check(int a) { int s = 0; int P[10000]; for (int i = 1; i <= 200; i++) { P[i - 1] = i * i; if (P[i - 1] == a) { s++; } } return s; } int main(void) { int N, D; int count = 0; int X[20][20]; scanf("%d%d", &N, &D); for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { scanf("%d", &X[i][j]); // printf("%d\n", X[i][j]); } } int sum = 0; int q = 0; int r = 1; for (int i = 0; i < (N * (N - 1)) / 2; i++) { for (int j = 0; j < D; j++) { sum += (X[q][j] - X[q + r][j]) * (X[q][j] - X[q + r][j]); // printf("%d\n", sum); } // printf("%d %d %d\n", sum,q,r); if (check(sum) == 1) { count++; } if (r == N - 1 - q) { q++; r = 1; } else r++; sum = 0; } printf("%d", count); return 0; }
[ "literal.number.change", "assignment.value.change", "assignment.add" ]
787,196
787,197
u956941456
cpp
p02982
#include <iostream> #include <math.h> using namespace std; int main() { int n, d; cin >> n >> d; double a; int count = 0; int i, j; int l; int x[n][d]; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> x[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { a = 0; for (int k = 0; k < d; k++) { a += (x[i][k] - x[j + 1][k]) * (x[i][k] - x[j + 1][k]); // cout <<a <<x[i][k]+x[j+1][k] <<endl; } a = sqrt(a); if (ceil(a) == floor(a)) { count++; } } } cout << count; }
#include <iostream> #include <math.h> using namespace std; int main() { int n, d; cin >> n >> d; double a; int count = 0; int i, j; int l; int x[n][d]; for (i = 0; i < n; i++) { for (j = 0; j < d; j++) { cin >> x[i][j]; } } for (int i = 0; i < n; i++) { for (int j = i; j < n - 1; j++) { a = 0; for (int k = 0; k < d; k++) { a += (x[i][k] - x[j + 1][k]) * (x[i][k] - x[j + 1][k]); // cout <<a <<x[i][k]+x[j+1][k] <<endl; } a = sqrt(a); if (ceil(a) == floor(a)) { count++; } } } cout << count; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
787,203
787,204
u938987929
cpp
p02982
#include <bits/stdc++.h> using namespace std; int main() { int n, d, x[11][11], ans, a; int sum = 0; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int c = 0; c < n; c++) { for (int e = c + 1; e < n; e++) { sum = 0; for (int f = 0; f < d; f++) { sum += (x[c][f] - x[e][f]) * (x[c][f] - x[e][f]); } a = floor(sqrt(sum) + 0.5); if (a * a == sum) { ans++; } } } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d, x[11][11], ans = 0, a; int sum = 0; cin >> n >> d; for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { cin >> x[i][j]; } } for (int c = 0; c < n; c++) { for (int e = c + 1; e < n; e++) { sum = 0; for (int f = 0; f < d; f++) { sum += (x[c][f] - x[e][f]) * (x[c][f] - x[e][f]); } a = floor(sqrt(sum) + 0.5); if (a * a == sum) { ans++; } } } cout << ans; return 0; }
[ "variable_declaration.value.change" ]
787,223
787,224
u684822781
cpp
p02982
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define pb push_back typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; int main() { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { cin >> a[i][j]; } } int ans = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int sum = 0; for (int k = 0; k < d; ++k) { sum += pow(abs(a[i][k] - a[j][k]), 2); } if (sqrt(sum) * sqrt(sum) == sum) ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define pb push_back typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; int main() { int n, d; cin >> n >> d; int a[n][d]; for (int i = 0; i < n; ++i) { for (int j = 0; j < d; ++j) { cin >> a[i][j]; } } int ans = 0; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { int sum = 0; for (int k = 0; k < d; ++k) { sum += pow(abs(a[i][k] - a[j][k]), 2); } if ((int)sqrt(sum) * (int)sqrt(sum) == sum) ans++; } } cout << ans << endl; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
787,248
787,249
u876386943
cpp
p02982
#include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; typedef unsigned int uint; typedef long long ll; typedef pair<int, int> P; const int c_INF = 11111111111; const int c_mINF = -11111111111; const int c_YET = -1; const int c_Dx[4] = {0, 0, 1, -1}; const int c_Dy[4] = {1, -1, 0, 0}; int main() { int N, D; scanf("%d%d", &N, &D); int X[10][10]; for (int i = 0; i < N; i++) for (int j = 0; j < D; j++) scanf("%d", &X[i][j]); int beki[200]; for (int i = 0; i < 200; i++) beki[i] = i * i; int count = 0; for (int i = 0; i < N; i++) for (int j = 1; i + j < N; j++) { int dis = 0; for (int k = 0; k < D; k++) dis += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); for (int k = 0; k < 200; k++) if (dis == beki[k]) { // printf("i=%d,j=") count++; } } printf("%d", count); } /* 提出前の確認事項 ・デバッグ用の関数は<<コメント化>>しているか? ・すべての<<入力例>>は試したか? ・<<限界値分析>>はしたか? ・<<出力の改行>>の有無は確認したか?         ↓ <<提出先>>に注意して提出!! */
#include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; typedef unsigned int uint; typedef long long ll; typedef pair<int, int> P; const int c_INF = 11111111111; const int c_mINF = -11111111111; const int c_YET = -1; const int c_Dx[4] = {0, 0, 1, -1}; const int c_Dy[4] = {1, -1, 0, 0}; int main() { int N, D; scanf("%d%d", &N, &D); int X[10][10]; for (int i = 0; i < N; i++) for (int j = 0; j < D; j++) scanf("%d", &X[i][j]); int beki[200]; for (int i = 0; i < 200; i++) beki[i] = i * i; int count = 0; for (int i = 0; i < N; i++) for (int j = 1; i + j < N; j++) { int dis = 0; for (int k = 0; k < D; k++) dis += (X[i][k] - X[i + j][k]) * (X[i][k] - X[i + j][k]); for (int k = 0; k < 200; k++) if (dis == beki[k]) { // printf("i=%d,j=") count++; } } printf("%d", count); } /* 提出前の確認事項 ・デバッグ用の関数は<<コメント化>>しているか? ・すべての<<入力例>>は試したか? ・<<限界値分析>>はしたか? ・<<出力の改行>>の有無は確認したか?         ↓ <<提出先>>に注意して提出!! */
[ "assignment.change" ]
787,267
787,268
u433195318
cpp
p02982
#include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) // repetition //------------------------------------------ #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) int main() { int N, D, ans = 0; cin >> N >> D; VVI X; REP(i, N) { VI A(D); REP(j, D) { cin >> A.at(j); } X.PB(A); } REP(i, N - 1) { FOR(j, i + 1, N) { int d = 0; REP(k, D) { d += pow(X.at(i).at(k) - X.at(j).at(k), 2); } double g = sqrt(d); if (g * g == d) ans++; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define SORT(c) sort((c).begin(), (c).end()) // repetition //------------------------------------------ #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) int main() { int N, D, ans = 0; cin >> N >> D; VVI X; REP(i, N) { VI A(D); REP(j, D) { cin >> A.at(j); } X.PB(A); } REP(i, N - 1) { FOR(j, i + 1, N) { int d = 0; REP(k, D) { d += pow(X.at(i).at(k) - X.at(j).at(k), 2); } double g = sqrt(d); if (ceil(g) == g) ans++; } } cout << ans << endl; return 0; }
[ "control_flow.branch.if.condition.change", "identifier.change" ]
787,278
787,279
u276588887
cpp
p02982
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, a, b) for (int i = a; i < b; i++) #define ll long long #define MOD 1000000007 #define IMIN INT_MIN; #define IMAX INT_MAX; int main() { int n, d; cin >> n >> d; int x[n][d]; int cnt; double dist; rep(i, n) rep(j, d) cin >> x[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { dist = 0; rep(k, d) dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); if (sqrt(dist) == (int)sqrt(dist)) cnt++; } } cout << cnt << endl; return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rept(i, a, b) for (int i = a; i < b; i++) #define ll long long #define MOD 1000000007 #define IMIN INT_MIN; #define IMAX INT_MAX; int main() { int n, d; cin >> n >> d; int x[n][d]; int cnt = 0; double dist; rep(i, n) rep(j, d) cin >> x[i][j]; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { dist = 0; rep(k, d) dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); if (sqrt(dist) == (int)sqrt(dist)) cnt++; } } cout << cnt << endl; return 0; }
[ "variable_declaration.value.change" ]
787,291
787,292
u569041543
cpp
p02982
#include <stdio.h> int main(void) { int n, d, x[10][10] = {0}, count = 0; scanf("%d %d", &n, &d); getchar(); for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { scanf("%d", &x[n][d]); getchar(); } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int sum = 0; for (int k = 0; k < d; k++) { sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } for (int i = 1; i < 100; i++) { if (sum == i * i) { count++; break; } } } } printf("%d\n", count); return 0; }
#include <stdio.h> int main(void) { int n, d, x[10][10] = {0}, count = 0; scanf("%d %d", &n, &d); getchar(); for (int i = 0; i < n; i++) { for (int j = 0; j < d; j++) { scanf("%d", &x[i][j]); getchar(); } } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int sum = 0; for (int k = 0; k < d; k++) { sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } // printf("%d\n", sum); for (int i = 1; i < 1000; i++) { if (sum == i * i) { count++; break; } } } } printf("%d\n", count); return 0; }
[ "identifier.change", "variable_access.subscript.index.change", "call.arguments.change", "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
787,306
787,305
u337266378
cpp
p02982
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y, z) for ((x) = (y)-1; (z) <= (x); (x)--) #define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++) #define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++) #define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z)) #define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s)) #define repiins(x, y, z, s) for ((x) = (z); (x) <= (y); (x) += (s)) #define repit(x) \ for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++) #define repit2(x) \ for (__typeof((x).begin()) it2 = (x).begin(); it2 != (x).end(); it2++) #define nepit(x) \ for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++) #define All(x) (x).begin(), (x).end() #define Mem0(x) memset(x, 0, sizeof(x)) #define Mem1(x) memset(x, -1, sizeof(x)) // can be applied to string type #define Unique(v) v.resize(unique(All(v)) - v.begin()) #define peq(p0, p1) (p0.first == p1.first && p0.second == p1.second) #define End '\n' #define Out(x) cout << (x) << End template <typename T> void OutN(T x) { size_t i, len = x.size() - 1; for (i = 0; i < len; i++) cout << x[i] << " "; cout << x[len] << '\n'; } #define OutaN(x) \ do { \ size_t i, len = sizeof(x) / sizeof(__typeof(x[0])) - 1; \ for (i = 0; i < len; i++) \ cout << x[i] << " "; \ cout << x[len] << '\n'; \ } while (0); template <typename T> void Outit(T x) { auto end = x.end(); end--; for (auto it = x.begin(); it != end; it++) cout << *it << " "; cout << *end << '\n'; } template <typename T> void Debug(const T &val) { cerr << val << End; } template <typename T, typename... Args> void Debug(const T &val, Args... args) { cerr << val << ' '; Debug(std::forward<Args>(args)...); } template <typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; } template <typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; } template <typename T> using V = vector<T>; template <typename T> using VV = V<V<T>>; // can be applied to string type #define Sort(v) sort(All(v)) #define SortR(v) sort(All(v), std::greater<__typeof(v[0])>()) // array sorters #define Sart(a) sort(a, a + sizeof(a) / sizeof(__typeof(a[0]))); #define SartR(a) \ sort(a, a + sizeof(a) / sizeof(__typeof(a[0])), \ std::greater<__typeof(a[0])>()) #define pb push_back #define mp make_pair #define a first #define b second #define lb std::lower_bound #define ub std::upper_bound #define lbi(v, x) lb(All(v), (x)) - v.begin() #define ubi(v, x) ub(All(v), (x)) - v.begin() static const ll MOD = 1e9 + 7; static const double PI = 3.141592653589793; #define LOCAL 1 int main() { #if LOCAL freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); freopen("debug.txt", "w", stderr); #endif cin.tie(0); ios::sync_with_stdio(false); // std::cout.precision(18); int n, d; cin >> n >> d; int x[n][d]; int ans = 0; double sum, rt; int i, j, k; rep(i, n) rep(j, d) cin >> x[i][j]; rep(i, n) { repi(j, n, i + 1) { sum = 0.0; rep(k, d) sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); rt = floor(sqrt(sum)); sum = sqrt(sum); if (rt == sum) ans++; } } Out(ans); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y, z) for ((x) = (y)-1; (z) <= (x); (x)--) #define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++) #define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++) #define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z)) #define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s)) #define repiins(x, y, z, s) for ((x) = (z); (x) <= (y); (x) += (s)) #define repit(x) \ for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++) #define repit2(x) \ for (__typeof((x).begin()) it2 = (x).begin(); it2 != (x).end(); it2++) #define nepit(x) \ for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++) #define All(x) (x).begin(), (x).end() #define Mem0(x) memset(x, 0, sizeof(x)) #define Mem1(x) memset(x, -1, sizeof(x)) // can be applied to string type #define Unique(v) v.resize(unique(All(v)) - v.begin()) #define peq(p0, p1) (p0.first == p1.first && p0.second == p1.second) #define End '\n' #define Out(x) cout << (x) << End template <typename T> void OutN(T x) { size_t i, len = x.size() - 1; for (i = 0; i < len; i++) cout << x[i] << " "; cout << x[len] << '\n'; } #define OutaN(x) \ do { \ size_t i, len = sizeof(x) / sizeof(__typeof(x[0])) - 1; \ for (i = 0; i < len; i++) \ cout << x[i] << " "; \ cout << x[len] << '\n'; \ } while (0); template <typename T> void Outit(T x) { auto end = x.end(); end--; for (auto it = x.begin(); it != end; it++) cout << *it << " "; cout << *end << '\n'; } template <typename T> void Debug(const T &val) { cerr << val << End; } template <typename T, typename... Args> void Debug(const T &val, Args... args) { cerr << val << ' '; Debug(std::forward<Args>(args)...); } template <typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; } template <typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; } template <typename T> using V = vector<T>; template <typename T> using VV = V<V<T>>; // can be applied to string type #define Sort(v) sort(All(v)) #define SortR(v) sort(All(v), std::greater<__typeof(v[0])>()) // array sorters #define Sart(a) sort(a, a + sizeof(a) / sizeof(__typeof(a[0]))); #define SartR(a) \ sort(a, a + sizeof(a) / sizeof(__typeof(a[0])), \ std::greater<__typeof(a[0])>()) #define pb push_back #define mp make_pair #define a first #define b second #define lb std::lower_bound #define ub std::upper_bound #define lbi(v, x) lb(All(v), (x)) - v.begin() #define ubi(v, x) ub(All(v), (x)) - v.begin() static const ll MOD = 1e9 + 7; static const double PI = 3.141592653589793; #define LOCAL 0 int main() { #if LOCAL freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); freopen("debug.txt", "w", stderr); #endif cin.tie(0); ios::sync_with_stdio(false); // std::cout.precision(18); int n, d; cin >> n >> d; int x[n][d]; int ans = 0; double sum, rt; int i, j, k; rep(i, n) rep(j, d) cin >> x[i][j]; rep(i, n) { repi(j, n, i + 1) { sum = 0.0; rep(k, d) sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); rt = floor(sqrt(sum)); sum = sqrt(sum); if (rt == sum) ans++; } } Out(ans); return 0; }
[ "preprocessor.define.value.change", "literal.integer.change" ]
787,319
787,320
u518883877
cpp
p02982
/*     ∧_∧ やあ    (´・ω・`)     /     ようこそ、バーボンハウスへ。    /∇y:::::\    [ ̄]     このテキーラはサービスだから、まず飲んで落ち着いて欲しい。    |:⊃:|:::::|   |──|  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| うん、「また」なんだ。済まない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| ̄  仏の顔もって言うしね、謝って許してもらおうとも思っていない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄/|     ∇ ∇ ∇ ∇   /./|   でも、この提出を見たとき、君は、きっと言葉では言い表せない     ┴ ┴ ┴ ┴ / /  |   「ときめき」みたいなものを感じてくれたと思う。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|/   |   殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄     |   そう思って、この提出を投げたんだ。    (⊆⊇) (⊆⊇) (⊆⊇)  |   ||   ||  ||  |    じゃあ、判定を聞こうか。   ./|\ /|\ /|\ */ #include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define fst first #define snd second #define mp make_pair #define ALL(obj) (obj).begin(), (obj).end() #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define SIZE(x) ((int)(x).size()) #define debug(x) \ cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n'; #define debugpair(x, y) \ cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y \ << ") (line:" << __LINE__ << ")" << '\n'; typedef long long lint; typedef pair<int, int> pint; typedef pair<lint, lint> plint; typedef vector<lint> vec; typedef vector<vector<lint>> matrix; typedef priority_queue<lint> p_que; typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev; const lint INF = INT_MAX; const lint LINF = LLONG_MAX; const lint MOD = 1000000000 + 7; const double EPS = 1e-9; const double PI = acos(-1); const int di[]{0, -1, 0, 1, -1, -1, 1, 1}; const int dj[]{1, 0, -1, 0, 1, -1, -1, 1}; lint gcd(lint a, lint b) { lint r; while (b != 0) { r = a % b; a = b; b = r; } return a; } lint lcm(lint a, lint b) { return (a / gcd(a, b)) * b; } lint power(lint x, lint n, lint mod = MOD) { lint ret = 1; while (n > 0) { if (n & 1) { (ret *= x) %= mod; } (x *= x) %= mod; n >>= 1; } return ret; } vector<lint> make_power(int n, lint base) { lint num = 1; vector<lint> ret; for (int i = 0; i <= n; ++i) { ret.push_back(num); num *= base; } return ret; } int main() { cin.tie(0); ios_base::sync_with_stdio(false); int n, d; cin >> n >> d; lint x[n][d]; lint check[30]; REP(i, 30) { check[i] = i * i; } REP(i, n) { REP(j, d) { cin >> x[i][j]; } } lint ans = 0; lint dist = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { dist = 0; REP(k, d) { dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } // debug(dist); REP(k, 1000) { // debug(check[k]); if (check[k] == dist) { ans++; break; } } } } cout << ans << endl; return 0; }
/*     ∧_∧ やあ    (´・ω・`)     /     ようこそ、バーボンハウスへ。    /∇y:::::\    [ ̄]     このテキーラはサービスだから、まず飲んで落ち着いて欲しい。    |:⊃:|:::::|   |──|  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| うん、「また」なんだ。済まない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| ̄  仏の顔もって言うしね、謝って許してもらおうとも思っていない。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄/|     ∇ ∇ ∇ ∇   /./|   でも、この提出を見たとき、君は、きっと言葉では言い表せない     ┴ ┴ ┴ ┴ / /  |   「ときめき」みたいなものを感じてくれたと思う。  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|/   |   殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄     |   そう思って、この提出を投げたんだ。    (⊆⊇) (⊆⊇) (⊆⊇)  |   ||   ||  ||  |    じゃあ、判定を聞こうか。   ./|\ /|\ /|\ */ #include <algorithm> #include <array> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define fst first #define snd second #define mp make_pair #define ALL(obj) (obj).begin(), (obj).end() #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) RFOR(i, 0, n) #define SIZE(x) ((int)(x).size()) #define debug(x) \ cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n'; #define debugpair(x, y) \ cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y \ << ") (line:" << __LINE__ << ")" << '\n'; typedef long long lint; typedef pair<int, int> pint; typedef pair<lint, lint> plint; typedef vector<lint> vec; typedef vector<vector<lint>> matrix; typedef priority_queue<lint> p_que; typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev; const lint INF = INT_MAX; const lint LINF = LLONG_MAX; const lint MOD = 1000000000 + 7; const double EPS = 1e-9; const double PI = acos(-1); const int di[]{0, -1, 0, 1, -1, -1, 1, 1}; const int dj[]{1, 0, -1, 0, 1, -1, -1, 1}; lint gcd(lint a, lint b) { lint r; while (b != 0) { r = a % b; a = b; b = r; } return a; } lint lcm(lint a, lint b) { return (a / gcd(a, b)) * b; } lint power(lint x, lint n, lint mod = MOD) { lint ret = 1; while (n > 0) { if (n & 1) { (ret *= x) %= mod; } (x *= x) %= mod; n >>= 1; } return ret; } vector<lint> make_power(int n, lint base) { lint num = 1; vector<lint> ret; for (int i = 0; i <= n; ++i) { ret.push_back(num); num *= base; } return ret; } int main() { cin.tie(0); ios_base::sync_with_stdio(false); int n, d; cin >> n >> d; lint x[n][d]; lint check[150]; REP(i, 150) { check[i] = i * i; } REP(i, n) { REP(j, d) { cin >> x[i][j]; } } lint ans = 0; lint dist = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { dist = 0; REP(k, d) { dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); } // debug(dist); REP(k, 150) { // debug(check[k]); if (check[k] == dist) { ans++; break; } } } } cout << ans << endl; return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change", "call.arguments.change" ]
787,353
787,352
u625092455
cpp
p02982
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int i, j, k; int N, D; cin >> N >> D; int a[N][D]; for (int i = 0; i < N; ++i) { for (int j = 0; j < D; ++j) { cin >> a[i][j]; } } int cnt = 0; double sum; for (i = 0; i < N; ++i) { for (j = i + 1; j < N; ++j) { sum = 0; for (k = 0; k < N; ++k) { sum += pow((double)a[i][k] - (double)a[j][k], 2.0); } sum = sqrt(sum); if (sum == (double)(int)sum) { cnt++; } } } cout << cnt << endl; }
#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int i, j, k; int N, D; cin >> N >> D; int a[N][D]; for (int i = 0; i < N; ++i) { for (int j = 0; j < D; ++j) { cin >> a[i][j]; } } int cnt = 0; double sum; for (i = 0; i < N; ++i) { for (j = i + 1; j < N; ++j) { sum = 0; for (k = 0; k < D; ++k) { sum += pow((double)a[i][k] - (double)a[j][k], 2.0); } sum = sqrt(sum); if (sum == (double)(int)sum) { cnt++; } } } cout << cnt << endl; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
787,381
787,382
u563252794
cpp
p02982
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; ll Pow(ll a, ll b, ll c) { ll ans = 1; a %= c; while (b) { if (b & 1) ans = (ans * a) % c; a = (a * a) % c; b >>= 1; } return (ans % c); } bool cmp(const int &a, const int &b) { return a < b; } ll gcd(ll x, ll y) { return x % y == 0 ? y : gcd(y, x % y); } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } const int MAXN = 2000 + 5; const int mod = 1e9 + 7; ll comb[MAXN][MAXN]; void init() { for (int i = 0; i < MAXN; i++) { comb[i][0] = comb[i][i] = 1; for (int j = 1; j < i; j++) { comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1]; comb[i][j] %= mod; } } } const int MAXM = 1e6; int primes[MAXM], cnt; bool st[MAXN]; void get_prime(int n) { for (int i = 2; i <= n; i++) { if (!st[i]) primes[cnt++] = i; for (int j = 0; j < cnt && i * primes[j] <= n; j++) { st[i * primes[j]] = true; if (i % primes[j] == 0) break; } } } int main() { int n, d; scanf("%d%d", &n, &d); int x[15][15] = {0}; for (int i = 1; i <= n; i++) for (int j = 1; j <= d; j++) scanf("%d", &x[i][j]); int cnt = 0; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { int tmp = 0; for (int k = 1; k <= d; k++) tmp += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); if (sqrt(tmp) * sqrt(tmp) == tmp) cnt++; } } printf("%d\n", cnt); return 0; }
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; ll Pow(ll a, ll b, ll c) { ll ans = 1; a %= c; while (b) { if (b & 1) ans = (ans * a) % c; a = (a * a) % c; b >>= 1; } return (ans % c); } bool cmp(const int &a, const int &b) { return a < b; } ll gcd(ll x, ll y) { return x % y == 0 ? y : gcd(y, x % y); } ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } const int MAXN = 2000 + 5; const int mod = 1e9 + 7; ll comb[MAXN][MAXN]; void init() { for (int i = 0; i < MAXN; i++) { comb[i][0] = comb[i][i] = 1; for (int j = 1; j < i; j++) { comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1]; comb[i][j] %= mod; } } } const int MAXM = 1e6; int primes[MAXM], cnt; bool st[MAXN]; void get_prime(int n) { for (int i = 2; i <= n; i++) { if (!st[i]) primes[cnt++] = i; for (int j = 0; j < cnt && i * primes[j] <= n; j++) { st[i * primes[j]] = true; if (i % primes[j] == 0) break; } } } int main() { int n, d; scanf("%d%d", &n, &d); int x[15][15] = {0}; for (int i = 1; i <= n; i++) for (int j = 1; j <= d; j++) scanf("%d", &x[i][j]); int cnt = 0; for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { int tmp = 0; for (int k = 1; k <= d; k++) tmp += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); if ((int)sqrt(tmp) * (int)sqrt(tmp) == tmp) cnt++; } } printf("%d\n", cnt); return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
787,416
787,417
u337067848
cpp
p02982
#include <cmath> #include <iostream> #include <vector> using namespace std; vector<vector<double>> X(10, vector<double>(10)); int main() { int N, D; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } double sum = 0; int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { sum = (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } if (sqrt(sum) == (int)sqrt(sum)) { ans++; } sum = 0; } } cout << ans << "\n"; }
#include <cmath> #include <iostream> #include <vector> using namespace std; vector<vector<double>> X(10, vector<double>(10, 0)); int main() { int N, D; cin >> N >> D; for (int i = 0; i < N; i++) { for (int j = 0; j < D; j++) { cin >> X[i][j]; } } double sum = 0; int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { for (int k = 0; k < D; k++) { sum += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]); } if (sqrt(sum) == (int)sqrt(sum)) { ans++; } sum = 0; } } cout << ans << "\n"; }
[ "call.arguments.add", "assignment.value.change" ]
787,433
787,434
u002428461
cpp
p02978
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define int long long using namespace std; int a[20], n; int f(int l, int r, int xl, int xr) { int i, j; if (r - l <= 1) return 0; int ans = 0x3f3f3f3f3f3f3f3f; for (i = l + 1; i < r; i++) { ans = min(ans, f(l, i, xl, xl + xr) + f(i, r, xl + xr, xl) + a[i] * (xl + xr)); } return ans; } signed main() { ios::sync_with_stdio(false); register int i, j; cin >> n; for (i = 1; i <= n; i++) cin >> a[i]; cout << a[1] + a[n] + f(1, n, 1, 1); }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define int long long using namespace std; int a[20], n; int f(int l, int r, int xl, int xr) { int i, j; if (r - l <= 1) return 0; int ans = 0x3f3f3f3f3f3f3f3f; for (i = l + 1; i < r; i++) { ans = min(ans, f(l, i, xl, xl + xr) + f(i, r, xl + xr, xr) + a[i] * (xl + xr)); } return ans; } signed main() { ios::sync_with_stdio(false); register int i, j; cin >> n; for (i = 1; i <= n; i++) cin >> a[i]; cout << a[1] + a[n] + f(1, n, 1, 1); }
[ "assignment.value.change", "identifier.change", "call.arguments.change", "expression.operation.binary.change" ]
787,504
787,505
u855085370
cpp
p02978
#include <bits/stdc++.h> #define meow(args...) fprintf(stderr, args) template <class T1, class T2> inline bool cmin(T1 &a, const T2 &b) { return b < a ? (a = b, true) : false; } template <class T1, class T2> inline bool cmax(T1 &a, const T2 &b) { return a < b ? (a = b, true) : false; } template <class Type> Type read() { Type a; bool b; unsigned char c; while (c = getchar() - 48, (c > 9) & (c != 253)) ; for (a = (b = c == 253) ? 0 : c; (c = getchar() - 48) <= 9; a = a * 10 + c) ; return b ? -a : a; } auto rd = read<int>; int n, a[19], l[1 << 16], r[1 << 16], u[1 << 16], v[1 << 16]; long long f[1 << 16][19][19]; int main() { n = rd(); for (int i = 1; i <= n; ++i) a[i] = rd(); if (n == 2) { printf("%d\n", a[1] + a[n]); return 0; } u[1] = v[1] = l[1] = 1; r[1] = n; for (int i = 1; i < 1 << (n - 3); ++i) { u[i << 1] = u[i]; v[i << 1] = u[i << 1 | 1] = u[i] + v[i]; v[i << 1 | 1] = v[i]; l[i << 1] = l[i], r[i << 1] = r[i] - 1; l[i << 1 | 1] = l[i] + 1, r[i << 1 | 1] = r[i]; } for (int x = 1 << (n - 3); --x;) { for (int i = l[x]; i <= r[x]; ++i) for (int j = i + 2; j <= r[x]; ++j) f[x][i][j] = 4e18; for (int i = l[x]; i < r[x]; ++i) for (int j = i + 1; j < r[x]; ++j) for (int k = j + 1; k <= r[x]; ++k) cmin(f[x][i][k], f[x << 1][i][j] + f[x << 1 | 1][j][k] + (long long)(u[x] + v[x]) * a[j]); } printf("%lld\n", a[1] + a[n] + f[1][1][n]); return 0; }
#include <bits/stdc++.h> #define meow(args...) fprintf(stderr, args) template <class T1, class T2> inline bool cmin(T1 &a, const T2 &b) { return b < a ? (a = b, true) : false; } template <class T1, class T2> inline bool cmax(T1 &a, const T2 &b) { return a < b ? (a = b, true) : false; } template <class Type> Type read() { Type a; bool b; unsigned char c; while (c = getchar() - 48, (c > 9) & (c != 253)) ; for (a = (b = c == 253) ? 0 : c; (c = getchar() - 48) <= 9; a = a * 10 + c) ; return b ? -a : a; } auto rd = read<int>; int n, a[19], l[1 << 16], r[1 << 16], u[1 << 16], v[1 << 16]; long long f[1 << 17][19][19]; int main() { n = rd(); for (int i = 1; i <= n; ++i) a[i] = rd(); if (n == 2) { printf("%d\n", a[1] + a[n]); return 0; } u[1] = v[1] = l[1] = 1; r[1] = n; for (int i = 1; i < 1 << (n - 3); ++i) { u[i << 1] = u[i]; v[i << 1] = u[i << 1 | 1] = u[i] + v[i]; v[i << 1 | 1] = v[i]; l[i << 1] = l[i], r[i << 1] = r[i] - 1; l[i << 1 | 1] = l[i] + 1, r[i << 1 | 1] = r[i]; } for (int x = 1 << (n - 2); --x;) { for (int i = l[x]; i <= r[x]; ++i) for (int j = i + 2; j <= r[x]; ++j) f[x][i][j] = 4e18; for (int i = l[x]; i < r[x]; ++i) for (int j = i + 1; j < r[x]; ++j) for (int k = j + 1; k <= r[x]; ++k) cmin(f[x][i][k], f[x << 1][i][j] + f[x << 1 | 1][j][k] + (long long)(u[x] + v[x]) * a[j]); } printf("%lld\n", a[1] + a[n] + f[1][1][n]); return 0; }
[ "literal.number.change", "expression.operation.binary.change", "control_flow.loop.for.initializer.change", "expression.off_by_one" ]
787,530
787,531
u852473670
cpp
p02983
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long double ld; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<char> vc; typedef vector<string> vs; typedef vector<ll> vll; typedef vector<pair<int, int>> vpii; typedef vector<vector<int>> vvi; typedef vector<vector<char>> vvc; typedef vector<vector<string>> vvs; typedef vector<vector<ll>> vvll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define fin(ans) cout << (ans) << endl #define P 1000000007 #define STI(s) atoi(s.c_str()) // string to int #define mp(p, q) make_pair(p, q) #define pb(n) push_back(n) #define Sort(a) sort(a.begin(), a.end()) 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 = INT_MAX; const long long LLINF = 1LL << 60; // g++ -std=c++1z temp.cpp //./a.out int main(void) { ios::sync_with_stdio(false); cin.tie(0); ////////////////////////////////////////////////////// ll l, r; cin >> l >> r; if (r - l > 2019) { fin(1); } else { ll ans = LLINF; for (ll i = l; i < r; i++) { for (ll j = l + 1; j <= r; j++) { ans = min(ans, i * j % 2019); } } fin(ans); } ////////////////////////////////////////////////////// return 0; }
#include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long double ld; typedef long long int ll; typedef unsigned long long int ull; typedef vector<int> vi; typedef vector<char> vc; typedef vector<string> vs; typedef vector<ll> vll; typedef vector<pair<int, int>> vpii; typedef vector<vector<int>> vvi; typedef vector<vector<char>> vvc; typedef vector<vector<string>> vvs; typedef vector<vector<ll>> vvll; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define fin(ans) cout << (ans) << endl #define P 1000000007 #define STI(s) atoi(s.c_str()) // string to int #define mp(p, q) make_pair(p, q) #define pb(n) push_back(n) #define Sort(a) sort(a.begin(), a.end()) 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 = INT_MAX; const long long LLINF = 1LL << 60; // g++ -std=c++1z temp.cpp //./a.out int main(void) { ios::sync_with_stdio(false); cin.tie(0); ////////////////////////////////////////////////////// ll l, r; cin >> l >> r; if (r - l > 2019) { fin(0); } else { ll ans = LLINF; for (ll i = l; i < r; i++) { for (ll j = l + 1; j <= r; j++) { ans = min(ans, i * j % 2019); } } fin(ans); } ////////////////////////////////////////////////////// return 0; }
[ "literal.number.change", "call.arguments.change" ]
787,629
787,630
u903311413
cpp
p02983
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } typedef long long ll; typedef pair<int, int> P; int main() { ll l, r; cin >> l >> r; int ans = INF; if (r - l >= 2019) ans = 0; else { l %= 2019; r %= 2019; if (l > r) ans = 0; else { for (int i = l; i < r; i++) { for (int j = i + 1; j <= r; j++) { chmin(ans, i * j); } } } } cout << ans << endl; }
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } typedef long long ll; typedef pair<int, int> P; int main() { ll l, r; cin >> l >> r; int ans = 2018; if (r - l >= 2019) ans = 0; else { l %= 2019; r %= 2019; if (l > r) ans = 0; else { for (int i = l; i < r; i++) { for (int j = i + 1; j <= r; j++) { chmin(ans, (i * j) % 2019); } } } } cout << ans << endl; }
[ "variable_declaration.value.change", "identifier.replace.remove", "literal.replace.add", "call.arguments.change", "call.arguments.add" ]
787,634
787,635
u639032323
cpp
p02983
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; int ml = l % 2019; int mr = r % 2019; if (r - l >= 2019 || ml > mr) { cout << 0 << endl; } else { int ans = 10000000; for (int i = ml; i < mr - 1; i++) { for (int j = i + 1; j < mr; j++) { int tmp = i * j; tmp %= 2019; ans = min(ans, tmp); } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; int ml = l % 2019; int mr = r % 2019; if (r - l >= 2019 || ml > mr) { cout << 0 << endl; } else { int ans = 10000000; for (int i = ml; i < mr; i++) { for (int j = i + 1; j <= mr; j++) { int tmp = i * j; tmp %= 2019; ans = min(ans, tmp); } } cout << ans << endl; } return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
787,636
787,637
u639032323
cpp
p02983
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; int ml = l % 2019; int mr = r % 2019; if (r - l >= 2019 || ml > mr) { cout << 0 << endl; } else { int ans = 10000000; for (int i = ml; i < mr - 1; i++) { for (int j = i; j < mr; j++) { int tmp = i * j; tmp %= 2019; ans = min(ans, tmp); } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; int ml = l % 2019; int mr = r % 2019; if (r - l >= 2019 || ml > mr) { cout << 0 << endl; } else { int ans = 10000000; for (int i = ml; i < mr; i++) { for (int j = i + 1; j <= mr; j++) { int tmp = i * j; tmp %= 2019; ans = min(ans, tmp); } } cout << ans << endl; } return 0; }
[ "control_flow.loop.for.condition.change", "expression.operation.binary.remove", "control_flow.loop.for.initializer.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
787,638
787,637
u639032323
cpp
p02983
#include <bits/stdc++.h> #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; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; vector<ll> A; // vectorのリサイズ // A.resize(N); ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } int main() { cin.tie(0); ios::sync_with_stdio(false); ll l, r; cin >> l >> r; // ll tmp = min(l % 2019, r % 2019); if (r - l > 2018) { cout << 0 << endl; return 0; } ll ans = 2018; for (ll i = l; i < r; i++) { for (ll j = i + 1; j <= r; j++) { ans = min(ans, (i % 2019) * (j % 2019)); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #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; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; vector<ll> A; // vectorのリサイズ // A.resize(N); ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } int main() { cin.tie(0); ios::sync_with_stdio(false); ll l, r; cin >> l >> r; // ll tmp = min(l % 2019, r % 2019); if (r - l > 2018) { cout << 0 << endl; return 0; } ll ans = 2018; for (ll i = l; i < r; i++) { for (ll j = i + 1; j <= r; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; }
[ "call.arguments.change" ]
787,661
787,662
u652037179
cpp
p02983
#include <bits/stdc++.h> #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; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; vector<ll> A; // vectorのリサイズ // A.resize(N); ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } int main() { cin.tie(0); ios::sync_with_stdio(false); ll l, r; cin >> l >> r; // ll tmp = min(l % 2019, r % 2019); if (r - l > 0) { cout << 0 << endl; return 0; } ll ans = 2018; for (ll i = l; i < r; i++) { for (ll j = i + 1; j < r + 1; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #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; typedef long long ll; typedef pair<ll, ll> P; const char wall = '#'; vector<vector<char>> fields; vector<vector<bool>> used; vector<vector<ll>> dist; const int dx[4] = {0, -1, 0, 1}; const int dy[4] = {1, 0, -1, 0}; vector<ll> A; // vectorのリサイズ // A.resize(N); ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } int main() { cin.tie(0); ios::sync_with_stdio(false); ll l, r; cin >> l >> r; // ll tmp = min(l % 2019, r % 2019); if (r - l > 2018) { cout << 0 << endl; return 0; } ll ans = 2018; for (ll i = l; i < r; i++) { for (ll j = i + 1; j <= r; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; }
[ "literal.number.change", "control_flow.branch.if.condition.change", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "expression.operation.binary.remove" ]
787,663
787,662
u652037179
cpp
p02983
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; // const int N = 1000000; const ll mod = 1000000007; using Graph = vector<vector<int>>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll gcd(ll A, ll B) { if (B == 0) return A; return gcd(B, A % B); } ll lcm(ll A, ll B) { return A * (B / gcd(A, B)); } /*------------------------------------------------------------------*/ int main() { ll l, r; cin >> l >> r; ll ans = INFINITY; ll L = l % 2019; ll R = r % 2019; if (r - l >= 2019) { cout << 0 << endl; return 0; } else { if (L <= R) { for (ll i = L; i <= R; i++) { for (ll j = L; j <= R; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; } else { cout << 0 << endl; return 0; } } }
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; // const int N = 1000000; const ll mod = 1000000007; using Graph = vector<vector<int>>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll gcd(ll A, ll B) { if (B == 0) return A; return gcd(B, A % B); } ll lcm(ll A, ll B) { return A * (B / gcd(A, B)); } /*------------------------------------------------------------------*/ int main() { ll l, r; cin >> l >> r; ll ans = INFINITY; ll L = l % 2019; ll R = r % 2019; if (r - l >= 2019) { cout << 0 << endl; return 0; } else { if (L <= R) { for (ll i = L; i <= R; i++) { for (ll j = i + 1; j <= R; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; } else { cout << 0 << endl; return 0; } } }
[ "control_flow.loop.for.initializer.change" ]
787,680
787,681
u999788719
cpp
p02983
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; // const int N = 1000000; const ll mod = 1000000007; using Graph = vector<vector<int>>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll gcd(ll A, ll B) { if (B == 0) return A; return gcd(B, A % B); } ll lcm(ll A, ll B) { return A * (B / gcd(A, B)); } /*------------------------------------------------------------------*/ int main() { ll l, r; cin >> l >> r; ll ans = INFINITY; ll L = l % 2019; ll R = r % 2019; if (r - l >= 2019) { cout << 0 << endl; return 0; } else { if (L <= R) { for (ll i = L; i <= R; i++) { for (ll j = i + 1; j <= R; j++) { ans = min(ans, i * j); } } cout << ans << endl; return 0; } else { cout << 0 << endl; return 0; } } }
#include <bits/stdc++.h> #define rep(i, n) for (long long int i = 0; i < n; i++) #define _rep(i, m, n) for (long long int i = m; i < n; i++) using namespace std; typedef long long ll; typedef pair<int, int> P; // const int N = 1000000; const ll mod = 1000000007; using Graph = vector<vector<int>>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; ll gcd(ll A, ll B) { if (B == 0) return A; return gcd(B, A % B); } ll lcm(ll A, ll B) { return A * (B / gcd(A, B)); } /*------------------------------------------------------------------*/ int main() { ll l, r; cin >> l >> r; ll ans = INFINITY; ll L = l % 2019; ll R = r % 2019; if (r - l >= 2019) { cout << 0 << endl; return 0; } else { if (L <= R) { for (ll i = L; i <= R; i++) { for (ll j = i + 1; j <= R; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; return 0; } else { cout << 0 << endl; return 0; } } }
[ "call.arguments.change", "call.arguments.add" ]
787,682
787,681
u999788719
cpp
p02983
#include <algorithm> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, string> P; int main() { long long l, r, ans, m; cin >> l >> r; m = 10000000000; for (long long i = l; i <= r; i++) { for (long long j = i + 1; j <= r; j++) { ans = (i * j) % 2019; m = min(ans, m); if (ans == 0) { cout << m << endl; break; } } } cout << m << endl; }
#include <algorithm> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, string> P; int main() { long long l, r, ans, m; cin >> l >> r; m = 10000000000; for (long long i = l; i <= r; i++) { for (long long j = i + 1; j <= r; j++) { ans = (i * j) % 2019; m = min(ans, m); if (ans == 0) { cout << m << endl; return 0; } } } cout << m << endl; }
[ "control_flow.break.remove", "control_flow.return.add", "function.return_value.change" ]
787,685
787,686
u027762862
cpp
p02983
// Template // #include <bits/stdc++.h> using namespace std; // マクロ // #define rep(i, N) for (int i = 0; i < (int)(N); i++) #define req(i, f, N) for (int i = f; i < (int)(N); i++) #define all(x) x.begin(), x.end() #define sort(x) sort(all(x)) #define uniq(x) x.erase(unique(all(x)), x.end()) #define vsum(x) accumulate(all(x), 0) #define cou(x) cout << x << endl #define y() cout << "Yes" << endl #define n() cout << "No" << endl #define Y() cout << "YES" << endl #define N() cout << "NO" << endl #define x2(x) (x) * (x) #define db(i) cout << #i << " = " << i; // 型エイリアス // using lint = long long; using pii = pair<int, int>; using vpii = vector<pii>; using vi = vector<int>; using vli = vector<lint>; using vc = vector<char>; using vs = vector<string>; using vb = vector<bool>; using vvi = vector<vi>; using vvli = vector<vli>; using vvb = vector<vb>; using vvc = vector<vc>; using vvs = vector<vs>; using mii = map<int, int>; using mili = map<int, lint>; using mci = map<char, int>; using mcli = map<char, lint>; using msi = map<string, int>; using msli = map<string, lint>; // 関数 // template <class T, class Q> lint gcd_(T a, Q b) { int t; while (b != 0) { t = a % b; a = b; b = t; } return a; } template <class T, class Q> lint lcm_(T a, Q b) { return a * b / gcd(a, b); } double distance(pii a, pii b) { double dist; dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second)); return dist; } lint perm(int a) { lint perm = 1; for (int i = a; i >= 1; i--) { perm *= i; } return perm; } lint combination(int n, int m) { long double c = 1; for (int i = n, k = 1; i > m; i--, k++) { c *= i; c /= k; } return (lint)c; } template <class T, class Q> inline bool chmin(T &a, Q b) { if (a > b) { a = b; return true; } return false; } template <class T, class Q> inline bool chmax(T &a, Q b) { if (a < b) { a = b; return true; } return false; } // 定数 // const double pi = acos(-1); const int mod = 1000000007; const int MOD = 998244353; const int inf = 1045141919; const lint linf = ((1LL << 62) - 1); // キーワード // #define elif else if // End of Template // int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int L, R; cin >> L >> R; if (R - L + 1 >= 2019) { cou(0); exit(0); } vi mo(R - L + 1); for (int i = 0; i < mo.size(); i++) { mo[i] = (i + L) % 2019; } int minmod = inf; rep(i, mo.size()) { rep(j, mo.size()) { if (i == j) continue; chmin(minmod, i * j % 2019); } } cou(minmod); }
// Template // #include <bits/stdc++.h> using namespace std; // マクロ // #define rep(i, N) for (int i = 0; i < (int)(N); i++) #define req(i, f, N) for (int i = f; i < (int)(N); i++) #define all(x) x.begin(), x.end() #define sort(x) sort(all(x)) #define uniq(x) x.erase(unique(all(x)), x.end()) #define vsum(x) accumulate(all(x), 0) #define cou(x) cout << x << endl #define y() cout << "Yes" << endl #define n() cout << "No" << endl #define Y() cout << "YES" << endl #define N() cout << "NO" << endl #define x2(x) (x) * (x) #define db(i) cout << #i << " = " << i; // 型エイリアス // using lint = long long; using pii = pair<int, int>; using vpii = vector<pii>; using vi = vector<int>; using vli = vector<lint>; using vc = vector<char>; using vs = vector<string>; using vb = vector<bool>; using vvi = vector<vi>; using vvli = vector<vli>; using vvb = vector<vb>; using vvc = vector<vc>; using vvs = vector<vs>; using mii = map<int, int>; using mili = map<int, lint>; using mci = map<char, int>; using mcli = map<char, lint>; using msi = map<string, int>; using msli = map<string, lint>; // 関数 // template <class T, class Q> lint gcd_(T a, Q b) { int t; while (b != 0) { t = a % b; a = b; b = t; } return a; } template <class T, class Q> lint lcm_(T a, Q b) { return a * b / gcd(a, b); } double distance(pii a, pii b) { double dist; dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second)); return dist; } lint perm(int a) { lint perm = 1; for (int i = a; i >= 1; i--) { perm *= i; } return perm; } lint combination(int n, int m) { long double c = 1; for (int i = n, k = 1; i > m; i--, k++) { c *= i; c /= k; } return (lint)c; } template <class T, class Q> inline bool chmin(T &a, Q b) { if (a > b) { a = b; return true; } return false; } template <class T, class Q> inline bool chmax(T &a, Q b) { if (a < b) { a = b; return true; } return false; } // 定数 // const double pi = acos(-1); const int mod = 1000000007; const int MOD = 998244353; const int inf = 1045141919; const lint linf = ((1LL << 62) - 1); // キーワード // #define elif else if // End of Template // int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int L, R; cin >> L >> R; if (R - L + 1 >= 2019) { cou(0); exit(0); } vi mo(R - L + 1); for (int i = 0; i < mo.size(); i++) { mo[i] = (i + L) % 2019; } int minmod = inf; rep(i, mo.size()) { rep(j, mo.size()) { if (i == j) continue; chmin(minmod, mo[i] * mo[j] % 2019); } } cou(minmod); }
[ "call.arguments.change" ]
787,687
787,688
u073983440
cpp
p02983
#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 l, r; cin >> l >> r; int ans = 2019; for (int i = l; i < r; i++) { for (int j = i + 1; j < r + 1; j++) { ans = min(ans, (i % 2019) * (j % 2019)); if (ans == 0) { cout << ans << endl; return 0; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int l, r; cin >> l >> r; int ans = 2019; for (int i = l; i < r; i++) { for (int j = i + 1; j < r + 1; j++) { ans = min(ans, ((i % 2019) * (j % 2019)) % 2019); if (ans == 0) { cout << ans << endl; return 0; } } } cout << ans << endl; return 0; }
[ "call.arguments.change", "call.arguments.add" ]
787,701
787,702
u354281482
cpp
p02983
#include <bits/stdc++.h> #include <chrono> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repl(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define rep2l(i, s, n) for (ll i = (ll)(s); i < (ll)n; i++) int main() { ll L, R; cin >> L >> R; priority_queue<ll, vector<ll>, greater<ll>> res; rep2l(i, L, R) { rep2l(j, i + 1, R + 1) { ll ans = ((i % 2019) * (j % 2019)) % 2019; if (ans == 0) { cout << ans << endl; break; } res.push(ans); } } cout << res.top() << endl; }
#include <bits/stdc++.h> #include <chrono> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repl(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define rep2l(i, s, n) for (ll i = (ll)(s); i < (ll)n; i++) int main() { ll L, R; cin >> L >> R; priority_queue<ll, vector<ll>, greater<ll>> res; rep2l(i, L, R) { rep2l(j, i + 1, R + 1) { ll ans = ((i % 2019) * (j % 2019)) % 2019; if (ans == 0) { cout << ans << endl; return 0; } res.push(ans); } } cout << res.top() << endl; }
[ "control_flow.break.remove", "control_flow.return.add", "function.return_value.change" ]
787,708
787,709
u632527507
cpp
p02983
#include <bits/stdc++.h> using namespace std; #define pb push_back using ll = long long; using ull = unsigned long long; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvl; typedef vector<string> vs; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll l, r, res; cin >> l >> r; if ((r / 2019) * 2019 >= l) { res = 0; } else { res = 2e9; l = l % 2019; r = r % 2019; for (ll i = l; i <= r; i++) { for (ll j = i + 1; j <= r; j++) { res = min(res, i * j); } } } cout << res << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; #define pb push_back using ll = long long; using ull = unsigned long long; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvl; typedef vector<string> vs; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll l, r, res; cin >> l >> r; if ((r / 2019) * 2019 >= l) { res = 0; } else { res = 2e9; l = l % 2019; r = r % 2019; for (ll i = l; i <= r; i++) { for (ll j = i + 1; j <= r; j++) { res = min(res, (i * j) % 2019); } } } cout << res << "\n"; return 0; }
[ "call.arguments.change", "call.arguments.add" ]
787,716
787,717
u214781572
cpp
p02983
#include <bits/stdc++.h> using namespace std; int main() { long long l, r; cin >> l >> r; if (l / 2019 - r / 2019 > 0) { cout << 0 << endl; return 0; } l = l % 2019; r = r % 2019; long long min = 100000000; for (int i = l; i < r; i++) { for (int j = i + 1; j < r + 1; j++) { if ((i * j) % 2019 < min) { min = (i * j) % 2019; } } } cout << min << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long l, r; cin >> l >> r; if (r / 2019 - l / 2019 > 0) { cout << 0 << endl; return 0; } l = l % 2019; r = r % 2019; long long min = 100000000; for (int i = l; i < r; i++) { for (int j = i + 1; j < r + 1; j++) { if ((i * j) % 2019 < min) { min = (i * j) % 2019; } } } cout << min << endl; return 0; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
787,722
787,723
u961443099
cpp
p02983
#include <bits/stdc++.h> using namespace std; int main() { long l, r; cin >> l >> r; if (r - l > 4038) cout << 1 << endl; else { int ans = 2018; for (long i = l; i < r; i++) { for (long j = i + 1; j <= r; j++) { ans = min(ans, (int)((i * j) % 2019)); if (ans == 1) break; } if (ans == 1) break; } cout << ans << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long l, r; cin >> l >> r; if (r - l > 4038) cout << 0 << endl; else { int ans = 2018; for (long i = l; i < r; i++) { for (long j = i + 1; j <= r; j++) { ans = min(ans, (int)((i * j) % 2019)); if (ans == 0) break; } if (ans == 0) break; } cout << ans << endl; } }
[ "literal.number.change", "io.output.change", "control_flow.branch.if.condition.change" ]
787,724
787,725
u523698212
cpp
p02983
// A.cpp #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } const ll mod = 1e9 + 7; int main() { ll L, R; cin >> L >> R; ll ans; ll right, left; ans = 2018 * 2018; if (R - L + 1 >= 2019) { ans = 1; } else { for (ll i = L; i <= R; i++) { for (ll j = i + 1; j <= R; j++) { right = i % 2019; left = j % 2019; right = (right * left) % 2019; ans = min(ans, right); } } } printf("%lld\n", ans); return 0; }
// A.cpp #include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } const ll mod = 1e9 + 7; int main() { ll L, R; cin >> L >> R; ll ans; ll right, left; ans = 2018 * 2018; if (R - L + 1 >= 2019) { ans = 0; } else { for (ll i = L; i <= R; i++) { for (ll j = i + 1; j <= R; j++) { right = i % 2019; left = j % 2019; right = (right * left) % 2019; ans = min(ans, right); } } } printf("%lld\n", ans); return 0; }
[ "literal.number.change", "assignment.value.change" ]
787,728
787,729
u837654535
cpp
p02983
#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() { ll L, R; cin >> L >> R; int L_mod = L % 2019; int R_mod = R % 2019; if ((R - L) >= 2019) cout << 0 << endl; else { if (R_mod > L_mod) { int N = R_mod - L_mod; int min = 200000; rep(i, N) { for (int j = i + 1; j < N; j++) { ll W = (L_mod + i) * (L_mod + j); int min2 = W % 2019; if (min2 < min) min = min2; } } cout << min << endl; } else cout << 0 << endl; } }
#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() { ll L, R; cin >> L >> R; int L_mod = L % 2019; int R_mod = R % 2019; if ((R - L) >= 2019) cout << 0 << endl; else { if (R_mod > L_mod) { int N = R_mod - L_mod; int min = 200000; rep(i, N) { for (int j = i + 1; j < N + 1; j++) { ll W = (L_mod + i) * (L_mod + j); int min2 = W % 2019; if (min2 < min) min = min2; } } cout << min << endl; } else cout << 0 << endl; } }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
787,730
787,731
u711381986
cpp
p02983
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; if (l - r >= 673) { cout << 0 << endl; return 0; } l = l % 2019; r = r % 2019; // cout << l << endl; // cout << r << endl; if (l > r) { cout << 0 << endl; return 0; } int mn = 2019; for (int i = l; i < r; i++) { for (int j = i + 1; j <= r; j++) { int mod; mod = (i * j) % 2019; mn = min(mod, mn); } } cout << mn << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main() { ll l, r; cin >> l >> r; if (r - l >= 673) { cout << 0 << endl; return 0; } l = l % 2019; r = r % 2019; // cout << l << endl; // cout << r << endl; if (l > r) { cout << 0 << endl; return 0; } int mn = 2019; for (int i = l; i < r; i++) { for (int j = i + 1; j <= r; j++) { int mod; mod = (i * j) % 2019; mn = min(mod, mn); } } cout << mn << endl; }
[ "expression.operation.binary.remove", "control_flow.branch.if.condition.change" ]
787,743
787,744
u965095643
cpp
p02983
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { const int mod = 2019; int L, R; cin >> L >> R; if (R - L + 1 >= 2019) { cout << 0 << endl; } else { int mn = 1e9; int range = max(R, L + mod); for (int i = L; i < range; i++) { for (int j = i + 1; j <= range; j++) { mn = min(mn, i * j % mod); } } cout << mn << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { const int mod = 2019; int L, R; cin >> L >> R; if (R - L + 1 >= 2019) { cout << 0 << endl; } else { ll mn = 1e9; int range = min(R, L + mod); for (ll i = L; i < range; i++) { for (ll j = i + 1; j <= range; j++) { mn = min(mn, i * j % mod); } } cout << mn << endl; } return 0; }
[ "variable_declaration.type.change", "misc.opposites", "identifier.change", "call.function.change", "control_flow.loop.for.initializer.change" ]
787,756
787,755
u107464079
cpp
p02983
#include <bits/stdc++.h> using namespace std; int main(void) { long long L, R; cin >> L >> R; long long ans = 2018; if (R - L > 2021) cout << 0 << endl; else { for (long long i = L; i <= R; i++) { for (long long j = i + 1; j <= R; j++) { ans = min(ans, (i * j) % 2019); } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { long long L, R; cin >> L >> R; long long ans = 2018; if (R - L > 2021) cout << 0 << endl; else { for (long long i = L; i <= R; i++) { for (long long j = i + 1; j <= R; j++) { ans = min(ans, (i * j) % 2019); } } cout << ans << endl; } return 0; }
[]
787,760
787,761
u150155436
cpp