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
p00768
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <utility> #include <vector> using P = std::pair<int, int>; using namespace std; struct team_data { int team_num = -1; int solved_num = 0; int sum_time = 0; // minute // vector<int> solved_time; vector<int> penalty; }; int main...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <utility> #include <vector> using P = std::pair<int, int>; using namespace std; struct team_data { int team_num = -1; int solved_num = 0; int sum_time = 0; // minute // vector<int> solved_time; vector<int> penalty; }; int main...
replace
36
37
36
37
0
p00768
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; class Team { public: int id; int solvednum; int penalty; vector<bool> solved; vector<int> WA; Team(int id, int N) { this->id = id; solvednum = 0; penalty = 0; solved.resize(N, false); WA.resize(N, 0); } bool operator==(const Team &t) con...
#include <bits/stdc++.h> using namespace std; class Team { public: int id; int solvednum; int penalty; vector<bool> solved; vector<int> WA; Team(int id, int N) { this->id = id; solvednum = 0; penalty = 0; solved.resize(N, false); WA.resize(N, 0); } bool operator==(const Team &t) con...
replace
40
41
40
41
0
p00769
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <util...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <util...
replace
49
50
49
50
0
p00769
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int n; string s; int calc(int l, int r) { int d = 0, c = 0, w = l; for (int i = l; i < r; i++) c += (s[i] == '[' || s[i] == ']' ? 1 : 0); if (c == 0) return stoi(s.substr(l + 1, r - l - 2)); vector<int> v; ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int n; string s; int calc(int l, int r) { int d = 0, c = 0, w = l; for (int i = l; i < r; i++) c += (s[i] == '[' || s[i] == ']' ? 1 : 0); if (c == 0) return stoi(s.substr(l, r)) / 2 + 1; vector<int> v; fo...
replace
12
13
12
13
-6
terminate called after throwing an instance of 'std::invalid_argument' what(): stoi
p00769
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> using namespace std; int a[10][100], n, cnt[10], u, sum, chain; string S, T; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> S; u = 0; sum = 0; for (int i = 0; i < 10; i++) { cnt[i] = 0; } for (int i = 0; i < S.size...
#include <algorithm> #include <iostream> #include <string> using namespace std; int a[100][1000], n, cnt[100], u, sum, chain; string S, T; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> S; u = 0; sum = 0; for (int i = 0; i < 10; i++) { cnt[i] = 0; } for (int i = 0; i < S.s...
replace
4
5
4
5
0
p00770
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair<...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair<...
replace
90
91
90
91
MLE
p00770
C++
Memory Limit Exceeded
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; const int MAX = 1000010; int prime[MAX]; bool is_prime[MAX]; int sieve(int n) { int p = 0; for (int i = 0; i <= n; i++) { is_prime[i] = true; } ...
#include <algorithm> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; const int MAX = 1000010; int prime[MAX]; bool is_prime[MAX]; int sieve(int n) { int p = 0; for (int i = 0; i <= n; i++) { is_prime[i] = true; } ...
replace
30
31
30
31
MLE
p00770
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #define MAX_M 1000000 using namespace std; typedef struct { int num, prime, last; } HOLE; int M, N; HOLE h[1000 + 2][1000 + 2]; bool prime_judge(int x) { if (x == 0 || x == 1) return false; for (int i = 2; i * ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #define MAX_M 1000000 using namespace std; typedef struct { int num, prime, last; } HOLE; int M, N; HOLE h[1000 + 2][1000 + 2]; bool prime_judge(int x) { if (x == 0 || x == 1) return false; for (int i = 2; i * ...
replace
29
30
29
30
-11
p00770
C++
Memory Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
replace
37
38
37
38
MLE
p00771
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <unordered_map> #include <unordered...
#include <algorithm> #include <array> #include <chrono> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <unordered_map> #include <unordered...
replace
794
795
794
795
TLE
p00771
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
replace
123
124
123
124
TLE
p00771
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
233
234
233
234
TLE
p00772
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < int(n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; int dp[25][25][26][26]; int main() { while (1) { int n, m, r; cin >> n >> m >> r; if (!n) break; deque<int> a(n), b(m); REP(...
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < int(n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; int dp[25][25][26][26]; int main() { while (1) { int n, m, r; cin >> n >> m >> r; if (!n) break; deque<int> a(n), b(m); REP(...
replace
58
59
58
59
0
p00773
C++
Runtime Error
#include <stdio.h> int max(int m1, int m2) { return m1 < m2 ? m2 : m1; } int main() { int t1, t2, sum, a, i, j; for (; scanf("%d %d %d", &t1, &t2, &sum), sum;) { static int A[1001]; for (j = 0; j < 1001; j++) A[j] = 0; int m = 0; for (i = 1; i < sum; i++) { a = i * (100 + t1) / 100; ...
#include <stdio.h> int max(int m1, int m2) { return m1 < m2 ? m2 : m1; } int main() { int t1, t2, sum, a, i, j; for (; scanf("%d %d %d", &t1, &t2, &sum), sum;) { static int A[10000]; for (j = 0; j < 1001; j++) A[j] = 0; int m = 0; for (i = 1; i < sum; i++) { a = i * (100 + t1) / 100; ...
replace
7
8
7
8
-11
p00773
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a[100]; int i, j, k, n = 0, t; int m1, m2; int mm1, mm2; int temp; while (1) { int x, y, s; // x???????¨????,y??´??°???????¨????,z??????????¨? cin >> x >> y >> s; if (x == 0 && y == 0 && s == 0) break; int max = 0; for...
#include <iostream> using namespace std; int main() { int a[1000]; int i, j, k, n = 0, t; int m1, m2; int mm1, mm2; int temp; while (1) { int x, y, s; // x???????¨????,y??´??°???????¨????,z??????????¨? cin >> x >> y >> s; if (x == 0 && y == 0 && s == 0) break; int max = 0; fo...
replace
4
5
4
5
0
p00773
C++
Runtime Error
// 1192_TaxRateChanged.cpp // 税率がx%の価格でループを回すのではなく、税抜き価格でループを回すのがポイント #include <bits/stdc++.h> using namespace std; const int MAX_S = 1010; int x, y, s; int p[MAX_S / 2]; void solve() { memset(p, 0, sizeof(p)); for (int i = 1; i < s; ++i) for (int j = 1; j < s; ++j) if (i * (100 + x) / 100 + j * (100 + x)...
// 1192_TaxRateChanged.cpp // 税率がx%の価格でループを回すのではなく、税抜き価格でループを回すのがポイント #include <bits/stdc++.h> using namespace std; const int MAX_S = 1010; int x, y, s; int p[MAX_S]; void solve() { memset(p, 0, sizeof(p)); for (int i = 1; i < s; ++i) for (int j = 1; j < s; ++j) if (i * (100 + x) / 100 + j * (100 + x) / 1...
replace
6
7
6
7
-11
p00773
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long int; using ui64 = unsigned long long int; ////// int intax(int i, int p) { return floor((double)i * (100 + p) / 100); } int main() { int x, y, s; while (cin >> x >> y >> s, x && y && s) { int res = -1; int mi, mj = 0; for (int i = 1...
#include <bits/stdc++.h> using namespace std; using i64 = long long int; using ui64 = unsigned long long int; ////// int intax(int i, int p) { return floor((double)i * (100 + p) / 100); } int main() { int x, y, s; while (cin >> x >> y >> s, x && y && s) { int res = -1; int mi, mj = 0; for (int i = 1...
replace
36
37
36
37
0
13 88 12 87 1 23 1 12 1 23 1 22 1 199 25 75 25 25 11 50 50 75 92 899 1 502 5 500 1 10 1 6
p00774
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int H; int b[10][5]; struct range { int row; int left; int right; }; void drop(int row, int col) { for (int i = row; i > 0; i--) { b[i][col] = b[i - 1][col]; } b[0][col] = -1; } void print_board() { for (int i = 0; i < H; i++) { for (i...
#include <iostream> #include <vector> using namespace std; int H; int b[10][5]; struct range { int row; int left; int right; }; void drop(int row, int col) { for (int i = row; i > 0; i--) { b[i][col] = b[i - 1][col]; } b[0][col] = -1; } void print_board() { for (int i = 0; i < H; i++) { for (i...
replace
33
34
33
34
0
6 9 9 9 9 6 -1 -1 -1 -1 5 9 5 5 9 5 5 6 9 9 4 6 3 6 9 3 3 2 9 9 2 2 1 1 1 5 9 -1 -1 -1 5 5 5 5 9 4 6 6 9 9 3 3 3 6 9 2 2 2 9 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 9 9 5 9 -1 6 9 4 6 6 9 9 3 5 6 5 6 2 2 2 8 3 6 2 5 9 2 7 7 7 6 1 4 6 6 4 9 8 9 1 1 8 5 6 1 8 1 6 8 2 1 2 9 6 3 3 5 5 3 8 8 8...
p00774
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) int tile[11][5]; int main() { int h; while (cin >> h, h) { REP(i, 11) REP(j, 5) { tile[i][j] = -1; } REP(i, h) REP(j, 5) { cin >> tile[h - 1 - i][j]; } int ans = 0; bool update = false; while (true) {...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) int tile[11][5]; int main() { int h; while (cin >> h, h) { REP(i, 11) REP(j, 5) { tile[i][j] = -1; } REP(i, h) REP(j, 5) { cin >> tile[h - 1 - i][j]; } int ans = 0; bool update = false; while (true) {...
replace
39
40
39
40
-11
p00774
C++
Runtime Error
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; #define Line vector<char> #define Puzzle vector<Line> void newline() { cout << endl; } template <typename T> void put(T input) { cout << input; } template <typename T> void putl(T input) { put(input); newline(); } i...
#include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; using Line = vector<char>; using Puzzle = vector<Line>; void newline() { cout << endl; } template <typename T> void put(T input) { cout << input; } template <typename T> void putl(T input) { put(input); newline(); } ...
replace
5
7
5
7
0
p00774
C++
Time Limit Exceeded
#include <iostream> #include <vector> #pragma warning(disable : 4996) using namespace std; int main() { int H; while (true) { scanf("%d", &H); if (H == 0) { break; } vector<vector<int>> M(H, vector<int>(5)); for (int i = 0; i < H; i++) { for (int j = 0; j < 5; j++) { s...
#include <iostream> #include <vector> #pragma warning(disable : 4996) using namespace std; int main() { int H; while (true) { scanf("%d", &H); if (H == 0) { break; } vector<vector<int>> M(H, vector<int>(5)); for (int i = 0; i < H; i++) { for (int j = 0; j < 5; j++) { s...
replace
52
58
52
60
TLE
p00774
C++
Time Limit Exceeded
#include <iostream> using namespace std; int x[2000][5], H; int solve() { int score = 0; for (int i = 0; i < 1000; i++) { for (int j = 0; j < H; j++) { if (x[j][0] == x[j][1] && x[j][1] == x[j][2] && x[j][2] == x[j][3] && x[j][3] == x[j][4] && x[j][0] >= 1) { score += x[j][0] * 5; ...
#include <iostream> using namespace std; int x[2000][5], H; int solve() { int score = 0; for (int i = 0; i < 500; i++) { for (int j = 0; j < H; j++) { if (x[j][0] == x[j][1] && x[j][1] == x[j][2] && x[j][2] == x[j][3] && x[j][3] == x[j][4] && x[j][0] >= 1) { score += x[j][0] * 5; ...
replace
7
8
7
8
TLE
p00774
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; void fill_stone(vector<int> stone[5]) { for (int i = 0; i < 5; ++i) { vector<int>::iterator it = stone[i].begin(); while (it != stone[i].end()) { if (*it == 0) { stone[i].erase(it); it = stone[i].begin(); } else ++...
#include <iostream> #include <vector> using namespace std; void fill_stone(vector<int> stone[5]) { for (int i = 0; i < 5; ++i) { vector<int>::iterator it = stone[i].begin(); while (it != stone[i].end()) { if (*it == 0) { stone[i].erase(it); it = stone[i].begin(); } else ++...
insert
58
58
58
60
TLE
p00775
C++
Time Limit Exceeded
// #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...
replace
40
42
40
42
TLE
p00776
C++
Memory Limit Exceeded
// tsukasa_diary's programing contest code template #include <bits/stdc++.h> using namespace std; // define #define for_(i, a, b) for (int i = a; i < b; ++i) #define for_rev(i, a, b) for (int i = a; i >= b; --i) #define allof(a) a.begin(), a.end() #define minit(a, b) memset(a, b, sizeof(a)) #define size_of(a) (int)a.si...
// tsukasa_diary's programing contest code template #include <bits/stdc++.h> using namespace std; // define #define for_(i, a, b) for (int i = a; i < b; ++i) #define for_rev(i, a, b) for (int i = a; i >= b; --i) #define allof(a) a.begin(), a.end() #define minit(a, b) memset(a, b, sizeof(a)) #define size_of(a) (int)a.si...
replace
60
61
60
61
MLE
p00776
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (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> vi; typedef...
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (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> vi; typedef...
insert
45
45
45
47
TLE
p00776
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; string S; bool ok2(string T) { bool used[26]; for (int i = 0; i < 26; i++) used[i] = false; for (int i = 0; i < S.size(); i++) { if (!used[T[i] - 97] && T[i] != 'a') { used[T[i] - 97] = true; ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; string S; inline bool ok2(string T) { bool used[26]; for (int i = 0; i < 26; i++) used[i] = false; for (int i = 0; i < S.size(); i++) { if (!used[T[i] - 97] && T[i] != 'a') { used[T[i] - 97] = true...
replace
9
10
9
10
TLE
p00777
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define all(c) (c).begin(), (c).end() #define loop(i, a, b) for (ll i = a; i < ll(b); i++) #define rep(i, b) loop(i, 0...
#define _CRT_SECURE_NO_WARNINGS // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define all(c) (c).begin(), (c).end() #define loop(i, a, b) for (ll i = a; i < ll(b); i++) #define rep(i, b) loop(i, 0...
replace
114
115
114
115
0
p00777
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1 << 30; vector<vector<pair<int, int>>> graph; int sum, D; int dfs(int v, int r) { vector<int> ch = {0, 0}; for (auto p : graph[v]) { int sv, d; tie(sv, d) = p; if (sv == r) continue; int res = dfs(sv, v); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1 << 30; vector<vector<pair<int, int>>> graph; int sum, D; int dfs(int v, int r) { vector<int> ch = {0, 0}; for (auto p : graph[v]) { int sv, d; tie(sv, d) = p; if (sv == r) continue; int res = dfs(sv, v); ...
replace
38
39
38
39
0
p00777
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <...
replace
33
34
33
34
TLE
p00778
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int ord[] = {0, 1, 3, 2}; string dir = "ENWS"; string rdir = "WSEN"; int roll[4][6] = {{4, 1, 0, 3, 5, 2}, {3, 0, 2, 5, 4, 1}, {2, 1, 5, 3, 0, 4}, {1, 5, 2, 0, 4, 3}}; bool check(const vector<int> &dice) { if (dice...
#include <bits/stdc++.h> using namespace std; int ord[] = {0, 1, 3, 2}; string dir = "ENWS"; string rdir = "WSEN"; int roll[4][6] = {{4, 1, 0, 3, 5, 2}, {3, 0, 2, 5, 4, 1}, {2, 1, 5, 3, 0, 4}, {1, 5, 2, 0, 4, 3}}; bool check(const vector<int> &dice) { if (dice...
insert
64
64
64
66
TLE
p00778
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const string dir = "ENSW"; const string rdir = "WSNW"; constexpr int rot[4][6] = {{2, 1, 5, 3, 0, 4}, {3, 0, 2, 5, 4, 1}, {1, 5, 2, 0, 4, 3}, {4, 1, 0, 3, 5, 2}}; vector<int> roll(vector<int>...
#include <bits/stdc++.h> using namespace std; const string dir = "ENSW"; const string rdir = "WSNW"; constexpr int rot[4][6] = {{2, 1, 5, 3, 0, 4}, {3, 0, 2, 5, 4, 1}, {1, 5, 2, 0, 4, 3}, {4, 1, 0, 3, 5, 2}}; vector<int> roll(vector<int>...
insert
40
40
40
43
TLE
p00780
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define f first #define s second #define mp make_pair #define REP(...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define f first #define s second #define mp make_pair #define REP(...
replace
66
67
66
67
0
p00780
C++
Runtime Error
#include <iostream> using namespace std; bool primes[100000]; void Sieve() { for (int i = 2; i < 1000000; i++) { primes[i] = true; } primes[1] = false; for (int i = 2; i <= 1000; i++) { if (primes[i] == true) for (int j = i; j * i <= 1000000; j++) { primes[j * i] = false; } } } ...
#include <iostream> using namespace std; bool primes[1000000]; void Sieve() { for (int i = 2; i < 1000000; i++) { primes[i] = true; } primes[1] = false; for (int i = 2; i <= 1000; i++) { if (primes[i] == true) for (int j = i; j * i <= 1000000; j++) { primes[j * i] = false; } } } ...
replace
2
3
2
3
-11
p00782
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) begin(v), end(v) bool mas[444][444]; void color(int x, int y, int gx, int gy) { mas[x][y] = true; if (x + 1 < gx) color(x + 1, y, gx, gy); if (y + 1 < gy) color(x, y + 1...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) begin(v), end(v) bool mas[444][444]; void color(int x, int y, int gx, int gy) { for (int i = x; i < gx; i++) { for (int j = y; j < gy; j++) mas[i][j] = true; } } int ma...
replace
8
13
8
12
TLE
p00786
C++
Runtime Error
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; const int SIZE = 299; struct but { vector<shared_ptr<but>> chs; char c; but(char c_) : chs(), c(c_) {} pair<int, vector<string>> getst() { ...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; const ld eps = 1e-9; const int SIZE = 299; struct but { vector<shared_ptr<but>> chs; char c; but(char c_) : chs(), c(c_) {} pair<int, vector<string>> getst() { ...
replace
193
194
193
194
-11
p00788
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long long gc...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; long long gc...
replace
43
58
43
58
TLE
p00788
C++
Runtime Error
#include <cassert> #include <cmath> #include <iostream> #include <set> #include <vector> using namespace std; const double eps = 1e-11; bool eq(double a, double b) { return abs(b - a) < eps; } int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } const double inf = 1e30; int main() { int p, n; while (c...
#include <cassert> #include <cmath> #include <iostream> #include <set> #include <vector> using namespace std; const double eps = 1e-11; bool eq(double a, double b) { return abs(b - a) < eps; } int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } const double inf = 1e30; int main() { int p, n; while (c...
replace
41
42
41
42
-6
f650f695-e169-473e-80d1-7169fc5eb39f.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00788/C++/s286752127.cpp:48: int main(): Assertion `rp-(double)m/i>0' failed.
p00789
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int dp[301][18]; int solve(int amount, int num) { // cerr << "solve(" << amount << "," << num << ")" << endl; if (amount == 0) return 1; if (num < 0) return 0; int &res = dp[amount][num]; if (res != -1) return res; ...
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int dp[301][18]; int solve(int amount, int num) { // cerr << "solve(" << amount << "," << num << ")" << endl; if (amount == 0) return 1; if (num < 0) return 0; int &res = dp[amount][num]; if (res != -1) return res; ...
insert
28
28
28
30
TLE
p00791
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) char in[1002][1001]; map<int, int> ans; int N; inline bool valid(int x, int y) { return 0 <= x && x < 1001 && 0 <= y && y < N; } int getlen_yaxis(int x, int y) { int top_y = y; whil...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) char in[1002][1001]; map<int, int> ans; int N; inline bool valid(int x, int y) { return 0 <= x && x < 1001 && 0 <= y && y < N; } int getlen_yaxis(int x, int y) { int top_y = y; whil...
insert
161
161
161
163
-11
p00791
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <map> #include <vector> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define EPS (1e-10) using namespace std; bool used[80][1000]; int dx[] = {-1, +0, +1, +1, +1, +0, -1, -1}; int dy[] = {+1, +1, +1,...
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <map> #include <vector> #define REP(i, s, n) for (int i = s; i < n; i++) #define rep(i, n) REP(i, 0, n) #define EPS (1e-10) using namespace std; bool used[1000][80]; int dx[] = {-1, +0, +1, +1, +1, +0, -1, -1}; int dy[] = {+1, +1, +1,...
replace
10
11
10
11
0
p00794
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; int W, H, div_row[4] = {-1, 0, 0, 1}, div_col[5] = {0, -1, 1, 0}; st...
#include <algorithm> #include <cmath> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> typedef long long int ll; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; int W, H, div_row[4] = {-1, 0, 0, 1}, div_col[5] = {0, -1, 1, 0}; st...
replace
80
81
80
81
MLE
p00795
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string str, pat; vector<char> num; str.reserve(1000001); num.reserve(1000001); pat.reserve(73); ios::sync_with_stdio(false); cin.tie(0); while (true) { str.clear(); pat.clear(); ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string str, pat; vector<char> num; str.reserve(1000001); num.reserve(1000001); pat.reserve(73); ios::sync_with_stdio(false); cin.tie(0); while (true) { str.clear(); pat.clear(); ...
replace
27
28
27
28
0
p00798
C++
Memory Limit Exceeded
#include <iostream> #include <queue> using namespace std; int w, h, mp[8][8]; int dx[] = {0, 0, -1, 1}; int dy[] = {1, -1, 0, 0}; struct po { int x, y, xx, yy; }; po mk(int a, int b, int c, int d) { po res; res.x = a, res.y = b, res.xx = c, res.yy = d; return res; } int bfs(po start, po goal, int flg) { int...
#include <iostream> #include <queue> using namespace std; int w, h, mp[8][8]; int dx[] = {0, 0, -1, 1}; int dy[] = {1, -1, 0, 0}; struct po { int x, y, xx, yy; }; po mk(int a, int b, int c, int d) { po res; res.x = a, res.y = b, res.xx = c, res.yy = d; return res; } int bfs(po start, po goal, int flg) { int...
replace
36
37
36
37
MLE
p00806
C++
Time Limit Exceeded
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; void dfs(int i, int n, const string dic[100], const bool b[300][100], vector<string> &tmp, vector<string> &ans) { if (i < -1) for (;;) ; if (i == -1) { string res; ...
#include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; void dfs(int i, int n, const string dic[100], const bool b[300][100], vector<string> &tmp, vector<string> &ans) { if (i < -1) return; if (i == -1) { string res; for (i...
replace
11
13
11
12
TLE
p00810
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <assert.h> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue...
#define _USE_MATH_DEFINES #define INF 0x3f3f3f3f #include <algorithm> #include <assert.h> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <limits> #include <list> #include <map> #include <queue...
replace
184
185
184
185
TLE
p00811
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i)) using ll = long long; using P = pair<ll, ll>; using namespace std; template <class t> void vin(vector<t> &v, int n) { v.resize(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } } const int MAX_N = 100001...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = (0); (i) < (int)(n); ++(i)) using ll = long long; using P = pair<ll, ll>; using namespace std; template <class t> void vin(vector<t> &v, int n) { v.resize(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } } const int MAX_N = 100001...
replace
41
52
41
52
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; bool isPrime(int n) { for (int i = 2; i * i <= n; i++) { if (n % i == 0) return false; } return true; } int ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long ll; bool isPrime(int n) { for (int i = 2; i * i <= n; i++) { if (n % i == 0) return false; } return true; } int ...
replace
41
42
41
43
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; int m, a, b; bool prime[100001]; vector<int> pp; int main(void) { memset(prime, true, sizeof(prime)); prime[0] = prime[1] = false; for (int i = 2; i <= 100000; i++) { if (prime[i]) { pp.push_back(i); f...
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; int m, a, b; bool prime[100001]; vector<int> pp; int main(void) { memset(prime, true, sizeof(prime)); prime[0] = prime[1] = false; for (int i = 2; i <= 100000; i++) { if (prime[i]) { pp.push_back(i); f...
replace
25
28
25
29
TLE
p00811
C++
Time Limit Exceeded
#include <iostream> using namespace std; #define MMAX 100000 #define YES 0 #define NO 1 struct S { int p, q, pq; }; int main() { int m, a, b; int hurui[MMAX + 1] = {YES}; int prime[MMAX + 1]; int cnt = 0; S ans = {-1, -1, -1}; hurui[0] = NO, hurui[1] = NO; for (int i = 2; i < MMAX; i++) { if (h...
#include <iostream> using namespace std; #define MMAX 100000 #define YES 0 #define NO 1 struct S { int p, q, pq; }; int main() { int m, a, b; int hurui[MMAX + 1] = {YES}; int prime[MMAX + 1]; int cnt = 0; S ans = {-1, -1, -1}; hurui[0] = NO, hurui[1] = NO; for (int i = 2; i < MMAX; i++) { if (h...
replace
36
40
36
39
TLE
p00811
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define fir first #define sec second #define PB push_back #define MP make_pair using namespace std; int SIZE = 1e5; int main() { int prime[SIZE + 1]; vector<int> V; memset(prime, 1, sizeof(prime)); prime[0] = prime[1] = 0; REP(i, SIZE + ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define fir first #define sec second #define PB push_back #define MP make_pair using namespace std; int SIZE = 1e5; int main() { int prime[SIZE + 1]; vector<int> V; memset(prime, 1, sizeof(prime)); prime[0] = prime[1] = 0; REP(i, SIZE + ...
replace
40
45
40
45
0
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX = 100001; vector<int> prime; bool is_prime(int n) { if (n == 2 || n == 3) return true; if (n % 2 == 0) return false; for (int i = 3; i * i <= n; i++) { if (n % i == 0) return false; } return true...
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX = 50000; vector<int> prime; bool is_prime(int n) { if (n == 2 || n == 3) return true; if (n % 2 == 0) return false; for (int i = 3; i * i <= n; i++) { if (n % i == 0) return false; } return true;...
replace
5
6
5
6
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, s, e) for (int i = (s); i < (e); i++) #define REPI(...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, s, e) for (int i = (s); i < (e); i++) #define REPI(...
replace
35
36
35
36
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> v; int main() { for (int i = 2; i < 50000; i++) { bool ok = true; for (int j = 0; j < v.size(); j++) { if (i % v[j] == 0) ok = false; } if (ok) v.push_back(i); } int m, a, b; while (ci...
#include <algorithm> #include <iostream> #include <vector> using namespace std; vector<int> v; int main() { for (int i = 2; i < 50000; i++) { bool ok = true; for (int j = 0; j < v.size(); j++) { if (i % v[j] == 0) ok = false; } if (ok) v.push_back(i); } int m, a, b; while (ci...
replace
20
21
20
23
TLE
p00811
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { int m, a, b, i, j; for (i = 2; i < 50000; i++) { bool ok = 1; for (j = 0; j < v.size(); j++) if (!i % v[j]) ok = 0; if (ok) v.push_back(i); } while (cin >> m >> a >> b && m) { int p = 0, q = 0; for ...
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { int m, a, b, i, j; for (i = 2; i < 50000; i++) { bool ok = 1; for (j = 0; j < v.size(); j++) if (i % v[j] == 0) ok = 0; if (ok) v.push_back(i); } while (cin >> m >> a >> b && m) { int p = 0, q = 0; ...
replace
8
9
8
9
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; #define ll long long #de...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; #define ll long long #de...
replace
52
55
52
55
TLE
p00811
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; bool isprime[100001]; void eratos(int n) { for (int i = 0; i <= n; i++) { isprime[i] = true; } isprime[0] = isprime[1] = false; for (int i = 2; i <= sqrt(n); i++) { if (isprime[i]) { int j = i + i; while (j <= n) { isprime[...
#include <cmath> #include <iostream> using namespace std; bool isprime[100001]; void eratos(int n) { for (int i = 0; i <= n; i++) { isprime[i] = true; } isprime[0] = isprime[1] = false; for (int i = 2; i <= sqrt(n); i++) { if (isprime[i]) { int j = i + i; while (j <= n) { isprime[...
replace
36
37
36
37
TLE
p00811
C++
Time Limit Exceeded
#include <iostream> #include <vector> #define M 100000 using namespace std; bool prime[M]; void primeInit() { for (int i = 0; i < M; i++) { prime[i] = false; } } void p() { prime[2] = true; for (int i = 3; i < M; i++) { bool flag = false; for (int j = 2; j * j <= i; j++) { if (i % j == 0) { ...
#include <iostream> #include <vector> #define M 100000 using namespace std; bool prime[M]; void primeInit() { for (int i = 0; i < M; i++) { prime[i] = false; } } void p() { prime[2] = true; for (int i = 3; i < M; i++) { bool flag = false; for (int j = 2; j * j <= i; j++) { if (i % j == 0) { ...
replace
35
36
35
36
TLE
p00811
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); // sieve of eratosthenes vector<int> pnums(1000000, 0); for (int i = 2; i < 1000000; i++) pnums[i] = 1; for (int i = 2; i * i < 1000000; i++) { if (pnums[i]) { for (int j = i * i; j < 1000000...
#include "bits/stdc++.h" using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); // sieve of eratosthenes vector<int> pnums(1000000, 0); for (int i = 2; i < 1000000; i++) pnums[i] = 1; for (int i = 2; i * i < 1000000; i++) { if (pnums[i]) { for (int j = i * i; j < 1000000...
replace
20
21
20
21
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int stoi(string x) { stringstream ss; ss << x; int tmp; ss >> tmp; return tmp; } string itos(int x) { stringstream ss; ss << x; return ss...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <sstream> #include <string> #include <vector> using namespace std; int stoi(string x) { stringstream ss; ss << x; int tmp; ss >> tmp; return tmp; } string itos(int x) { stringstream ss; ss << x; return ss...
insert
55
55
55
57
TLE
p00811
C++
Time Limit Exceeded
#include <iostream> using namespace std; bool is_prime[100001]; void prime(int n) { for (int i = 0; i <= n; i++) is_prime[i] = true; is_prime[0] = is_prime[1] = false; for (int i = 2; i <= n; i++) { if (is_prime[i] == true) { for (int j = 2 * i; j <= n; j += i) is_prime[j] = false; } ...
#include <iostream> using namespace std; bool is_prime[100001]; void prime(int n) { for (int i = 0; i <= n; i++) is_prime[i] = true; is_prime[0] = is_prime[1] = false; for (int i = 2; i <= n; i++) { if (is_prime[i] == true) { for (int j = 2 * i; j <= n; j += i) is_prime[j] = false; } ...
replace
24
25
24
25
TLE
p00811
C++
Time Limit Exceeded
#include <climits> #include <cstdlib> #include <iostream> #include <vector> using namespace std; const static int M_MAX = 999999; int main() { int era[M_MAX + 1] = {0}; vector<int> primes; era[0] = era[1] = 1; for (int i = 2; i <= M_MAX; i++) { if (era[i]) { continue; } primes.push_back(i);...
#include <climits> #include <cstdlib> #include <iostream> #include <vector> using namespace std; const static int M_MAX = 999999; int main() { int era[M_MAX + 1] = {0}; vector<int> primes; era[0] = era[1] = 1; for (int i = 2; i <= M_MAX; i++) { if (era[i]) { continue; } primes.push_back(i);...
replace
32
37
32
40
TLE
p00811
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) const double EPS = 1.0e-9; int main() { vector<int> prime; prime.push_back(2); prime.push_back(3); for (int i = 4; i < 100000; i++) { bool flag = true; for (int j = 0; j < prime....
#include <cmath> #include <iostream> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) const double EPS = 1.0e-9; int main() { vector<int> prime; prime.push_back(2); prime.push_back(3); for (int i = 4; i < 10000; i++) { bool flag = true; for (int j = 0; j < prime.s...
replace
13
14
13
14
TLE
p00811
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) begin(a), end(a) #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(5) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int> P; typ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(a) begin(a), end(a) #define MS(m, v) memset(m, v, sizeof(m)) #define D10 fixed << setprecision(5) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int> P; typ...
insert
55
55
55
58
TLE
p00811
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; bool isPrime(int x) { if (x <= 1) return false; for (int i = 2; i * i <= x; ++i) { if (x % i == 0) return false; } return true; } int main() { vector<int> ps; for (int x = 2; x <= 50000; ++x) { if (isPrime(x)) ps.push_back(x); } for...
#include <bits/stdc++.h> using namespace std; bool isPrime(int x) { if (x <= 1) return false; for (int i = 2; i * i <= x; ++i) { if (x % i == 0) return false; } return true; } int main() { vector<int> ps; for (int x = 2; x <= 50000; ++x) { if (isPrime(x)) ps.push_back(x); } for...
replace
22
23
22
23
TLE
p00811
C++
Runtime Error
#include <iostream> using namespace std; int isPrime(int n) { for (int i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; } int main() { int m, a, b; int i, j, k; int memo[200001] = {}; for (i = 2; i < 200001; i++) memo[i] = isPrime(i); cin >> m >> a >> b; while ((m + a + b) != 0)...
#include <iostream> using namespace std; int isPrime(int n) { for (int i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; } int main() { int m, a, b; int i, j, k; int memo[200001] = {}; for (i = 2; i < 200001; i++) memo[i] = isPrime(i); cin >> m >> a >> b; while ((m + a + b) != 0)...
replace
20
25
20
27
0
p00811
C++
Time Limit Exceeded
#define DEBUG_ON #define CONDITION true using namespace std; /*{{{*/ #include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <iterator> #include <list> #include...
#define DEBUG_ON #define CONDITION true using namespace std; /*{{{*/ #include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <iterator> #include <list> #include...
replace
244
252
244
256
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define mp...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define mp...
replace
72
73
72
73
TLE
p00811
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <set> #include <vector> using namespace std; int main() { int m, a, b; bool pp[100001]; vector<int> prime; { memset(pp, true, sizeof(pp)); pp[0] = pp[1] = false; for (int i = 2; i < 100001; i++) { if (pp[i]) { prime...
#include <algorithm> #include <cstring> #include <iostream> #include <set> #include <vector> using namespace std; int main() { int m, a, b; bool pp[100001]; vector<int> prime; { memset(pp, true, sizeof(pp)); pp[0] = pp[1] = false; for (int i = 2; i < 100001; i++) { if (pp[i]) { prime...
replace
27
29
27
29
TLE
p00813
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define double long double #define int long long using namespace std; typedef pair<int, int> P; typedef pair<string, string> P1; typedef pair<int, string> P2; typedef pair<P, P2> P3; int fac(int n) { int res = 1; for (int i = 1; i <= n; i++) res *= i; return res; } double get(int i...
#include <bits/stdc++.h> #define double long double #define int long long using namespace std; typedef pair<int, int> P; typedef pair<string, string> P1; typedef pair<int, string> P2; typedef pair<P, P2> P3; int fac(int n) { int res = 1; for (int i = 1; i <= n; i++) res *= i; return res; } double get(int i...
replace
94
95
94
95
TLE
p00815
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define all(x) (x).begin(), (x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout << #x " = " << ((x)) << endl template <class T, class U> ostream &operator<<(ost...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define all(x) (x).begin(), (x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout << #x " = " << ((x)) << endl template <class T, class U> ostream &operator<<(ost...
replace
23
24
23
24
0
p00816
C++
Memory Limit Exceeded
#include <iostream> #include <string> #include <vector> using namespace std; int dp[7][1000000]; int pr[7][1000000]; int df[7][1000000]; int main() { while (true) { int n; string s; cin >> n >> s; if (n == 0 && s == "0") { break; } const int m = s.size(); for (int i = 0; i <= m; +...
#include <iostream> #include <string> #include <vector> using namespace std; unsigned short dp[7][1000000]; unsigned char pr[7][1000000]; int df[7][1000000]; int main() { while (true) { int n; string s; cin >> n >> s; if (n == 0 && s == "0") { break; } const int m = s.size(); for ...
replace
6
8
6
8
MLE
p00816
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int dig(int n) { if (n < 10) return 1; else return dig(n / 10) + 1; } int main() { while (1) { int t, n; cin >> t >> n; if (...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int dig(int n) { if (n < 10) return 1; else return dig(n / 10) + 1; } int main() { while (1) { int t, n; cin >> t >> n; if (...
insert
23
23
23
24
0
p00817
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define MAX_V 305 #define MAX_E 1005 struct edge { int to, cost; }; vector<edge> G[MAX_V]; int V, E, A, B; vector<vector<int>> t, u; bool visited[MAX_V]; vector<int> a, b; void dfs(int pos, bool flg) { if (visited[pos]) return; ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define MAX_V 605 #define MAX_E 1005 struct edge { int to, cost; }; vector<edge> G[MAX_V]; int V, E, A, B; vector<vector<int>> t, u; bool visited[MAX_V]; vector<int> a, b; void dfs(int pos, bool flg) { if (visited[pos]) return; ...
replace
4
5
4
5
0
p00817
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #define MP make_pair #define PB push_bac...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #define MP make_pair #define PB push_bac...
replace
20
23
20
23
0
p00817
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <queue> #include <vector> using namespace std; int main() { int n, p1, p2; while (scanf("%d%d%d", &n, &p1, &p2), n || p1 || p2) { vector<vector<int>> G(p1 + p2 + 1); for (int i = 0; i < n; ++i) { int x, y; char c; scanf("%d%d %c%*s", &x, &y,...
#include <algorithm> #include <cstdio> #include <queue> #include <vector> using namespace std; int main() { int n, p1, p2; while (scanf("%d%d%d", &n, &p1, &p2), n || p1 || p2) { vector<vector<int>> G(p1 + p2 + 1); for (int i = 0; i < n; ++i) { int x, y; char c; scanf("%d%d %c%*s", &x, &y,...
replace
46
47
46
47
0
p00817
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...
delete
100
101
100
100
0
0 1 1 0 0 0 1 1 2 2 0 1 1 2 0 1 0 2 3 4 4 5 5 6
p00820
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; vector<long long> sq; // int memo[1<<15][20...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; vector<long long> sq; // int memo[1<<15][20...
replace
31
32
31
32
TLE
p00820
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) namespace std { template <> struct hash<std::vector<int>> { size_t operator()(const vector<int> &v) const { std::hash<int> hasher; size_t seed = 0; for (int i : v) { seed ^= hasher(i) + 0x9e3779b9 + (see...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) namespace std { template <> struct hash<std::vector<int>> { size_t operator()(const vector<int> &v) const { std::hash<int> hasher; size_t seed = 0; for (int i : v) { seed ^= hasher(i) + 0x9e3779b9 + (see...
replace
38
50
38
46
TLE
p00820
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define FOR(I, A, B) for (in...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> using namespace std; #define FOR(I, A, B) for (in...
replace
25
29
25
35
TLE
p00820
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using std::cin; using std::cout; using std::endl; int dfs(int n, int sum, int k, int sn) { int ret = 0; if (k < 0) { return 0; } else { if (sn == sum) { return 1; } } if (sn > sum || n == 0) { return 0; } ret += dfs(n, sum, k - 1, sn + pow(n, 2...
#include <cmath> #include <iostream> using std::cin; using std::cout; using std::endl; int dfs(int n, int sum, int k, int sn) { int ret = 0; if (k < 0) { return 0; } else { if (sn == sum) { return 1; } } if (sn > sum || n == 0) { return 0; } if (sn + (k * pow(n, 2)) < sum) { re...
insert
17
17
17
20
TLE
p00820
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <list> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> const int MOD = 1000000007; const int INF = 100...
#include <algorithm> #include <array> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <list> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> const int MOD = 1000000007; const int INF = 100...
insert
119
119
119
121
TLE
p00820
C++
Time Limit Exceeded
#include <iostream> using namespace std; int n; int ans; void saiki(int kai, int sum, int i) { if (sum == n) ans++; else if (kai < 4 && sum < n) for (int j = i; j * j <= n; j++) saiki(kai + 1, sum + j * j, j); } int main() { while (1) { cin >> n; if (n == 0) break; ans = 0; sa...
#include <iostream> using namespace std; int n; int ans; void saiki(int kai, int sum, int i) { if (sum == n) ans++; else if (kai < 4 && sum < n) for (int j = i; sum + j * j <= n; j++) saiki(kai + 1, sum + j * j, j); } int main() { while (1) { cin >> n; if (n == 0) break; ans = 0; ...
replace
8
9
8
9
TLE
p00820
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define DEB 0 #define all(x) x.begin(), x.end() // max:2192 unsigned short int dp[5][32770]; int main() { unsigned short int i, j, k, n; for (i...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; #define REP(i, a, n) for (int i = (a); i < (int)(n); i++) #define rep(i, n) REP(i, 0, n) #define DEB 0 #define all(x) x.begin(), x.end() // max:2192 unsigned short int dp[5][32770]; int main() { unsigned short int i, j, k; int n; ...
replace
15
16
15
17
0
p00820
C++
Runtime Error
// Enjoy your stay. #include <bits/stdc++.h> #define EPS 1e-9 #define INF 1070000000LL #define MOD 1000000007LL #define fir first #define foreach(it, X) for (auto it = (X).begin(); it != (X).end(); it++) #define ite iterator #define mp make_pair #define mt make_tuple #define rep(i, n) rep2(i, 0, n) #define rep2(i, m,...
// Enjoy your stay. #include <bits/stdc++.h> #define EPS 1e-9 #define INF 1070000000LL #define MOD 1000000007LL #define fir first #define foreach(it, X) for (auto it = (X).begin(); it != (X).end(); it++) #define ite iterator #define mp make_pair #define mt make_tuple #define rep(i, n) rep2(i, 0, n) #define rep2(i, m,...
replace
34
35
34
35
-11
p00820
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <vector> #define MAX 32768 using namespace std; vector<int> sq; bool isSqNum[MAX + 1]; void makeTable() { int tmp; for (int i = 0; i <= MAX; i++) { isSqNum[i] = false; } sq.clear(); for (int i = 1; (tmp = (int)pow((double)i, 2.0)) <= MAX; i++) { sq.push_b...
#include <cmath> #include <iostream> #include <vector> #define MAX 32768 using namespace std; vector<int> sq; bool isSqNum[MAX + 1]; void makeTable() { int tmp; for (int i = 0; i <= MAX; i++) { isSqNum[i] = false; } sq.clear(); for (int i = 1; (tmp = (int)pow((double)i, 2.0)) <= MAX; i++) { sq.push_b...
replace
31
32
31
32
TLE
p00820
C++
Memory Limit Exceeded
#include <cmath> #include <iostream> using namespace std; const int MAX = 33000; const int SQRT = 200; int dp[MAX][5][SQRT]; int main() { dp[0][0][1] = 1; for (int i = 0; i < MAX; i++) { for (int j = 0; j < 5; j++) { for (int k = 1; k < SQRT; k++) if (dp[i][j][k] > 0) { for (int l = ...
#include <cmath> #include <iostream> using namespace std; const int MAX = 32770; // 1<<15 const int SQRT = 182; int dp[MAX][5][SQRT]; int main() { dp[0][0][1] = 1; for (int i = 0; i < MAX; i++) { for (int j = 0; j < 5; j++) { for (int k = 1; k < SQRT; k++) if (dp[i][j][k] > 0) { for ...
replace
4
6
4
6
MLE
p00820
C++
Memory Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS 1 #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <forward_list> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #in...
#define _CRT_SECURE_NO_WARNINGS 1 #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <forward_list> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #in...
replace
42
43
42
43
MLE
p00820
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, j) REP((i), 0, (j)) #define REP(i, j, k) for (int i = (j); (i) < (k)...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define rep(i, j) REP((i), 0, (j)) #define REP(i, j, k) for (int i = (j); (i) < (k)...
replace
40
41
40
41
TLE
p00821
C++
Memory Limit Exceeded
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" stru...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" stru...
replace
52
53
52
53
MLE
p00821
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <iostream> #include <list> #include <set> #include <vector> using namespace std; typedef double elem; typedef complex<elem> point, vec; typedef pair<point, point> line, hline, seg, pp; enum CCW { BACK = 0x01, FRONT = 0x02, OVER = 0x04...
#include <algorithm> #include <cassert> #include <cmath> #include <complex> #include <iostream> #include <list> #include <set> #include <vector> using namespace std; typedef double elem; typedef complex<elem> point, vec; typedef pair<point, point> line, hline, seg, pp; enum CCW { BACK = 0x01, FRONT = 0x02, OVER = 0x04...
replace
69
70
69
70
0
p00821
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
replace
89
91
89
91
0
p00822
C++
Memory Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define FOR(i, k, n) for (int i = (k); i < (i...
insert
90
90
90
92
MLE
p00822
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <set> #include <sst...
replace
107
112
107
112
TLE
p00822
C++
Memory Limit Exceeded
#include <cstdio> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int to[9][5]; // to[i] : 雲が位置 i から移動できる位置 int n; int sun[366][16]; // sun[t][j]==1 <=> t 日目にマス j は晴れていないといけない int rain[9][16]; // rain[i][j]==1 <=> 雲が位置 i にいるとき, マス j は雨 set<vector<char>> vis[366...
#include <cstdio> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int to[9][5]; // to[i] : 雲が位置 i から移動できる位置 int n; int sun[366][16]; // sun[t][j]==1 <=> t 日目にマス j は晴れていないといけない int rain[9][16]; // rain[i][j]==1 <=> 雲が位置 i にいるとき, マス j は雨 set<vector<char>> vis[366...
replace
16
19
16
21
MLE
p00824
C++
Memory Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace ...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace ...
insert
72
72
72
73
MLE
p00824
C++
Memory Limit Exceeded
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" map<v...
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" map<v...
insert
47
47
47
48
MLE
p00825
C++
Time Limit Exceeded
#include <iostream> #include <vector> #define inf 100000000 using namespace std; struct edge { int to, cap, cost, rev; edge(int a, int b, int c, int d) { to = a, cap = b, cost = c, rev = d; } }; int n; vector<edge> G[370]; const int S = 0, T = 366; int prevv[370], preve[350]; void add_edge(int s, int t, int cap...
#include <iostream> #include <vector> #define inf 100000000 using namespace std; struct edge { int to, cap, cost, rev; edge(int a, int b, int c, int d) { to = a, cap = b, cost = c, rev = d; } }; int n; vector<edge> G[370]; const int S = 0, T = 366; int prevv[370], preve[370]; void add_edge(int s, int t, int cap...
replace
14
15
14
15
TLE
p00825
C++
Runtime Error
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; struct PrimalDual { const int INF = 1 << 28; typedef pair<int, int> P; struct edge { int to, cap, cost, rev; edge() {} edge(int to, int cap, int cost, int rev) : to(to), cap(cap), cost(cost), rev(rev) {}...
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; struct PrimalDual { const int INF = 1 << 28; typedef pair<int, int> P; struct edge { int to, cap, cost, rev; edge() {} edge(int to, int cap, int cost, int rev) : to(to), cap(cap), cost(cost), rev(rev) {}...
replace
73
74
73
74
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p00826
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pi M_PI #define inf 1 << 30 #define eps (1e-5) #define MAX 10000 #define equals(a, b) (fabs((a) - (b)) < eps) using namespace std; class Point { public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} Point ope...
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pi M_PI #define inf 1 << 30 #define eps (1e-7) #define MAX 20000 #define equals(a, b) (fabs((a) - (b)) < eps) using namespace std; class Point { public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} Point ope...
replace
6
8
6
8
MLE