problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p01086
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int n; int d_words[5] = {5, 7, 5, 7, 7}; while (cin >> n && n != 0) { int *n_words = new int[n]; for (int i = 0; i < n; i++) { string str; cin >> str; n_words[i] = str.size(); } int start = 0; int succes...
#include <iostream> #include <string> using namespace std; int main() { int n; int d_words[5] = {5, 7, 5, 7, 7}; while (cin >> n && n != 0) { int *n_words = new int[n]; for (int i = 0; i < n; i++) { string str; cin >> str; n_words[i] = str.size(); } int start = 0; int succes...
insert
24
24
24
25
-11
p01087
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define all(x) (...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define all(x) (...
replace
31
32
31
32
0
p01087
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b) for (int i = a; i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b) for (int i = a; i...
replace
53
54
53
54
0
p01087
C++
Runtime Error
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; typedef vector<pair<int, string>> vpis; int parse(const vpis &v, int l, int r) { if (v[l].second != "+" && v[l].second != "*") return strtol(v[l].second.c_str(), NULL, 10); int unit = v[l].second ==...
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <vector> using namespace std; typedef vector<pair<int, string>> vpis; int parse(const vpis &v, int l, int r) { if (v[l].second != "+" && v[l].second != "*") return strtol(v[l].second.c_str(), NULL, 10); int unit = v[l].second ==...
replace
14
15
14
15
-11
p01087
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long int; using ui64 = unsigned long long int; //////// using pic = pair<int, char>; #define mp make_pair using psic = pair<stack<int>, char>; pic parse(string &s) { return make_pair(s.length() - 1, s[s.length() - 1]); } void calc(deque<psic> &q, int ...
#include <bits/stdc++.h> using namespace std; using i64 = long long int; using ui64 = unsigned long long int; //////// using pic = pair<int, char>; #define mp make_pair using psic = pair<stack<int>, char>; pic parse(string &s) { return make_pair(s.length() - 1, s[s.length() - 1]); } void calc(deque<psic> &q, int ...
replace
73
74
73
74
0
0 9 0 + 1 1 1 2 1 3 0 + 1 0 1 + 2 * 3 1 3 * 4 1 4 2 2 0 0 + 1 + 2 6 2 2 1 + 2 1 2 * 3 7 3 6 1 3
p01087
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int n; string s[10]; int calc(int a, int b, bool m) { int res = m; for (int i = b; i < n; i++) { if (s[i].size() <= a) break; if ('0' <= s[i][a] && s[i][a] <= '9') { if (m) res *= s[i][a] - '0'; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int n; string s[50]; int calc(int a, int b, bool m) { int res = m; for (int i = b; i < n; i++) { if (s[i].size() <= a) break; if ('0' <= s[i][a] && s[i][a] <= '9') { if (m) res *= s[i][a] - '0'; ...
replace
5
6
5
6
0
p01087
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { static auto add = [](int a, int b) { return a + b; }; static auto mul = [](int a, int b) { return a * b; }; int n; while (cin >> n, n) { vector<string> a(n); for (auto &e : a) { cin >> e; } a.push_back("0"); vector<pair<functi...
#include <bits/stdc++.h> using namespace std; int main() { static auto add = [](int a, int b) { return a + b; }; static auto mul = [](int a, int b) { return a * b; }; int n; while (cin >> n, n) { vector<string> a(n); for (auto &e : a) { cin >> e; } a.push_back("0"); vector<pair<functi...
replace
16
19
16
19
-6
terminate called after throwing an instance of 'std::bad_function_call' what(): bad_function_call
p01088
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; const int INF = 5000 * 100 * 3; const int max_x = 102; const int max_y = 25000; int dp[max_x + 10][max_y + 10]; void solve(int n) { // init for (int j = 0; j < max_x + 10; j++) for (int k = 0; k < max_y + 10; k++) ...
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; const int INF = 5000 * 100 * 3; const int max_x = 102; const int max_y = 12000; int dp[max_x + 10][max_y + 10]; void solve(int n) { // init for (int j = 0; j < max_x + 10; j++) for (int k = 0; k < max_y + 10; k++) ...
replace
8
9
8
9
TLE
p01088
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long long LL; typedef pair<int, int> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; con...
#include <bits/stdc++.h> using namespace std; #define fs first #define sc second #define mp make_pair #define pb push_back #define eb emplace_back #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() typedef long long LL; typedef pair<int, int> P; const LL mod = 1e9 + 7; const LL LINF = 1LL << 62; con...
replace
15
16
15
16
0
p01088
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (int)(k); i < (int)(n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) a.begin(), a.end() #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(10) typedef long long ll; typedef long double ld; typedef vector<int> v...
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (int)(k); i < (int)(n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) a.begin(), a.end() #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(10) typedef long long ll; typedef long double ld; typedef vector<int> v...
replace
47
48
47
48
TLE
p01088
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define M 25000 int dp[2][101][M]; int main() { int n; while (cin >> n, n) { int p[100], pp[100]; for (int i = 0; i < n; i++) scanf("%d", &p[i]), pp[i] = (1000 - p[i] % 1000) % 1000; for (int i = 0; i < 2; i++) for (int j = 0; j <= n; j++) ...
#include <bits/stdc++.h> using namespace std; #define M 25000 int dp[2][101][M]; int main() { int n; while (cin >> n, n) { int p[100], pp[100]; for (int i = 0; i < n; i++) scanf("%d", &p[i]), pp[i] = (1000 - p[i] % 1000) % 1000; for (int i = 0; i < 2; i++) for (int j = 0; j <= n; j++) ...
delete
37
38
37
37
TLE
p01088
C++
Runtime Error
#include <bits/stdc++.h> #define INF 100000000 using namespace std; typedef long long ll; typedef pair<int, int> P; int n; int p[101]; P dp[101][50001]; P max_get(P a, P b) { if (a.first > b.first) { return a; } if (a.first < b.first) { return b; } return (a.second <= b.second) ? a : b; } int main(...
#include <bits/stdc++.h> #define INF 100000000 using namespace std; typedef long long ll; typedef pair<int, int> P; int n; int p[101]; P dp[101][50001]; P max_get(P a, P b) { if (a.first > b.first) { return a; } if (a.first < b.first) { return b; } return (a.second <= b.second) ? a : b; } int main(...
replace
29
30
29
30
0
p01088
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { const int BIG = 1000000; const int CMAX = 25000; for (;;) { int n; cin >> n; if (n == 0) break; vector<int> ps; for (int i = 0; i < n; i++) { int p; cin >> p; ps.push_back(p); ...
#include <iostream> #include <vector> using namespace std; int main(int argc, char *argv[]) { const int BIG = 1000000; const int CMAX = 20000; for (;;) { int n; cin >> n; if (n == 0) break; vector<int> ps; for (int i = 0; i < n; i++) { int p; cin >> p; ps.push_back(p); ...
replace
5
6
5
6
TLE
p01088
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long #define reps(i, s, n) for (int(i) = (s); (i) < (n); ++(i)) #define rep(i, n) reps(i, 0, n) #define rept(i, n) rep(i, (n) + 1) #define repst(i, s, n) reps(i, s, (n) + 1) #define reprt(i, n, t) for (int(i) = (n); (i) >= (t); --(i)) #define repr(i, n)...
#include <bits/stdc++.h> using namespace std; // #define int long long #define reps(i, s, n) for (int(i) = (s); (i) < (n); ++(i)) #define rep(i, n) reps(i, 0, n) #define rept(i, n) rep(i, (n) + 1) #define repst(i, s, n) reps(i, s, (n) + 1) #define reprt(i, n, t) for (int(i) = (n); (i) >= (t); --(i)) #define repr(i, n)...
replace
88
89
88
89
0
p01088
C++
Runtime Error
#include <iostream> #include <utility> #include <vector> using namespace std; struct Info { int mai; int cost; bool operator<(const Info &i) const { return (mai != i.mai) ? mai > i.mai : cost < i.cost; } bool operator==(const Info &i) const { return mai == i.mai and cost == i.cost; } Info operato...
#include <iostream> #include <utility> #include <vector> using namespace std; struct Info { int mai; int cost; bool operator<(const Info &i) const { return (mai != i.mai) ? mai > i.mai : cost < i.cost; } bool operator==(const Info &i) const { return mai == i.mai and cost == i.cost; } Info operato...
replace
22
23
22
23
0
p01089
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (i = 0; i < (n); i++) using namespace std; int n; string s; bool dp[1024][1025]; // dp[S][T] = (ロック資源の集合がS, // 待ち資源の集合がT)になることがあるか bool solve() { int i, j, k, l; int locked = 0, waiting = 0; rep(i, s.length())...
#include <algorithm> #include <iostream> #include <string> #define rep(i, n) for (i = 0; i < (n); i++) using namespace std; int n; string s; bool dp[1024][1025]; // dp[S][T] = (ロック資源の集合がS, // 待ち資源の集合がT)になることがあるか bool solve() { int i, j, k, l; int locked = 0, waiting = 0; rep(i, s.length())...
insert
40
40
40
43
TLE
p01089
C++
Time Limit Exceeded
#include <bitset> #include <iostream> #include <string> #include <vector> using namespace std; int n; bool ok[1028]; string s; int main() { while (cin >> n, n) { cin >> s; bool flag = false; for (int i = 1; i < 1024; i++) { for (int j = 0; j < 1024; j++) ok[j] = false; int bit = 0; ...
#include <bitset> #include <iostream> #include <string> #include <vector> using namespace std; int n; bool ok[1028]; string s; int main() { while (cin >> n, n) { cin >> s; bool flag = false; for (int i = 1; i < 1024; i++) { for (int j = 0; j < 1024; j++) ok[j] = false; int bit = 0; ...
replace
26
27
26
27
TLE
p01089
C++
Time Limit Exceeded
#include <iostream> #include <set> #include <utility> #include <vector> using namespace std; int main() { int n; while (cin >> n && n != 0) { string s; cin >> s; set<pair<int, int>> st; int tmp = 0; bool flag = 0; for (int i = 0; i < n; i++) { if (s[i] == 'u') { tmp = 0; ...
#include <iostream> #include <set> #include <utility> #include <vector> using namespace std; int main() { int n; while (cin >> n && n != 0) { string s; cin >> s; set<pair<int, int>> st; int tmp = 0; bool flag = 0; for (int i = 0; i < n; i++) { if (s[i] == 'u') { tmp = 0; ...
delete
33
34
33
33
TLE
p01089
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define DEBUG(x) cerr << #x << " = " << x << endl vector<string> parse(const string &s) { vector<string> ret; string buf; REP(i, s.size()) { if (s[i] == 'u') { ret.push_back(buf); ...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define DEBUG(x) cerr << #x << " = " << x << endl vector<string> parse(const string &s) { vector<string> ret; string buf; REP(i, s.size()) { if (s[i] == 'u') { ret.push_back(buf); ...
insert
88
88
88
90
TLE
p01089
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n; set<int> dp[1 << 11]; int main(voi...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n; set<int> dp[1 << 11]; int main(voi...
insert
49
49
49
51
TLE
p01090
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Int = long long; struct Kruskal { struct UnionFind { Int n; vector<Int> r, p; UnionFind() {} UnionFind(Int sz) : n(sz), r(sz, 1), p(sz, 0) { iota(p.begin(), p.end(), 0); } Int find(Int x) { return (x == p[x] ? x : p[x] = find(p[x])); ...
#include <bits/stdc++.h> using namespace std; using Int = long long; struct Kruskal { struct UnionFind { Int n; vector<Int> r, p; UnionFind() {} UnionFind(Int sz) : n(sz), r(sz, 1), p(sz, 0) { iota(p.begin(), p.end(), 0); } Int find(Int x) { return (x == p[x] ? x : p[x] = find(p[x])); ...
replace
115
117
115
116
-6
99d5f2a9-5c71-46fc-9ff5-85121f49a169.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p01090/C++/s036048471.cpp:108: int main(): Assertion `check(l)==k' failed.
p01090
C++
Runtime Error
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (i...
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = (i...
replace
131
132
131
134
0
p01093
C++
Runtime Error
#include <iostream> using namespace std; int abs(int x) { if (x >= 0) return x; else return -x; } int main(void) { while (true) { int n; cin >> n; if (n == 0) break; int a[n]; for (size_t i = 0; i < n; i++) cin >> a[i]; int min = 1000000; for (size_t i = 0; i < n...
#include <iostream> using namespace std; int abs(int x) { if (x >= 0) return x; else return -x; } int main(void) { while (true) { int n; cin >> n; if (n == 0) break; int a[n]; for (size_t i = 0; i < n; i++) cin >> a[i]; int min = 1000000; for (size_t i = 0; i < n...
replace
32
33
32
33
1
p01093
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int m, nmin, nmax, ans, gap; int a[201]; int main() { while (1) { cin >> m; if (m == 0) break; for (int i = 0; i < m; i++) { cin >> a[i]; } sort(a, a + (m)); gap = 1000001; for (int i = 1; i < m; i++) { if (a[...
#include <algorithm> #include <iostream> using namespace std; int m, nmin, nmax, ans, gap; int a[1001]; int main() { while (1) { cin >> m; if (m == 0) break; for (int i = 0; i < m; i++) { cin >> a[i]; } sort(a, a + (m)); gap = 1000001; for (int i = 1; i < m; i++) { if (a...
replace
5
6
5
6
0
p01093
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int t, n, k, x, ans, a; while (1) { vector<int> point; cin >> n; for (int i = 0; i < n; ++i) { cin >> x; point.push_back(x); } sort(point.begin(), point.end()); reverse(point.begin()...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int t, n, k, x, ans, a; while (1) { vector<int> point; cin >> n; if (n == 0) { break; } for (int i = 0; i < n; ++i) { cin >> x; point.push_back(x); } sort(point.begin(), p...
insert
12
12
12
16
-11
p01093
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
insert
23
23
23
25
TLE
p01094
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) using namespace ...
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) using namespace ...
replace
33
34
33
34
0
p01094
C++
Runtime Error
#include <iostream> using namespace std; int main() { while (true) { int n; cin >> n; if (n == 0) break; int c[n]; for (int i = 0; i < n; i++) { cin >> c[i]; } int can[26] = {0}; //????£????(candidate)????\¨??° for (int i = 0; i < n; i++) { can[(int)(c[i] - 'A')]+...
#include <iostream> using namespace std; int main() { while (true) { int n; cin >> n; if (n == 0) break; char c[n]; for (int i = 0; i < n; i++) { cin >> c[i]; } int can[26] = {0}; //????£????(candidate)????\¨??° for (int i = 0; i < n; i++) { can[(int)(c[i] - 'A')]...
replace
10
11
10
11
-11
p01094
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { while (1) { int n; cin >> n; char c[100]; for (int i = 0; i < n; i++) { cin >> c[i]; } int cnt[26] = {0}; for (int i = 0; i < n; i++) { cnt[(int)(c[i] - 'A')]++; int max1 = -1; int max2 = -1; for (int...
#include <iostream> using namespace std; int main() { while (1) { int n; cin >> n; if (n == 0) break; char c[100]; for (int i = 0; i < n; i++) { cin >> c[i]; } int cnt[26] = {0}; for (int i = 0; i < n; i++) { cnt[(int)(c[i] - 'A')]++; int max1 = -1; ...
insert
7
7
7
10
TLE
p01095
C++
Time Limit Exceeded
// clang-format off #include <bits/stdc++.h> using namespace std; #define int long long #define main signed main() #define loop(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) loop(i, 0, n) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define prec(n) fixed << setprecision(n)...
// clang-format off #include <bits/stdc++.h> using namespace std; #define int long long #define main signed main() #define loop(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) loop(i, 0, n) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define prec(n) fixed << setprecision(n)...
replace
36
37
36
37
TLE
p01095
C++
Runtime Error
#include <stdio.h> #include <stdlib.h> #define MAX 7368791 int main(void) { int m, n; int year[MAX]; while (1) { scanf("%d %d", &m, &n); if (m == 0 && n == 0) break; for (int i = 0; i < MAX; i++) year[i] = false; int seed = 0; for (int i = m; i <= MAX; i++) { if (!year[i...
#include <stdio.h> #include <stdlib.h> #define MAX 7368791 int main(void) { int m, n; bool year[MAX]; while (1) { scanf("%d %d", &m, &n); if (m == 0 && n == 0) break; for (int i = 0; i < MAX; i++) year[i] = false; int seed = 0; for (int i = m; i <= MAX; i++) { if (!year[...
replace
7
8
7
8
-11
p01095
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <float.h> #include <functional> #include <iostream> #include <map> #include <sstream> #include <string> #include <unordered_map> #include <vector> using namespace std; #define INT_MAX 2147483647 bool f[INT_MAX]; void del_flag(int m) { int tmp = m; while (tmp < INT_MA...
#include <algorithm> #include <cmath> #include <float.h> #include <functional> #include <iostream> #include <map> #include <sstream> #include <string> #include <unordered_map> #include <vector> using namespace std; void A(); void B(); #define INT_MAX 7368793 bool f[INT_MAX]; void del_flag(int m) { int tmp = m; wh...
replace
12
13
12
15
MLE
p01095
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define pb push_back #define all(r) (r).begin(), (r).end() #define rall(r) (r).rbegin(), (r).rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; t...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define pb push_back #define all(r) (r).begin(), (r).end() #define rall(r) (r).rbegin(), (r).rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; t...
replace
28
29
28
29
TLE
p01095
C++
Runtime Error
#include <bits/stdc++.h> bool ok[7368792]; int main() { int m, n; while (scanf("%d%d", &m, &n), m) { memset(ok, 0, sizeof(ok)); int cnt = 0; for (int i = m;; i++) { if (!ok[i]) continue; if (++cnt > n) { printf("%d\n", i); break; } for (int j = i; j <= 736...
#include <bits/stdc++.h> bool ok[7368792]; int main() { int m, n; while (scanf("%d%d", &m, &n), m) { memset(ok, 0, sizeof(ok)); int cnt = 0; for (int i = m;; i++) { if (ok[i]) continue; if (++cnt > n) { printf("%d\n", i); break; } for (int j = i; j <= 7368...
replace
8
9
8
9
-11
p01095
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; int MAX = 736891; int main() { int n, m; bool f[MAX + 1]; while (1) { cin >> m >> n; if (m + n == 0) break; REP(i, MAX + 1) f[i] = false; for (int i = m;; i++) { if (!f[i]) { if (n == ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; int MAX = 7368791; int main() { int n, m; bool f[MAX + 1]; while (1) { cin >> m >> n; if (m + n == 0) break; REP(i, MAX + 1) f[i] = false; for (int i = m;; i++) { if (!f[i]) { if (n ==...
replace
3
4
3
4
-11
p01095
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define N 8000000 using namespace std; int prime[N] = {0}; int n, m, now = 0; int sprime() { int i, j; for (i = n; i < N; ++i) if (prime[i] == 0) { if (now == m) return i; ++now; for (j = 1; i * j < N; ++j) prime[i * j] = 1; } return 0; } int m...
#include <bits/stdc++.h> #define N 8000000 using namespace std; int prime[N] = {0}; int n, m, now = 0; int sprime() { int i, j; for (i = n; i < N; ++i) if (prime[i] == 0) { if (now == m) return i; ++now; for (j = 1; i * j < min(N, m * 1000); ++j) prime[i * j] = 1; } ret...
replace
14
15
14
15
TLE
p01095
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <set> #include <string> using namespace std; bool a[7368800]; int main() { int m = 3, n = 1; while (/*cin >>m>> n&&*/ n != 0 && m != 0) { int sum = m, n2 = n; fill(a, a + 7368800, false); while (n2 != 0 || a[sum]) { if (!a[sum]) { a[sum] = ...
#include <algorithm> #include <iostream> #include <set> #include <string> using namespace std; bool a[7368800]; int main() { int m = 3, n = 1; while (cin >> m >> n && n != 0 && m != 0) { int sum = m, n2 = n; fill(a, a + 7368800, false); while (n2 != 0 || a[sum]) { if (!a[sum]) { a[sum] = t...
replace
8
9
8
9
TLE
p01095
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; typedef pair<int, P> PP; bool memo[8000000]; int m, n; void furui(int n, int count) { fill(memo...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; typedef pair<int, P> PP; bool memo[8000000]; int m, n; void furui(int n, int count) { fill(memo...
replace
49
50
49
50
0
p01095
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long long int a[10000000] = {}; int main() { const long long int mod = 1000000007; map<long lo...
#include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; int a[10000000] = {}; int main() { const long long int mod = 1000000007; map<long long int, lo...
replace
12
13
12
13
TLE
p01095
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int m, n; while (cin >> m >> n, m) { bool s[7654321] = {}; int i = m, j = 0, k; for (; j <= n; i++) if (!s[i] && j != n) for (k = 2, j++; i * k < 7654321; k++) s[i * k] = 1; cout << i - 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int m, n; while (cin >> m >> n, m) { bool s[7654321] = {}; int i = m, j = 0, k; for (; j <= n; i++) if (!s[i]) for (k = 2, j++; i * k < 7654321; k++) s[i * k] = 1; cout << i - 1 << endl; } return 0; }
replace
8
9
8
9
-11
p01095
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int MAX_N = 1e7; int primes[MAX_N + 1]; // i????´???°??????true int main() { cin.tie(0); ios::sync_with_stdio(false); while (true) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; for (int i = 0; i < MAX_N; i++) primes[i] =...
#include <bits/stdc++.h> using namespace std; const int MAX_N = 7.4 * 1e6; int primes[MAX_N + 1]; // i????´???°??????true int main() { cin.tie(0); ios::sync_with_stdio(false); while (true) { int m, n; cin >> m >> n; if (m == 0 && n == 0) break; for (int i = 0; i < MAX_N; i++) prime...
replace
4
5
4
5
TLE
p01095
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; bool e[7368792]; int main() { while (true) { int m, n; cin >> m >> n; if (m + n == 0) { break; } memset(e, false, sizeof(e)); int count = 0; for (int i = m; count < n; i++) { if (!e[i]) { count++; } for (int ...
#include <bits/stdc++.h> using namespace std; bool e[7368792]; int main() { while (true) { int m, n; cin >> m >> n; if (m + n == 0) { break; } memset(e, false, sizeof(e)); int count = 0; for (int i = m; count < n; i++) { if (!e[i]) { count++; } else { ...
insert
19
19
19
21
TLE
p01095
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int m, n; while (cin >> m >> n, m) { vector<int> goodyear(7368792, 0); int cnt = 0; int res = -1; for (int i = m;; i++) { if (goodyear[i] == 0) { if (cnt == n) { res = i; break; } else { c...
#include <bits/stdc++.h> using namespace std; int main() { int m, n; while (cin >> m >> n, m) { vector<int> goodyear(7368792, 0); int cnt = 0; int res = -1; for (int i = m;; i++) { if (goodyear[i] == 0) { if (cnt == n) { res = i; break; } else { c...
replace
16
17
16
17
-11
p01095
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #define MAX (7368791 + 1) using namespace std; bool a[MAX]; int main(void) { int m, n; while (cin >> m >> n, m || n) { fill(a, a + MAX, true); int count = 0; for (int i = m; i < MAX; i++) { if (a[i] == true) { if (count == n) { cout <<...
#include <algorithm> #include <iostream> #define MAX (7368791 + 1) using namespace std; bool a[MAX]; int main(void) { int m, n; while (cin >> m >> n, m || n) { fill(a, a + MAX, true); int count = 0; for (int i = m; i < MAX; i++) { if (a[i] == true) { if (count == n) { cout <<...
delete
27
29
27
27
TLE
p01096
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) using namespace std; int n; vector<int> w; int dp[310][310]; int calc(int l, int r) { if (dp[l][r] != -1) return dp[l][r]; if (l + 1 >= r) return dp[l][r] = 0; int res = 0; rep(i, l, r - 1) { rep(j, i + 1, r) { int tmp...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) using namespace std; int n; vector<int> w; int dp[310][310]; int calc(int l, int r) { if (dp[l][r] != -1) return dp[l][r]; if (l + 1 >= r) return dp[l][r] = 0; int res = 0; rep(i, l, r) { int tmp = 0; int cent = calc(l +...
replace
14
24
14
22
TLE
p01096
C++
Runtime Error
// #define __USE_MINGW_ANSI_STDIO 0 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #def...
// #define __USE_MINGW_ANSI_STDIO 0 #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; typedef vector<VL> VVL; typedef pair<int, int> PII; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #def...
insert
39
39
39
41
0
p01096
C++
Runtime Error
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <cctype> #include <cmath> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <list> #include <stdio.h> #include <string.h> #include <cstdlib> #include <math.h> #include <bitse...
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <cctype> #include <cmath> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <list> #include <stdio.h> #include <string.h> #include <cstdlib> #include <math.h> #include <bitse...
insert
60
60
60
62
0
p01096
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <utility> #include ...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <cstdio> #include <fstream> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <utility> #include ...
replace
43
44
43
44
0
p01096
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
replace
84
85
84
85
-11
p01096
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; inline int abs(int a, int b) { return a < b ? b - a : a - b; } int w[301]; bool rm[301][301]; int rmct[301][301]; int main() { int n; while (cin >> n, n) { for (int i = 0; i < n; i++) cin >> w[i]; for (int i = 0; i <= n; i++) for (int j = 0; j <=...
#include <bits/stdc++.h> using namespace std; inline int abs(int a, int b) { return a < b ? b - a : a - b; } int w[301]; bool rm[301][301]; int rmct[301][301]; int main() { int n; while (cin >> n, n) { for (int i = 0; i < n; i++) cin >> w[i]; for (int i = 0; i <= n; i++) for (int j = 0; j <=...
replace
47
48
47
48
0
p01096
C++
Runtime Error
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; bool check(int a, int b) { return abs(a - b) <= 1; } int main() { int n; wh...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; bool check(int a, int b) { return abs(a - b) <= 1; } int main() { int n; wh...
insert
19
19
19
21
0
p01096
C++
Runtime Error
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 using namespace std; int main() { int N, data[301]; bool **table = new bool *[301]; // table[left][right] = /...
#include <algorithm> #include <cmath> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 using namespace std; int main() { int N, data[301]; bool **table = new bool *[301]; // table[left][right] = /...
replace
89
90
89
91
0
p01096
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(), (a).end() #define ll...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); i++) #define PB push_back #define MP make_pair #define ALL(a) (a).begin(), (a).end() #define ll...
insert
36
36
36
38
TLE
p01096
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define pb push_back #define all(r) r.begin(), r.end() #define rall(r) r.rbegin(), r.rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef v...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (int i = (s); i < (int)(e); i++) #define pb push_back #define all(r) r.begin(), r.end() #define rall(r) r.rbegin(), r.rend() #define fi first #define se second typedef long long ll; typedef vector<int> vi; typedef v...
replace
61
62
61
62
TLE
p01097
C++
Runtime Error
#include <bits/stdc++.h> #define INF 1000000000000007LL using namespace std; typedef long long ll; typedef pair<int, ll> P; int n, k, s; vector<P> G[101]; bool flag[101]; int x[101], y[101], z[101]; int cnt = 0; ll sum = 0; bool check(int i, int j) { if (x[i] + s <= x[j] || x[j] + s <= x[i]) return false; if...
#include <bits/stdc++.h> #define INF 1000000000000007LL using namespace std; typedef long long ll; typedef pair<int, ll> P; int n, k, s; vector<P> G[2001]; bool flag[2001]; int x[2001], y[2001], z[2001]; int cnt = 0; ll sum = 0; bool check(int i, int j) { if (x[i] + s <= x[j] || x[j] + s <= x[i]) return false;...
replace
8
11
8
11
0
p01100
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct Dinic { struct edge { int to, cap, rev; }; vector<vector<edge>> graph; vector<int> min_cost, iter; Dinic(int n) { graph.resize(n); } void add_edge(int from, int to, int cap) { graph[from].push_back((edge){to, cap, (i...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; struct Dinic { struct edge { int to, cap, rev; }; vector<vector<edge>> graph; vector<int> min_cost, iter; Dinic(int n) { graph.resize(n); } void add_edge(int from, int to, int cap) { graph[from].push_back((edge){to, cap, (i...
replace
70
71
70
71
0
p01101
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m; while (cin >> m >> n, n || m) { vector<int> data(n); for (int i = 0; i < n; i++) { // input cin >> data[i]; } int max = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m; while (cin >> n >> m, n || m) { vector<int> data(n); for (int i = 0; i < n; i++) { // input cin >> data[i]; } int max = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n...
replace
8
9
8
9
TLE
p01101
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FI first #define SE second #define VE vector<int> #define PB push_back #define PA pair<int, int> #define MA make_pair #define LL long long #define FOR(...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define FI first #define SE second #define VE vector<int> #define PB push_back #define PA pair<int, int> #define MA make_pair #define LL long long #define FOR(...
replace
41
42
41
42
0
p01101
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, MAX = 0, SUM; int a, size; vector<int> v; while (cin >> n >> m, n) { for (int i = 0; i < n; i++) { cin >> a; v.push_back(a); } for (int i = 0; i < v.size(); i++) { for (int j ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, m, MAX = 0, SUM; int a, size; vector<int> v; while (cin >> n >> m, n) { int MAX = 0, SUM, a, size; vector<int> v; for (int i = 0; i < n; i++) { cin >> a; v.push_back(a); } for...
insert
11
11
11
14
TLE
p01101
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> #define INF 2147483647 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; int main() { int n, m; while (cin >> n >> m, ...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <string> #include <utility> #include <vector> #define INF 2147483647 #define pb push_back #define mp make_pair #define F first #define S second #define ll long long using namespace std; int main() { int n, m; while (cin >> n >> m, ...
delete
18
19
18
18
TLE
p01102
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S, T; while (cin >> S, S != ".") { cin >> T; int beet = 0; string latte, malta; vector<string> oi, ushi; for (int i = 0; i < S.size(); i++) { if (beet % 2 == 0) latte += S[i], oi.push_back(""); else o...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; while (cin >> S, S != ".") { cin >> T; int beet = 0; string latte, malta; vector<string> oi, ushi; for (int i = 0; i < S.size(); i++) { if (beet % 2 == 0) latte += S[i], oi.push_back(""); else o...
replace
31
33
31
34
0
p01102
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { while (1) { string s1; cin >> s1; if (s1 == ".") break; string s2; cin >> s2; if (s1 == s2) { cout << "IDENTICAL" << endl; continue; } string t1 = s1; string t2 = s2; while (1) { ...
#include <iostream> #include <string> using namespace std; int main() { while (1) { string s1; cin >> s1; if (s1 == ".") break; string s2; cin >> s2; if (s1 == s2) { cout << "IDENTICAL" << endl; continue; } string t1 = s1; string t2 = s2; while (1) { ...
replace
37
38
37
38
0
p01102
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) rep(i, 0, n) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define int long long #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) using namespace std; typedef pair<int, i...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) rep(i, 0, n) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define int long long #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) using namespace std; typedef pair<int, i...
replace
42
43
42
43
0
p01104
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(obj) obj.begin(), obj.end() #define fcout cout << setprecision(10) const int iINF = 1e9; const long long llINF = 1e18; const int MOD = 1e9 + 7; using namespace std; template <typename T> void debug(vector<T> &vec) { for (auto x : v...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(obj) obj.begin(), obj.end() #define fcout cout << setprecision(10) const int iINF = 1e9; const long long llINF = 1e18; const int MOD = 1e9 + 7; using namespace std; template <typename T> void debug(vector<T> &vec) { for (auto x : v...
replace
33
34
33
34
MLE
p01104
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int fie[501][501]; int dp[60][1 << 21]; int dp2[501][1 << 11]; int res = 0; int used[501]; void dfs(int v, int c, int bit) { if (v == n) { for (int i = 0; i < m; i++) { int cnt = 0; for (int j = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int n, m; int fie[501][501]; int dp[51][1 << 20]; int dp2[501][1 << 11]; int res = 0; int used[501]; void dfs(int v, int c, int bit) { if (v == n) { for (int i = 0; i < m; i++) { int cnt = 0; for (int j = ...
replace
7
8
7
8
MLE
p01104
C++
Time Limit Exceeded
#include <iostream> #include <string> #include <vector> using namespace std; int main(int argc, char *argv[]) { for (;;) { int n, m; cin >> n >> m; if (n == 0 && m == 0) break; vector<vector<bool>> bs; for (int i = 0; i < n; i++) { string str; cin >> str; vector<bool> v; ...
#include <iostream> #include <string> #include <vector> using namespace std; int main(int argc, char *argv[]) { for (;;) { int n, m; cin >> n >> m; if (n == 0 && m == 0) break; vector<vector<bool>> bs; for (int i = 0; i < n; i++) { string str; cin >> str; vector<bool> v; ...
replace
20
21
20
21
TLE
p01104
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(obj) obj.begin(), obj.end() #define fcout cout << setprecision(10) const int iINF = 1e9; const long long llINF = 1e18; const int MOD = 1e9 + 7; using namespace std; template <typename T> void debug(vector<T> &vec) { for (auto x : v...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define ALL(obj) obj.begin(), obj.end() #define fcout cout << setprecision(10) const int iINF = 1e9; const long long llINF = 1e18; const int MOD = 1e9 + 7; using namespace std; template <typename T> void debug(vector<T> &vec) { for (auto x : v...
replace
33
34
33
34
MLE
p01104
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { for (int N, M;;) { cin >> N >> M; if (N == 0 and M == 0) { break; } if (N <= 25) { vector<vector<int>> b(N, vector<int>(M)); for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { char c; cin ...
#include <bits/stdc++.h> using namespace std; int main() { for (int N, M;;) { cin >> N >> M; if (N == 0 and M == 0) { break; } if (N <= 20) { vector<vector<int>> b(N, vector<int>(M)); for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { char c; cin ...
replace
8
9
8
9
TLE
p01104
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #...
#include <algorithm> #include <bitset> #include <climits> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #...
replace
76
77
76
77
TLE
p01104
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } tem...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } tem...
replace
65
66
65
66
0
p01104
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } tem...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } tem...
replace
65
66
65
66
0
p01104
C++
Time Limit Exceeded
#include <bits/stdc++.h> using Int = int64_t; const Int inf = 1LL << 53; int main() { for (;;) { Int n, m; std::cin >> n >> m; if (n == 0 && m == 0) { break; } auto xss = std::vector<std::string>(n); for (Int i = 0; i < n; ++i) { std::string ss; std::cin >> ss; xss[i] ...
#include <bits/stdc++.h> using Int = int64_t; const Int inf = 1LL << 53; int main() { for (;;) { Int n, m; std::cin >> n >> m; if (n == 0 && m == 0) { break; } auto xss = std::vector<std::string>(n); for (Int i = 0; i < n; ++i) { std::string ss; std::cin >> ss; xss[i] ...
replace
17
18
17
18
TLE
p01105
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <cassert> #include <functi...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <cassert> #include <functi...
replace
125
126
125
126
0
117 : vec[i].size() = 6 117 : vec[i].size() = 6 117 : vec[i].size() = 6 117 : vec[i].size() = 78 117 : vec[i].size() = 150 117 : vec[i].size() = 294 117 : vec[i].size() = 438 117 : vec[i].size() = 1518 117 : vec[i].size() = 4326 117 : vec[i].size() = 10662 117 : vec[i].size() = 22182 117 : vec[i].size() = 63150 117 : v...
p01105
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) int parse(string &s, int &p) { if (s[p] == '(') { p++; int x = parse(s, p); char op = s[p++]; int y = parse(s, p); p++; if (op == '^') { return x ^ y; } else { return x & y; } ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) int parse(string &s, int &p) { if (s[p] == '(') { p++; int x = parse(s, p); char op = s[p++]; int y = parse(s, p); p++; if (op == '^') { return x ^ y; } else { return x & y; } ...
replace
107
108
107
108
TLE
p01108
C++
Time Limit Exceeded
#include <iostream> #include <math.h> #define eps 1e-9 using namespace std; struct vec2d { double x, y; vec2d() {} vec2d(double x, double y) { this->x = x, this->y = y; } double add(double a, double b) { if (fabs(a + b) < eps * (fabs(a) + fabs(b))) return 0.0; return a + b; } vec2d operator+...
#include <iostream> #include <math.h> #define eps 1e-9 using namespace std; struct vec2d { double x, y; vec2d() {} vec2d(double x, double y) { this->x = x, this->y = y; } double add(double a, double b) { if (fabs(a + b) < eps * (fabs(a) + fabs(b))) return 0.0; return a + b; } vec2d operator+...
replace
73
74
73
78
TLE
p01110
C++
Runtime Error
#define _USE_MA_DEFINES #include <bits/stdc++.h> #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define Rep(i, a, b) for (int i = a; i < b; i++) #define REP(i, a, b) for (int i = a; i <= b; i++) #define rev(i, n) for (int i = n - 1; i >= 0; i--) #define vi vector<int> #define vvi vector<vi> #define...
#define _USE_MA_DEFINES #include <bits/stdc++.h> #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define Rep(i, a, b) for (int i = a; i < b; i++) #define REP(i, a, b) for (int i = a; i <= b; i++) #define rev(i, n) for (int i = n - 1; i >= 0; i--) #define vi vector<int> #define vvi vector<vi> #define...
replace
46
47
46
47
0
p01110
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { while (true) { int n, m, t, p; cin >> n >> m >> t >> p; if (n == 0) break; vector<vector<int>> card(300, vector<int>(300, 0)); for (int x = 0; x < n; ++x) { for (int y = 0; y < m; ++y) { card[x][y] = 1; ...
#include <iostream> #include <vector> using namespace std; int main() { while (true) { int n, m, t, p; cin >> n >> m >> t >> p; if (n == 0) break; vector<vector<int>> card(500, vector<int>(500, 0)); for (int x = 0; x < n; ++x) { for (int y = 0; y < m; ++y) { card[x][y] = 1; ...
replace
12
13
12
13
0
p01110
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, m, t, p; while (cin >> n >> m >> t >> p, n) { vector<pair<int, int>> d(t), x(p); for (auto &e : d) cin >> e.first >> e.second; for (auto &e : x) cin >> e.first >> e.second; vector<vector<int>> a(2 * m, vector<int>(2 * n)...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, t, p; while (cin >> n >> m >> t >> p, n) { vector<pair<int, int>> d(t), x(p); for (auto &e : d) cin >> e.first >> e.second; for (auto &e : x) cin >> e.first >> e.second; vector<vector<int>> a((t + 1) * m, vector<int>(...
replace
12
13
12
13
0
p01110
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define MAX_N 100 using namespace std; typedef long long ll; const int INF = 1 << 3...
#include <algorithm> #include <cmath> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define MAX_N 100 using namespace std; typedef long long ll; const int INF = 1 << 3...
replace
25
26
25
26
0
p01111
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) typedef long long ll; using namespace std; #define sum(l, r) (((r) * ((r)-1) - (l) * ((l)-1)) / 2) int main(void) { ll B; while (cin >> B, B) { for (ll w = 100000; w >= 0; w--) { ll l = 0, h = B + 1; while (h - l ...
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) typedef long long ll; using namespace std; #define sum(l, r) (((r) * ((r)-1) - (l) * ((l)-1)) / 2) int main(void) { ll B; while (cin >> B, B) { for (ll w = 65000; w >= 0; w--) { ll l = 0, h = B + 1; while (h - l >...
replace
10
11
10
11
TLE
p01111
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); cout.precision(20); } } fast; /* define */ #define FOR(I, X, Y) for (long long(I) = (X); (I) < (Y); (I)++) #define REP(I, X, Y) for (long long(I) = (Y)-1; (I) >= (X); (I)--) #define ALL(X)...
#include <bits/stdc++.h> using namespace std; struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); cout.precision(20); } } fast; /* define */ #define FOR(I, X, Y) for (long long(I) = (X); (I) < (Y); (I)++) #define REP(I, X, Y) for (long long(I) = (Y)-1; (I) >= (X); (I)--) #define ALL(X)...
replace
86
87
86
87
TLE
p01112
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; class ScoreBoard { public: // 1: win // -1: lose // enum vector<vector<int>> board; vector<int> wincounts; ScoreBoard(int N) { board = vector<vector<int>>(N, vector<int>(N)); wincounts.resize(N); } void update(int x, int y) { boar...
#include <iostream> #include <vector> using namespace std; class ScoreBoard { public: // 1: win // -1: lose // enum vector<vector<int>> board; vector<int> wincounts; ScoreBoard(int N) { board = vector<vector<int>>(N, vector<int>(N)); wincounts.resize(N); } void update(int x, int y) { boar...
replace
67
68
67
69
TLE
p01114
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int N, K; int X[10000], Y[10000]; void beet() { cin >> K; vector<int> vs; for (int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; vs.push_back(Y[i]); } double sq3 = sqrt(3); vector<int> latte(N), malta(N); iota(begin(latte), end(latte), 0); iota(begin(...
#include <bits/stdc++.h> using namespace std; int N, K; int X[10000], Y[10000]; void beet() { cin >> K; vector<int> vs; for (int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; vs.push_back(Y[i]); } double sq3 = sqrt(3); vector<int> latte(N), malta(N); iota(begin(latte), end(latte), 0); iota(begin(...
replace
48
51
48
50
0
p01125
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { bool dia[20][20] = {}; for (int i = 0, x, y; i < n; i++) { cin >> x >> y; dia[y][x] = 1; } int mo; cin >> mo; string di = "NESW"; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; for ...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { bool dia[41][41] = {}; for (int i = 0, x, y; i < n; i++) { cin >> x >> y; dia[y][x] = 1; } int mo; cin >> mo; string di = "NESW"; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; for ...
replace
5
6
5
6
0
p01125
C++
Runtime Error
#include <iostream> #include <map> using namespace std; #define N 20 int main(int argc, char const *argv[]) { int f[N][N]; int n, xj, yj; int m, d; char c; int xr, yr; int cnt; map<char, pair<int, int>> mp; mp['N'] = make_pair(0, 1); mp['E'] = make_pair(1, 0); mp['S'] = make_pair(0, -1); mp['...
#include <iostream> #include <map> using namespace std; #define N 21 int main(int argc, char const *argv[]) { int f[N][N]; int n, xj, yj; int m, d; char c; int xr, yr; int cnt; map<char, pair<int, int>> mp; mp['N'] = make_pair(0, 1); mp['E'] = make_pair(1, 0); mp['S'] = make_pair(0, -1); mp['...
replace
5
6
5
6
0
p01125
C++
Runtime Error
/* 2000:Misterious Gems */ #include <iostream> using namespace std; int main(void) { while (1) { int Map[20][20] = {0}; int cGems = 0; int point[2] = {10, 10}; int cCount; cin >> cGems; if (cGems == 0) { break; } for (int i = 0; i < cGems; i++) { int a, b; ...
/* 2000:Misterious Gems */ #include <iostream> using namespace std; int main(void) { while (1) { int Map[21][21] = {0}; int cGems = 0; int point[2] = {10, 10}; int cCount; cin >> cGems; if (cGems == 0) { break; } for (int i = 0; i < cGems; i++) { int a, b; ...
replace
9
10
9
10
0
p01125
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; int n; int m; int dx[256]; int dy[256]; int xs[256]; int ys[256]; bool field[100][100]; int main() { dx['N'] = 0; dy['N'] = 1; dx['S'] = 0; dy['S'] = -1; dx['E'] = 1; dy['E'] = 0; dx['W'] = -1; dy['W'] = 0; while (1) { scanf("%d", &n);...
#include <algorithm> #include <cstdio> using namespace std; int n; int m; int dx[256]; int dy[256]; int xs[256]; int ys[256]; bool field[100][100]; int main() { dx['N'] = 0; dy['N'] = 1; dx['S'] = 0; dy['S'] = -1; dx['E'] = 1; dy['E'] = 0; dx['W'] = -1; dy['W'] = 0; while (1) { scanf("%d", &n);...
replace
45
47
45
47
-11
p01125
C++
Runtime Error
#include <iostream> #include <stdio.h> using namespace std; struct JWE { bool f; int x; int y; }; int main() { bool ma[22][22] = {}; JWE JW[21]; int n1, n2, x1, y1, k, x = 10, y = 10; char ch; for (int i = 0; i < 22; i++) for (int j = 0; j < 22; j++) ma[i][j] = false; while (scanf("%d", &...
#include <iostream> #include <stdio.h> using namespace std; struct JWE { bool f; int x; int y; }; int main() { bool ma[22][22] = {}; JWE JW[21]; int n1, n2, x1, y1, k, x = 10, y = 10; char ch; for (int i = 0; i < 22; i++) for (int j = 0; j < 22; j++) ma[i][j] = false; while (scanf("%d", &...
replace
27
28
27
28
0
p01125
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef pair<int, int> P; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; while (cin >> n, n) { vector<P> gems; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; gems.push_back(P(x, y)); } int rx = 10, ry = 10;...
#include "bits/stdc++.h" using namespace std; typedef pair<int, int> P; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; while (cin >> n, n) { vector<P> gems; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; gems.push_back(P(x, y)); } int rx = 10, ry = 10;...
replace
21
22
21
22
0
p01125
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n; while (cin >> n, n) { bool used[21][21] = {{0}}; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; used[y][x] = 1; } int m; cin >> m; int nx = 10, ny = 10; used[ny][nx] = ...
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n; while (cin >> n, n) { bool used[21][21] = {{0}}; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; used[y][x] = 1; } int m; cin >> m; int nx = 10, ny = 10; used[ny][nx] = ...
replace
40
41
40
41
-6
*** stack smashing detected ***: terminated
p01125
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) #define RREP(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define RFOR(i, m, n) for (int i = m - 1;...
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) #define RREP(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define RFOR(i, m, n) for (int i = m - 1;...
replace
24
27
24
27
0
p01125
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--) #define al...
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--) #define al...
replace
13
15
13
15
0
p01125
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) range(i, 0, b) #define debug(x) cout << "debug" << x << endl; using namespace std...
#include <algorithm> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) range(i, 0, b) #define debug(x) cout << "debug" << x << endl; using namespace std...
replace
17
18
17
18
0
p01125
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { vector<vector<int>> g(20, vector<int>(20)); for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; g[x][y] += 1; } int r; cin >> r; int x = 10; int y = 10; int sum = 0; whi...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { vector<vector<int>> g(21, vector<int>(21)); for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; g[x][y] += 1; } int r; cin >> r; int x = 10; int y = 10; int sum = 0; whi...
replace
6
7
6
7
0
p01125
C++
Runtime Error
#include <iostream> using namespace std; int main() { int n; while (cin >> n) { if (n == 0) break; int m, count = n, p[20][20]; for (int i = 0; i < 20; ++i) for (int j = 0; j < 20; ++j) p[i][j] = 0; for (int i = 0, x, y; i < n; ++i) { cin >> x >> y; p[x][y] = 1; }...
#include <iostream> using namespace std; int main() { int n; while (cin >> n) { if (n == 0) break; int m, count = n, p[21][21]; for (int i = 0; i < 21; ++i) for (int j = 0; j < 21; ++j) p[i][j] = 0; for (int i = 0, x, y; i < n; ++i) { cin >> x >> y; p[x][y] = 1; }...
replace
7
10
7
10
0
p01125
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define lp(i, n) for (int i = 0; i < n; i++) int main() { while (1) { int n; cin >> n; if (n == 0) break; int h[21][21]; lp(i, 21) { lp(j, 21) { h[i][j] = 0; } } lp(i, n) { int a, b; cin >> a >> b; h[a][b] = 1; ...
#include <bits/stdc++.h> using namespace std; #define lp(i, n) for (int i = 0; i < n; i++) int main() { while (1) { int n; cin >> n; if (n == 0) break; int h[21][21]; lp(i, 21) { lp(j, 21) { h[i][j] = 0; } } lp(i, n) { int a, b; cin >> a >> b; h[a][b] = 1; ...
replace
59
60
59
60
0
p01125
C++
Runtime Error
#include <iostream> #define N 21 using namespace std; int main() { int n, m, x, y, rx, ry, l, cnt, d[N][N]; char c; while (1) { for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) d[i][j] = 0; cin >> n; if (!n) break; for (int i = 0; i < n; i++) cin >> x >> y, d[N - ...
#include <iostream> #define N 21 using namespace std; int main() { int n, m, x, y, rx, ry, l, cnt, d[N][N]; char c; while (1) { for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) d[i][j] = 0; cin >> n; if (!n) break; for (int i = 0; i < n; i++) cin >> x >> y, d[N - ...
replace
29
30
29
30
0
p01125
C++
Runtime Error
#include <cstdio> #include <iostream> #include <queue> #include <stack> #define MAX 32 using namespace std; int main(void) { while (1) { int n, m; int x[MAX], y[MAX]; int m_x = 10, m_y = 10; char d; int l; bool moved[MAX][MAX] = {false}; moved[10][10] = true; bool collect = true; ...
#include <cstdio> #include <iostream> #include <queue> #include <stack> #define MAX 32 using namespace std; int main(void) { while (1) { int n, m; int x[MAX], y[MAX]; int m_x = 10, m_y = 10; char d; int l; bool moved[MAX][MAX] = {false}; moved[10][10] = true; bool collect = true; ...
replace
51
52
51
52
0
p01125
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using nam...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using nam...
replace
116
117
116
117
0
p01126
C++
Runtime Error
#include <cstdio> #include <map> using namespace std; typedef pair<int, int> pii; typedef pair<int, pii> pipii; int main() { while (true) { int n, m, a; scanf("%d%d%d", &n, &m, &a); if (n == 0 || m == 0 || a == 0) { break; } multimap<int, pii, greater<int>> field; for (int i = 0; i < m...
#include <cstdio> #include <map> using namespace std; typedef pair<int, int> pii; typedef pair<int, pii> pipii; int main() { while (true) { int n, m, a; scanf("%d%d%d", &n, &m, &a); if (n == 0 || m == 0 || a == 0) { break; } multimap<int, pii, greater<int>> field; for (int i = 0; i < m...
replace
31
32
31
32
1