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 <iostream> #include <vector> using namespace std; int main() { int n; while (cin >> n) { vector<int> taro(n); vector<int> hanako; for (int i = 0; i < n; i++) { cin >> taro[i]; } for (int i = 1; i <= 2 * n; i++) { if (find(taro.begin(), taro.end(), i) ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; while (cin >> n, n) { vector<int> taro(n); vector<int> hanako; for (int i = 0; i < n; i++) { cin >> taro[i]; } for (int i = 1; i <= 2 * n; i++) { if (find(taro.begin(), taro.end(), ...
[["+", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 12, 22]]
1
397
2
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; vector<int> t, h; int tmp; int p, m; int i; while (1) { cin >> n; if (!n) break; t.clear(); for (i = 0; i < n; i++) { cin >> tmp; t.push_back(tmp); } sort(t.begin(...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n; vector<int> t, h; int tmp; int p, m; int i; while (1) { cin >> n; if (!n) break; t.clear(); for (i = 0; i < n; i++) { cin >> tmp; t.push_back(tmp); } sort(t.begin(...
[["-", 31, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["+", 31, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["-", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22]]
1
371
4
#include <iostream> #include <set> #include <vector> using namespace std; int main() { int n; while (cin >> n && n != 0) { set<int> taro, hanako; for (int i = 1; i <= 2 * n; i++) hanako.insert(i); for (int i = 0; i < n; i++) { int tmp; cin >> tmp; hanako.erase(tmp); taro...
#include <iostream> #include <set> #include <vector> using namespace std; int main() { int n; while (cin >> n && n != 0) { set<int> taro, hanako; for (int i = 1; i <= 2 * n; i++) hanako.insert(i); for (int i = 0; i < n; i++) { int tmp; cin >> tmp; hanako.erase(tmp); taro...
[["-", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 16, 31, 16, 12, 2, 63, 118, 28, 22]]
1
273
4
#include <iostream> using namespace std; int main() { int n; bool *taro, *hanako; while (cin >> n) { if (n == 0) break; int card; taro = new bool[2 * n + 1]; hanako = new bool[2 * n + 1]; for (int i = 0; i < 2 * n + 1; i++) { taro[i] = false; hanako[i] = true; } taro...
#include <iostream> using namespace std; int main() { int n; bool *taro, *hanako; while (cin >> n) { if (n == 0) break; int card; taro = new bool[2 * n + 1]; hanako = new bool[2 * n + 1]; for (int i = 0; i < 2 * n + 1; i++) { taro[i] = false; hanako[i] = true; } taro...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
320
8
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; //タロー→ハナァコォ const int NONE = -1; int main(void) { while (1) { int n; vector<int> card[2]; cin >> n; if (n == 0) return 0; int field = NONE; //今場に出ているカード int...
#include <algorithm> #include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; //タロー→ハナァコォ const int NONE = -1; int main(void) { while (1) { int n; vector<int> card[2]; cin >> n; if (n == 0) return 0; int field = NONE; //今場に出ているカード int...
[["-", 12, 2, 63, 118, 28, 69, 341, 342, 0, 13], ["+", 12, 2, 63, 118, 28, 69, 341, 342, 0, 13]]
1
485
2
#include <iostream> using namespace std; int main() { int n, a, c = 0, T, H; bool t[200 + 2], h[200 + 2]; while (1) { fill(t, t + 202, false); fill(h, h + 202, false); scanf("%d", &n); if (n == 0) break; for (int i = 0; i < n; i++) { scanf("%d", &a); t[a] = true; } f...
#include <iostream> using namespace std; int main() { int n, a, c = 0, T, H; bool t[200 + 2], h[200 + 2]; while (1) { c = 0; fill(t, t + 202, false); fill(h, h + 202, false); scanf("%d", &n); if (n == 0) break; for (int i = 0; i < n; i++) { scanf("%d", &a); t[a] = true; ...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
310
4
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define MP make_pair using namespace std; typedef vector<int> vi; typedef pair<int, int> P; int main() { int n; while (cin >> n, 0) { vector<int> v(2 * n + 1, 0); rep(i, n) { ...
#include <algorithm> #include <iostream> #include <queue> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) #define MP make_pair using namespace std; typedef vector<int> vi; typedef pair<int, int> P; int main() { int n; while (cin >> n, n) { vector<int> v(2 * n + 1, 0); rep(i, n) { ...
[["-", 8, 9, 0, 52, 15, 339, 51, 34, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 12, 22]]
1
301
2
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef pair<int, int> P;...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef pair<int, int> P;...
[["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["-", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125], ["+", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22]]
1
400
6
#include <ctype.h> #include <math.h> #include <stdio.h> #include <string.h> int main() { int n, i, j, a, suu1, suu2, ba, t; int tarou[100]; int hanako[100]; while (1) { scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) tarou[i] = 0, hanako[i] = 0; for (i = 0; i < n; i++) ...
#include <ctype.h> #include <math.h> #include <stdio.h> #include <string.h> int main() { int n, i, j, a, suu1, suu2, ba, t; int tarou[100]; int hanako[100]; while (1) { scanf("%d", &n); if (n == 0) break; for (i = 0; i < n; i++) tarou[i] = 0, hanako[i] = 0; for (i = 0; i < n; i++) ...
[["-", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 52, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
465
4
#include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; /* int main(){ int n; int count=0; string name; cin >> n >> name; vector<string> signs(n); for(int i=0; i<n; ++i){ ...
#include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; /* int main(){ int n; int count=0; string name; cin >> n >> name; vector<string> signs(n); for(int i=0; i<n; ++i){ ...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 12, 13]]
1
337
4
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; const int INF = 1 << 29; typedef pair<int, int> P; vector<int> tcard[2]; int n; int main(v...
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; const int INF = 1 << 29; typedef pair<int, int> P; vector<int> tcard[2]; int n; int main(v...
[["-", 12, 2, 63, 118, 28, 69, 341, 342, 0, 13], ["+", 12, 2, 63, 118, 28, 69, 341, 342, 0, 13]]
1
547
4
loop { n = gets.to_i break if n == 0 hand = [(1..n).map { gets.to_i }.sort] hand << (1..2*n).to_a - hand[-1] min = 0 i = 0 loop { x = hand[i].find{|y| y > min} if x hand[i].delete(x) min = x break if hand[i].empty? else ...
loop { n = gets.to_i break if n == 0 hand = [(1..n).map { gets.to_i }.sort] hand << (1..2*n).to_a - hand[-1] min = 0 i = 0 loop { x = hand[i].find{|y| y > min} if x hand[i].delete(x) min = x break if hand[i].empty? else ...
[["+", 8, 734, 0, 652, 3, 4, 0, 652, 17, 131], ["+", 8, 734, 0, 652, 3, 4, 0, 652, 735, 22]]
4
113
2
#!/usr/bin/ruby M=999 while(n=gets.to_i)>0 do a=(1..(2*n)).map.to_a b=[];n.times{b.push(gets.to_i)} h=[b,a-b];f=0;m=0 while true do x=h[f].map{|e|e>m ?e: M}.min if x<M then h[f]-=[x];m=x else m=0 end if h[f].size==0 then p h[1].size,h[0].size;exit end f^=1 end end
#!/usr/bin/ruby M=999 while(n=gets.to_i)>0 do a=(1..(2*n)).map.to_a b=[];n.times{b.push(gets.to_i)} h=[b,a-b];f=0;m=0 while true do x=h[f].map{|e|e>m ?e: M}.min if x<M then h[f]-=[x];m=x else m=0 end if h[f].size==0 then p h[1].size,h[0].size;break end f^=1 end end
[["-", 0, 89, 8, 170, 0, 121, 64, 749, 0, 22], ["+", 8, 170, 0, 121, 64, 749, 0, 94, 0, 94]]
4
144
2
def discard(c, cards): for card in cards: if c < card: return card return 0 while True: n = int(input()) if n == 0: break taro = [int(input()) for _ in range(n)] hanako = [x + 1 for x in range(2*n) if (x + 1) not in taro] taro.sort() hanako.sort() table...
def discard(c, cards): for card in cards: if c < card: return card return 0 while True: n = int(input()) if n == 0: break taro = [int(input()) for _ in range(n)] hanako = [x + 1 for x in range(2*n) if (x + 1) not in taro] taro.sort() hanako.sort() table...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
168
1
import bisect while True: n = int(input()) if n == 0: break tc = sorted([int(input()) for _ in range(n)]) hc = sorted([v for v in range(1, 2*n+1) if v not in tc]) ba = [] flag = True while tc and hc: if len(ba) == 0: try: if flag: ...
import bisect while True: n = int(input()) if n == 0: break tc = sorted([int(input()) for _ in range(n)]) hc = sorted([v for v in range(1, 2*n+1) if v not in tc]) ba = [] flag = True while tc and hc: if len(ba) == 0: try: if flag: ...
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
218
4
import bisect while True: n = int(input()) if n == 0: break card_set = [sorted(int(input()) for _ in range(n)), []] card_set[1] = sorted({i for i in range(1, 2*n+1)}.difference(card_set[0])) card = turn = 0 flag = 1 ba = [] while flag: if len(ba) == 0: card = ...
import bisect while True: n = int(input()) if n == 0: break card_set = [sorted(int(input()) for _ in range(n)), []] card_set[1] = sorted({i for i in range(1, 2*n+1)}.difference(card_set[0])) card = turn = 0 flag = 1 ba = [] while flag: if len(ba) == 0: card = ...
[["+", 0, 661, 0, 658, 0, 659, 12, 206, 0, 70], ["+", 0, 658, 0, 659, 12, 206, 206, 663, 0, 102], ["+", 0, 659, 12, 206, 206, 663, 0, 664, 17, 33], ["+", 0, 659, 12, 206, 206, 663, 0, 664, 28, 612], ["+", 0, 661, 0, 658, 0, 659, 12, 206, 0, 73]]
5
225
6
#include <stdio.h> #define HASH_LEN 1024 typedef struct { int x, y; } point_t; typedef struct _hash_element hash_element_t; struct _hash_element { void *value; hash_element_t *next; }; hash_element_t *_hash[HASH_LEN]; hash_element_t _hashelm[HASH_LEN]; int _hashelm_index; void hash_init() { int i; for (i...
#include <stdio.h> #define HASH_LEN 1024 typedef struct { int x, y; } point_t; typedef struct _hash_element hash_element_t; struct _hash_element { void *value; hash_element_t *next; }; hash_element_t *_hash[HASH_LEN]; hash_element_t _hashelm[HASH_LEN]; int _hashelm_index; void hash_init() { int i; for (i...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 109], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 67], ["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 24], ["+", 0, 37, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 37, 0, 16, 12, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 37, 0, 16, 12, 23, 0, 25]]
0
602
6
#include <iostream> #include <map> #include <vector> using namespace std; struct pos { int x, y; }; map<int, map<int, int>> smap; int index(int x, int y) { auto i0 = smap.find(x); if (i0 == smap.end()) return -1; auto i1 = i0->second.find(y); if (i1 == i0->second.end()) return -1; return i1->seco...
#include <iostream> #include <map> #include <vector> using namespace std; struct pos { int x, y; }; map<int, map<int, int>> smap; int index(int x, int y) { auto i0 = smap.find(x); if (i0 == smap.end()) return -1; auto i1 = i0->second.find(y); if (i1 == i0->second.end()) return -1; return i1->seco...
[["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
366
2
#include <iostream> #include <set> #include <vector> using namespace std; typedef long long ll; const int mod = 10000000; int m, n, a, b; int main() { while (cin >> m, m) { vector<ll> v(m); for (int i = 0; i < m; i++) { cin >> a >> b; v[i] = 1LL * a * mod + b; } set<int> s; cin >> n; ...
#include <iostream> #include <set> #include <vector> using namespace std; typedef long long ll; const int mod = 10000000; int m, n, a, b; int main() { while (cin >> m, m) { vector<ll> v(m); for (int i = 0; i < m; i++) { cin >> a >> b; v[i] = 1LL * a * mod + b; } set<ll> s; cin >> n; ...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 8, 9, 0, 52, 8, 9, 0, 338, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 338, 39, 78]]
1
237
4
#include <bits/stdc++.h> #define FOR(i, n) for (int i = 0; i < (int)(n); i++) #define FORR(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define pb(a) push_back(a) #define mp(x, y) make_pair(x, y) #define ZERO(a) memset(a, 0, sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int, int> #defi...
#include <bits/stdc++.h> #define FOR(i, n) for (int i = 0; i < (int)(n); i++) #define FORR(i, m, n) for (int i = (int)(m); i < (int)(n); i++) #define pb(a) push_back(a) #define mp(x, y) make_pair(x, y) #define ZERO(a) memset(a, 0, sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int, int> #defi...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
355
4
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 10; bitset<maxn> cookie[10]; int main() { int R, C; while (cin >> R >> C && (R || C)) { int i, j; for (int i = 0; i < R; i++) for (int j = 0; j < C; j++) { bool upward; cin >> upward; cookie[i][j] = upward; ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 10; bitset<maxn> cookie[10]; int main() { int R, C; while (cin >> R >> C && (R || C)) { int i, j; for (int i = 0; i < R; i++) for (int j = 0; j < C; j++) { bool upward; cin >> upward; cookie[i][j] = upward; ...
[["-", 0, 2, 63, 118, 28, 69, 341, 342, 0, 22], ["+", 0, 2, 63, 118, 28, 69, 341, 342, 0, 22]]
1
285
2
#include <cstdio> #include <string> #include <vector> using namespace std; int r, c; string ConvertDecToBinString(int dec_num) { if (dec_num == 0) { return string("0"); } string bin_num_str; while (dec_num) { if ((dec_num & 1) == 0) { bin_num_str.insert(bin_num_str.begin(), '0'); } else { ...
#include <cstdio> #include <string> #include <vector> using namespace std; int r, c; string ConvertDecToBinString(int dec_num) { if (dec_num == 0) { return string("0"); } string bin_num_str; while (dec_num) { if ((dec_num & 1) == 0) { bin_num_str.insert(bin_num_str.begin(), '0'); } else { ...
[["+", 0, 7, 15, 16, 12, 16, 12, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 16, 12, 16, 12, 13]]
1
499
2
#include <bits/stdc++.h> using namespace std; int R, C; int cnt; int s = 0; bool sen[11][10001]; bool flg[11]; int fnc() { // for(int i = 1;i <= R;i++){ // cout <<flg[i] <<" "; // } // printf("\n"); int ret = 0; int senc[R + 1][C + 1]; for (int i = 1; i <= R; i++) { for (int j = 1; j <= C; j++) {...
#include <bits/stdc++.h> using namespace std; int R, C; int cnt; int s = 0; bool sen[11][10001]; bool flg[11]; int fnc() { // for(int i = 1;i <= R;i++){ // cout <<flg[i] <<" "; // } // printf("\n"); int ret = 0; int senc[R + 1][C + 1]; for (int i = 1; i <= R; i++) { for (int j = 1; j <= C; j++) {...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
452
7
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int MAX_R = 15; const int MAX_C = 10005; bool pan[MAX_R][MAX_C] = {0}; int r, c; void reverse(int row) { for (int i = 0; i < c; i++) { if (pan[row][i] == 0) pan[row][i] = 1; else pan[row][i] = 0; } } int df...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; const int MAX_R = 15; const int MAX_C = 10005; bool pan[MAX_R][MAX_C] = {0}; int r, c; void reverse(int row) { for (int i = 0; i < c; i++) { if (pan[row][i] == 0) pan[row][i] = 1; else pan[row][i] = 0; } } int df...
[["-", 8, 9, 0, 57, 64, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 49, 22], ["-", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 8, 9, 0, 1, 0, 41, 15, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 41, 15, 16...
1
324
10
#include <iostream> int R, C, s[10000][10], f[10], N, i, j, n, m; void rec(int k) { if (k < R) { f[k] = 0; rec(k + 1); f[k] = 1; rec(k + 1); } else for (n = i = 0; i<C; i++, n += m> R - m ? m : R - m) { for (m = j = 0; j < R; j++) m += s[i][j] ^ f[j]; N = N > n ? N : n; }...
#include <iostream> int R, C, s[10000][10], f[10], N, i, j, n, m; void rec(int k) { if (k < R) { f[k] = 0; rec(k + 1); f[k] = 1; rec(k + 1); } else { for (n = i = 0; i<C; i++, n += m> R - m ? m : R - m) for (m = j = 0; j < R; j++) m += s[i][j] ^ f[j]; N = N > n ? N : n; } } m...
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 0, 57, 75, 76, 0, 7, 8, 9, 0, 45], ["-", 8, 9, 0, 7, 15, 34, 12, 16, 17, 139], ["-", 8, 9, 0, 7, 15, 34, 12, 16, 12, 22]]
1
217
36
#include <iostream> #include <vector> using namespace std; int main() { int r, c; while (cin >> r >> c && r && c) { vector<vector<int>> v(r, vector<int>(c)), v2; int ans = 0; for (int i = 0; i < r; i++) for (int j = 0; j < c; j++) cin >> v[i][j]; for (int i = 0; i < (1 << (r - 1)); i...
#include <iostream> #include <vector> using namespace std; int main() { int r, c; while (cin >> r >> c && r && c) { vector<vector<int>> v(r, vector<int>(c)), v2; int ans = 0; for (int i = 0; i < r; i++) for (int j = 0; j < c; j++) cin >> v[i][j]; for (int i = 0; i < (1 << (r - 1)); i...
[["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
280
4
#include <algorithm> #include <iostream> #define rep2(i, b, n) for (int i = b; i < n; ++i) #define rep(i, n) rep2(i, 0, n) using namespace std; bool fd[10][10000]; int h, w; int search(int r) { int res = 0; if (r >= w) { rep(x, w) { int t_sum = 0; rep(y, h) { if (!fd[y][x]) ++...
#include <algorithm> #include <iostream> #define rep2(i, b, n) for (int i = b; i < n; ++i) #define rep(i, n) rep2(i, 0, n) using namespace std; bool fd[10][10000]; int h, w; int search(int r) { int res = 0; if (r >= h) { rep(x, w) { int t_sum = 0; rep(y, h) { if (!fd[y][x]) ++...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 52, 15, 339, 51, 34, 31, 16, 12, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 34, 0, 21], ["+", 0, 52, 15, 339, 51, 34, 12, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 34, 12, 16, 17, 139]]
1
244
6
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; bool field[11][10010]; int r, c; int calc(int bit) { for (int i = 0; i < r; i++) { if ((bit >> i) && 1) { for (int j = 0; j < c; j++) { field[i][j] = !field[i][j]; } } } int ret = 0; ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; bool field[11][10010]; int r, c; int calc(int bit) { for (int i = 0; i < r; i++) { if ((bit >> i) & 1) { for (int j = 0; j < c; j++) { field[i][j] = !field[i][j]; } } } int ret = 0; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 67]]
1
350
4
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; struct island { int way[1010]; bool kaku; }; void slove(int n, int k) { int a, b, c, d; pair<...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; struct island { int way[1010]; bool kaku; }; void slove(int n, int k) { int a, b, c, d; pair<...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]]
1
430
4
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) //#define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIS...
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) //#define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define EXIS...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
397
4
#include <iostream> using namespace std; int main() { int d[101]; bool v[101]; int map[101][101]; int mx = 99999999, mn, z, a, b, c, dd, e, hozon, k, n; while (1) { for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { map[i][j] = mx; } d[i] = mx; } cin >> n >> ...
#include <iostream> using namespace std; int main() { int d[101]; bool v[101]; int map[101][101]; int mx = 99999999, mn, z, a, b, c, dd, e, hozon, k, n; while (1) { for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { map[i][j] = mx; } d[i] = mx; } cin >> n >> ...
[["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
404
2
#include <bits/stdc++.h> #define INF 1 << 29 using namespace std; int d[150][150]; void wa_syaru(int n, int s, int g); main() { int n, k; int num; while (1) { cin >> n >> k; if (n == 0 && k == 0) break; fill_n(*d, 150 * 150, INF); for (int i = 0; i < n; i++) { d[i][i] = 0; } fo...
#include <bits/stdc++.h> #define INF 1 << 29 using namespace std; int d[150][150]; void wa_syaru(int n, int s, int g); main() { int n, k; int num; while (1) { cin >> n >> k; if (n == 0 && k == 0) break; fill_n(*d, 150 * 150, INF); for (int i = 0; i <= n; i++) { d[i][i] = 0; } f...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
361
2
#include <algorithm> #include <cassert> #include <cctype> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; typedef complex<int> P; int m, n, x, y; P c[200], s[1000]; int main() { while (cin >> m) { ...
#include <algorithm> #include <cassert> #include <cctype> #include <complex> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <string> #include <vector> using namespace std; typedef complex<int> P; int m, n, x, y; P c[200], s[1000]; int main() { while (cin >> m) { ...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
324
4
#include <algorithm> #include <bitset> #include <cmath> #include <ctime> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> Pair_i; int main() { int n, m; whi...
#include <algorithm> #include <bitset> #include <cmath> #include <ctime> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> Pair_i; int main() { int n, m; whi...
[["+", 31, 16, 31, 16, 31, 16, 12, 91, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 91, 17, 33]]
1
331
2
#include <iostream> #include <queue> using namespace std; int main() { int m; int n; int c; int f; int g; int h; int i; int j; int k; while (cin >> m) { if (m == 0) { break; } int a[m]; int b[m]; c = 0; while (c < m) { cin >> a[c]; cin >> b[c]; c = c +...
#include <iostream> #include <queue> using namespace std; int main() { int m; int n; int c; int f; int g; int h; int i; int j; int k; while (cin >> m) { if (m == 0) { break; } int a[m]; int b[m]; c = 0; while (c < m) { cin >> a[c]; cin >> b[c]; c = c +...
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
307
4
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef pair<int, int> P; int n, m; /* bool operator == (const P &a, const P &b)const { return (a.first == b.first) & (a.second == b.second); } */ void solve() { vector<P> model(n); vector<P> dist(n); for (int i = 0; i < n;...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef pair<int, int> P; int n, m; /* bool operator == (const P &a, const P &b)const { return (a.first == b.first) & (a.second == b.second); } */ void solve() { vector<P> model(n); vector<P> dist(n); for (int i = 0; i < n;...
[["-", 12, 16, 31, 118, 28, 69, 341, 342, 0, 13], ["+", 12, 16, 31, 118, 28, 69, 341, 342, 0, 22]]
1
355
2
for e in iter(input,'0'): a={tuple(map(int,input().split())) for _ in range(int(e))} s,t=a[0] b={tuple(map(int,input().split())) for _ in range(int(input()))} for x,y in b: flag = True for u,v in a[1:]: if(x+u-s,y+v-t)not in b: flag = False break if flag == True: print(x - s, y - t) break
for e in iter(input,'0'): a=list(tuple(map(int,input().split())) for _ in range(int(e))) s,t=a[0] b={tuple(map(int,input().split())) for _ in range(int(input()))} for x,y in b: flag = True for u,v in a[1:]: if(x+u-s,y+v-t)not in b: flag = False break if flag == True: print(x - s, y - t) break...
[["-", 8, 196, 0, 1, 0, 662, 12, 689, 0, 45], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 668, 0, 24], ["-", 8, 196, 0, 1, 0, 662, 12, 689, 0, 46], ["+", 0, 1, 0, 662, 12, 652, 3, 668, 0, 25]]
5
139
17
for e in iter(input,'0'): a={tuple(map(int,input().split())) for _ in range(int(e))} s,t=a[0] b={tuple(map(int,input().split())) for _ in range(int(input()))} for x,y in b: flag = True for u,v in a[1:]: if(x+u-s,y+v-t)not in b: flag = False break if flag == True: print(x - s, y - t) break
for e in iter(input,'0'): a=list(tuple(map(int,input().split())) for _ in range(int(e))) s,t=a[0] b=[tuple(map(int,input().split())) for _ in range(int(input()))] for x,y in b: flag = True for u,v in a[1:]: if(x+u-s,y+v-t)not in b: flag = False break if flag == True: print(x - s, y - t) break...
[["-", 8, 196, 0, 1, 0, 662, 12, 689, 0, 45], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 668, 0, 24], ["-", 8, 196, 0, 1, 0, 662, 12, 689, 0, 46], ["+", 0, 1, 0, 662, 12, 652, 3, 668, 0, 25], ["+", 8, 196, 0, 1, 0, 662, 12, 658, 0, 70], ["+", 8, 196, 0, 1, 0, 662, 12, 658, 0, 73]]
5
139
17
import java.util.Scanner; public class Main { private static boolean debug = false; private static int r; private static int c; private static int[][] senbeis; private static int URA = 0, OMOTE = 1; @SuppressWarnings("unused") private static void debug(String format, Object... objects) { if (!de...
import java.util.Scanner; public class Main { private static boolean debug = false; private static int r; private static int c; private static int[][] senbeis; private static int URA = 0, OMOTE = 1; @SuppressWarnings("unused") private static void debug(String format, Object... objects) { if (!de...
[["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 499], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 22], ["-", 31, 23, 0, 16, 31, 23, 0, 16, 31, 22], ["-", 31, 23, 0, 16, 31, 23, 0, 16, 17, 152], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 152], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 12, 22]]
3
452
6
#include <stdio.h> #include <stdlib.h> #include <string.h> #define mem(x, y) (x *)malloc(sizeof(x) * (y)); int main() { int r, c, i, j, k; int *list; int **data; int *count; while (scanf("%d %d", &r, &c), r) { if (r == 1) printf("%d\n", c); else { list = mem(int, 2 << (r - 1)); coun...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define mem(x, y) (x *)malloc(sizeof(x) * (y)); int main() { int r, c, i, j, k; int *list; int **data; int *count; while (scanf("%d %d", &r, &c), r) { if (r == 1) printf("%d\n", c); else { list = mem(int, 2 << (r - 1)); coun...
[["-", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25], ["+", 0, 57, 75, 76, 0, 9, 0, 43, 39, 40], ["-", 75, 76, 0, 9, 0, 43, 39, 78, 0, 22]]
0
448
6
#include <iostream> #include <vector> using namespace std; int main() { int R, C; while (1) { cin >> R >> C; if (R == 0 && C == 0) break; vector<vector<bool>> senbei(R, vector<bool>(C)); for (int i = 0, x; i < R; ++i) { for (int j = 0; j < C; ++j) { cin >> x; senbei[i][...
#include <iostream> #include <vector> using namespace std; int main() { int R, C; while (1) { cin >> R >> C; if (R == 0 && C == 0) break; vector<vector<bool>> senbei(R, vector<bool>(C)); for (int i = 0, x; i < R; ++i) { for (int j = 0; j < C; ++j) { cin >> x; senbei[i][...
[["-", 0, 338, 8, 1, 0, 11, 12, 91, 17, 92], ["+", 0, 338, 8, 1, 0, 11, 12, 91, 17, 111]]
1
276
2
// Solution for 0525: Osenbei #include <algorithm> #include <iostream> using namespace std; int r, c, ans, sum; int cracker[11][10001], save[11][10001]; void solve(int i) { sum = 0; for (int j = 1; j <= c; j++) { save[i][j] = cracker[i][j]; if (cracker[i][j]) cracker[i][j] = 0; else cracker[...
// Solution for 0525: Osenbei #include <algorithm> #include <iostream> using namespace std; int r, c, ans, sum; int cracker[11][10001], save[11][10001]; void solve(int i) { sum = 0; for (int j = 1; j <= c; j++) { save[i][j] = cracker[i][j]; if (cracker[i][j]) cracker[i][j] = 0; else cracker[...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 14, 8, 9, ...
1
337
8
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
[["-", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["+", 3, 4, 0, 2, 3, 4, 0, 69, 28, 22], ["-", 3, 4, 0, 2, 63, 118, 28, 69, 28, 22], ["+", 3, 4, 0, 2, 63, 118, 28, 69, 28, 22]]
1
373
4
#include <algorithm> #include <iostream> using namespace std; const int MAX_Y = 10000; const int MAX_X = 10; int a[MAX_X][MAX_Y] = {0}; int n, m; void solve() { while (cin >> n >> m && n && m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> a[i][j]; } } int d = 0,...
#include <algorithm> #include <iostream> using namespace std; const int MAX_Y = 10000; const int MAX_X = 10; int a[MAX_X][MAX_Y] = {0}; int n, m; void solve() { while (cin >> n >> m && n && m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> a[i][j]; } } int d = 0,...
[["+", 15, 16, 12, 23, 0, 16, 12, 16, 17, 33], ["+", 15, 16, 12, 23, 0, 16, 12, 16, 12, 13], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 31, 22]]
1
231
4
#include <stdio.h> int main() { int ha, ma, sa, hb, mb, sb, seca, secb, sum, i; for (i = 0; i < 3; i++) { scanf("%d %d %d %d %d %d\n", &ha, &ma, &sa, &hb, &mb, &sb); seca = ha * 3600 + ma * 60 + sa; secb = hb * 3600 + mb * 60 * mb; sum = secb - seca; ha = sum / 3600; ma = (sum % 3600) / 60; ...
#include <stdio.h> int main() { int ha, ma, sa, hb, mb, sb, seca, secb, sum, i; for (i = 0; i < 3; i++) { scanf("%d %d %d %d %d %d\n", &ha, &ma, &sa, &hb, &mb, &sb); seca = ha * 3600 + ma * 60 + sa; secb = hb * 3600 + mb * 60 + sb; sum = secb - seca; ha = sum / 3600; ma = (sum % 3600) / 60; ...
[["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
143
4
#include <stdio.h> int main() { int h1, m1, s1, h2, m2, s2, i; for (i = 0; i < 3; i++) { scanf(" %d %d %d %d %d %d", &h1, &m1, &s1, &h2, &m2, &s2); s2 -= s1; if (s2 < 0) { s2 += 60; m2--; } m2 -= 1; if (m2 < 0) { m2 += 60; h2--; } h2 -= h1; printf("%...
#include <stdio.h> int main() { int h1, m1, s1, h2, m2, s2, i; for (i = 0; i < 3; i++) { scanf(" %d %d %d %d %d %d", &h1, &m1, &s1, &h2, &m2, &s2); s2 -= s1; if (s2 < 0) { s2 += 60; m2--; } m2 -= m1; if (m2 < 0) { m2 += 60; h2--; } h2 -= h1; printf("...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22]]
0
122
2
#include <stdio.h> int main() { int h[3][2], m[3][2], s[3][2], i, k, koh[3], kom[3], kos[3], da = 0, de = 0; for (k = 0; k < 3; k++) { scanf("%d %d %d %d %d %d", &h[k][0], &m[k][0], &s[k][0], &h[k][1], &m[k][1], &s[k][1]); } for (i = 0; i < 3; i++) { if (s[i][0] <= s[i][1]) { kos[i] = ...
#include <stdio.h> int main() { int h[3][2], m[3][2], s[3][2], i, k, koh[3], kom[3], kos[3], da = 0, de = 0; for (k = 0; k < 3; k++) { scanf("%d %d %d %d %d %d", &h[k][0], &m[k][0], &s[k][0], &h[k][1], &m[k][1], &s[k][1]); } for (i = 0; i < 3; i++) { if (s[i][0] <= s[i][1]) { kos[i] = ...
[["-", 75, 76, 0, 9, 0, 1, 0, 16, 17, 33], ["-", 75, 76, 0, 9, 0, 1, 0, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 17, 68]]
0
356
6
#include "stdio.h" typedef struct { int Arrive[3]; int Leave[3]; } Time; void timecal(int arrive[3], int leave[3], int result[3]) { int temp; for (temp = 2; temp > 0; temp--) { result[temp] = (leave[temp] - arrive[temp]); if (result[temp] < 0) { result[temp] = 60 + result[temp]; leave[temp...
#include "stdio.h" typedef struct { int Arrive[3]; int Leave[3]; } Time; void timecal(int arrive[3], int leave[3], int result[3]) { int temp; for (temp = 2; temp > 0; temp--) { result[temp] = (leave[temp] - arrive[temp]); if (result[temp] < 0) { result[temp] = 60 + result[temp]; leave[temp...
[["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
449
3
#include <stdio.h> int main() { int h1[3], m1[3], s1[3]; int h2[3], m2[3], s2[3]; int h[3], m[3], s[3]; int i; for (i = 0; i < 3; i++) { scanf("%d%d%d%d%d%d", &h1[i], &m1[i], &s1[i], &h2[i], &m2[i], &s2[i]); } for (i = 0; i < 3; i++) { int x[3]; int y[3]; y[i] = h2[i] * 3600 + m2[i] * 60 +...
#include <stdio.h> int main() { int h1[3], m1[3], s1[3]; int h2[3], m2[3], s2[3]; int h[3], m[3], s[3]; int i; for (i = 0; i < 3; i++) { scanf("%d%d%d%d%d%d", &h1[i], &m1[i], &s1[i], &h2[i], &m2[i], &s2[i]); } for (i = 0; i < 3; i++) { int x[3]; int y[3]; y[i] = h2[i] * 3600 + m2[i] * 60 +...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
297
2
#include <stdio.h> int main() { int ah; int am; int as; int bh; int bm; int bs; int h; int hh; int m; int mm; int mmm; int s; int i; for (i = 2; i >= 0; i--) { scanf("%d %d %d", ah, am, as); scanf("%d %d %d", bh, bm, bs); h = bh - ah; if (am > bm) { hh = h - 1; m...
#include <stdio.h> int main() { int ah; int am; int as; int bh; int bm; int bs; int h; int hh; int m; int mm; int mmm; int s; int i; for (i = 2; i >= 0; i--) { scanf("%d %d %d", &ah, &am, &as); scanf("%d %d %d", &bh, &bm, &bs); h = bh - ah; if (am > bm) { hh = h - 1; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
281
6
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, V, w, x, y, z, A, B, C, D, E, F, G, H, I, J; scanf("%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m, &n, &o, &p, &q, &r); s = 3600 * a +...
#include <stdio.h> int main(void) { int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, V, w, x, y, z, A, B, C, D, E, F, G, H, I, J; scanf("%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m, &n, &o, &p, &q, &r); s = 3600 * a +...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
0
354
2
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define ALL(co) co.begin(), co.end() #defi...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define ALL(co) co.begin(), co.end() #defi...
[["-", 64, 1, 0, 23, 0, 34, 31, 16, 17, 33], ["+", 64, 1, 0, 23, 0, 34, 0, 42, 0, 110]]
1
550
4
#include <fstream> #include <iostream> using namespace std; int main() { // ifstream cin("INPUT.txt"); // ofstream cout("OUTPUT.txt"); int i, h, m, s, t; for (i = 0; i < 3; i++) { cin >> h >> m >> s; t = (h * 3600) + (m * 60) + s; cin >> h >> m >> s; t = ((h * 3600) + (m * 60) + s) - t; c...
#include <fstream> #include <iostream> using namespace std; int main() { // ifstream cin("INPUT.txt"); // ofstream cout("OUTPUT.txt"); int i, h, m, s, t; for (i = 0; i < 3; i++) { cin >> h >> m >> s; t = (h * 3600) + (m * 60) + s; cin >> h >> m >> s; t = ((h * 3600) + (m * 60) + s) - t; c...
[["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 85], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 109], ["-", 31, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 16, 31, 16, 31, 16, 12, 16, 17, 85]]
1
125
4
#include <algorithm> #include <bits/stdc++.h> #include <queue> #include <vector> using namespace std; typedef long long ll; int main() { for (int i = 0; i < 2; i++) { int a[6]; for (int j = 0; j < 6; j++) scanf("%d", &a[j]); int x = a[0] * 3600 + a[1] * 60 + a[2]; int y = a[3] * 3600 + a[4] * 6...
#include <algorithm> #include <bits/stdc++.h> #include <queue> #include <vector> using namespace std; typedef long long ll; int main() { for (int i = 0; i <= 2; i++) { int a[6]; for (int j = 0; j < 6; j++) scanf("%d", &a[j]); int x = a[0] * 3600 + a[1] * 60 + a[2]; int y = a[3] * 3600 + a[4] * ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
150
2
#include <bits/stdc++.h> using namespace std; int a, b, c; int main() { for (int i = 0; i < 3; i++) { int t1, t2; cin >> a >> b >> c; t1 = a * 3600 + b * 60 + c; cin >> a >> b >> c; t2 = a * 3600 + b * 60 + c; int t3 = t2 - t1; cout << t3 / 3600 << ' ' << t2 / 60 % 60 << ' ' << t2 % 60 << ...
#include <bits/stdc++.h> using namespace std; int a, b, c; int main() { for (int i = 0; i < 3; i++) { int t1, t2; cin >> a >> b >> c; t1 = a * 3600 + b * 60 + c; cin >> a >> b >> c; t2 = a * 3600 + b * 60 + c; int t3 = t2 - t1; cout << t3 / 3600 << ' ' << t3 / 60 % 60 << ' ' << t3 % 60 << ...
[["-", 31, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["+", 31, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22]]
1
116
23
#include <iostream> using namespace std; int main() { int sh, sm, ss, eh, em, es; int h, m, s; for (int i = 0; i < 4; i++) { cin >> sh >> sm >> ss >> eh >> em >> es; if (es < ss) { em = em - 1; es = es + 60; } s = es - ss; if (em < sm) { eh = eh - 1; em = em + 60; }...
#include <iostream> using namespace std; int main() { int sh, sm, ss, eh, em, es; int h, m, s; for (int i = 0; i < 3; i++) { cin >> sh >> sm >> ss >> eh >> em >> es; if (es < ss) { em = em - 1; es = es + 60; } s = es - ss; if (em < sm) { eh = eh - 1; em = em + 60; }...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
141
2
#include <algorithm> #include <functional> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; int main(void) { int a, aa, aaa, b, bb, bbb, T, TT, TTT; for (int i = 0; i < 4; i++) { cin >> a >> aa >> aaa >> b...
#include <algorithm> #include <functional> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; int main(void) { int a, aa, aaa, b, bb, bbb, T, TT, TTT; for (int i = 0; i < 3; i++) { cin >> a >> aa >> aaa >> b...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
193
4
#include <bits/stdc++.h> using namespace std; int h, m, s, h2, m2, s2; void res(int &h, int &m, int &s, int &h2, int &m2, int &s2) { int sa; sa = (h2 * 3600 + m2 * 60 + s2) - (h * 3600 + m * 60 + s); h = sa / 3600; m = (sa - h * 3600) / 60; s = sa - h * 3600 - m * 60; } int main() { for (int i = 0; i < 3...
#include <bits/stdc++.h> using namespace std; int h, m, s, h2, m2, s2; void res(int &h, int &m, int &s, int &h2, int &m2, int &s2) { int sa; sa = (h2 * 3600 + m2 * 60 + s2) - (h * 3600 + m * 60 + s); h = sa / 3600; m = (sa - h * 3600) / 60; s = sa - h * 3600 - m * 60; } int main() { for (int i = 0; i < 3...
[["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22]]
1
179
2
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <fstream> #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 <fstream> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include ...
[["-", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22]]
1
205
2
#include <cstdio> int main() { for (int i = 0; i < 3; ++i) { int l[3], r[3]; for (int j = 0; j < 3; ++j) scanf("%d", l + j); for (int j = 0; j < 3; ++j) scanf("%d", r + j); int h, m, s; s = r[0] - l[0]; if (s < 0) { s += 60; r[1] -= 1; } m = r[1] - l[1]; if...
#include <cstdio> int main() { for (int i = 0; i < 3; ++i) { int l[3], r[3]; for (int j = 0; j < 3; ++j) scanf("%d", l + j); for (int j = 0; j < 3; ++j) scanf("%d", r + j); int h, m, s; s = r[2] - l[2]; if (s < 0) { s += 60; r[1] -= 1; } m = r[1] - l[1]; if...
[["-", 0, 11, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 13], ["-", 0, 11, 12, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 11, 12, 16, 12, 69, 341, 342, 0, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13]]
1
183
10
#include <cstdio> #include <iostream> using namespace std; int main(void) { int a[3][6]; for (int i = 0; i < 3; i++) for (int j = 0; j < 6; j++) cin >> a[i][j]; for (int i = 0; i < 3; i++) for (int j = 2; 0 <= j; j--) { a[i][j + 3] -= a[i][j]; if (a[i][j + 3] < 0) { a[i][j + 2] -...
#include <cstdio> #include <iostream> using namespace std; int main(void) { int a[3][6]; for (int i = 0; i < 3; i++) for (int j = 0; j < 6; j++) cin >> a[i][j]; for (int i = 0; i < 3; i++) for (int j = 2; 0 <= j; j--) { a[i][j + 3] -= a[i][j]; if (a[i][j + 3] < 0) { a[i][j + 2] -...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151]]
1
217
6
import java.util.*; class Main { public static void main(String[] args) { Solve s = new Solve(); s.solve(); } } class Solve { Solve() {} Scanner in = new Scanner(System.in); void solve() { int[] a = new int[10]; for (int i = 0; i < 10; i++) { a[i] = in.nextInt(); } Arrays.sor...
import java.util.*; class Main { public static void main(String[] args) { Solve s = new Solve(); s.solve(); } } class Solve { Solve() {} Scanner in = new Scanner(System.in); void solve() { int[] a = new int[10]; for (int i = 0; i < 10; i++) { a[i] = in.nextInt(); } Arrays.sor...
[["-", 0, 195, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 195, 8, 196, 0, 1, 0, 492, 141, 22]]
3
199
2
import java.util.*; class Main { public static void main(String args[]) { Scanner in = new Scanner(System.in); int w = 0, k = 0; int ws[] = new int[10], ks[] = new int[10]; for (int i = 0; i < 10; i++) ws[i] = in.nextInt(); for (int i = 0; i < 10; i++) ks[k] = in.nextInt(); Array...
import java.util.*; class Main { public static void main(String args[]) { Scanner in = new Scanner(System.in); int w = 0, k = 0; int ws[] = new int[10], ks[] = new int[10]; for (int i = 0; i < 10; i++) ws[i] = in.nextInt(); for (int i = 0; i < 10; i++) ks[i] = in.nextInt(); Array...
[["-", 0, 7, 8, 1, 0, 11, 31, 504, 71, 22], ["+", 0, 7, 8, 1, 0, 11, 31, 504, 71, 22]]
3
189
2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int[] a = new int[10]; int[] b = new int[10]; for (int i = 0; i < 10; i++) { a[i] = sc.nextInt(); } for (int i = 0; i < 10; i++)...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int[] a = new int[10]; int[] b = new int[10]; for (int i = 0; i < 10; i++) { a[i] = sc.nextInt(); } for (int i = 0; i < 10; i++)...
[["-", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 492, 141, 22], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 62], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 491]]
3
179
6
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int wt = 0, kt = 0; int[] w = new int[9]; int[] k = new int[9]; for (int i = 0; i < 10; i++) { w[i] = sc.nextInt(); } for (int i = 0; i < 10; i++) { k[i] = sc.n...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int wt = 0, kt = 0; int[] w = new int[10]; int[] k = new int[10]; for (int i = 0; i < 10; i++) { w[i] = sc.nextInt(); } for (int i = 0; i < 10; i++) { k[i] = sc...
[["-", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499], ["+", 0, 503, 49, 200, 51, 227, 497, 505, 0, 499]]
3
183
4
#include <stdio.h> main() { int ma; int a[10]; int b[10]; int aa; int bb; int c; int d; int counta; int countb; for (ma = 0; ma < 10; ma++) { scanf("%d", &a[ma]); } for (ma = 0; ma < 10; ma++) { scanf("%d", &b[ma]); } for (c = 0; c < 10; c++) { for (d = c - 1; d > 0; d--) { ...
#include <stdio.h> main() { int ma; int a[10]; int b[10]; int aa; int bb; int c; int d; int counta; int countb; for (ma = 0; ma < 10; ma++) { scanf("%d", &a[ma]); } for (ma = 0; ma < 10; ma++) { scanf("%d", &b[ma]); } for (c = 0; c < 10; c++) { for (d = 10 - 1; d > c; d--) { ...
[["-", 8, 9, 0, 7, 10, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 31, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
0
266
4
#include <stdio.h> #define num 10 int main(void) { int w[num], k[num], i, j, temp, W = 0, K = 0; for (i = 0; i < num; i++) { scanf("%d", &w[i]); } for (i = 0; i < num; i++) { scanf("%d", &k[i]); } for (i = 0; i < num - 1; i++) { for (j = num - 1; j > i; j--) { if (w[j] > w[j - 1]) { ...
#include <stdio.h> #define num 10 int main(void) { int w[num], k[num], i, j, temp, W = 0, K = 0; for (i = 0; i < num; i++) { scanf("%d", &w[i]); } for (i = 0; i < num; i++) { scanf("%d", &k[i]); } for (i = 0; i < num - 1; i++) { for (j = num - 1; j > i; j--) { if (w[j] > w[j - 1]) { ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
261
4
#include <stdio.h> int main(void) { int w[10], k[10]; int i, j, tmp; int W = 0, K = 0; for (i = 0; i < 10; i++) { scanf("%d", &w[i]); } for (i = 0; i < 10; i++) { scanf("%d", &k[i]); } for (i = 0; i < 9; i++) { for (j = 9; j > i; j--) { if (w[j - 1] < w[j]) { tmp = w[j]; ...
#include <stdio.h> int main(void) { int w[10], k[10]; int i, j, tmp; int W = 0, K = 0; for (i = 0; i < 10; i++) { scanf("%d", &w[i]); } for (i = 0; i < 10; i++) { scanf("%d", &k[i]); } for (i = 0; i < 9; i++) { for (j = 9; j > i; j--) { if (w[j - 1] < w[j]) { tmp = w[j]; ...
[["-", 64, 9, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 0, 70], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 71, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 69, 0, 73], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
0
257
5
#include <stdio.h> int main() { int i, k, a[10], b[10], yo; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (i = 0; i < 10; i++) { scanf("%d", &b[i]); } for (i = 0; i < 10; i++) { for (k = i + 1; k < 10; k++) { if (a[i] < a[k]) { yo = a[i]; a[i] = a[k]; a[k] = ...
#include <stdio.h> int main() { int i, k, a[10], b[10], yo; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (i = 0; i < 10; i++) { scanf("%d", &b[i]); } for (i = 0; i < 10; i++) { for (k = i + 1; k < 10; k++) { if (a[i] < a[k]) { yo = a[i]; a[i] = a[k]; a[k] = ...
[["+", 8, 9, 0, 7, 10, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 10, 11, 12, 16, 17, 72]]
0
260
2
#include <stdio.h> int main(void) { int w[10], k[10], wsum, ksum, i, j, n, m; n = 0; m = 0; for (i = 0; i < 10; i++) { scanf("%d", &w[i]); } for (i = 0; i < 10; i++) { scanf("%d", &k[i]); } for (i = 0; i < 10; i++) { for (j = i + 1; j < 10; j++) { if (w[i] < k[j]) { n = w[i];...
#include <stdio.h> int main(void) { int w[10], k[10], wsum, ksum, i, j, n, m; n = 0; m = 0; for (i = 0; i < 10; i++) { scanf("%d", &w[i]); } for (i = 0; i < 10; i++) { scanf("%d", &k[i]); } for (i = 0; i < 10; i++) { for (j = i + 1; j < 10; j++) { if (w[i] < w[j]) { n = w[i];...
[["-", 0, 57, 15, 23, 0, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 28, 22]]
0
285
2
#include <math.h> #include <stdio.h> #include <stdlib.h> int main() { int a[10], b[10], ah[3], bh[3], as, bs, i, j, store; as = 0; bs = 0; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (i = 0; i < 10; i++) { scanf("%d", &b[i]); } for (i = 0; i < 3; i++) { ah[i] = 0; bh[i] = 0; ...
#include <math.h> #include <stdio.h> #include <stdlib.h> int main() { int a[10], b[10], ah[3], bh[3], as, bs, i, j, store; as = 0; bs = 0; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } for (i = 0; i < 10; i++) { scanf("%d", &b[i]); } for (i = 0; i < 3; i++) { ah[i] = 0; bh[i] = 0; ...
[["-", 0, 57, 15, 23, 0, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 28, 22]]
0
286
2
#include <stdio.h> int main() { int a[10]; int sum[10 * 9 * 8 / 6]; int i, j, k, l; int max; for (i = 0; i < 10; i++) scanf("%d", &a[i]); l = 0; for (i = 0; i < 10; i++) for (j = i + 1; j < 10; j++) for (k = j + 1; k < 10; k++) sum[l++] = a[i] + a[j] + a[k]; max = 0; for (i = 0...
#include <stdio.h> int main() { int a[10]; int sum[10 * 9 * 8 / 6]; int i, j, k, l; int max; for (i = 0; i < 10; i++) scanf("%d", &a[i]); l = 0; for (i = 0; i < 10; i++) for (j = i + 1; j < 10; j++) for (k = j + 1; k < 10; k++) sum[l++] = a[i] + a[j] + a[k]; max = 0; for (i = 0...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
327
3
#include <stdio.h> int main(void) { int w, k; /*一番目に大きい点数*/ int max1 = 0; /*二番目に大きい点数*/ int max2 = 0; /*三番目に大きい点数*/ int max3 = 0; int i; for (i = 0; i < 10; i++) { scanf("%d", &w); if (max1 <= w) { max3 = max2; max2 = max1; max1 = w; } else if (max2 <= w) { max3 ...
#include <stdio.h> int main(void) { int w, k; /*一番目に大きい点数*/ int max1 = 0; /*二番目に大きい点数*/ int max2 = 0; /*三番目に大きい点数*/ int max3 = 0; int i; for (i = 0; i < 10; i++) { scanf("%d", &w); if (max1 <= w) { max3 = max2; max2 = max1; max1 = w; } else if (max2 <= w) { max3 ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
223
2
#include <algorithm> #include <iostream> using namespace std; int main() { int W[10]; int K[10]; int i = 0; while (i < 10) { cin >> W[i]; i++; } while (i < 20) { cin >> K[i - 10]; i++; } sort(W, W + 10); sort(K, K + 10); cout << W[7] + W[8] + W[9] << K[7] + K[8] + K[9] << endl;...
#include <algorithm> #include <iostream> using namespace std; int main() { int W[10]; int K[10]; int i = 0; while (i < 10) { cin >> W[i]; i++; } while (i < 20) { cin >> K[i - 10]; i++; } sort(W, W + 10); sort(K, K + 10); cout << W[7] + W[8] + W[9] << " " << K[7] + K[8] + K[9] <...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
124
4
#include <algorithm> #include <array> #include <deque> #include <iostream> #include <list> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; int main() { int answer = 0; int W[10], K[10]; for (int i = 0; i < 10; i++) { cin >> W[i]; } for (int i = 0; i < 10; i++...
#include <algorithm> #include <array> #include <deque> #include <iostream> #include <list> #include <math.h> #include <set> #include <string> #include <vector> using namespace std; int main() { int answer = 0; int W[10], K[10]; for (int i = 0; i < 10; i++) { cin >> W[i]; } for (int i = 0; i < 10; i++...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
147
4
#include <iostream> using namespace std; int main() { int big[3]; for (int i = 0; i < 3; i++) big[i] = 0; for (int i = 0; i < 10; i++) { int a; cin >> a; if (a > big[0]) { big[2] = big[1]; big[1] = big[0]; big[0] = a; } else if (a > big[1]) { big[2] = big[0]; big[...
#include <iostream> using namespace std; int main() { int big[3]; for (int i = 0; i < 3; i++) big[i] = 0; for (int i = 0; i < 10; i++) { int a; cin >> a; if (a > big[0]) { big[2] = big[1]; big[1] = big[0]; big[0] = a; } else if (a > big[1]) { big[2] = big[1]; big[...
[["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13]]
1
325
8
#include <bits/stdc++.h> using namespace std; int main() { int a[10], b[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } for (int i = 0; i < 10; i++) { cin >> b[i]; } sort(a, a + 10); sort(b, b + 10); cout << a[8] + a[9] + a[7] << endl; cout << b[8] + b[9] + b[7] << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a[10], b[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } for (int i = 0; i < 10; i++) { cin >> b[i]; } sort(a, a + 10); sort(b, b + 10); cout << a[8] + a[9] + a[7] << " "; cout << b[8] + b[9] + b[7] << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
128
4
#include <cstdio> #include <iostream> int main() { int nowpoint, wran[3] = {0}, kran[3] = {0}, wsum = 0, ksum = 0; for (int i = 0; i < 10; i++) { scanf("%d", &nowpoint); if (wran[0] < nowpoint) wran[2] = wran[1], wran[1] = wran[0], wran[0] = nowpoint; else if (wran[1] < nowpoint) wran[2] = w...
#include <cstdio> #include <iostream> int main() { int nowpoint, wran[3] = {0}, kran[3] = {0}, wsum = 0, ksum = 0; for (int i = 0; i < 10; i++) { scanf("%d", &nowpoint); if (wran[0] < nowpoint) wran[2] = wran[1], wran[1] = wran[0], wran[0] = nowpoint; else if (wran[1] < nowpoint) wran[2] = w...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
296
4
#include <algorithm> #include <iostream> using namespace std; int main() { int m = 0, W[10], T[10], i; for (i = 0; i < 10; i++) { cin >> W[i]; } sort(W, W + 10); for (i = 7; i < 10; i++) m += W[i]; cout << m << " "; for (i = 0; i < 10; i++) { cin >> T[i]; } sort(T, T + 10); for (i = 7; ...
#include <algorithm> #include <iostream> using namespace std; int main() { int m = 0, W[10], T[10], i; for (i = 0; i < 10; i++) { cin >> W[i]; } sort(W, W + 10); for (i = 7; i < 10; i++) m += W[i]; cout << m << " "; m = 0; for (i = 0; i < 10; i++) { cin >> T[i]; } sort(T, T + 10); for...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
147
4
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main(void) { int a[11], b[11], i, s, z; for (i = 1; i <= 10; i++) { scanf("%d", &a[i]); } sort(a + 1, a + 10, greater<int>()); for (i = 1; i <= 10; i++) { scanf("%d", &b[i]); } sort(b + 1, b + 10, greater<int>()...
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main(void) { int a[11], b[11], i, s, z; for (i = 1; i <= 10; i++) { scanf("%d", &a[i]); } sort(a + 1, a + 11, greater<int>()); for (i = 1; i <= 10; i++) { scanf("%d", &b[i]); } sort(b + 1, b + 11, greater<int>()...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
175
4
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main(void) { int i, s = 0, z = 0, a[11], aa[11]; for (i = 1; i <= 10; i++) { scanf("%d", &a[i]); } sort(a, a + 10, greater<int>()); for (i = 1; i <= 10; i++) { scanf("%d", &aa[i]); } sort(aa, aa + 10, greater<in...
#include <algorithm> #include <functional> #include <stdio.h> using namespace std; int main(void) { int i, s = 0, z = 0, a[10], aa[10]; for (i = 0; i < 10; i++) { scanf("%d", &a[i]); } sort(a, a + 10, greater<int>()); for (i = 0; i < 10; i++) { scanf("%d", &aa[i]); } sort(aa, aa + 10, greater<int>...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
175
12
#include <bits/stdc++.h> using namespace std; int main() { priority_queue<int> q[2]; int a, sum[2] = {0}; for (int i = 0; i < 2; i++) { for (int j = 0; j < 10; j++) { cin >> a; q[i].push(a); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) sum[i] += q[i].top(); q...
#include <bits/stdc++.h> using namespace std; int main() { priority_queue<int> q[2]; int a, sum[2] = {0}; for (int i = 0; i < 2; i++) { for (int j = 0; j < 10; j++) { cin >> a; q[i].push(a); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { sum[i] += q[i].top(); ...
[["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]]
1
150
2
#include <algorithm> #include <cmath> #include <cstdio> #include <ctype.h> #include <iostream> #include <string> using namespace std; int main() { int people[21], Total, Total2; for (int i = 0; i < 20; i++) { cin >> people[i]; } sort(people, people + 10, greater<int>()); sort(people + 11, people + 20, gr...
#include <algorithm> #include <cmath> #include <cstdio> #include <ctype.h> #include <iostream> #include <string> using namespace std; int main() { int people[21], Total, Total2; for (int i = 0; i < 20; i++) { cin >> people[i]; } sort(people, people + 10, greater<int>()); sort(people + 10, people + 20, gr...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
138
2
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10], b[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } for (int i = 0; i < 10; i++) { cin >> b[i]; } sort(a, a + 10); sort(b, b + 10); cout << a[9] + a[8] + a[7] << b[9] + b[8] + b[7] << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int a[10], b[10]; for (int i = 0; i < 10; i++) { cin >> a[i]; } for (int i = 0; i < 10; i++) { cin >> b[i]; } sort(a, a + 10); sort(b, b + 10); cout << a[9] + a[8] + a[7] << " " << b[9] + b[8] + b[7] << endl; return ...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
126
4
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <typeinfo> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; ...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <typeinfo> #include <vector> #define syosu(x) fixed << setprecision(x) using namespace std; typedef long long ll; ...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
270
4
#include <stdio.h> #define N 10 int main(void) { int wScores[N]; int kScores[N]; int wBests, kBests; for (int i = 0; i < N; i++) scanf("%d", &wScores[i]); for (int i = 0; i < N; i++) scanf("%d", &kScores[i]); wBests = 0; kBests = 0; for (int i = 0; i < 3; i++) { int max, p; max = 0; ...
#include <stdio.h> #define N 10 int main(void) { int wScores[N]; int kScores[N]; int wBests, kBests; for (int i = 0; i < N; i++) scanf("%d", &wScores[i]); for (int i = 0; i < N; i++) scanf("%d", &kScores[i]); wBests = 0; kBests = 0; for (int i = 0; i < 3; i++) { int max, p; max = 0; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22]]
1
254
2
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int main() { int sum[2] = {0}, num[10] = {0}, i, j; for (j = 0; j < 2; j++) { for (i = 0; i < 10; i++) { cin >> num[i]; } sort(num, num + 10); sum[j] = num[7] + num[8] + num[9]; } cout << sum...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int main() { int sum[2] = {0}, num[10] = {0}, i, j; for (j = 0; j < 2; j++) { for (i = 0; i < 10; i++) { cin >> num[i]; } sort(num, num + 10); sum[j] = num[7] + num[8] + num[9]; } cout << sum...
[["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]]
1
124
4
#include <algorithm> #include <functional> #include <iostream> #include <limits> #include <map> #include <string> #include <vector> using namespace std; int main() { vector<int> w, k; int a; for (int i = 0; i < 10; i++) { cin >> a; w.emplace_back(a); } sort(w.begin(), w.end(), greater<int>()); for ...
#include <algorithm> #include <functional> #include <iostream> #include <limits> #include <map> #include <string> #include <vector> using namespace std; int main() { vector<int> w, k; int a; for (int i = 0; i < 10; i++) { cin >> a; w.emplace_back(a); } sort(w.begin(), w.end(), greater<int>()); for ...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22]]
1
171
4
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int P[2]; for (int i = 0; i < 2; i++) { vector<int> point(10); for (int j = 0; j < 10; j++) { cin >> point[j]; } sort(point.begin(), point.end()); P[i] = point[0] + point[1] + point[2]; } cout...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int P[2]; for (int i = 0; i < 2; i++) { vector<int> point(10); for (int j = 0; j < 10; j++) { cin >> point[j]; } sort(point.rbegin(), point.rend()); P[i] = point[0] + point[1] + point[2]; } co...
[["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120]]
1
123
4
#include <algorithm> #include <iostream> using namespace std; int main() { int j, w[11], k[11], i, wg = 0, kg = 0; for (i = 0; i < 10; i++) { cin >> w[i]; } for (i = 0; i < 10; i++) { cin >> k[i]; } sort(w, w + 11); sort(k, k + 11); wg = w[7] + w[8] + w[9]; kg = k[7] + k[8] + k[9]; cout << w...
#include <algorithm> #include <iostream> using namespace std; int main() { int j, w[11], k[11], i, wg = 0, kg = 0; for (i = 0; i < 10; i++) { cin >> w[i]; } for (i = 0; i < 10; i++) { cin >> k[i]; } sort(w, w + 10); sort(k, k + 10); wg = w[7] + w[8] + w[9]; kg = k[7] + k[8] + k[9]; cout << w...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
148
4
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { //コンテスト int W[10], K[10]; for (int i = 0; i < 10; i++) { cin >> W[i]; } for (int i = 0; i < 10; i++) { cin >> K[10]; } sort(W, W + 10); reverse(W, W + 10); sort(K, K + 10); revers...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { //コンテスト int W[10], K[10]; for (int i = 0; i < 10; i++) { cin >> W[i]; } for (int i = 0; i < 10; i++) { cin >> K[i]; } sort(W, W + 10); reverse(W, W + 10); sort(K, K + 10); reverse...
[["-", 0, 1, 0, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
163
2
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vecto...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <vecto...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
262
4
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
264
6
#include <algorithm> #include <iostream> using namespace std; main() { int data1[10], data2[10]; while (cin >> data1[0]) { for (int i = 1; i < 10; i++) { cin >> data1[i]; } for (int i = 0; i < 10; i++) { cin >> data2[i]; } sort(data1, data1 + 10); sort(data2, data2 + 10); ...
#include <algorithm> #include <iostream> using namespace std; main() { int data1[10], data2[10]; while (cin >> data1[0]) { for (int i = 1; i < 10; i++) { cin >> data1[i]; } for (int i = 0; i < 10; i++) { cin >> data2[i]; } sort(data1, data1 + 10); sort(data2, data2 + 10); ...
[["-", 0, 52, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 16, 12, 103, 0, 125]]
1
140
4
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #include...
[["-", 0, 2, 3, 4, 0, 41, 64, 103, 0, 125], ["+", 0, 2, 3, 4, 0, 41, 64, 103, 0, 44], ["-", 0, 2, 3, 4, 0, 41, 75, 103, 0, 44], ["+", 0, 2, 3, 4, 0, 41, 75, 103, 0, 125]]
1
273
4
#include <algorithm> #include <cstdio> #define s(A, B) std::sort(A, B); int main() { int W[10], K[10], p; for (int i = 0; i < 20; i++) scanf("%d", &p), (i < 10) ? W[i] = p : W[i - 10] = p; s(W, W + 10); s(K, K + 10); int Wp = W[7] + W[8] + W[9], Kp = K[7] + K[8] + K[9]; printf("%d %d\n", Wp, Kp); }
#include <algorithm> #include <cstdio> #define s(A, B) std::sort(A, B); int main() { int W[10], K[10], p; for (int i = 0; i < 20; i++) scanf("%d", &p), (i < 10) ? W[i] = p : K[i - 10] = p; s(W, W + 10); s(K, K + 10); int Wp = W[7] + W[8] + W[9], Kp = K[7] + K[8] + K[9]; printf("%d %d\n", Wp, Kp); }
[["-", 0, 34, 12, 41, 75, 11, 31, 69, 28, 22], ["+", 0, 34, 12, 41, 75, 11, 31, 69, 28, 22]]
1
142
2
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { vector<int> W, K; for (int i = 0, j; i < 10; i++) { cin >> j; W.push_back(j); } for (int i = 0, j; i < 10; i++) { cin >> j; K.push_back(j); } sort(W.begin(), W.end()); sort(K.begin(), K.end()); c...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { vector<int> W, K; for (int i = 0, j; i < 10; i++) { cin >> j; W.push_back(j); } for (int i = 0, j; i < 10; i++) { cin >> j; K.push_back(j); } sort(W.begin(), W.end()); sort(K.begin(), K.end()); c...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
151
4
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; int w[10], k[10]; for (int i = 0; i < 10; i++) { cin >> a; w[i] = a; } for (int i = 0; i < 10; i++) { cin >> b; k[i] = b; } sort(w, w + 9); sort(k, k + 9); cout << w[9] + w[8] + w[7] << " " << k[9] + k...
#include <algorithm> #include <iostream> using namespace std; int main() { int a, b; int w[10], k[10]; for (int i = 0; i < 10; i++) { cin >> a; w[i] = a; } for (int i = 0; i < 10; i++) { cin >> b; k[i] = b; } sort(w, w + 10); sort(k, k + 10); cout << w[9] + w[8] + w[7] << " " << k[9] +...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
143
4
/* 0533:Contest */ #include <iostream> #include <queue> using namespace std; int main(void) { priority_queue<int> W; priority_queue<int> K; int WP, KP, tops[2][3]; for (int i = 0; i < 10; i++) { int p; cin >> p; W.push(p); } for (int j = 0; j < 3; j++) { tops[0][j] = W.top(); ...
/* 0533:Contest */ #include <iostream> #include <queue> using namespace std; int main(void) { priority_queue<int> W; priority_queue<int> K; int WP, KP, tops[2][3]; for (int i = 0; i < 10; i++) { int p; cin >> p; W.push(p); } for (int j = 0; j < 3; j++) { tops[0][j] = W.top(); ...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 0, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
238
4
W = [] K = [] for i in range(10): W.append(int(input())) for i in range(10): K.append(int(input())) W.sort(reverse=True) K.sort(reverse=True) print(W[0] + W[1] + W[2]) print(K[0] + K[1] + K[2])
W = [] K = [] for i in range(10): W.append(int(input())) for i in range(10): K.append(int(input())) W.sort(reverse=True) K.sort(reverse=True) print(W[0] + W[1] + W[2] , K[0] + K[1] + K[2])
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21]]
5
96
4