buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
change_count
int64
0
100
#include <iostream> using namespace std; struct Sweets { int i, p, q, r; }; int main() { int n; Sweets s[1000]; while (1) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) { cin >> s[i].i >> s[i].p >> s[i].q >> s[i].r; } int P, Q, R, C; cin >> P >> Q >> R >> C; ...
#include <iostream> using namespace std; struct Sweets { int i, p, q, r; }; int main() { int n; Sweets s[1000]; while (1) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) { cin >> s[i].i >> s[i].p >> s[i].q >> s[i].r; } int P, Q, R, C; cin >> P >> Q >> R >> C; ...
[["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
226
6
#include <iostream> using namespace std; int main() { int n; while (true) { int i[1000], p[1000], q[1000], r[1000]; cin >> n; if (n == 0) break; for (int j = 0; j < n; j++) { cin >> i[j] >> p[j] >> q[j] >> r[j]; } int P, Q, R, C; int sp = 0, sq = 0, sr = 0; int cal[...
#include <iostream> using namespace std; int main() { int n; while (true) { int i[1000], p[1000], q[1000], r[1000]; cin >> n; if (n == 0) break; for (int j = 0; j < n; j++) { cin >> i[j] >> p[j] >> q[j] >> r[j]; } int P, Q, R, C; int sp = 0, sq = 0, sr = 0; int cal...
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 17, 20], ["-", 51, 16, 31, 16, 31, 16, 12, 16, 17, 47], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 17, 20], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 47], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 20], ["-", 0, 57, 15, 339, 51, 16, 12, 1...
1
251
8
#include <cstdio> using namespace std; int main() { int n; while (scanf("%d", &n), n) { int a[1024], b[1024], c[1024], d[1024], cal[1024]; for (int i = 0; i < n; i++) { scanf("%d%d%d%d", &a[i], &b[i], &c[i], &d[i]); cal[i] = (4 * b[i]) + (7 * c[i]) + (4 * d[i]); } int P, Q, R, C; sca...
#include <cstdio> using namespace std; int main() { int n; while (scanf("%d", &n), n) { int a[1024], b[1024], c[1024], d[1024], cal[1024]; for (int i = 0; i < n; i++) { scanf("%d%d%d%d", &a[i], &b[i], &c[i], &d[i]); cal[i] = (4 * b[i]) + (9 * c[i]) + (4 * d[i]); } int P, Q, R, C; sca...
[["-", 12, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 31, 13]]
1
251
2
#include <iostream> #include <vector> using namespace std; int main() { for (;;) { int n; cin >> n; if (n == 0) break; vector<vector<int>> v(n, vector<int>(4)); for (int i = 0; i < n; i++) { cin >> v[i][0] >> v[i][1] >> v[i][2] >> v[i][3]; } int P, Q, R, C; cin >> P >> Q >>...
#include <iostream> #include <vector> using namespace std; int main() { for (;;) { int n; cin >> n; if (n == 0) break; vector<vector<int>> v(n, vector<int>(4)); for (int i = 0; i < n; i++) { cin >> v[i][0] >> v[i][1] >> v[i][2] >> v[i][3]; } int P, Q, R, C; cin >> P >> Q >>...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13]]
1
256
2
#include <iostream> using namespace std; int main() { int P, Q, R, C; int n, h; while (cin >> n) { if (n == 0) break; h = 0; int i[n], p[n], q[n], r[n]; for (int j = 0; j < n; j++) cin >> i[j] >> p[j] >> q[j] >> r[j]; cin >> P >> Q >> R >> C; for (int j = 0; j < n; j++) { ...
#include <iostream> using namespace std; int main() { int P, Q, R, C; int n, h; while (cin >> n) { if (n == 0) break; h = 0; int i[n], p[n], q[n], r[n]; for (int j = 0; j < n; j++) cin >> i[j] >> p[j] >> q[j] >> r[j]; cin >> P >> Q >> R >> C; for (int j = 0; j < n; j++) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
222
2
#include <bits/stdc++.h> using namespace std; #define MAX 1000 int main() { int N, Num[MAX], P[MAX], Q[MAX], R[MAX], Cal[MAX]; while (cin >> N, N) { int p, q, r, c; for (int i = 0; i < N; i++) { cin >> Num[i] >> P[i] >> Q[i] >> R[i]; Cal[i] = P[i] * 4 + Q[i] * 9 + R[i] * 4; } vector...
#include <bits/stdc++.h> using namespace std; #define MAX 1000 int main() { int N, Num[MAX], P[MAX], Q[MAX], R[MAX], Cal[MAX]; while (cin >> N, N) { int p, q, r, c; for (int i = 0; i < N; i++) { cin >> Num[i] >> P[i] >> Q[i] >> R[i]; Cal[i] = P[i] * 4 + Q[i] * 9 + R[i] * 4; } vector...
[["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
256
2
while 1: N = int(input()) if N == 0:break cals = [ list(map(int,input().split())) for i in range(N)] P,Q,R,C = list(map(int,input().split())) res = [ x for x in cals if x[1]<=P and x[2]<=Q and x[3]<=R and 4*x[1] + 9*x[2] + 4*x[3]] if len(res) == 0:print('NA') else: for i in res: ...
while 1: N = int(input()) if N == 0:break cals = [ list(map(int,input().split())) for i in range(N)] P,Q,R,C = list(map(int,input().split())) res = [ x for x in cals if x[1]<=P and x[2]<=Q and x[3]<=R and 4*x[1] + 9*x[2] + 4*x[3] <= C] if len(res) == 0:print('NA') else: for i in res:...
[["+", 12, 658, 0, 678, 0, 679, 12, 666, 667, 19], ["+", 12, 658, 0, 678, 0, 679, 12, 666, 0, 22]]
5
145
2
while True: n = int(input()) if n == 0: break s = [] for i in range(n): s.append([int(i) for i in input().split()]) p, q, r, c = [int(i) for i in input().split()] possible = [] for i in range(n): if (s[i][1] <= p) & (s[i][2] <= q) & (s[i][3] <= r) & ((4 * (s[i][...
while True: n = int(input()) if n == 0: break s = [] for i in range(n): s.append([int(i) for i in input().split()]) p, q, r, c = [int(i) for i in input().split()] possible = [] for i in range(n): if (s[i][1] <= p) & (s[i][2] <= q) & (s[i][3] <= r) & ((4 * (s[i][...
[["+", 0, 652, 3, 4, 0, 206, 51, 206, 51, 22], ["+", 0, 652, 3, 4, 0, 206, 51, 206, 0, 70], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 652, 3, 4, 0, 206, 51, 206, 0, 73], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 1, 0, 652, 3, 4, 0, 206, 206, 612], ["+", 0, ...
5
190
8
#include <math.h> #include <stdio.h> int main(void) { int n, y, i, b, t, maxb; double sum, r, max; for (; max = 0, scanf("%d", &n), n;) { scanf("%d", &y); for (i = 0; i < n; i++) { scanf("%d %lf %d", &b, &r, &t); switch (t) { case 1: sum = (1 + y * r / 100); break; ...
#include <math.h> #include <stdio.h> int main(void) { int n, y, i, b, t, maxb; double sum, r, max; for (; max = 0, scanf("%d", &n), n;) { scanf("%d", &y); for (i = 0; i < n; i++) { scanf("%d %lf %d", &b, &r, &t); switch (t) { case 1: sum = (1 + y * r / 100); break; ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
171
4
#include <stdio.h> int main() { int n, y, i, j, b, r, t, num; double ans, max; while (1) { max = 0.0; scanf("%d", &n); if (n == 0) break; scanf("%d", &y); for (i = 0; i < n; i++) { scanf("%d%d%d", &b, &r, &t); if (t == 1) { ans = (1 + y * (double)r / 100); ...
#include <stdio.h> int main() { int n, y, i, j, b, r, t, num; double ans, max; while (1) { max = 0.0; scanf("%d", &n); if (n == 0) break; scanf("%d", &y); for (i = 0; i < n; i++) { scanf("%d%d%d", &b, &r, &t); if (t == 1) { ans = (1 + y * (double)r / 100); ...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
0
182
4
#include <math.h> #include <stdio.h> double calcuate(int y, int t, int r) { if (t == 1) { return 1.0 * (1.0 + y * (double)r / 100); } else { return 1.0 * pow(1.0 + (double)r / 100, y); } } int main(void) { int n, y, b, r, t; int i; double max, now; int maxno; while (1) { scanf("%d", &n); ...
#include <math.h> #include <stdio.h> double calcuate(int y, int t, int r) { if (t == 1) { return 1.0 * (1.0 + y * (double)r / 100); } else { return 1.0 * pow(1.0 + (double)r / 100, y); } } int main(void) { int n, y, b, r, t; int i; double max, now; int maxno; while (1) { scanf("%d", &n); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
203
1
#include <algorithm> #include <cmath> #include <iostream> using namespace std; #define loop(i, a, b) for (int i = (a); i < int(b); i++) #define rep(i, b) loop(i, 0, b) int main() { int n; while (cin >> n) { int y; cin >> y; double mr = 0; int maxb = -1; rep(i, n) { double b, r, t; ...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; #define loop(i, a, b) for (int i = (a); i < int(b); i++) #define rep(i, b) loop(i, 0, b) int main() { int n; while (cin >> n && n) { int y; cin >> y; double mr = 0; int maxb = -1; rep(i, n) { double b, r, t; ...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
149
4
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13]]
1
195
2
#include <bits/stdc++.h> using namespace std; int main() { int i, maxi, n, y, b, r, t; while (cin >> n, n) { cin >> y; double maxm = 0; for (i = 0; i < n; ++i) { cin >> b >> r >> t; double m = (t == 1) ? (double)(1.0 + (double)y * (double)r / 100) : (double)(pow((1...
#include <bits/stdc++.h> using namespace std; int main() { int i, maxi, n, y, b, r, t; while (cin >> n, n) { cin >> y; double maxm = 0; for (i = 0; i < n; ++i) { cin >> b >> r >> t; double m = (t == 1) ? (double)(1.0 + (double)y * (double)r / 100) : (double)(pow((1...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
145
4
#include <cmath> #include <cstdio> int n, y, b, r, t; int main() { while (~scanf("%d", &n)) { if (!n) break; int p = 0; double d = 0, e; scanf("%d", &y); for (int i = 0; i < n; i++) { scanf("%d%d%d", &b, &r, &t); if (t == 1) e = y * r * 0.01; else e = pow(1 ...
#include <cmath> #include <cstdio> int n, y, b, r, t; int main() { while (~scanf("%d", &n)) { if (!n) break; int p = 0; double d = 0, e; scanf("%d", &y); for (int i = 0; i < n; i++) { scanf("%d%d%d", &b, &r, &t); if (t == 1) e = 1 + y * r * 0.01; else e = po...
[["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 13], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72]]
1
152
2
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } ret...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } ret...
[["-", 0, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
1
296
2
#include <cmath> #include <iostream> using namespace std; int main() { int n, y; while (cin >> n) { cin >> y; int b, r, t, res; double mx = 0; for (int i = 0; i < n; ++i) { cin >> b >> r >> t; if (t == 1) { double interest = 100.0 * (1 + y * r / 100.0); if (mx < interest)...
#include <cmath> #include <iostream> using namespace std; int main() { int n, y; while (cin >> n, n) { cin >> y; int b, r, t, res; double mx = 0; for (int i = 0; i < n; ++i) { cin >> b >> r >> t; if (t == 1) { double interest = 100.0 * (1 + y * r / 100.0); if (mx < intere...
[["+", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 12, 22]]
1
152
2
#include <iostream> using namespace std; double f(double k, int p) { if (p == 0) return 1; else return k * f(k, p - 1); } int main() { int n; while (cin >> n) { int y; cin >> y; double maxv = 0; int maxn; for (int i = 1; i <= n; i++) { int b, t; double r; cin >> b >...
#include <iostream> using namespace std; double f(double k, int p) { if (p == 0) return 1; else return k * f(k, p - 1); } int main() { int n; while (cin >> n, n) { int y; cin >> y; double maxv = 0; int maxn; for (int i = 1; i <= n; i++) { int b, t; double r; cin >> ...
[["+", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 12, 22]]
1
158
2
#include <cmath> #include <cstdio> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { for (int n; scanf("%d", &n), n;) { int y, ans; scanf("%d", &y); double p_ans = -1; rep(i, n) { int b, r, t; scanf("%d%d%d", &b, &r, &t); double p; if (t == 1)...
#include <cmath> #include <cstdio> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { for (int n; scanf("%d", &n), n;) { int y, ans; scanf("%d", &y); double p_ans = -1; rep(i, n) { int b, r, t; scanf("%d%d%d", &b, &r, &t); double p; if (t == 1)...
[["-", 64, 1, 0, 34, 12, 11, 12, 16, 31, 22], ["-", 64, 1, 0, 34, 12, 11, 12, 16, 17, 72], ["-", 64, 1, 0, 34, 12, 11, 12, 16, 12, 13], ["+", 0, 57, 64, 1, 0, 34, 12, 11, 12, 22]]
1
161
4
#include <algorithm> #include <math.h> #include <stdio.h> #include <utility> int main() { int n, y, r, t; std::pair<double, int> b[50]; while (scanf("%d", &n), n) { scanf("%d", &y); for (int i = 0; i < n; ++i) { scanf("%d%d%d", &b[i].second, &r, &t); if (r - 2) b[i].first = 1 + t / 100...
#include <algorithm> #include <math.h> #include <stdio.h> #include <utility> int main() { int n, y, r, t; std::pair<double, int> b[50]; while (scanf("%d", &n), n) { scanf("%d", &y); for (int i = 0; i < n; ++i) { scanf("%d%d%d", &b[i].second, &r, &t); if (t - 2) b[i].first = 1 + r / 100...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 0, 11, 12, 16, 12, 16, 31, 16, 31, 22], ["+", 0, 11, 12, 16, 12, 16, 31, 16, 31, 22], ["-", 12, 2, 3, 4, 0, 16, 12, 16, 31, 22], ["+", 12, 2, 3, 4, 0, 16, 12, 16, 31, 22]]
1
173
6
#include <cmath> #include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) int main() { while (true) { int n, y, res; double mx = 0; cin >> n; if (n == 0) break; cin >> y; while (n--) { int b, r, t; cin >> b >> r >> t; double k; ...
#include <cmath> #include <iostream> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) int main() { while (true) { int n, y, res; double mx = 0; cin >> n; if (n == 0) break; cin >> y; while (n--) { int b, r, t; cin >> b >> r >> t; double k; ...
[["-", 12, 16, 12, 16, 31, 16, 31, 74, 51, 22], ["+", 12, 16, 12, 16, 31, 16, 31, 74, 51, 22], ["-", 3, 4, 0, 16, 12, 16, 31, 74, 51, 22], ["+", 3, 4, 0, 16, 12, 16, 31, 74, 51, 22]]
1
142
4
#include <cmath> #include <iostream> using namespace std; int main() { int n, y, b, r, t; int ans_num; double ans_value; double v; while (1) { ans_value = ans_num = -1; cin >> n; if (!n) break; cin >> y; for (int i = 0; i < n; i++) { cin >> b >> r >> t; if (t == 1) ...
#include <cmath> #include <iostream> using namespace std; int main() { int n, y, b, r, t; int ans_num; double ans_value; double v; while (1) { ans_value = ans_num = -1; cin >> n; if (!n) break; cin >> y; for (int i = 0; i < n; i++) { cin >> b >> r >> t; if (t == 1) ...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
147
4
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <stack> #include <string> #include <strstream> #include <vector> using namespace std; int main() { int n; while (cin >> n && n) { multimap<double, int, greater<double>> rieki; int y; c...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <stack> #include <string> #include <strstream> #include <vector> using namespace std; int main() { int n; while (cin >> n && n) { multimap<double, int, greater<double>> rieki; int y; c...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
202
8
#include <iostream> using namespace std; int main() { long n, d; while (cin >> n, n) { while (n >= 13) { d = 0; if (n % 2 == 1) { for (int i = 3; i * i < n; i += 2) { if (d == 1) break; if (i * i < n - 8) { if ((n - 8) % i == 0) ...
#include <iostream> using namespace std; int main() { long n, d; while (cin >> n, n) { while (n >= 13) { d = 0; if (n % 2 == 1) { for (int i = 3; i * i <= n; i += 2) { if (d == 1) break; if (i * i <= n - 8) { if ((n - 8) % i == 0) ...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
201
8
#include <iostream> using namespace std; bool p[10000000]; void erato() { fill(p, p + 10000000, true); p[0] = p[1] = false; for (int i = 0; i < 10000000; i++) { if (!p[i]) continue; for (int j = i + i; j < 10000000; j += i) { p[j] = false; } } } int main() { erato(); int n; wh...
#include <iostream> using namespace std; bool p[10000000]; void erato() { fill(p, p + 10000000, true); p[0] = p[1] = false; for (int i = 0; i < 10000000; i++) { if (!p[i]) continue; for (int j = i + i; j < 10000000; j += i) { p[j] = false; } } } int main() { erato(); int n; wh...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
167
2
#include <iostream> #include <map> #include <queue> using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; class state { public: int tx; int ty; int kx; int ky; bool operator<(const state &s) const { if (ty != s.ty) return ty < s.ty; if (tx != s.tx) return tx < s.tx; ...
#include <iostream> #include <map> #include <queue> using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; class state { public: int tx; int ty; int kx; int ky; bool operator<(const state &s) const { if (ty != s.ty) return ty < s.ty; if (tx != s.tx) return tx < s.tx; ...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["-", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
588
6
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; struct State { pair<int, int> t, k; int turn; }; int dy[] = {0, 1, 0, -1}; int dx[] = {1, 0, -1, 0}; int w, h; int field[52][52]; bool visited[52][52][52][52]; int main() { while (cin >> w >> h, w | h) { memse...
#include <algorithm> #include <cstring> #include <iostream> #include <queue> using namespace std; struct State { pair<int, int> t, k; int turn; }; int dy[] = {0, 1, 0, -1}; int dx[] = {1, 0, -1, 0}; int w, h; int field[52][52]; bool visited[52][52][52][52]; int main() { while (cin >> w >> h, w | h) { memse...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
636
8
#include <algorithm> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; struct Data {...
#include <algorithm> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 using namespace std; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; struct Data {...
[["-", 12, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["+", 12, 16, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 51, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 22]]
1
667
8
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["+", 0, 16, 12, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
575
8
#include <iostream> #include <queue> struct D { int t, u, k, l, c; }; main() { for (int X, Y, t, u, k, l, d[50][50], a[4] = {1, 0, -1, 0}; std::cin >> X >> Y >> t >> u >> k >> l, X; ~k ? printf("%d\n", k) : puts("NA")) { std::queue<D> q; D p = {t - 1, u - 1, k - 1, l - 1, 0}, r; q.push(p);...
#include <iostream> #include <queue> struct D { int t, u, k, l, c; }; main() { for (int X, Y, t, u, k, l, d[50][50], a[4] = {1, 0, -1, 0}; std::cin >> X >> Y >> t >> u >> k >> l, X; ~k ? printf("%d\n", k) : puts("NA")) { std::queue<D> q; D p = {t - 1, u - 1, k - 1, l - 1, 0}, r; q.push(p);...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40]]
1
526
2
#include <algorithm> #include <cstdio> #include <cstring> #include <queue> #include <vector> #define limX(a) (min(max(1, a), X)) #define limY(a) (min(max(1, a), Y)) using namespace std; typedef struct d { int tx, ty, kx, ky, time; } D; int G[55][55], X, Y, R, tx, ty, kx, ky, mx[4] = {0, -1, 0, 1}, my[4] = {-1, 0,...
#include <algorithm> #include <cstdio> #include <cstring> #include <queue> #include <vector> #define limX(a) (min(max(1, a), X)) #define limY(a) (min(max(1, a), Y)) using namespace std; typedef struct d { int tx, ty, kx, ky, time; } D; int G[55][55], X, Y, R, tx, ty, kx, ky, mx[4] = {0, -1, 0, 1}, my[4] = {-1, 0,...
[["-", 15, 339, 51, 69, 341, 342, 0, 118, 119, 120], ["+", 15, 339, 51, 69, 341, 342, 0, 118, 119, 120]]
1
585
4
import java.util.Scanner; // Quaternion Multiplication public class Main { void run() { Scanner sc = new Scanner(System.in); for (;;) { int n = sc.nextInt(); if (n == 0) break; for (int i = 0; i < n; i++) { int x1 = sc.nextInt(), y1 = sc.nextInt(), z1 = sc.nextInt(), ...
import java.util.Scanner; // Quaternion Multiplication public class Main { void run() { Scanner sc = new Scanner(System.in); for (;;) { int n = sc.nextInt(); if (n == 0) break; for (int i = 0; i < n; i++) { int x1 = sc.nextInt(), y1 = sc.nextInt(), z1 = sc.nextInt(), ...
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["-", 49, 200, 51, 16, 31, 16, 12, 16, 12, 22], ["+", 49, 200, 51, 16, 31, 16, 12, 16, 12, 22]]
3
260
4
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; while (n != 0) { int a = sc.nextInt(); int b = sc.nextInt(); ...
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); if (n == 0) break; while (n != 0) { int a = sc.nextInt(); int b = sc.nextInt(); ...
[["-", 49, 200, 51, 16, 31, 16, 12, 16, 12, 22], ["+", 49, 200, 51, 16, 31, 16, 12, 16, 12, 22], ["-", 51, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 503, 49, 200, 51, 16, 31, 16, 17, 72]]
3
246
4
#include <iostream> using namespace std; int main() { int n, a, b, c, d, e, f, g, h, x, y, z, w; while (cin >> n, n) while (n--) cin >> a >> b >> c >> d >> e >> f >> g >> h; cout << a * e - b * f - c * g - d * h << " " << a * f + b * e + c * h - d * g << " " << a * g - b * h + c * e + d * f << " ...
#include <iostream> using namespace std; int main() { int n, a, b, c, d, e, f, g, h, x, y, z, w; while (cin >> n, n) while (n--) { cin >> a >> b >> c >> d >> e >> f >> g >> h; cout << a * e - b * f - c * g - d * h << " " << a * f + b * e + c * h - d * g << " " << a * g - b * h ...
[["+", 8, 9, 0, 52, 8, 52, 8, 9, 0, 45], ["+", 8, 9, 0, 52, 8, 52, 8, 9, 0, 46]]
1
150
2
#include <iostream> using namespace std; #define N 4 #define X 0 #define Y 1 #define Z 2 #define W 3 int main() { while (true) { int n; cin >> n; if (!n) { break; } for (int i = 0; i < n; i++) { int val1[N], val2[N]; for (int j = 0; j < N; j++) { cin >> val1[j]; ...
#include <iostream> using namespace std; #define N 4 #define X 0 #define Y 1 #define Z 2 #define W 3 int main() { while (true) { int n; cin >> n; if (!n) { break; } for (int i = 0; i < n; i++) { int val1[N], val2[N]; for (int j = 0; j < N; j++) { cin >> val1[j]; ...
[["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 16, 12, 103, 0, 44]]
1
345
10
#include <cstdio> using namespace std; int main() { int n, fi, se, th, fo, x1, x2, y1, y2, z1, z2, w1, w2; while (true) { scanf("%d", &n); if (n == 0) break; for (int i = 0; i < n; i++) { scanf("%d%d%d%d%d%d%d%d", &x1, &y1, &z1, &w1, &x2, &y2, &z2, &w2); fi = x1 * x2 + (-1) * (y1 * y2...
#include <cstdio> using namespace std; int main() { int n, fi, se, th, fo, x1, x2, y1, y2, z1, z2, w1, w2; while (true) { scanf("%d", &n); if (n == 0) break; for (int i = 0; i < n; i++) { scanf("%d%d%d%d%d%d%d%d", &x1, &y1, &z1, &w1, &x2, &y2, &z2, &w2); fi = x1 * x2 + (-1) * (y1 * y2...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
234
1
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <time.h> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #define pb push_back #define mp make_pai...
[["-", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22]]
1
245
4
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl //#define int long long #define fi first #define se second using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; ty...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long #define fi first #define se second using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; type...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 12, 16, 31, 16, 31, 16, 12, 16, 12, 22], ["+", 12, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
244
5
#ifdef __GNU_C__ #include <bits/stdc++.h> #else #include <cstdio> #include <deque> #include <iostream> #include <map> #include <memory.h> #include <sstream> #include <string> #include <vector> #endif // __GNU_C__ using namespace std; #define REP(i, max) for (int i = 0, iMax = max; i < iMax; i++) #define RREP(i, min, ...
#ifdef __GNU_C__ #include <bits/stdc++.h> #else #include <cstdio> #include <deque> #include <iostream> #include <map> #include <memory.h> #include <sstream> #include <string> #include <vector> #endif // __GNU_C__ using namespace std; #define REP(i, max) for (int i = 0, iMax = max; i < iMax; i++) #define RREP(i, min, ...
[["-", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22]]
1
533
2
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { for (int i = 0; i < n; i++) { int x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3; cin >> x1 >> y1 >> z1 >> w1 >> x2 >> y2 >> z2 >> w2; x3 = x1 * x2 - y1 * y2 - z1 * z2 - w1 * w2; y3 = x1 * y2 + y1 * ...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { for (int i = 0; i < n; i++) { int x1, y1, z1, w1, x2, y2, z2, w2, x3, y3, z3, w3; cin >> x1 >> y1 >> z1 >> w1 >> x2 >> y2 >> z2 >> w2; x3 = x1 * x2 - y1 * y2 - z1 * z2 - w1 * w2; y3 = x1 * y2 + y1 * ...
[["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
181
2
#include <iostream> #include <vector> using namespace std; struct four { int a, b, c, d; four(int _a, int _b, int _c, int _d) : a(_a), b(_b), c(_c), d(_d) {} four() { a = b = c = d = 0; } }; four operator+(const four &x, const four &y) { return four(x.a + y.a, x.b + y.b, x.c + y.c, x.d + y.d); } four operat...
#include <iostream> #include <vector> using namespace std; struct four { int a, b, c, d; four(int _a, int _b, int _c, int _d) : a(_a), b(_b), c(_c), d(_d) {} four() { a = b = c = d = 0; } }; four operator+(const four &x, const four &y) { return four(x.a + y.a, x.b + y.b, x.c + y.c, x.d + y.d); } four operat...
[["-", 31, 16, 31, 16, 12, 16, 12, 118, 119, 120], ["+", 31, 16, 31, 16, 12, 16, 12, 118, 119, 120], ["-", 0, 11, 12, 16, 12, 16, 12, 118, 119, 120], ["+", 0, 11, 12, 16, 12, 16, 12, 118, 119, 120]]
1
428
8
#include <algorithm> #include <cstdio> #include <cstdlib> using namespace std; int main() { int n; while (scanf("%d", &n), n) { for (int i = 0; i < n; i++) { int form1[4], form2[4]; /*0:x,1:y,2:z,w:3*/ for (int i = 0; i < 4; i++) scanf("%d", &form1[i]); for (int i = 0; i < 4; i++) ...
#include <algorithm> #include <cstdio> #include <cstdlib> using namespace std; int main() { int n; while (scanf("%d", &n), n) { for (int i = 0; i < n; i++) { int form1[4], form2[4]; /*0:x,1:y,2:z,w:3*/ for (int i = 0; i < 4; i++) scanf("%d", &form1[i]); for (int i = 0; i < 4; i++) ...
[["-", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
385
3
#include <iostream> using namespace std; int main() { int n; while (cin >> n, n) { while (n--) { int a[4], b[4], c[4]; for (int i = 0; i < 4; i++) { cin >> a[i]; c[i] = 0; } for (int i = 0; i < 4; i++) cin >> b[i]; c[0] = a[0] * b[0] - a[1] * b[1] - a[2...
#include <iostream> using namespace std; int main() { int n; while (cin >> n, n) { while (n--) { int a[4], b[4], c[4]; for (int i = 0; i < 4; i++) { cin >> a[i]; c[i] = 0; } for (int i = 0; i < 4; i++) cin >> b[i]; c[0] = a[0] * b[0] - a[1] * b[1] - a[2...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 33]]
1
316
2
#include <iostream> using namespace std; int main() { int a[4], b[4]; int n; while (1) { cin >> n; if (!n) break; while (!n) { for (int i = 0; i < 4; i++) cin >> a[i]; for (int i = 0; i < 4; i++) cin >> b[i]; cout << a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a...
#include <iostream> using namespace std; int main() { int a[4], b[4]; int n; while (1) { cin >> n; if (!n) break; while (n) { for (int i = 0; i < 4; i++) cin >> a[i]; for (int i = 0; i < 4; i++) cin >> b[i]; cout << a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a...
[["-", 8, 9, 0, 52, 15, 339, 51, 91, 17, 111]]
1
271
1
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string...
#include <algorithm> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string...
[["-", 31, 16, 31, 16, 12, 16, 12, 69, 28, 22], ["+", 31, 16, 31, 16, 12, 16, 12, 69, 28, 22], ["-", 0, 11, 12, 16, 12, 16, 12, 69, 28, 22], ["+", 0, 11, 12, 16, 12, 16, 12, 69, 28, 22]]
1
405
4
#include <stdio.h> #include <stdlib.h> #include <string.h> char s[10000][1025], tmp[10000000], x[1025], *p, q; int c[10000] = {0}, n, i, j, f, r; int main() { for (; scanf("%d\n", &n), n;) { memset(c, 0, sizeof(c)); memset(s, 0, sizeof(tmp)); for (; n--; sprintf(tmp, "%s %s ", tmp, x)) gets(x); ...
#include <stdio.h> #include <stdlib.h> #include <string.h> char s[10000][1025], tmp[20000000], x[1025], *p, q; int c[10000] = {0}, n, i, j, f, r; int main() { for (; scanf("%d\n", &n), n;) { memset(c, 0, sizeof(c)); memset(tmp, 0, sizeof(tmp)); for (; n--; sprintf(tmp, "%s %s ", tmp, x)) gets(x); ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
458
4
#include <algorithm> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <set> #define _A_ true using namespace std; typedef pair<int, string> P; int main() { int n; // map<string,int> dic; P dic[10000]; string s[10000]; int index = 0; string si; char...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <set> #define _A_ true using namespace std; typedef pair<int, string> P; int main() { int n; // map<string,int> dic; P dic[10000]; string s[10000]; int index = 0; string si; char...
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
581
6
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #incl...
[["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
1,151
2
#include <algorithm> #include <climits> #include <cstring> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool larger(pair<int, string> d1, pair<int, string> d2) { return (d1.first > d2.first); } int main() { while (1) { int n; cin >> n; if (n == 0) ...
#include <algorithm> #include <climits> #include <cstring> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; bool larger(pair<int, string> d1, pair<int, string> d2) { return (d1.first > d2.first); } int main() { while (1) { int n; cin >> n; if (n == 0) ...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
465
2
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define each(i, c) for (__ty...
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define each(i, c) for (__ty...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
312
2
#include <algorithm> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; bool cmp(pair<string, int> x, pair<string, int> y) { return x.second != y.second ? x.second > y.second : x.first < y.first; } int main() { for (int N; cin >> N, N;) { map<char, m...
#include <algorithm> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; bool cmp(pair<string, int> x, pair<string, int> y) { return x.second != y.second ? x.second > y.second : x.first < y.first; } int main() { for (int N; cin >> N, N;) { map<char, m...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
281
2
#include <algorithm> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; class Word { public: string name; int cnt, pos; Word(string name, int cnt, int pos) : name(name), cnt(cnt), pos(pos) { cnt = 0; pos = 0; } bool operator<(...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; class Word { public: string name; int cnt, pos; Word(string name, int cnt, int pos) : name(name), cnt(cnt), pos(pos) { cnt = 0; pos = 0; } bool operator<(...
[["-", 8, 9, 0, 57, 64, 37, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 37, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 64, 37, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 64, 37, 0, 16, 17, 18], ["-", 0, 57, 64, 37, 0, 16, 12, 118, 119, 120], ["+", 0, 57, 64, 37, 0, 16, 12, 118, 119, 120]]
1
431
6
#include <iostream> int main() { int sum = 0, i; for (int j = 0; j <= 10; j++) { std::cin >> i; sum = sum + i; } std::cout << sum << std::endl; }
#include <iostream> int main() { int sum = 0, i; for (int j = 0; j < 10; j++) { std::cin >> i; sum = sum + i; } std::cout << sum << std::endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
53
2
#include <iostream> using namespace std; int s, sum; int main() { for (int i = 0; i < 10; i++) { cin >> s; sum += s; } cout << s << endl; return 0; }
#include <iostream> using namespace std; int s, sum; int main() { for (int i = 0; i < 10; i++) { cin >> s; sum += s; } cout << sum << endl; return 0; }
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
50
2
#include <iostream> using namespace std; int main() { int sum = 0; for (int i = 0; i < 10; i++) { int s; cin >> s; sum += s; cout << sum << endl; } return 0; }
#include <iostream> using namespace std; int main() { int sum = 0; for (int i = 0; i < 10; i++) { int s; cin >> s; sum += s; } cout << sum << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
53
2
#include <iostream> using namespace std; int main() { int point = 0; int x; for (int i = 0; i < 10; i++) { cin >> x; point += x; } cout << x << endl; return 0; }
#include <iostream> using namespace std; int main() { int point = 0; int x; for (int i = 0; i < 10; i++) { cin >> x; point += x; } cout << point << endl; return 0; }
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
53
2
#include <bits/stdc++.h> using namespace std; int main() { int s = 0, a; for (int i = 0; i < 10; i++) { cin >> s; s += a; } cout << s << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int s = 0, a; for (int i = 0; i < 10; i++) { cin >> a; s += a; } cout << s << endl; }
[["-", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
49
2
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> using...
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> using...
[["-", 0, 7, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 2, 63, 22]]
1
114
2
p $<.split.map(&:to_i).inject(:+)
p $<.map(&:to_i).inject(:+)
[["-", 3, 4, 0, 652, 486, 652, 486, 652, 735, 22], ["-", 0, 652, 3, 4, 0, 652, 486, 652, 17, 131]]
4
15
2
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { vector<pair<int, int>> yabashi; int n, m, a, b, weight; bool bl; while (1) { bl = true; weight = 0; cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) { cin ...
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { vector<pair<int, int>> yabashi; int n, m, a, b, weight; bool bl; while (1) { bl = true; weight = 0; yabashi.clear(); cin >> n; if (n == 0) break; for (int i = 0; i <...
[["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
202
6
loop do n = gets.to_i break if n==0 hash = Hash.new(0) max =0 n.times do m,a,b = gets.split.map(&:to_i) hash[a] += m hash[b] += -m max = [max,b].max end flag = true sum=0 0.upto(max) do |t| sum+=hash[t] if sum>150 flag = false break end end puts flag ? "OK" ...
loop do n = gets.to_i break if n==0 hash = Hash.new(0) max =0 n.times do m,a,b = gets.split.map(&:to_i) hash[a] += m hash[b] += -m max = [max,b].max end flag = true sum=0 hash.keys.sort.each do |t| sum+=hash[t] if sum>150 flag = false break end end puts flag...
[["-", 0, 652, 196, 737, 8, 736, 0, 652, 486, 612], ["+", 8, 736, 0, 652, 486, 652, 486, 652, 486, 22], ["-", 0, 652, 196, 737, 8, 736, 0, 652, 735, 22], ["-", 196, 737, 8, 736, 0, 652, 3, 4, 0, 24], ["-", 196, 737, 8, 736, 0, 652, 3, 4, 0, 22], ["-", 196, 737, 8, 736, 0, 652, 3, 4, 0, 25], ["+", 8, 736, 0, 652, 486, 6...
4
108
11
while True: n = eval(input()) if n == 0: break datas = [list(map(int,input().split())) for i in range(n)] maxw = 0 for d1 in datas: w = sum([d2[0] for d2 in datas if d2[1]<=d1[1]<d2[2]]) maxw = max(w,mxw) print("OK" if maxw <= 150 else "NG")
while True: n = eval(input()) if n == 0: break datas = [list(map(int,input().split())) for i in range(n)] maxw = 0 for d1 in datas: w = sum([d2[0] for d2 in datas if d2[1]<=d1[1]<d2[2]]) maxw = max(w,maxw) print("OK" if maxw <= 150 else "NG")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
103
2
import java.util.Scanner; class Main { double[][] dp; int[] v; int[][] event; int x, y, z; public static void main(String args[]) { Main app = new Main(); Scanner scan = new Scanner(System.in); while (true) { app.x = scan.nextInt(); app.y = scan.nextInt(); app.z = scan.nextInt()...
import java.util.Scanner; class Main { double[][] dp; int[] v; int[][] event; int x, y, z; public static void main(String args[]) { Main app = new Main(); Scanner scan = new Scanner(System.in); while (true) { app.x = scan.nextInt(); app.y = scan.nextInt(); app.z = scan.nextInt()...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 511, 0, 512], ["+", 0, 195, 8, 196, 0, 37, 0, 74, 0, 24], ["+", 8, 196, 0, 37, 0, 74, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 37, 0, 74, 0, 25]]
3
532
5
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { new Main().run(); } private void run() throws...
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { new Main().run(); } private void run() throws...
[["-", 0, 57, 15, 15, 0, 91, 439, 492, 500, 22], ["+", 0, 57, 15, 15, 0, 91, 439, 492, 500, 22]]
3
720
2
import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner scanner = new Scanner(System.in); while (true) { int x = sc...
import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner scanner = new Scanner(System.in); while (true) { int x = sc...
[["-", 75, 196, 0, 503, 49, 200, 51, 492, 500, 22], ["+", 75, 196, 0, 503, 49, 200, 51, 492, 500, 22]]
3
668
2
#include <bits/stdc++.h> using namespace std; int X, Y, Z; vector<int> V; vector<int> pl, gt; vector<vector<double>> dp; double calc(int v, int m) { if (v == Y) return (double)m; if (dp[v][m] > -1.) return dp[v][m]; double sum = 0; for (int i = 0; i < V.size(); i++) { int tv = min(Y, v + V[i]); ...
#include <bits/stdc++.h> using namespace std; int X, Y, Z; vector<int> V; vector<int> pl, gt; vector<vector<double>> dp; double calc(int v, int m) { if (v == Y) return (double)m; if (dp[v][m] > -1.) return dp[v][m]; double sum = 0; for (int i = 0; i < V.size(); i++) { int tv = min(Y, v + V[i]); ...
[["-", 3, 4, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 3, 4, 0, 16, 12, 69, 341, 342, 0, 22]]
1
389
2
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000001 using namespace std; enum Event { None, Move_On, Get, Lose, }; struct Info { void init() { value =...
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000001 using namespace std; enum Event { None, Move_On, Get, Lose, }; struct Info { void init() { value =...
[["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 85]]
1
689
2
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; struct E { int e, a; E() {} E(int e, int a) : e(e), a(a) {} }; int x, y, z; int v[55]; E e[55]; // int dp[55][5555]; double dp[55][5555]; // int solve(int n,int m){ double solve(int n, int m) { if (n >= y) return m; if (dp[n][m...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; struct E { int e, a; E() {} E(int e, int a) : e(e), a(a) {} }; int x, y, z; int v[55]; E e[66]; // int dp[55][5555]; double dp[55][5555]; // int solve(int n,int m){ double solve(int n, int m) { if (n >= y) return m; if (dp[n][m...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 12, 13]]
1
435
6
def solve(x,y,maxm): for i in range(y): for j in range(maxm+1): if dp[i][j]==0:continue for k in range(int(x)): if event[min(y,i+v[k])][0]==0: dp[min(y,i+v[k])][j]+=dp[i][j]/x elif event[i+v[k]][0]==1: skip=eve...
def solve(x,y,maxm): for i in range(y): for j in range(maxm+1): if dp[i][j]==0:continue for k in range(int(x)): if event[min(y,i+v[k])][0]==0: dp[min(y,i+v[k])][j]+=dp[i][j]/x elif event[i+v[k]][0]==1: skip=eve...
[["+", 3, 4, 0, 657, 31, 657, 12, 206, 51, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 206, 0, 70], ["+", 3, 4, 0, 657, 31, 657, 12, 206, 206, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 206, 0, 73], ["+", 51, 206, 206, 652, 3, 4, 0, 657, 17, 72]]
5
463
5
#include <algorithm> #include <queue> #include <stdio.h> using namespace std; int dp[12][12][12][12][52]; int v[12][12][12][12][52]; int t[12][12]; struct wolf { int cost; int row; int col; int L; int R; int v; wolf() {} wolf(int a, int b, int c, int d, int e, int f) { cost = a; row = b; col...
#include <algorithm> #include <queue> #include <stdio.h> using namespace std; int dp[12][12][12][12][52]; int v[12][12][12][12][52]; int t[12][12]; struct wolf { int cost; int row; int col; int L; int R; int v; wolf() {} wolf(int a, int b, int c, int d, int e, int f) { cost = a; row = b; col...
[["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 13]]
1
2,296
2
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var str = input.trim(); if (str = "1 0 0") console.log("Close"); if (str = "0 1 0") console.log("Close"); if (str = "1 1 0") console.log("Open"); if (str = "0 0 1") console.log("Open"); if (str = "0 0 0") console.log("Close");
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var str = input.trim(); if (str == "1 0 0") console.log("Close"); if (str == "0 1 0") console.log("Close"); if (str == "1 1 0") console.log("Open"); if (str == "0 0 1") console.log("Open"); if (str == "0 0 0") console.log("Close");
[["-", 0, 493, 0, 57, 15, 23, 0, 11, 0, 32], ["+", 0, 493, 0, 57, 15, 23, 0, 16, 17, 60]]
2
115
10
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int b1 = scan.nextInt(); int b2 = scan.nextInt(); int b3 = scan.nextInt(); if (b1 == 1 && b2 == 0 && b3 == 0 || b1 == 0 && b2 == 1 && b3 == 0 || b1 == 0 && b2 == 0...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int b1 = scan.nextInt(); int b2 = scan.nextInt(); int b3 = scan.nextInt(); if (b1 == 1 && b2 == 0 && b3 == 0 || b1 == 0 && b2 == 1 && b3 == 0 || b1 == 0 && b2 == 0...
[["-", 15, 15, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 15, 15, 0, 16, 31, 16, 12, 16, 31, 22]]
3
155
2
#include <stdio.h> int main(void) { int b[3] = {0}; int x = 0, i; for (i = 0; i < 3; i++) { scanf("%d", b[i]); } x = 2 * 2 * b[0] + 2 * b[1] + b[2]; switch (x) { case 6: case 1: printf("Open\n"); break; default: printf("Close\n"); break; } return (0); }
#include <stdio.h> int main(void) { int b[3] = {0}; int x = 0, i; for (i = 0; i < 3; i++) { scanf("%d", &b[i]); } x = 2 * 2 * b[0] + 2 * b[1] + b[2]; switch (x) { case 6: case 1: printf("Open\n"); break; default: printf("Close\n"); break; } return (0); }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
115
1
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a + b == 2) || (c = 1)) { printf("Open\n"); } else { printf("Close"); } return 0; }
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a + b == 2) || (c == 1)) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["-", 15, 23, 0, 16, 12, 23, 0, 11, 17, 32], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 60], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
71
3
#include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", a, b, c); if (c == 1) printf("Open\n"); else if (a == 1 && b == 1) printf("Open\n"); else printf("Close\n"); return 0; }
#include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (c == 1) printf("Open\n"); else if (a == 1 && b == 1) printf("Open\n"); else printf("Close\n"); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
73
3
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if ((b1 == 1 && b2 == 0 && b3 == 0) || (b1 == 0 && b2 == 1 && b3 == 0) || (b1 == 0 && b2 == 0 && b3 == 0)) { printf("close\n"); } else if ((b1 == 1 && b2 == 1 && b3 == 0) || (b1 == 0 && b2 == 0 && b3 == 1)) { ...
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if ((b1 == 1 && b2 == 0 && b3 == 0) || (b1 == 0 && b2 == 1 && b3 == 0) || (b1 == 0 && b2 == 0 && b3 == 0)) { printf("Close\n"); } else if ((b1 == 1 && b2 == 1 && b3 == 0) || (b1 == 0 && b2 == 0 && b3 == 1)) { ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
132
4
#include <stdio.h> int main(void) { int b1; int b2; int b3; scanf("%d %d %d", &b1, &b2, &b3); if ((b1 = 1) && (b2 = 1) || (b3 = 1)) { printf("Open\n"); } else { printf("Close\n"); } return (0); }
#include <stdio.h> int main(void) { int b1; int b2; int b3; scanf("%d %d %d", &b1, &b2, &b3); if ((b1 == 1) && (b2 == 1) || (b3 == 1)) { printf("Open\n"); } else { printf("Close\n"); } return (0); }
[["-", 0, 16, 31, 16, 31, 23, 0, 11, 17, 32], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 60], ["-", 0, 16, 31, 16, 12, 23, 0, 11, 17, 32], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 60], ["-", 15, 23, 0, 16, 12, 23, 0, 11, 17, 32], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 60]]
0
80
6
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1) { if (b2 == 1) puts("Open"); else puts("Close"); } else { if (b2 == 1 || b3 == 1) puts("Open"); else puts("Close"); } return 0; }
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1) { if (b2 == 1) puts("Open"); else puts("Close"); } else { if (b3 == 1) puts("Open"); else puts("Close"); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13], ["-", 0, 9, 0, 57, 15, 23, 0, 16, 17, 106]]
0
92
4
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 == b2 || b3 == 1) printf("Open\n"); else printf("Close\n"); return 0; }
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 && 1 == b2 || b3 == 1) printf("Open\n"); else printf("Close\n"); return 0; }
[["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 98], ["+", 15, 23, 0, 16, 31, 16, 12, 16, 31, 13]]
0
64
2
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", b1, b2, b3); if ((b1 == 1 && b2 == 1) || b3 == 1) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if ((b1 == 1 && b2 == 1) || b3 == 1) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
69
3
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", a, b, c); if (a == 1 && b == 1 && c == 0 || c == 1) { printf("Open\n"); } else printf("Close\n"); return 0; }
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a == 1 && b == 1 && c == 0 || c == 1) { printf("Open\n"); } else printf("Close\n"); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
68
3
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a == 1 && b == 0 && c == 0) { printf("Close\n"); } if (a == 0 && b == 1 && c == 0) { printf("Close\n"); } if (a == a && b == 1 && c == 0) { printf("Open\n"); } if (a == 0 && b == 0 && c == 1) { printf("...
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a == 1 && b == 0 && c == 0) { printf("Close\n"); } else if (a == 0 && b == 1 && c == 0) { printf("Close\n"); } else if (a == a && b == 1 && c == 0) { printf("Open\n"); } else if (a == 0 && b == 0 && c == 1) { ...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
0
155
4
#include <stdio.h> int main(void) { int s1, s2, s3; scanf("%d %d %d", &s1, &s2, &s3); if (s1 == 1 && s2 == 1 && s3 == 0) { printf("Open\n"); } if (s1 == 0 && s2 == 0 && s3 == 1) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
#include <stdio.h> int main(void) { int s1, s2, s3; scanf("%d %d %d", &s1, &s2, &s3); if (s1 == 1 && s2 == 1 && s3 == 0) { printf("Open\n"); } else if (s1 == 0 && s2 == 0 && s3 == 1) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
0
94
1
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", b1, b2, b3); if (b1 == 1 && b2 == 0 && b3 == 0 || b1 == 0 && b2 == 1 && b3 == 0 || b1 == 0 && b2 == 0 && b3 == 0) printf("Close\n"); else printf("Open\n"); return 0; }
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 && b2 == 0 && b3 == 0 || b1 == 0 && b2 == 1 && b3 == 0 || b1 == 0 && b2 == 0 && b3 == 0) printf("Close\n"); else printf("Open\n"); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
87
3
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a == 1 && b == 0 && c == 0) || (a == 0 && b == 1 && c == 0) || (a == b == c == 0)) { printf("Close\n"); } else { printf("Open\n"); } return 0; }
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a == 1 && b == 0 && c == 0) || (a == 0 && b == 1 && c == 0) || (a == 0 && b == 0 && c == 0)) { printf("Close\n"); } else { printf("Open\n"); } return 0; }
[["+", 12, 23, 0, 16, 31, 16, 31, 16, 12, 13], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 17, 98], ["+", 12, 23, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 98]]
0
96
4
main(a, b, c) { scanf("%d%d%d", &a, &b, &c); div(puts(a ? b : c ? "Open" : "Close")); }
main(a, b, c) { scanf("%d%d%d", &a, &b, &c); div(puts(a * b + c ? "Open" : "Close")); }
[["-", 3, 4, 0, 2, 3, 4, 0, 41, 0, 101], ["+", 3, 4, 0, 41, 15, 16, 31, 16, 17, 48], ["-", 3, 4, 0, 2, 3, 4, 0, 41, 0, 102], ["+", 0, 2, 3, 4, 0, 41, 15, 16, 17, 72]]
0
47
4
main(a) { gets(&a); div(puts(15 & a & 15 & a >> 16 | 15 & *&a + 1 ? "Open" : "Close")); }
main(a) { gets(&a); div(puts(15 & a & a >> 16 | 15 & (&a)[1] ? "Open" : "Close")); }
[["-", 0, 41, 15, 16, 31, 16, 31, 16, 12, 13], ["-", 3, 4, 0, 41, 15, 16, 31, 16, 17, 67], ["-", 15, 16, 12, 16, 12, 16, 31, 66, 17, 48], ["+", 15, 16, 12, 16, 12, 69, 28, 23, 0, 24], ["-", 0, 41, 15, 16, 12, 16, 12, 16, 17, 72], ["+", 15, 16, 12, 16, 12, 69, 28, 23, 0, 25], ["+", 0, 41, 15, 16, 12, 16, 12, 69, 0, 70],...
0
44
8
a[]; main() { gets(a); div(puts(*a & *a >> 16 | a[1] % 2 ? "Open" : "Close")); }
a[]; main() { gets(a); div(puts(15 & *a & *a >> 16 | 15 & a[1] ? "Open" : "Close")); }
[["+", 0, 41, 15, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 41, 15, 16, 31, 16, 31, 16, 17, 67], ["+", 3, 4, 0, 41, 15, 16, 12, 16, 31, 13], ["+", 3, 4, 0, 41, 15, 16, 12, 16, 17, 67], ["-", 3, 4, 0, 41, 15, 16, 12, 16, 17, 109], ["-", 3, 4, 0, 41, 15, 16, 12, 16, 12, 13]]
0
45
2
a[]; main() { gets(a); div(puts(*a & *a >> 16 | a[1] % 2 ? "Open" : "Close")); }
a[]; main() { gets(a); div(puts(15 & *a & *a >> 16 | a[1] % 2 ? "Open" : "Close")); }
[["+", 0, 41, 15, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 41, 15, 16, 31, 16, 31, 16, 17, 67]]
0
45
2
#include <bits/stdc++.h> using namespace std; #define int long long #define UNIQUE(v) v.erase(unique(all(v)), v.end()); #define ZIP(v) sort(all(v)), UNIQUE(v) #define ADD(a, b) a = (a + b) % mod #define SUB(a, b) a = (a + mod - b) % mod #define MUL(a, b) a = (a * b) % mod #define repi(i, m, n) for (int i = m; i < n; i+...
#include <bits/stdc++.h> using namespace std; #define int long long #define UNIQUE(v) v.erase(unique(all(v)), v.end()); #define ZIP(v) sort(all(v)), UNIQUE(v) #define ADD(a, b) a = (a + b) % mod #define SUB(a, b) a = (a + mod - b) % mod #define MUL(a, b) a = (a * b) % mod #define repi(i, m, n) for (int i = m; i < n; i+...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
276
2
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); if ((x == 1 && y == 1) || z == 1) { printf("open\n"); } else { printf("close\n"); } return 0; }
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); if ((x == 1 && y == 1) || z == 1) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
71
4
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if ((a == 1 && b == 1 && c == 0) || (a == 0 && b == 0 && c == 1)) cout << "open" << endl; else cout << "close" << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; if ((a == 1 && b == 1 && c == 0) || (a == 0 && b == 0 && c == 1)) cout << "Open" << endl; else cout << "Close" << endl; return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
77
4
#include <iostream> using namespace std; int main() { int b1, b2, b3; cin >> b1 >> b2 >> b3; if (b1 == 1 && b2 == 0 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 0 && b2 == 1 && b3 == 0) { cout << "Colse" << endl; } else if (b1 == 1 && b2 == 1 && b3 == 0) { cout << "Open" << endl; } el...
#include <iostream> using namespace std; int main() { int b1, b2, b3; cin >> b1 >> b2 >> b3; if (b1 == 1 && b2 == 0 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 0 & b2 == 1 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 1 && b2 == 1 && b3 == 0) { cout << "Open" << endl; } els...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 67], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
151
12
#include <iostream> #include <stdio.h> using namespace std; int main() { int b1, b2, b3; cin >> b1 >> b2 >> b3; if (b1 == 1 && b2 == 1 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 0 && b2 == 1 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 1 && b2 == 1 && b3 == 0) { cout << "Op...
#include <iostream> #include <stdio.h> using namespace std; int main() { int b1, b2, b3; cin >> b1 >> b2 >> b3; if (b1 == 1 && b2 == 0 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 0 && b2 == 1 && b3 == 0) { cout << "Close" << endl; } else if (b1 == 1 && b2 == 1 && b3 == 0) { cout << "Op...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
156
4
#include <bits/stdc++.h> #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 (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define PB push_back #define INF INT_MAX / 3 #define ALL(a) (a).begin(), (a).end() #...
#include <bits/stdc++.h> #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 (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = n - 1; i >= 0; i--) #define PB push_back #define INF INT_MAX / 3 #define ALL(a) (a).begin(), (a).end() #...
[["+", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 60], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98]]
1
136
4
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a == 0, b == 0, c == 1) { printf("Open\n"); } if (a == 1, b == 1, c == 0) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
#include <stdio.h> int main(void) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if (a == 0 && b == 0 && c == 1) { printf("Open\n"); } else if (a == 1 && b == 1 && c == 0) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 34, 0, 21], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 34, 12, 34, 0, 21], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98]]
1
94
9
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); if ((x == 1 && y == 1) || (z == 1)) { printf("open\n"); } else { printf("close\n"); } return 0; }
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); if ((x == 1 && y == 1) || (z == 1)) { printf("Open\n"); } else { printf("Close\n"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
73
4
#include <iostream> using namespace std; int main() { int a = 0, b = 0, i = 0; cin >> a >> b >> i; if (a == 1 && b == 1) { cout << "open" << endl; } else if (i == 1) { cout << "open" << endl; } else { cout << "close" << endl; } return 0; }
#include <iostream> using namespace std; int main() { int a = 0, b = 0, i = 0; cin >> a >> b >> i; if (a == 1 && b == 1) { cout << "Open" << endl; } else if (i == 1) { cout << "Open" << endl; } else { cout << "Close" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
84
6
#include <iostream> using namespace std; int main() { int b, com = 0; for (int i = 2; i >= 0; i--) { cin >> b; com += (b << i); } if (b == 6 || b == 1) { cout << "Open\n"; } else { cout << "Close\n"; } return 0; }
#include <iostream> using namespace std; int main() { int b, com = 0; for (int i = 2; i >= 0; i--) { cin >> b; com += (b << i); } if (com == 6 || com == 1) { cout << "Open\n"; } else { cout << "Close\n"; } return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
79
4
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 && b2 == 0 && b3 == 0) { printf("Close\n"); } else if (b1 == 0 && b2 == 1 && b3 == 0) { printf("Close\n"); } else if (b1 == 1 && b2 == 1 && b3 == 0) { printf("Open\n"); } else if (b1 == 0 && b2 == ...
#include <stdio.h> int main(void) { int b1, b2, b3; scanf("%d %d %d", &b1, &b2, &b3); if (b1 == 1 && b2 == 0 && b3 == 0) { printf("Close\n"); } else if (b1 == 0 && b2 == 1 && b3 == 0) { printf("Close\n"); } else if (b1 == 1 && b2 == 1 && b3 == 0) { printf("Open\n"); } else if (b1 == 0 && b2 == ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
159
2