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 <algorithm> #include <climits> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(c) c.begin(), c.end() #define RAL...
#include <algorithm> #include <climits> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(c) c.begin(), c.end() #define RAL...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22]]
1
679
2
#include <bits/stdc++.h> using namespace std; #define INF 1e9 const int MAX_N = 1 << 17; typedef pair<int, int> pii; class RMQ { public: int n; pii dat[2 * MAX_N - 1]; void init(int n_) { n = 1; while (n < n_) { n *= 2; } for (int i = 0; i < 2 * n - 1; i++) { dat[i] = pii(-INF, -IN...
#include <bits/stdc++.h> using namespace std; #define INF 1e9 const int MAX_N = 1 << 17; typedef pair<int, int> pii; class RMQ { public: int n; pii dat[2 * MAX_N - 1]; void init(int n_) { n = 1; while (n < n_) { n *= 2; } for (int i = 0; i < 2 * n - 1; i++) { dat[i] = pii(-INF, -IN...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107]]
1
550
4
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX_N (100001) #define MAX_R (1000000) #define max(x, y) ((x) > (y) ? (x) : (y)) void init(int data[], int n); void updata(int data[], int k, int a, int n); int query(int data[]); int such(int data[], int k, int n); int n_; type...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define MAX_N (100001) #define MAX_R (1000000) #define max(x, y) ((x) > (y) ? (x) : (y)) void init(int data[], int n); void updata(int data[], int k, int a, int n); int query(int data[]); int such(int data[], int k, int n); int n_; type...
[["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
581
7
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, init, n) for (int i = init; i < (n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define fi first #define se second using namespace std; using ll = long long int; using P = pair<ll, ll>; using T = tuple<int, int, int>; using ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, init, n) for (int i = init; i < (n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define fi first #define se second using namespace std; using ll = long long int; using P = pair<ll, ll>; using T = tuple<int, int, int>; using ...
[["-", 0, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 16, 31, 2, 63, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
748
4
#include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) struct RMQ { pair<int, int> DEF; int n; vector<pair<int, int>> d; RMQ(int n) { DEF = make_pair(-1e9, 1e9); this->n = n; d.resize(2 * n - 1); rep(i, 2 * n - 1) d[i] = DEF; } void...
#include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) struct RMQ { pair<int, int> DEF; int n; vector<pair<int, int>> d; RMQ(int n) { DEF = make_pair(-1e9, 1e9); this->n = n; d.resize(2 * n - 1); rep(i, 2 * n - 1) d[i] = DEF; } void...
[["-", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 31, 118, 119, 120], ["-", 0, 57, 15, 339, 51, 16, 12, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 16, 12, 118, 119, 120]]
1
636
4
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define each(itr, c) \ for (__typeof(c.begin()) itr = c.begin(); itr != c.end(); ++itr) #define all(x) (x).begin(), (x).end() #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define each(itr, c) \ for (__typeof(c.begin()) itr = c.begin(); itr != c.end(); ++itr) #define all(x) (x).begin(), (x).end() #define...
[["-", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 52, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
437
4
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define X real() #define Y imag() typedef long double D; typedef complex<D> P; struct L { P a, b; }; typedef vector<P> Pol; const D EPS = 1e-8; int sig(D a, D b = 0) { return a < b - EPS ? -1 : a > b + EPS ? 1 : 0; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define X real() #define Y imag() typedef double D; typedef complex<D> P; struct L { P a, b; }; typedef vector<P> Pol; const D EPS = 1e-8; int sig(D a, D b = 0) { return a < b - EPS ? -1 : a > b + EPS ? 1 : 0; } boo...
[["-", 36, 36, 0, 30, 0, 134, 39, 86, 0, 96], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,174
3
#include <cstdio> #include <iostream> #include <string> using namespace std; int J, Y; void t(int j, int y, string str) { if (j > J && y > Y) return; if (j == J && y == Y) { cout << str << endl; return; } if (j == 5 && y == 5) { return; } if ((j <= 3 && y >= 5) || (j >= 5 && y <= 3)) { ...
#include <cstdio> #include <iostream> #include <string> using namespace std; int J, Y; void t(int j, int y, string str) { if (j > J || y > Y) return; if (j == J && y == Y) { cout << str << endl; return; } if (j == 5 && y == 5) { return; } if ((j <= 3 && y >= 5) || (j >= 5 && y <= 3)) { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
160
2
// ナニソレイミワカンナイ #include <algorithm> #include <cstdio> int replacement[4][2][5] = {{{1, 2, 3, 15, 19}, {28, 29, 30, 16, 21}}, {{7, 8, 9, 13, 10}, {22, 23, 24, 18, 12}}, {{1, 4, 7, 10, 16}, {24, 27, 30, 21, 18}}, {{3, 6, 9, 12, 13}, {22...
// ???????????????????????¶????????? #include <algorithm> #include <cstdio> int replacement[4][2][5] = {{{1, 2, 3, 15, 19}, {28, 29, 30, 16, 21}}, {{7, 8, 9, 13, 10}, {22, 23, 24, 18, 12}}, {{1, 4, 7, 10, 16}, {24, 27, 30, 21, 18}}, {...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
450
2
#include <algorithm> #include <iostream> #include <queue> using namespace std; class FC { public: int p[31]; int n; bool is_over() { return p[1] == p[2] && p[2] == p[3] && p[3] == p[4] && p[4] == p[5] && p[5] == p[6] && p[6] == p[7] && p[7] == p[8] && p[8] == p[9] && p[10] == p[11] && ...
#include <algorithm> #include <iostream> #include <queue> using namespace std; class FC { public: int p[31]; int n; bool is_over() { return p[1] == p[2] && p[2] == p[3] && p[3] == p[4] && p[4] == p[5] && p[5] == p[6] && p[6] == p[7] && p[7] == p[8] && p[8] == p[9] && p[10] == p[11] && ...
[["-", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120]]
1
773
6
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define rep(i, a, n) for (int i = (a); i < (n); i++) #define dep(i, a, n) for (int i = (a); i >= (n); i--) #define mod 1e9 + 7 __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_wit...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; #define pb push_back #define rep(i, a, n) for (int i = (a); i < (n); i++) #define dep(i, a, n) for (int i = (a); i >= (n); i--) #define mod 1e9 + 7 __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_wit...
[["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["-", 0, 14, 8, 9, 0, 57, 64, 37, 0, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 37, 0, 22]]
1
872
12
#include <stdio.h> int next[200001]; int prev[200001]; int main() { int N, M, Q; int a, q; int i, j, p = 0, r = 0; scanf("%d %d %d", &N, &M, &Q); for (i = 0; i < N; i++) { next[i] = (i + 1) % N; prev[i] = (i + N - 1) % N; } for (i = 0; i < M; i++) { scanf("%d", &a); for (j = 0; j < a; j++)...
#include <stdio.h> int next[200001]; int prev[200001]; int main() { int N, M, Q; int a, q; int i, j, p = 0, r = 0; scanf("%d %d %d", &N, &M, &Q); for (i = 0; i < N; i++) { next[i] = (i + 1) % N; prev[i] = (i + N - 1) % N; } for (i = 0; i < M; i++) { scanf("%d", &a); for (j = 0; j < a; j++)...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
265
4
#include <iostream> using namespace std; struct students { int num[200000]; }; int main() { students prev, next; int n, m, q; int o, p = 0; cin >> n >> m >> q; for (int i = 0; i < n; i++) { prev.num[i] = (i - 1 + n) % n; next.num[i] = (i + 1) % n; } for (int i = 0; i < m; i++) { cin >>...
#include <iostream> using namespace std; struct students { int num[200000]; }; int main() { students prev, next; int n, m, q; int o, p = 0; cin >> n >> m >> q; for (int i = 0; i < n; i++) { prev.num[i] = (i - 1 + n) % n; next.num[i] = (i + 1) % n; } for (int i = 0; i < m; i++) { cin >>...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
267
4
#include <algorithm> #include <iostream> #define INF 1000000000 #define f first #define s second using namespace std; typedef pair<int, pair<int, int>> P; typedef long long ll; int n, d, tree[4][(1 << 19)]; P star[200001]; void update(int i, int flg, int x) { i = i + (1 << 18) - 1; tree[flg][i] = x; while (i) { ...
#include <algorithm> #include <iostream> #define INF 1000000000 #define f first #define s second using namespace std; typedef pair<int, pair<int, int>> P; typedef long long ll; int n, d, tree[4][(1 << 19)]; P star[200001]; void update(int i, int flg, int x) { i = i + (1 << 18) - 1; tree[flg][i] = x; while (i) { ...
[["-", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 31, 16, 31, 22]]
1
616
2
#include <stdio.h> int main(void) { int time, D, L; scanf("%d %d", &D, L); time = D / L + D % L; printf("%d", time); return 0; }
#include <stdio.h> int main(void) { int time, D, L; scanf("%d %d", &D, &L); time = D / L + D % L; printf("%d\n", time); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
1
50
2
#include <bits/stdc++.h> using namespace std; int main() { int d, l, a, b; int count = 0; cin >> d >> l; a = d / l; count = a; if (count != 0) { b = d % l; b = b / 1; count = b; } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int d, l, a, b; int count = 0; cin >> d >> l; a = d / l; count = a; if (count != 0 || d < l) { b = d % l; b = b / 1; count += b; } cout << count << endl; return 0; }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107]]
1
75
6
a,b=map(int,input().split()) c=a//b d=a%b e=c+b print(e)
a,b=map(int,input().split()) c=a//b d=a%b e=c+d print(e)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
35
2
#include <stdio.h> int main(void) { int a[101][3] = {0}, N, X, Y, Z, q, w, e, r, t, y, u, i = 0; scanf("%d", &N); scanf("%d", &X); for (q = 0; q < X; q++) { scanf("%d", &r); a[r][0] = 1; } scanf("%d", &Y); for (w = 0; w < Y; w++) { scanf("%d", &t); a[t][1] = 1; } scanf("%d", &Z); for...
#include <stdio.h> int main(void) { int a[101][3] = {0}, N, X, Y, Z, q, w, e, r, t, y, u, i = 0; scanf("%d", &N); scanf("%d", &X); for (q = 0; q < X; q++) { scanf("%d", &r); a[r][0] = 1; } scanf("%d", &Y); for (w = 0; w < Y; w++) { scanf("%d", &t); a[t][1] = 1; } scanf("%d", &Z); for...
[["-", 0, 16, 12, 16, 12, 16, 31, 69, 71, 13], ["+", 0, 16, 12, 16, 12, 16, 31, 69, 71, 13]]
0
266
2
#include <stdio.h> int main(void) { int ha, hb, ka, kb, a, b, c, d, ht, kt; scanf("%d %d", &ha, &hb); scanf("%d %d", &ka, &kb); scanf("%d %d %d %d", &a, &b, &c, &d); ht = ha * a + hb * b; if (ha <= 10) ht += (ha / 10) * c; if (hb <= 20) ht += (hb / 20) * d; kt = ka * a + kb * b; if (ka <= 10) ...
#include <stdio.h> int main(void) { int ha, hb, ka, kb, a, b, c, d, ht, kt; scanf("%d %d", &ha, &hb); scanf("%d %d", &ka, &kb); scanf("%d %d %d %d", &a, &b, &c, &d); ht = ha * a + hb * b; if (ha >= 10) ht += (ha / 10) * c; if (hb >= 20) ht += (hb / 20) * d; kt = ka * a + kb * b; if (ka >= 10) ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
200
9
#include <stdio.h> int main(void) { // Your code here! int h1, h2, k1, k2, a, b, c, d; scanf("%d%d%d%d%d%d%d%d", &h1, &h2, &k1, &k2, &a, &b, &c, &d); if (h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d > k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d) { puts("hirosi"); } else if (h1 * a + h2 * b + ...
#include <stdio.h> int main(void) { // Your code here! int h1, h2, k1, k2, a, b, c, d; scanf("%d%d%d%d%d%d%d%d", &h1, &h2, &k1, &k2, &a, &b, &c, &d); if (h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d > k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d) { puts("hiroshi"); } else if (h1 * a + h2 * b +...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
187
2
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, hi, ke; scanf("%d %d", &a, &b); scanf("%d %d", &c, &d); scanf("%d %d %d %d", &e, &f, &g, &h); hi = a * e + b * f + a / 10 * g + b / 20 * h; ke = c * e + d * f + c / 10 * g + d / 20 * h; if (hi = ke) { printf("even\n"); } else if (hi > k...
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, hi, ke; scanf("%d %d", &a, &b); scanf("%d %d", &c, &d); scanf("%d %d %d %d", &e, &f, &g, &h); hi = a * e + b * f + a / 10 * g + b / 20 * h; ke = c * e + d * f + c / 10 * g + d / 20 * h; if (hi == ke) { printf("even\n"); } else if (hi > ...
[["-", 8, 9, 0, 57, 15, 23, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60]]
0
166
2
#include <stdio.h> int main(void) { int h1, h2, k1, k2, a, b, c, d, g, m; scanf("%d%d%d%d%d%d%d%d", &h1, &h2, &k1, &k2, &a, &b, &c, &d); g = h1 * a + h2 * b + h1 / 10 * c + h2 / 20 * d; m = k1 * a + k2 * b + k1 / 10 * c + k2 / 20 * d; if (g < m) { printf("kenji\n"); } else if (m < g) { printf("hiros...
#include <stdio.h> int main(void) { int h1, h2, k1, k2, a, b, c, d, g, m; scanf("%d%d%d%d%d%d%d%d", &h1, &h2, &k1, &k2, &a, &b, &c, &d); g = h1 * a + h2 * b + h1 / 10 * c + h2 / 20 * d; m = k1 * a + k2 * b + k1 / 10 * c + k2 / 20 * d; if (g < m) { printf("kenjiro\n"); } else if (m < g) { printf("hir...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
152
2
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, i, j, k; scanf("%d %d", &a, &b); scanf("%d %d", &c, &d); scanf("%d %d %d %d", &e, &f, &g, &h); i = a * e + b * f; j = c * e + d * f; if (a >= 10) { k = a / 10; i = i + k * g; } if (c >= 10) { k = c / 10; j = j + k * g; }...
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, i, j, k; scanf("%d %d", &a, &b); scanf("%d %d", &c, &d); scanf("%d %d %d %d", &e, &f, &g, &h); i = a * e + b * f; j = c * e + d * f; if (a >= 10) { k = a / 10; i = i + k * g; } if (c >= 10) { k = c / 10; j = j + k * g; }...
[["-", 75, 76, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 75, 76, 0, 57, 15, 23, 0, 16, 17, 47]]
0
238
2
#include <stdio.h> int main() { int k1, k2, h1, h2, a, b, c, d; scanf("%d %d\n%d %d\n %d %d %d %d\n", &h1, &h2, &k1, &k2, &a, &b, &c, &d); int hiro, ken; hiro = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d; ken = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d; if (hiro < ken) { printf("kenjiro\n"); ...
#include <stdio.h> int main() { int k1, k2, h1, h2, a, b, c, d; scanf("%d %d\n%d %d\n %d %d %d %d\n", &h1, &h2, &k1, &k2, &a, &b, &c, &d); int hiro, ken; hiro = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d; ken = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d; if (hiro < ken) { printf("kenjiro\n"); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
165
2
#include <stdio.h> int main() { int h[2], k[2], a, b, c, d, l = 0, r = 0; for (int i = 0; i < 2; i++) scanf("%d", &h[i]); for (int i = 0; i < 2; i++) scanf("%d", &k[i]); scanf("%d%d%d%d", &a, &b, &c, &d); l = h[1] * a + (h[0] / 10) * c + h[1] * b + (h[1] / 20) * d; for (int i = 0; i < 2; i++) h[...
#include <stdio.h> int main() { int h[2], k[2], a, b, c, d, l = 0, r = 0; for (int i = 0; i < 2; i++) scanf("%d", &h[i]); for (int i = 0; i < 2; i++) scanf("%d", &k[i]); scanf("%d%d%d%d", &a, &b, &c, &d); l = h[0] * a + (h[0] / 10) * c + h[1] * b + (h[1] / 20) * d; for (int i = 0; i < 2; i++) h[...
[["-", 31, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 13]]
1
246
2
#include <iostream> using namespace std; int main() { int h[2]; int k[2]; cin >> h[0] >> h[1]; cin >> k[0] >> k[1]; int a, b, c, d; cin >> a >> b >> c >> d; int hp = a * h[0] + (h[0] / 10) * c + b * h[1] + (h[1] / 20) * d; int kp = a * k[0] + (h[0] / 10) * c + b * k[1] + (k[1] / 20) * d; if (hp > k...
#include <iostream> using namespace std; int main() { int h[2]; int k[2]; cin >> h[0] >> h[1]; cin >> k[0] >> k[1]; int a, b, c, d; cin >> a >> b >> c >> d; int hp = a * h[0] + (h[0] / 10) * c + b * h[1] + (h[1] / 20) * d; int kp = a * k[0] + (k[0] / 10) * c + b * k[1] + (k[1] / 20) * d; if (hp > k...
[["-", 12, 16, 31, 23, 0, 16, 31, 69, 28, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 69, 28, 22]]
1
186
2
#include <iostream> using namespace std; int main() { int h1, h2, k1, k2, a, b, c, d; cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d; if ((h1 / 10) * c + h1 * a + (h2 / 20) * d + h2 * b > (k1 / 10) * c + k1 * a + (k2 / 20) * d + h2 * b) { cout << "hiroshi" << endl; } if ((h1 / 10) * c + h1 * a + (...
#include <iostream> using namespace std; int main() { int h1, h2, k1, k2, a, b, c, d; cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d; if ((h1 / 10) * c + h1 * a + (h2 / 20) * d + h2 * b > (k1 / 10) * c + k1 * a + (k2 / 20) * d + k2 * b) { cout << "hiroshi" << endl; } if ((h1 / 10) * c + h1 * a + (...
[["-", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 31, 22]]
1
230
6
#include <iostream> using namespace std; int main() { int h[2], k[2]; int iwana, yamame, iwapo, yamapo; int hiroshi, kenji; cin >> h[0] >> h[1] >> k[0] >> k[1] >> iwana >> yamame >> iwapo >> yamapo; hiroshi = (h[0] * iwana) + (h[1] * yamame); kenji = (k[0] * iwana) + (k[1] * yamame); hiroshi += ((h[0...
#include <iostream> using namespace std; int main() { int h[2], k[2]; int iwana, yamame, iwapo, yamapo; int hiroshi, kenji; cin >> h[0] >> h[1] >> k[0] >> k[1] >> iwana >> yamame >> iwapo >> yamapo; hiroshi = (h[0] * iwana) + (h[1] * yamame); kenji = (k[0] * iwana) + (k[1] * yamame); hiroshi += ((h[0...
[["-", 31, 23, 0, 16, 31, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 85], ["-", 12, 23, 0, 16, 31, 23, 0, 16, 17, 109], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 17, 85]]
1
207
8
#include <cstdio> int main() { int a[8]; for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } int h, k; h = a[0] * a[4] + a[0] / 10 * a[6] + a[1] * a[5] + a[1] / 10 * a[7]; k = a[2] * a[4] + a[2] / 10 * a[6] + a[3] * a[5] + a[3] / 10 * a[7]; printf("%s\n", h == k ? "even" : h > k ? "hiroshi" : "kenji"...
#include <cstdio> int main() { int a[8]; for (int i = 0; i < 8; i++) { scanf("%d", &a[i]); } int h, k; h = a[0] * a[4] + a[0] / 10 * a[6] + a[1] * a[5] + a[1] / 20 * a[7]; k = a[2] * a[4] + a[2] / 10 * a[6] + a[3] * a[5] + a[3] / 20 * a[7]; printf("%s\n", h == k ? "even" : h > k ? "hiroshi" : "kenjir...
[["-", 0, 11, 12, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 16, 12, 16, 31, 16, 12, 13], ["-", 3, 4, 0, 41, 75, 41, 75, 5, 0, 6], ["+", 3, 4, 0, 41, 75, 41, 75, 5, 0, 6]]
1
171
6
#include <iostream> using namespace std; int main() { int h, j; int k, l; int a, b, c, d; cin >> h >> j >> k >> l >> a >> b >> c >> d; int H = h * a + j * b + 10 * (h / 10) + 20 * (j / 20); int K = k * a + l * b + 10 * (k / 10) + 20 * (l / 20); if (H > K) cout << "hiroshi" << endl; if (H < K) co...
#include <iostream> using namespace std; int main() { int h, j; int k, l; int a, b, c, d; cin >> h >> j >> k >> l >> a >> b >> c >> d; int H = h * a + j * b + c * (h / 10) + d * (j / 20); int K = k * a + l * b + c * (k / 10) + d * (l / 20); if (H > K) cout << "hiroshi" << endl; if (H < K) cout <...
[["-", 49, 50, 51, 16, 31, 16, 12, 16, 31, 13], ["+", 49, 50, 51, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 16, 12, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
148
10
#include <iostream> using namespace std; ; int main() { int h1, h2, k1, k2, a, b, c, d; cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d; int A = h1 / 10; int B = h2 / 20; int C = k1 / 10; int D = k2 / 20; if (h1 * a + h2 * b + A * c + B * d > k1 * a + k2 * b + C * c + D * d) cout << "horoshi" << en...
#include <iostream> using namespace std; ; int main() { int h1, h2, k1, k2, a, b, c, d; cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d; int A = h1 / 10; int B = h2 / 20; int C = k1 / 10; int D = k2 / 20; if (h1 * a + h2 * b + A * c + B * d > k1 * a + k2 * b + C * c + D * d) cout << "hiroshi" << en...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
205
2
#include <bits/stdc++.h> using namespace std; int main() { int h1, h2, k1, k2, sum1, sum2, a, b, c, d; cin >> h1 >> h2; cin >> k1 >> k2; cin >> a >> b >> c >> d; sum1 = h1 * a + h2 * b; sum2 = k1 * a + k2 * b; if (h1 == 10) { sum1 += c; if (h2 == 20) sum1 += d; } if (k1 == 10) { s...
#include <bits/stdc++.h> using namespace std; int main() { int h1, h2, k1, k2, sum1, sum2, a, b, c, d; cin >> h1 >> h2 >> k1 >> k2; cin >> a >> b >> c >> d; sum1 = h1 * a + h2 * b; sum2 = k1 * a + k2 * b; if (h1 >= 10) { sum1 += c; if (h2 >= 20) sum1 += d; } if (k1 >= 10) { sum2 += ...
[["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
160
10
h1, h2 = gets.split.map(&:to_i) k1, k2 = gets.split.map(&:to_i) a, b, c, d, = gets.split.map(&:to_i) f = -> i, y { a * i + b * y + c * (i / 10) + d * (y / 20) } h = f[h1, h2] k = f[k1, k2] puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'draw'
h1, h2 = gets.split.map(&:to_i) k1, k2 = gets.split.map(&:to_i) a, b, c, d, = gets.split.map(&:to_i) f = -> i, y { a * i + b * y + c * (i / 10) + d * (y / 20) } h = f[h1, h2] k = f[k1, k2] puts h > k ? 'hiroshi' : h < k ? 'kenjiro' : 'even'
[["-", 3, 4, 0, 754, 75, 754, 75, 557, 0, 6], ["+", 3, 4, 0, 754, 75, 754, 75, 557, 0, 6]]
4
111
2
h1, h2 = map(int, input().split()) k1, k2 = map(int, input().split()) a, b, c, d = map(int, input().split()) hiroshi = (a * h1) + (b * h2) + (divmod(h1, 10)[0] * c) + (divmod(h2, 20)[0] * d) kenjiro = (a * k1) + (b * k2) + (divmod(k1, 10)[0] * c) + (divmod(k2, 20)[0] * d) print("even" if hiroshi else ["hiroshi", "kenji...
h1, h2 = map(int, input().split()) k1, k2 = map(int, input().split()) a, b, c, d = map(int, input().split()) hiroshi = (a * h1) + (b * h2) + (divmod(h1, 10)[0] * c) + (divmod(h2, 20)[0] * d) kenjiro = (a * k1) + (b * k2) + (divmod(k1, 10)[0] * c) + (divmod(k2, 20)[0] * d) print("even" if hiroshi == kenjiro else ["hiros...
[["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 60], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22]]
5
157
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int D = scan.nextInt(); int L = scan.nextInt(); System.out.println(D / L); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int D = scan.nextInt(); int L = scan.nextInt(); System.out.println(D / L + D % L); } }
[["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 0, 492, 3, 4, 0, 16, 12, 16, 31, 22], ["+", 0, 492, 3, 4, 0, 16, 12, 16, 17, 109], ["+", 0, 492, 3, 4, 0, 16, 12, 16, 12, 22]]
3
64
4
#include <stdio.h> int main(void) { int d, l; scanf("%d %d", &d, l); printf("%d", d / l + d % l); return 0; }
#include <stdio.h> int main(void) { int d, l; scanf("%d %d", &d, &l); printf("%d\n", d / l + d % l); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
44
2
#include <stdio.h> int main(void) { int times, dist, len; scanf("%d,%d,", &dist, &len); times = (dist / len) + (dist % len); printf("%d\n", times); return 0; }
#include <stdio.h> int main(void) { int times, dist, len; scanf("%d %d", &dist, &len); times = (dist / len) + (dist % len); printf("%d\n", times); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
56
2
#include <stdio.h> int main(void) { int times, dist, len; scanf("%d %d", &dist, &len); times = dist / len; times = dist % len; printf("%d\n", times); return 0; }
#include <stdio.h> int main(void) { int times, dist, len; scanf("%d %d", &dist, &len); times = dist / len; times += dist % len; printf("%d\n", times); return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107]]
0
54
2
#include <iostream> #include <string> #include <vector> using namespace std; int N, a, b, f, vis[222]; string z; vector<int> G[222]; void rec(int pos, int c, int s) { if (pos == s && c) { f = 1; return; } if (c) vis[pos] = 1; for (auto &e : G[pos]) { if (!vis[e]) rec(e, c + 1, s); } } in...
#include <iostream> #include <string> #include <vector> using namespace std; int N, a, b, f, vis[222]; string z; vector<int> G[222]; void rec(int pos, int c, int s) { if (pos == s && c) { f = 1; return; } if (c) vis[pos] = 1; for (auto &e : G[pos]) { if (!vis[e]) rec(e, c + 1, s); } } in...
[["+", 0, 7, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
224
5
#include <bits/stdc++.h> using namespace std; #define REP(i, n) FOR(i, 0, n) #define FOR(i, a, b) for (int i = a; i < b; i++) #define PB push_back #define MP make_pair typedef pair<int, int> pii; int n; vector<int> rods[200]; bool visited[200]; int nw; bool chk(int pl) { visited[pl] = true; REP(i, rods[pl].size...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) FOR(i, 0, n) #define FOR(i, a, b) for (int i = a; i < b; i++) #define PB push_back #define MP make_pair typedef pair<int, int> pii; int n; vector<int> rods[200]; bool visited[200]; int nw; bool chk(int pl) { visited[pl] = true; REP(i, rods[pl].size...
[["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
279
6
#include <stdio.h> struct arrow { int origin; int next; }; int checkLoop(int start, struct arrow *arrows, int arrowsCount) { int maps[200]; int i, j, k; for (i = 0; i < 200; i++) { maps[i] = -1; } maps[start] = 0; for (i = 0; i < 200; i++) { for (j = 0; j < 200; j++) { if (maps[j] != i) ...
#include <stdio.h> struct arrow { int origin; int next; }; int checkLoop(int start, struct arrow *arrows, int arrowsCount) { int maps[200]; int i, j, k; for (i = 0; i < 200; i++) { maps[i] = -1; } maps[start] = 0; for (i = 0; i < 200; i++) { for (j = 0; j < 200; j++) { if (maps[j] != i) ...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
388
4
#include <bits/stdc++.h> using namespace std; int p[333][333]; int yoko[333][333]; int tate[333][333]; int dp[301][301][301]; signed main() { int n; cin >> n; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> p[i][j]; for (int i = 0; i < n; i++) { int sum = 0; for (int j = 0; ...
#include <bits/stdc++.h> using namespace std; int p[333][333]; int yoko[333][333]; int tate[333][333]; int dp[301][301][301]; signed main() { int n; cin >> n; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> p[i][j]; for (int i = 0; i < n; i++) { int sum = 0; for (int j = 0; ...
[["-", 0, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
582
6
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 28; int n; int grid[301][301]; int sum(int sx, int sy, int ex, int ey) { return grid[ex][ey] - grid[ex][sy - 1] - grid[sx - 1][ey] + grid[sx - 1][sy - 1]; } int calc(int sx, int sy, int ex, int ey) { return sum(sx, sy, ex, ey) - sum(sx +...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 28; int n; int grid[301][301]; int sum(int sx, int sy, int ex, int ey) { return grid[ex][ey] - grid[ex][sy - 1] - grid[sx - 1][ey] + grid[sx - 1][sy - 1]; } int calc(int sx, int sy, int ex, int ey) { return sum(sx, sy, ex, ey) - sum(sx +...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
497
4
from sys import stdin from itertools import accumulate def solve(): file_input = stdin N = int(file_input.readline()) G = tuple(tuple(map(int, line.split())) for line in file_input) # accumulated rows ar = ((0,) + tuple(accumulate(line)) for line in G) # accumulated columns a...
from sys import stdin from itertools import accumulate def solve(): file_input = stdin N = int(file_input.readline()) G = tuple(tuple(map(int, line.split())) for line in file_input) # accumulated rows ar = ((0,) + tuple(accumulate(line)) for line in G) # accumulated columns a...
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 7, 12, 652, 3, 4, 0, 653, 51, 22]]
5
308
39
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << a << b << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << a + b + c << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72]]
1
40
4
#include <bits/stdc++.h> using namespace std; int main() { int p, m, c; cin >> p >> m >> c; cout << p * m * c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int p, m, c; cin >> p >> m >> c; cout << p + m + c << endl; }
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 72], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72]]
1
37
4
#include <algorithm> #include <iostream> using namespace std; int n, m, c, d, a[10000], b[1440], cnt; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> c >> d; b[c * 60 + d] = 1; } cin >> m; for (int i = 0; i < m; i++) { cin >> c >> d; b[c * 60 + d] = 1; } for (int i = 0; i < 144...
#include <algorithm> #include <iostream> using namespace std; int n, m, c, d, a[10000], b[1440], cnt; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> c >> d; b[c * 60 + d] = 1; } cin >> m; for (int i = 0; i < m; i++) { cin >> c >> d; b[c * 60 + d] = 1; } for (int i = 0; i < 144...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
192
2
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, p, q; vector<int> t; cin >> n; for (int i = 0; i < n; i++) { cin >> p >> q; t.push_back(p * 60 + q); } cin >> m; for (int i = 0; i < m; i++) { cin >> p >> q; t.push_back(p * 60 + q); ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, p, q; vector<int> t; cin >> n; for (int i = 0; i < n; i++) { cin >> p >> q; t.push_back(p * 60 + q); } cin >> m; for (int i = 0; i < m; i++) { cin >> p >> q; t.push_back(p * 60 + q); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
235
2
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> po; int n; cin >> n; for (int i = 0; i < n; ++i) { int h, m; cin >> h >> m; po.push_back(make_pair(h, m)); } cin >> n; for (int i = 0; i < n; ++i) { int h, m; cin >> h >> m; po.push_back(make_pair(h,...
#include <bits/stdc++.h> using namespace std; int main() { vector<pair<int, int>> po; int n; cin >> n; for (int i = 0; i < n; ++i) { int h, m; cin >> h >> m; po.push_back(make_pair(h, m)); } cin >> n; for (int i = 0; i < n; ++i) { int h, m; cin >> h >> m; po.push_back(make_pair(h,...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
208
6
#include <iostream> using namespace std; int main() { int bus[200]; int a, b, min, sec, count = 0, now = 0, x; cin >> a; for (int i = 0; i < a; i++) { cin >> min >> sec; bus[count] = min * 60 + sec; count++; } cin >> b; for (int i = 0; i < b; i++) { cin >> min >> sec; bus[count] = m...
#include <iostream> using namespace std; int main() { int bus[200]; int a, b, min, sec, count = 0, now = 0, x; cin >> a; for (int i = 0; i < a; i++) { cin >> min >> sec; bus[count] = min * 60 + sec; count++; } cin >> b; for (int i = 0; i < b; i++) { cin >> min >> sec; bus[count] = m...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 31, 16, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 31, 16, 12, 16, 31, 69, 341, 342, 0, 22]]
1
298
4
#include <iostream> using namespace std; int main() { int N = 0, M = 0; cin >> N; int h[N], m[N]; for (int i = 0; i < N; i++) cin >> h[i] >> m[i]; cin >> M; int k[M], g[M], all[M + N]; for (int i = 0; i < M; i++) cin >> k[i] >> g[i]; for (int i = 0; i < M + N; i++) { if (i < N) all...
#include <iostream> using namespace std; int main() { int N = 0, M = 0; cin >> N; int h[N], m[N]; for (int i = 0; i < N; i++) cin >> h[i] >> m[i]; cin >> M; int k[M], g[M], all[M + N]; for (int i = 0; i < M; i++) cin >> k[i] >> g[i]; for (int i = 0; i < M + N; i++) { if (i < N) all...
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
455
3
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) { cin >> h[i] >> m[i]; } h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int j = 0; j < M; j++) { cin >> k[j] >> g[j]; } k[M] = 24; g[M] = 0; fo...
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) { cin >> h[i] >> m[i]; } h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int j = 0; j < M; j++) { cin >> k[j] >> g[j]; } k[M] = 24; g[M] = 0; fo...
[["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
333
4
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> using namespace std; int main() { int n, m; vector<int> times; cin >> n; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; times.push_back(x * 60 + y); } cin >> m; n += m; for (int i = 0; i < m; i++) { i...
#include <algorithm> #include <iostream> #include <stdio.h> #include <vector> using namespace std; int main() { int n, m; vector<int> times; cin >> n; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; times.push_back(x * 60 + y); } cin >> m; n += m; for (int i = 0; i < m; i++) { i...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
205
4
#include <algorithm> #include <iostream> #include <vector> using namespace std; int N = 0; //?£?????±±??????????????° int h[100], m[100]; int M = 0; //?¶´??¶?????????????????° int k[100], g[100]; vector<int> L; void timetable() { for (int i = 0; i < N; i++) { L.push_back(60 * h[i] + m[i]); } for (int i = N;...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int N = 0; //?£?????±±??????????????° int h[100], m[100]; int M = 0; //?¶´??¶?????????????????° int k[100], g[100]; vector<int> L; void timetable() { for (int i = 0; i < N; i++) { L.push_back(60 * h[i] + m[i]); } for (int i = N;...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
350
2
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) cin >> h[i] >> m[i]; h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int i = 0; i < M; i++) cin >> k[i] >> g[i]; k[N] = 24; g[N] = 0; for (int i = ...
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) cin >> h[i] >> m[i]; h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int i = 0; i < M; i++) cin >> k[i] >> g[i]; k[M] = 24; g[M] = 0; for (int i = ...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
325
4
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) { cin >> h[i] >> m[i]; } h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int j = 0; j < M; j++) { cin >> k[j] >> g[j]; } k[M] = 24; g[M] = 0; for (...
#include <iostream> using namespace std; int main() { int N; cin >> N; int h[101], m[101]; for (int i = 0; i < N; i++) { cin >> h[i] >> m[i]; } h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for (int j = 0; j < M; j++) { cin >> k[j] >> g[j]; } k[M] = 24; g[M] = 0; for (...
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 22], ["+", 31, 16, 31, 16, 12, 69, 341, 342, 0, 22]]
1
347
2
#include <algorithm> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; // typedef typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int...
#include <algorithm> #include <cmath> #include <complex> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; // typedef typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
315
5
#include <algorithm> #include <iostream> #include <vector> using namespace std; template <class T> inline void YES(T condition) { if (condition) cout << "YES" << endl; else cout << "NO" << endl; } template <class T> inline void Yes(T condition) { if (condition) cout << "Yes" << endl; else cout ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; template <class T> inline void YES(T condition) { if (condition) cout << "YES" << endl; else cout << "NO" << endl; } template <class T> inline void Yes(T condition) { if (condition) cout << "Yes" << endl; else cout ...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
821
6
a = list(map(int,input().split()))[1:] + list(map(int,input().split()))[1:] a = sorted([60*a[i]+a[i+1] for i in range(0,len(a),2)]) print(" ".join("%d:%02d"%(ai/60,ai%60) for ai in a))
a = list(map(int,input().split()))[1:] + list(map(int,input().split()))[1:] a = sorted(list(set([60*a[i]+a[i+1] for i in range(0,len(a),2)]))) print(" ".join("%d:%02d"%(ai/60,ai%60) for ai in a))
[["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
102
6
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, p; cin >> N >> M >> p; int d[10020]; for (int i = 0; i < M; i++) { cin >> d[i], d[i] -= p; if (d[i] < 0) d[i] += N; } sort(d, d + M); int ans = 1e+9; for (int i = 1; i < M; i++) { ans = min(ans, d[i ...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, p; cin >> N >> M >> p; int d[10020]; for (int i = 0; i < M; i++) { cin >> d[i], d[i] -= p; if (d[i] < 0) d[i] += N; } sort(d, d + M); int ans = 1e+9; for (int i = 1; i < M; i++) { ans = min(ans, d[i ...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72]]
1
198
2
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> int main() { int N, M, p, flg = true; std::cin >> N >> M >> p; std::vector<int> d; for (int i = 0; i < M; ++i) { int a; std::cin >> a; a -= p; if (a < 0) a += N; if (a == 0) flg = false; d.push_back(...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> int main() { int N, M, p, flg = true; std::cin >> N >> M >> p; std::vector<int> d; for (int i = 0; i < M; ++i) { int a; std::cin >> a; a -= p; if (a < 0) a += N; if (a == 0) flg = false; d.push_back(...
[["-", 0, 16, 12, 69, 341, 342, 0, 16, 12, 22], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
260
4
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> int main() { int N, M, p; std::cin >> N >> M >> p; std::vector<int> d; for (int i = 0; i < M; ++i) { int a; std::cin >> a; a -= p; if (a < 0) a += N; d.push_back(a); } d.push_back(0); M = d.size(); std...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> int main() { int N, M, p; std::cin >> N >> M >> p; std::vector<int> d; for (int i = 0; i < M; ++i) { int a; std::cin >> a; a -= p; if (a < 0) a += N; d.push_back(a); } d.push_back(0); M = d.size(); std...
[["-", 0, 16, 12, 69, 341, 342, 0, 16, 12, 22], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
242
4
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int N; int M; int p; int d[10010]; int ans = 0; int main() { cin >> N >> M >> p; for (int i = 0; i < M; i++) { cin >> d[i]; d[i] -= p; if (d[i] < 0) d[i] += N; } sort(&d[0], &d[M]); ans = d[M - 1] * 100;...
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; int N; int M; int p; int d[10010]; int ans = 0; int main() { cin >> N >> M >> p; for (int i = 0; i < M; i++) { cin >> d[i]; d[i] -= p; if (d[i] < 0) d[i] += N; } sort(&d[0], &d[M]); ans = d[M - 1] * 100;...
[["+", 3, 4, 0, 23, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 23, 0, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 23, 0, 24], ["+", 49, 50, 51, 23, 0, 16, 31, 23, 0, 25]]
1
263
4
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, p; cin >> N >> M >> p; int d[10001]; d[0] = p; for (int i = 1; i < M; i++) { cin >> d[i]; } sort(d, d + M + 1); int c_min = N - 1; for (int i = 0; i < M + 1; i++) { int q = d[i]; int r1 = d[(i - 1 + M + ...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, M, p; cin >> N >> M >> p; int d[10001]; d[0] = p; for (int i = 1; i <= M; i++) { cin >> d[i]; } sort(d, d + M + 1); int c_min = N - 1; for (int i = 0; i < M + 1; i++) { int q = d[i]; int r1 = d[(i - 1 + M +...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 23, 0, 16, 31, 16, 17, 33], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 17, 33], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
228
6
#include <bits/stdc++.h> using namespace std; typedef long long int64; const int INF = 1 << 30; int sum[1000]; int getSum(int left, int right) { // [left, right) if (left == 0) return sum[right - 1]; return sum[right - 1] - sum[left - 1]; } int main() { int N, c[1000], w[1000], dp1[1000][1001], dp2[1001]; ...
#include <bits/stdc++.h> using namespace std; typedef long long int64; const int INF = 1 << 30; int sum[1000]; int getSum(int left, int right) { // [left, right) if (left == 0) return sum[right - 1]; return sum[right - 1] - sum[left - 1]; } int main() { int N, c[1000], w[1000], dp1[1000][1001], dp2[1001]; ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 160]]
1
417
4
#include <iostream> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; const int inf = 1 << 28; int dp[1010]; bool can[1010][1010]; int w[1010], c[1010]; int main(void) { int n; cin >> n; rep(i, n) cin >> c[i] >> w[i]; rep(i, n) w[i + 1] += w[i], can[i][i + 1] = true; for (int d = 2; d <= n...
#include <iostream> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; const int inf = 1 << 28; int dp[1010]; bool can[1010][1010]; int w[1010], c[1010]; int main(void) { int n; cin >> n; rep(i, n) cin >> c[i] >> w[i]; rep(i, n) w[i + 1] += w[i], can[i][i + 1] = true; for (int d = 2; d <= n...
[["+", 31, 69, 341, 342, 0, 16, 31, 16, 17, 72], ["+", 31, 69, 341, 342, 0, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
349
4
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" int ...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" int ...
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95]]
1
388
1
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) #define INF (1LL << 60) using namespace std; typedef long long ll; ll N, C[2000], W[2000]; ll sum[2000], memo[2000][2000]; struct edge { ll v, dist; }; struct state { ll v, cost; bool operator>(const state s) const { return c...
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) #define INF (1LL << 60) using namespace std; typedef long long ll; ll N, C[2000], W[2000]; ll sum[2000], memo[2000][2000]; struct edge { ll v, dist; }; struct state { ll v, cost; bool operator>(const state s) const { return c...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
573
6
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long i64; typedef long double ld; typedef pair<i64, i64> P; #define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i)) int ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string.h> #include <string> #include <vector> using namespace std; typedef long long i64; typedef long double ld; typedef pair<i64, i64> P; #define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i)) int ...
[["-", 51, 218, 8, 9, 0, 1, 0, 27, 28, 22], ["-", 51, 218, 8, 9, 0, 1, 0, 27, 17, 68], ["-", 49, 50, 51, 218, 8, 9, 0, 1, 0, 35]]
1
421
3
n = gets.to_i c = Array.new(n+1, 0) w = Array.new(n+1, 0) (1..n).each do |i| c[i], w[i] = gets.split.map(&:to_i) end dp = Array.new(n+1){ Array.new(n+1, 0) } ret = Array.new(n+1, 0) (1..n).each do |i| dp[i][i] = c[i] ret[i] = ret[i-1] + 1 x = w[i] y = w[i-1] (i-1).downto(1) do |j| dp[j][i] = [[dp[j+1][...
n = gets.to_i c = Array.new(n+1, 0) w = Array.new(n+1, 0) (1..n).each do |i| c[i], w[i] = gets.split.map(&:to_i) end dp = Array.new(n+1){ Array.new(n+1, 0) } ret = Array.new(n+1, 0) (1..n).each do |i| dp[i][i] = c[i] ret[i] = ret[i-1] + 1 x = w[i] y = w[i-1] (i-1).downto(1) do |j| dp[j][i] = [[dp[j+1][...
[["-", 0, 652, 486, 516, 0, 738, 31, 742, 500, 22], ["+", 0, 652, 486, 516, 0, 738, 31, 742, 500, 22]]
4
256
4
import sys f = sys.stdin n = int(f.readline()) s = [list(map(int, line.split())) for line in f] p = [[i==j for j in range(n + 1)] for i in range(n + 1)] c = [0] + [c for c,w in s] sum_w = [0] + [w for c,w in s] for i in range(1, len(sum_w)): sum_w[i] += sum_w[i - 1] for length in range(n + 1): for i in r...
import sys f = sys.stdin n = int(f.readline()) s = [list(map(int, line.split())) for line in f] p = [[i==j for j in range(n + 1)] for i in range(n + 1)] c = [0] + [c for c,w in s] sum_w = [0] + [w for c,w in s] for i in range(1, len(sum_w)): sum_w[i] += sum_w[i - 1] for length in range(n): for i in range...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
307
6
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { int r = sc.nextInt(), t = sc.nextInt(); String a = ""; for (int y = 0; y < (t % 30 > 0 ? 2 : 1); y++) for (int x = ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { int r = sc.nextInt(), t = sc.nextInt(); String a = ""; for (int y = 0; y < (t % 30 > 0 ? 2 : 1); y++) for (int x = ...
[["-", 8, 196, 0, 7, 8, 7, 26, 27, 0, 22], ["-", 8, 196, 0, 7, 8, 7, 26, 27, 0, 29], ["-", 0, 52, 8, 196, 0, 7, 8, 7, 0, 21], ["+", 8, 7, 26, 11, 12, 16, 12, 27, 0, 29]]
3
167
4
#include <iostream> using namespace std; int main() { int N, r, t; cin >> N; for (int i = 0; i < N; i++) { cin >> r >> t; if (r % 100 == 0) { if (t % 30 == 0) { cout << t / 30 * 5 + r / 100; } else { cout << t / 30 * 5 + r / 100 << " " << (t / 30 + 1) * 5 + r / 100 ...
#include <iostream> using namespace std; int main() { int N, r, t; cin >> N; for (int i = 0; i < N; i++) { cin >> r >> t; if (r % 100 == 0) { if (t % 30 == 0) { cout << t / 30 * 5 + r / 100 << endl; } else { cout << t / 30 * 5 + r / 100 << " " << (t / 30 + 1) * 5 + r / 100 ...
[["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22]]
1
229
2
#include <stdio.h> #define rep(i, n) for (int i = 0; i < n; ++i) int main(void) { int n, i, j; scanf("%d", &n); rep(i, n) { int r, r1, d, d1; scanf("%d%d", &r, &d); r1 = r % 30; r /= 30; r *= 5; d1 = d % 100; d1 /= 100; if (r1 && d1) printf("%d %d %d %d\n", r + d, r + d + 1,...
#include <stdio.h> #define rep(i, n) for (int i = 0; i < n; ++i) int main(void) { int n, i, j; scanf("%d", &n); rep(i, n) { int r, r1, d, d1; scanf("%d%d", &d, &r); r1 = r % 30; r /= 30; r *= 5; d1 = d % 100; d /= 100; if (r1 && d1) printf("%d %d %d %d\n", r + d, r + d + 1, ...
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 64, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 64, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 16, ...
1
192
10
import java.util.Scanner; // 0306 class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), a[] = new int[4], i = 0; while (n > 0) { a[i++] = (n + 1) % 3 - 1; n = (n - a[i - 1]) / 3; } while (i-- > 0) System.out.print((a[i] =...
import java.util.Scanner; // 0306 class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), a[] = new int[15], i = 0; while (n > 0) { a[i++] = (n + 1) % 3 - 1; n = (n - a[i - 1]) / 3; } while (i-- > 0) System.out.print((a[i] ...
[["-", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499], ["+", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499]]
3
152
2
#include <cmath> #include <iostream> using namespace std; int main() { int w; char d[20]; cin >> w; for (int i = 0; i < 20; i++) d[i] = 'a'; while (1) { bool flag = false; int count = 0; for (int i = 0; i < 20; i++) { char ans; count += pow(3, i); if (abs(w) <= count) { ...
#include <cmath> #include <iostream> using namespace std; int main() { int w; char d[20]; cin >> w; for (int i = 0; i < 20; i++) d[i] = 'a'; while (1) { bool flag = false; int count = 0; for (int i = 0; i < 20; i++) { char ans; count += pow(3, i); if (abs(w) <= count) { ...
[["-", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
279
1
#include <cmath> #include <iostream> using namespace std; int n; int v[15]; int sum; char T[4] = "-0+"; int main() { cin >> n; for (int i = 0; i < 531441; i++) { for (int j = 0; j < 12; j++) { v[j] = (i / (int)(pow(3, j))) % 3; sum += (v[j] - 1) * (int)(pow(3, j)); } bool ok = false; i...
#include <cmath> #include <iostream> using namespace std; int n; int v[15]; int sum; char T[4] = "-0+"; int main() { cin >> n; for (int i = 0; i < 531441; i++) { sum = 0; for (int j = 0; j < 12; j++) { v[j] = (i / (int)(pow(3, j))) % 3; sum += (v[j] - 1) * (int)(pow(3, j)); } bool ok =...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
187
4
#include <stdio.h> int w = 0; int main() { scanf("%d", w); printf("%d", w * 4); return 0; }
#include <stdio.h> int w = 0; int main() { scanf("%d", &w); printf("%d\n", w * 32); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
36
4
#include <iostream> using namespace std; int main() { int w; cin >> w; cout << w * 4 << endl; }
#include <iostream> using namespace std; int main() { int w; cin >> w; cout << w * 32 << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
27
2
#include <bits/stdc++.h> using namespace std; int main() { int w; cin >> w; cout << w * 4; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int w; cin >> w; cout << w * 32 << endl; return 0; }
[["-", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
28
4
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { int n; cin >> n; c...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int inf = 1000000000; int main(void) { int n; cin >> n; c...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
61
2
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << a * 24 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; cout << a * 32 << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
30
2
#include <iostream> using namespace std; struct Human { bool a, b, c; Human() { a = b = c = false; } }; int main() { int n, x, y, z, tmp, count = 0; cin >> n; Human hu[n + 1]; cin >> x; for (int i = 0; i < x; i++) { cin >> tmp; hu[tmp].a = true; } cin >> y; for (int i = 0; i < y; i+...
#include <iostream> using namespace std; struct Human { bool a, b, c; Human() { a = b = c = false; } }; int main() { int n, x, y, z, tmp, count = 0; cin >> n; Human hu[n + 1]; cin >> x; for (int i = 0; i < x; i++) { cin >> tmp; hu[tmp].a = true; } cin >> y; for (int i = 0; i < y; i+...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
222
20
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n, x, y, z, re, count = 0; bool a[101] = {false}, b[101] = {false}, c[101] = {false}; scanf("%d%d", &n, &x); for (int i = 0; i < x; ++i) { scanf("%d", &re); a[re] = true; } scanf("%d", &y); for (int i ...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n, x, y, z, re, count = 0; bool a[101] = {false}, b[101] = {false}, c[101] = {false}; scanf("%d%d", &n, &x); for (int i = 0; i < x; ++i) { scanf("%d", &re); a[re] = true; } scanf("%d", &y); for (int i ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
252
4
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a, ans = 0, data[101] = {}; scanf("%d %d", &n, &m); for (int i = 0; i < m; i++) { scanf("%d", &a); data[a] = 1; } scanf("%d", &m); for (int i = 0; i < m; i++) { scanf("%d", &a); data[a] |= 2; } scanf("%d", &m); for (i...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, a, ans = 0, data[101] = {}; scanf("%d %d", &n, &m); for (int i = 0; i < m; i++) { scanf("%d", &a); data[a] = 1; } scanf("%d", &m); for (int i = 0; i < m; i++) { scanf("%d", &a); data[a] |= 2; } scanf("%d", &m); for (i...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 13]]
1
214
2
#include <iostream> using namespace std; int main() { int n, a[101][3] = {0}, sum = 0, m, z; cin >> n; cin >> m; for (int i = 0; i < m; i++) { int k; cin >> k; a[k][0] = 1; } cin >> m; for (int i = 0; i < m; i++) { int k; cin >> k; a[k][1] = 1; } cin >> m; for (int i = 0; i <...
#include <iostream> using namespace std; int main() { int n, a[101][3] = {0}, sum = 0, m, z; cin >> n; cin >> m; for (int i = 0; i < m; i++) { int k; cin >> k; a[k - 1][0] = 1; } cin >> m; for (int i = 0; i < m; i++) { int k; cin >> k; a[k - 1][1] = 1; } cin >> m; for (int i ...
[["+", 31, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 69, 28, 69, 341, 342, 0, 16, 12, 13]]
1
232
6
#include <stdio.h> #define rep(i, n) for (int i = 0; i < n; ++i) int main(void) { int n, i, j, k, ans = 0; scanf("%d", &n); int f[n][3]; rep(i, n) rep(j, 3) f[i][j] = 0; rep(i, 3) { int x; scanf("%d", &x); rep(j, x) { int a; scanf("%d", &a); f[i][a - 1] = 1; } } rep(i, n...
#include <stdio.h> #define rep(i, n) for (int i = 0; i < n; ++i) int main(void) { int n, i, j, k, ans = 0; scanf("%d", &n); int f[n][3]; rep(i, n) rep(j, 3) f[i][j] = 0; rep(i, 3) { int x; scanf("%d", &x); rep(j, x) { int a; scanf("%d", &a); f[a - 1][i] = 1; } } /*rep(i,...
[["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 22], ["-", 0, 11, 31, 69, 28, 69, 341, 342, 0, 73], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 31, 69, 28, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]]
1
189
6
#include <iostream> using namespace std; void readIds(bool (&is_grouped)[100], int counter); int main() { int n; int x; int y; int z; bool is_grouped_x[100] = {}; bool is_grouped_y[100] = {}; bool is_grouped_z[100] = {}; int ans = 0; /* Read */ cin >> n; cin >> x; readIds(is_grouped_x, x); ...
#include <iostream> using namespace std; void readIds(bool (&is_grouped)[100], int counter); int main() { int n; int x; int y; int z; bool is_grouped_x[100] = {}; bool is_grouped_y[100] = {}; bool is_grouped_z[100] = {}; int ans = 0; /* Read */ cin >> n; cin >> x; readIds(is_grouped_x, x); ...
[["+", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13]]
1
216
2
#include <iostream> using namespace std; int main() { int n; cin >> n; int a[n] = {}; int x; cin >> x; for (int i = 0; i < x; i++) { int b; cin >> b; for (int j = 0; j < 100; j++) { if (b == j) { a[j] += 1; } } } int y; cin >> y; for (int i = 0; i < y; i++) { ...
#include <iostream> using namespace std; int main() { int n; cin >> n; int a[n + 1] = {}; int x; cin >> x; for (int i = 0; i < x; i++) { int b; cin >> b; for (int j = 0; j <= 100; j++) { if (b == j) { a[j] += 1; } } } int y; cin >> y; for (int i = 0; i < y; i++) {...
[["+", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["+", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
270
8
#include <bits/stdc++.h> using namespace std; int main() { int N, a[110], t, X, Y, Z, A = 0, B = 0, C = 0; for (int i = 0; i < 110; i++) a[i] = 1; cin >> N; cin >> X; for (int i = 0; i < X; i++) { cin >> t; a[t] *= 2; } cin >> Y; for (int i = 0; i < Y; i++) { cin >> t; a[t] *= ...
#include <bits/stdc++.h> using namespace std; int main() { int N, a[110], t, X, Y, Z, A = 0, B = 0, C = 0; for (int i = 0; i < 110; i++) a[i] = 1; cin >> N; cin >> X; for (int i = 0; i < X; i++) { cin >> t; a[t] *= 2; } cin >> Y; for (int i = 0; i < Y; i++) { cin >> t; a[t] *= ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
229
4
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int t[] = new int[a]; for (int i = 0; i < a; i++) { t[i] = sc.nextInt(); } for (int i = a; i > 0; i--) { int count = 0; for (i...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int t[] = new int[a]; for (int i = 0; i < a; i++) { t[i] = sc.nextInt(); } for (int i = a; i > 0; i--) { int count = 0; for (i...
[["-", 64, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 492, 3, 4, 0, 22]]
3
152
2
/* ????????? ????????°???????????°??????????????? ???????????? ?????´???????????§?????§????????°???????????°???????????????????????¬??????????????¨????????????????????? ?????????????????§????????????????????????????????????????????????????????£?????????????????????????????? ?????????????????????????????? ???????§????...
/* ????????? ????????°???????????°??????????????? ???????????? ?????´???????????§?????§????????°???????????°???????????????????????¬??????????????¨????????????????????? ?????????????????§????????????????????????????????????????????????????????£?????????????????????????????? ?????????????????????????????? ???????§????...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
206
2
#include <stdio.h> int main(void) { int n, a[101]; int cnt, max, i, j; scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); max = 1; for (i = 1; i <= n; i++) { cnt = 0; for (j = 1; j <= n; j++) { if (i <= a[j]) cnt++; } if (cnt == i && max < cnt) max = cnt; ...
#include <stdio.h> int main(void) { int n, a[101]; int cnt, max, i, j; scanf("%d", &n); for (i = 1; i <= n; i++) scanf("%d", &a[i]); max = 1; for (i = 1; i <= n; i++) { cnt = 0; for (j = 1; j <= n; j++) { if (i <= a[j]) cnt++; } if (cnt >= i && max < i) max = i; } ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 20], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22]]
1
136
6
#include <bits/stdc++.h> using namespace std; // Preprocessor loop #define CAT_I(x, y) x##y #define CAT(x, y) CAT_I(x, y) #define INC0 1 #define INC1 2 #define INC2 3 #define INC3 4 #define INC4 5 #define INC5 6 #define INC6 7 #define INC7 8 #define INC8 9 #define INC(i) CAT(INC, i) #define EMPTY(...) #define DEF_C...
#include <bits/stdc++.h> using namespace std; // Preprocessor loop #define CAT_I(x, y) x##y #define CAT(x, y) CAT_I(x, y) #define INC0 1 #define INC1 2 #define INC2 3 #define INC3 4 #define INC4 5 #define INC5 6 #define INC6 7 #define INC7 8 #define INC8 9 #define INC(i) CAT(INC, i) #define EMPTY(...) #define DEF_C...
[["+", 0, 56, 49, 53, 54, 55, 0, 42, 0, 72], ["+", 0, 56, 49, 53, 54, 55, 0, 42, 0, 13]]
1
1,134
2
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main(void) { int N, T = 0, ans = 0; int p[100]; cin >> N; for (int i = 0; i < N; i++) { cin >> p[i]; } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (p[j] >= i) { ans++; } } ...
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main(void) { int N, T = 0, ans = 0; int p[100]; cin >> N; for (int i = 0; i < N; i++) { cin >> p[i]; } for (int i = 0; i < N + 1; i++) { for (int j = 0; j < N; j++) { if (p[j] >= i) { ans++; } ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
134
4
#include <iostream> using namespace std; int main() { int n; cin >> n; int p[n]; for (int i = 0; i < n; i++) { cin >> p[i]; } int t = 0, score = 0; ; while (1) { int cnt = 0; for (int i = 0; i < n; i++) { if (p[i] >= t) cnt++; } if (cnt >= t) { score++; } els...
#include <iostream> using namespace std; int main() { int n; cin >> n; int p[100]; for (int i = 0; i < n; i++) { cin >> p[i]; } int t = 0, score = 0; ; while (1) { int cnt = 0; for (int i = 0; i < n; i++) { if (p[i] >= t) cnt++; } if (cnt >= t) { score = t; }...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
125
5
#include "bits/stdc++.h" using namespace std; int main() { int cnt[101]; memset(cnt, 0, sizeof(cnt)); int N; cin >> N; while (N--) { int s; cin >> s; cnt[s]++; } for (int i = 100; i > 0; i--) { cnt[i - 1] += cnt[i]; if (cnt[i] >= i) { cout << cnt[i] << endl; return 0; }...
#include "bits/stdc++.h" using namespace std; int main() { int cnt[101]; memset(cnt, 0, sizeof(cnt)); int N; cin >> N; while (N--) { int s; cin >> s; cnt[s]++; } for (int i = 100; i > 0; i--) { cnt[i - 1] += cnt[i]; if (cnt[i] >= i) { cout << i << endl; return 0; } } ...
[["-", 0, 1, 0, 16, 31, 16, 12, 69, 28, 22], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73]]
1
110
3
#include <bits/stdc++.h> using namespace std; int main() { int n, sum, ten; cin >> n; int p[n]; for (int i = 0; i < n; i++) { cin >> p[i]; } for (int i = 1; i < 100; i++) { sum = 0; for (int j = 0; j < n; j++) { if (p[j] >= i) { sum++; } } if (sum >= i) { ten = ...
#include <bits/stdc++.h> using namespace std; int main() { int n, sum, ten; cin >> n; int p[n]; for (int i = 0; i < n; i++) { cin >> p[i]; } for (int i = 1; i <= 100; i++) { sum = 0; for (int j = 0; j < n; j++) { if (p[j] >= i) { sum++; } } if (sum >= i) { ten =...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
120
4
#include <stdio.h> int main(void) { int H, R; scanf("%d %d", &H, &R); if (R == H) { printf("1\n"); } else if (R == -H) { printf("0\n"); } else printf("-1\n"); return 0; }
#include <stdio.h> int main(void) { int H, R; scanf("%d %d", &H, &R); if (R + H > 0) { printf("1\n"); } else if (R == -H) { printf("0\n"); } else printf("-1\n"); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 72], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13]]
0
73
4
#include <bits/stdc++.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define ALL(v) (v).begin(), (v).end() #define pb push_back #define pf push_front #define fi first #...
#include <bits/stdc++.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define ALL(v) (v).begin(), (v).end() #define pb push_back #define pf push_front #define fi first #...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13], ["-", 75, 76, 0, 1, 0, 16, 31, 16, 12, 13],...
1
161
8