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
p00828
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using n...
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using n...
delete
65
66
65
65
0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 2 1 1 0 0 2 0 0 0 0 1 2 0 1 0 0 2 2 0 0 0 0 1 1 0 0 0 0 0 0 1 2 2 0 2 2 0 2 2 1 0 0 0 0 0 1 0 0 2 2 2 0 2 2 1 2 2 2 2 2 0 2 2 1 2 2 2 2 2 3 3 3 0 0 0 0 0 0 1 0 0 2 0 0 3 3 3 0 3 3 1 3 3 0 3 3 1 3 3 2 3 3 0 3 3 1 3 3 2 3 3 3 3 0 0 1 1 0 1 1 1
p00828
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
27
28
27
28
0
p00828
C++
Runtime Error
#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]; } } int n, m, p; int b[10][1...
#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]; } } int n, m, p; int b[10][1...
delete
69
70
69
69
0
1 1 1 1 1 2 2 2 3 3 1 1 2 2 1 1 2 1 2 2 2 2 2 1 4
p00828
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, m, p; int x[100], y[100]; int pegs[10][10][10]; int z_idx[10][10]; int dx[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; int dy[] = {0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 1, 1}; int dz[] = {-1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1}; bool sequence(int x, int y, i...
#include <bits/stdc++.h> using namespace std; int n, m, p; int x[500], y[500]; int pegs[10][10][10]; int z_idx[10][10]; int dx[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; int dy[] = {0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 1, 1}; int dz[] = {-1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1}; bool sequence(int x, int y, i...
replace
5
6
5
6
0
p00830
C++
Runtime Error
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define rep(i, j) for (int i = 0; i < j; i++) #define all(i) i.begin(), i.end() #define clr(n) mem...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <set> #include <sstream> #include <stdio.h> #include <string.h> #include <string> #include <vector> #define rep(i, j) for (int i = 0; i < j; i++) #define all(i) i.begin(), i.end() #define clr(n) mem...
insert
67
67
67
69
0
p00832
C++
Time Limit Exceeded
#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 <...
delete
156
160
156
156
TLE
p00833
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)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef ...
#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)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef ...
insert
120
120
120
122
TLE
p00833
C++
Runtime Error
#include <algorithm> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; const double EPS = 1e-10; const double INF = 1e+10; const double PI = acos(-1); int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; } inline double ABS(double a) { return max(a...
#include <algorithm> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; const double EPS = 1e-10; const double INF = 1e+10; const double PI = acos(-1); int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; } inline double ABS(double a) { return max(a...
replace
101
103
101
103
0
p00833
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
150
151
150
151
0
p00836
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, n) for (int i = s; i < (int)n; ++i) #define per(i, n) for (int i = n; i >= 0; i--) #define ROF(i, s, n) for (int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(), (a).end() #defin...
#include <bits/stdc++.h> using namespace std; #define FOR(i, s, n) for (int i = s; i < (int)n; ++i) #define per(i, n) for (int i = n; i >= 0; i--) #define ROF(i, s, n) for (int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #define ALL(a) (a).begin(), (a).end() #defin...
replace
61
62
61
62
MLE
p00836
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; bool isPrime[10001]; for (int i = 0; i < 10001; i++) isPrime[i] = 1; isPrime[0] = isPrime[1] = 0; for (int i = 0; i < 10001; i++) { if (!isPrime[i]) continue; for (int j = 2; j * i < 10001; j++) { isPrime[i * j] = 0; ...
#include <bits/stdc++.h> using namespace std; int main() { int N; bool isPrime[10001]; for (int i = 0; i < 10001; i++) isPrime[i] = 1; isPrime[0] = isPrime[1] = 0; for (int i = 0; i < 10001; i++) { if (!isPrime[i]) continue; for (int j = 2; j * i < 10001; j++) { isPrime[i * j] = 0; ...
replace
29
30
29
30
-11
p00836
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <stack> #include <string> #include <vector> #define FOR(i, k, n) for (int(i) = (k); (i) < (...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <stack> #include <string> #include <vector> #define FOR(i, k, n) for (int(i) = (k); (i) < (...
replace
36
37
36
37
0
p00836
C++
Time Limit Exceeded
#include <iostream> #include <vector> using namespace std; const int M = 10000; int main() { vector<int> primes; for (int i = 2; i < M; i++) { bool flag = true; for (int j = 2; j * j <= i; j++) { if (i % j == 0) { flag = false; break; } } if (flag) { primes.pus...
#include <iostream> #include <vector> using namespace std; const int M = 20000; int main() { vector<int> primes; for (int i = 2; i < M; i++) { bool flag = true; for (int j = 2; j * j <= i; j++) { if (i % j == 0) { flag = false; break; } } if (flag) { primes.pus...
replace
4
5
4
5
TLE
p00837
C++
Runtime Error
/* 2012-11-23T16:06:54 */ #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...
/* 2012-11-23T16:06:54 */ #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 <iterato...
replace
1
2
1
2
0
Request: 50 get it from 2 put it on desk 0 [L214] cost = 4 Request: 50 get it from 2 put it on desk 0 [L214] cost = 4 Request: 60 get it from 2 temporary put it on 1 take lru(50) from desk 0 put lru on 2 retrive book from tmp(1) put it on desk 0 [L214] cost = 16 Request: 60 get it from 2 put it on desk 0...
p00837
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <queue> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { for (int m, c, n; scanf("%d%d%d", &m, &c, &n), m;) { queue<int> Q[100]; rep(i, n) { int sz; scanf("%d", &sz); rep(j, sz) { int a; scanf...
#include <algorithm> #include <cstdio> #include <queue> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { for (int m, c, n; scanf("%d%d%d", &m, &c, &n), m;) { queue<int> Q[100]; rep(i, n) { int sz; scanf("%d", &sz); rep(j, sz) { int a; scanf...
replace
76
77
76
79
-11
p00838
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define...
replace
145
146
145
146
TLE
p00839
C++
Time 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 ...
replace
71
72
71
72
TLE
p00841
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #define INF 2000000 #define t first #define x second using namespace std; typedef pair<double, int> P; double b, v, e, f; int r; double mk(int x) { if (x >= r) return 1.0 / (v - e * (x - r)); return 1.0 / (v - f * (r - x)); } int main() { while (1) ...
#include <algorithm> #include <cstdio> #include <iostream> #define INF 2000000 #define t first #define x second using namespace std; typedef pair<double, int> P; double b, v, e, f; int r; double mk(int x) { if (x >= r) return 1.0 / (v - e * (x - r)); return 1.0 / (v - f * (r - x)); } int main() { while (1) ...
replace
19
20
19
20
0
p00842
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int N, M; int a[55][55]; int b[11111][11111]; vector<int> sw[1111]; void print() { for (int i = 0; i < N + M; i++) { for (int j = 0; j < N + M; j++) cout << b[i][j] << " "; cout << endl; } } int main() { while (cin >> N, N) { memset(a, 0, sizeof...
#include <bits/stdc++.h> using namespace std; int N, M; int a[55][55]; int b[1111][1111]; vector<int> sw[1111]; void print() { for (int i = 0; i < N + M; i++) { for (int j = 0; j < N + M; j++) cout << b[i][j] << " "; cout << endl; } } int main() { while (cin >> N, N) { memset(a, 0, sizeof(a...
replace
6
7
6
7
MLE
p00848
C++
Memory Limit Exceeded
// 37 #include <iostream> #include <vector> using namespace std; int main() { int cmp[1121] = {}; vector<int> prm; for (int i = 2; i <= 1120; i++) { if (!cmp[i]) { prm.push_back(i); for (int j = 2; i * j <= 1120; j++) { cmp[i * j] = true; } } } static int dp[1121][1000][15]...
// 37 #include <iostream> #include <vector> using namespace std; int main() { int cmp[1121] = {}; vector<int> prm; for (int i = 2; i <= 1120; i++) { if (!cmp[i]) { prm.push_back(i); for (int j = 2; i * j <= 1120; j++) { cmp[i * j] = true; } } } static int dp[1121][200][15];...
replace
17
18
17
18
MLE
p00848
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; vector<int> sieve_of_eratosthenes(int n) { vector<int> primes(n); for (int i = 2; i < n; ++i) primes[i] = i; for (int i = 2; i * i < n; ++i) if (primes[i]) for (int j = i * i; j < n; j += i) ...
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; vector<int> sieve_of_eratosthenes(int n) { vector<int> primes(n); for (int i = 2; i < n; ++i) primes[i] = i; for (int i = 2; i * i < n; ++i) if (primes[i]) for (int j = i * i; j < n; j += i) ...
replace
17
18
17
18
MLE
p00848
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> pn; vector<bool> is_p; void enum_prime() { is_p.resize(1515, true); is_p[0] = is_p[1] = false; for (int i = 2; i <= 1515; i++) { if (!is_p[i]) continue; pn.push_back(i); for (int j = i + i; j <= 1515; j += i) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> pn; vector<bool> is_p; void enum_prime() { is_p.resize(1515, true); is_p[0] = is_p[1] = false; for (int i = 2; i <= 1515; i++) { if (!is_p[i]) continue; pn.push_back(i); for (int j = i + i; j <= 1515; j += i) ...
replace
21
22
21
22
MLE
p00848
C++
Memory Limit Exceeded
#include <iostream> #include <vector> using namespace std; #define MAX_N 20 #define MAX_K 1355 long long dp[MAX_N + 1][MAX_K][300]; long long sum[MAX_N + 1][MAX_K]; int prime[MAX_K]; int main() { prime[0] = 1; prime[1] = 1; for (int i = 2; i * i < MAX_K; i++) { for (int j = i * i; j < MAX_K; j += i) { p...
#include <iostream> #include <vector> using namespace std; #define MAX_N 20 #define MAX_K 1355 long long dp[MAX_N + 1][MAX_K][220]; long long sum[MAX_N + 1][MAX_K]; int prime[MAX_K]; int main() { prime[0] = 1; prime[1] = 1; for (int i = 2; i * i < MAX_K; i++) { for (int j = i * i; j < MAX_K; j += i) { p...
replace
5
6
5
6
MLE
p00854
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> usi...
#define _USE_MATH_DEFINES #include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> usi...
insert
41
41
41
43
-11
p00854
C++
Time Limit Exceeded
#include <iostream> using namespace std; bool isExist[10000]; int n, k, m; int main() { while (cin >> n >> k >> m) { if (!n) break; int i; for (i = 0; i < n; i++) { isExist[i] = true; } int cur = m - 1; isExist[cur] = false; for (i = 1; i < n; i++) { int step = (k - 1...
#include <iostream> using namespace std; bool isExist[10000]; int n, k, m; int main() { while (cin >> n >> k >> m) { if (!n) break; int i; for (i = 0; i < n; i++) { isExist[i] = true; } int cur = m - 1; isExist[cur] = false; for (i = 1; i < n; i++) { int step = (k - 1...
replace
25
26
25
28
TLE
p00854
C++
Runtime Error
#include <algorithm> #include <complex> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n);...
#include <algorithm> #include <complex> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string.h> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n);...
replace
60
61
60
61
0
p00854
C++
Time Limit Exceeded
#include <iostream> #include <list> using std::cin; using std::cout; using std::endl; using std::list; int main(void) { int n, k, m; cin >> n >> k >> m; while (n != 0 || k != 0 || m != 0) { list<int> nums(n, 0); int num = 1; for (list<int>::iterator itr = nums.begin(); itr != nums.end(); ++itr) { ...
#include <iostream> #include <list> using std::cin; using std::cout; using std::endl; using std::list; int main(void) { int n, k, m; cin >> n >> k >> m; while (n != 0 || k != 0 || m != 0) { list<int> nums(n, 0); int num = 1; for (list<int>::iterator itr = nums.begin(); itr != nums.end(); ++itr) { ...
replace
35
36
35
37
TLE
p00854
C++
Runtime Error
#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...
insert
236
236
236
239
-11
p00854
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, k, m; while (scanf("%d%d%d", &n, &k, &m)) { m--; vector<int> v(n); iota(v.begin(), v.end(), 1); while (v.size() > 1) { v.erase(v.begin() + m); m = (m + k - 1) % v.size(); ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n, k, m; while (scanf("%d%d%d", &n, &k, &m), n) { m--; vector<int> v(n); iota(v.begin(), v.end(), 1); while (v.size() > 1) { v.erase(v.begin() + m); m = (m + k - 1) % v.size(); ...
replace
6
7
6
7
-11
p00854
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, k, m; while (cin >> n >> k >> m, n || k || m) { int stone[10000]; for (int i = 0; i < n; i++) stone[i] = (i + 1) % n; m--; stone[m - 1] = stone[stone[m - 1]]; while (1) { if (stone[m] == m) break; for (...
#include <bits/stdc++.h> using namespace std; int main() { int n, k, m; while (cin >> n >> k >> m, n || k || m) { int stone[10000]; for (int i = 0; i < n; i++) stone[i] = (i + 1) % n; m -= 2; if (m < 0) m += n; stone[m] = stone[stone[m]]; while (stone[m] != m) { for (int ...
replace
10
15
10
15
TLE
p00854
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define INF (int)1e09 using std::cin; using std::cout; using std::end...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define INF (int)1e09 using std::cin; using std::cout; using std::end...
replace
68
69
68
72
TLE
p00854
C++
Time Limit Exceeded
#include <cstring> #include <iostream> using namespace std; bool x[10000]; int a, b, c, d, e, p; int main() { while (true) { memset(x, true, 10000); cin >> a >> b >> c; if (a == 0) { break; } d = a - 1; x[c - 1] = false; p = c - 1; while (d >= 2) { e = b % d + d; for ...
#include <cstring> #include <iostream> using namespace std; bool x[10000]; int a, b, c, d, e, p; int main() { while (true) { memset(x, true, 10000); cin >> a >> b >> c; if (a == 0) { break; } d = a - 1; x[c - 1] = false; p = c - 1; while (d >= 2) { e = b % d; if (e ==...
replace
16
17
16
20
TLE
p00855
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define each(a, b) for (auto(a) : (b)) #define all(v) (v).begin(), (v).end() #define fi first #define se second #define pb push_back #define show(x) cout << #x...
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define each(a, b) for (auto(a) : (b)) #define all(v) (v).begin(), (v).end() #define fi first #define se second #define pb push_back #define show(x) cout << #x...
replace
26
27
26
27
-11
p00855
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using n...
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using n...
insert
61
61
61
63
TLE
p00855
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int pmem[130000]; vector<int> prime; void init() { for (int i = 2; i < 1300000; i++) { if (pmem[i]) continue; pmem[i] = 1; prime.push_back(i); for (int j = i + i; j < 1300000; j += i) pmem[j] = -1; } } int main() { loop: ini...
#include <iostream> #include <vector> using namespace std; int pmem[1300000]; vector<int> prime; void init() { for (int i = 2; i < 1300000; i++) { if (pmem[i]) continue; pmem[i] = 1; prime.push_back(i); for (int j = i + i; j < 1300000; j += i) pmem[j] = -1; } } int main() { loop: in...
replace
5
6
5
6
-11
p00855
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define COUNT(i, n) for ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define COUNT(i, n) for ...
replace
34
35
34
35
0
p00855
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; #define MAX_LIST 100000000 int main() { bool *prime = (bool *)malloc(sizeof(bool) * MAX_LIST); // bool prime[MAX_LIST]; for (int i = 0; i < MAX_LIST; i++) { prime[i] = 1; } prime[0] = prime[1] = 0; for (int i = 0; i * i < MAX_LIST; i++) { ...
#include <algorithm> #include <iostream> using namespace std; #define MAX_LIST 10000000 int main() { bool *prime = (bool *)malloc(sizeof(bool) * MAX_LIST); // bool prime[MAX_LIST]; for (int i = 0; i < MAX_LIST; i++) { prime[i] = 1; } prime[0] = prime[1] = 0; for (int i = 0; i * i < MAX_LIST; i++) { ...
replace
3
4
3
4
MLE
p00855
C++
Runtime Error
#include <iostream> using namespace std; const int max_p = 1299709; bool prime[max_p + 1]; void initial_prime() { for (int i = 0; i < max_p; i++) prime[i] = true; prime[0] = prime[1] = false; for (int i = 2; i * i < max_p; i++) if (prime[i]) for (int j = 2 * i; j <= max_p; j += i) prime[...
#include <iostream> using namespace std; const int max_p = 1300000; bool prime[max_p + 1]; void initial_prime() { for (int i = 0; i < max_p; i++) prime[i] = true; prime[0] = prime[1] = false; for (int i = 2; i * i < max_p; i++) if (prime[i]) for (int j = 2 * i; j <= max_p; j += i) prime[...
replace
4
5
4
5
0
p00855
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996) #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std...
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996) #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std...
replace
40
41
40
41
-11
p00855
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> using namespace std; #define MAX 1000001 bool p[MAX]; int main() { memset(p, 1, sizeof(p)); p[0] = p[1] = 0; for (int i = 0; i < MAX; i++) { if (p[i]) { for (int j = 2 * i; j < MAX; j += i) { p[j] = 0; } } } int n; whil...
#include <cstdio> #include <cstring> #include <iostream> using namespace std; #define MAX 10000001 bool p[MAX]; int main() { memset(p, 1, sizeof(p)); p[0] = p[1] = 0; for (int i = 0; i < MAX; i++) { if (p[i]) { for (int j = 2 * i; j < MAX; j += i) { p[j] = 0; } } } int n; whi...
replace
5
6
5
6
0
p00855
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; #define N 1000000 bool prime[N + 1]; int main() { for (int i = 2; i <= N; ++i) prime[i] = true; for (int i = 2; i <= N; ++i) if (prime[i]) for (int j = 2; i * j <= N; ++j) prime[i * j] = false; int k; while (cin >> k, k) { ...
#include <algorithm> #include <iostream> using namespace std; #define N 2000000 bool prime[N + 1]; int main() { for (int i = 2; i <= N; ++i) prime[i] = true; for (int i = 2; i <= N; ++i) if (prime[i]) for (int j = 2; i * j <= N; ++j) prime[i * j] = false; int k; while (cin >> k, k) { ...
replace
3
4
3
4
0
p00855
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; int main() { vector<bool> prime(1000001, 1); prime[1] = 0; for (int i = 2; i < prime.size(); i++) { if (prime[i] == 1) { for (int j = i * 2; j < prime.size(); j += i) prime[j] = 0; } } // for(int i=0;i<prime.size();i++)if(prime[...
#include <iostream> #include <vector> using namespace std; int main() { vector<bool> prime(1299709, 1); prime[1] = 0; for (int i = 2; i < prime.size(); i++) { if (prime[i] == 1) { for (int j = i * 2; j < prime.size(); j += i) prime[j] = 0; } } // for(int i=0;i<prime.size();i++)if(prime[...
replace
5
6
5
6
0
p00855
C++
Runtime Error
// Prime Gap #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll> prime; int main() { prime.push_back(2); for (ll i = 3; i < 1200000; i += 2) { bool flag = true; for (ll j = 0; j < prime.size() && i >= prime[j] * prime[j]; j++) { if (i % prime[j] == 0) { flag = fal...
// Prime Gap #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll> prime; int main() { prime.push_back(2); for (ll i = 3; i < 1300000; i += 2) { bool flag = true; for (ll j = 0; j < prime.size() && i >= prime[j] * prime[j]; j++) { if (i % prime[j] == 0) { flag = fal...
replace
10
11
10
11
0
p00855
C++
Runtime Error
#include <iostream> #define N 1200000 using namespace std; int start(int); int goal(int); int sosu[N]; int main() { int i, j, n, s, g; for (i = 0; i < N; i++) sosu[i] = 1; sosu[0] = 0; sosu[1] = 0; for (i = 0; i < N / 2; i++) { if (sosu[i] == 1) { for (j = i * 2; j < N; j += i) { sosu[j]...
#include <iostream> #define N 1300000 using namespace std; int start(int); int goal(int); int sosu[N]; int main() { int i, j, n, s, g; for (i = 0; i < N; i++) sosu[i] = 1; sosu[0] = 0; sosu[1] = 0; for (i = 0; i < N / 2; i++) { if (sosu[i] == 1) { for (j = i * 2; j < N; j += i) { sosu[j]...
replace
1
2
1
2
0
p00856
C++
Runtime Error
#include <iostream> #include <stdio.h> #define MAX_N 100 #define MAX_T 100 using namespace std; double mbg(int N, int T, int L, int B, int Lose[], int Back[]) { int t; double p_goal = 0; double ways[MAX_T + 1][MAX_N] = {{0}}; t = 0; ways[0][0] = 1.0; while (t < T) { for (int i = 0; i < N; ++i) { ...
#include <iostream> #include <stdio.h> #define MAX_N 100 #define MAX_T 100 using namespace std; double mbg(int N, int T, int L, int B, int Lose[], int Back[]) { int t; double p_goal = 0; double ways[MAX_T + 2][MAX_N + 1] = {{0}}; t = 0; ways[0][0] = 1.0; while (t < T) { for (int i = 0; i < N; ++i) { ...
replace
9
10
9
10
0
p00856
C++
Runtime Error
#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
52
53
52
53
0
p00856
C++
Runtime Error
#include <iomanip> #include <iostream> #include <vector> using namespace std; int N, T, L, B; int next(int cur, int dice) { int ret = cur + dice; if (N < ret) ret = N - (ret - N); return ret; } int main() { ios::sync_with_stdio(false); while (cin >> N >> T >> L >> B && (N || T || L || B)) { strin...
#include <iomanip> #include <iostream> #include <vector> using namespace std; int N, T, L, B; int next(int cur, int dice) { int ret = cur + dice; if (N < ret) ret = N - (ret - N); return ret; } int main() { ios::sync_with_stdio(false); while (cin >> N >> T >> L >> B && (N || T || L || B)) { strin...
replace
19
20
19
21
0
p00856
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX 101 typedef pair<int, int> pii; int N, T, L, B; int arr[MAX]; double solve() { double dp[MAX][MAX]; // dp[ターン数][どのマスにいるか] memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 1; i <= T; i++) { for (int j = 0; j < N; j++) { for (int k = 0; ...
#include <bits/stdc++.h> using namespace std; #define MAX 501 typedef pair<int, int> pii; int N, T, L, B; int arr[MAX]; double solve() { double dp[MAX][MAX]; // dp[ターン数][どのマスにいるか] memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 1; i <= T; i++) { for (int j = 0; j < N; j++) { for (int k = 0; ...
replace
4
5
4
5
0
p00858
C++
Runtime Error
#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; /* ??????????????¬ */ #include <complex> typedef long double ld; typedef complex<ld> Point; #...
#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; /* ??????????????¬ */ #include <complex> typedef long double ld; typedef complex<ld> Point; #...
replace
557
558
557
558
0
p00858
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef double ld; typedef pair<int, int> P; typedef pair<ll, P> P1; #define fr first #define sc se...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef double ld; typedef pair<short, short> P; typedef pair<ll, P> P1; #define fr first #define s...
replace
14
15
14
15
MLE
p00859
C++
Runtime Error
#include <iostream> #include <map> #include <vector> using namespace std; typedef pair<int, int> P; int n, m; int a[110], b[110], w[110]; bool use[110]; vector<P> g[110]; int dfs(int x, int low, int up) { if (use[x]) return 0; use[x] = true; int res = 0; for (int i = 0; i < g[x].size(); i++) { if (g...
#include <iostream> #include <map> #include <vector> using namespace std; typedef pair<int, int> P; int n, m; int a[11000], b[11000], w[11000]; bool use[110]; vector<P> g[110]; int dfs(int x, int low, int up) { if (use[x]) return 0; use[x] = true; int res = 0; for (int i = 0; i < g[x].size(); i++) { ...
replace
8
9
8
9
0
p00859
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct UnionFind { vector<int> data; UnionFind(int n) : data(n, -1) {} bool unite(int x, int y) { x = find(x); y = find(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; //??????...
#include <algorithm> #include <iostream> #include <vector> using namespace std; struct UnionFind { vector<int> data; UnionFind(int n) : data(n, -1) {} bool unite(int x, int y) { x = find(x); y = find(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; //??????...
replace
34
35
34
35
0
p00860
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <cassert> #include <cctype> #include <iostream> #include <map> #include <queue> #include <unordered_set> #include <vector> #define repeat(i, n) for (int i = 0; (i) < (n); ++(i)) #define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i)) #define repeat_reverse(i, n) f...
#include <algorithm> #include <array> #include <cassert> #include <cctype> #include <iostream> #include <map> #include <queue> #include <unordered_set> #include <vector> #define repeat(i, n) for (int i = 0; (i) < (n); ++(i)) #define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i)) #define repeat_reverse(i, n) f...
replace
40
41
40
41
TLE
p00860
C++
Memory Limit Exceeded
#include <cctype> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> using namespace std; char f[16][16]; int fx, fy, N; int dx[] = {0, 0, -1, 1, 0}; int dy[] = {0, -1, 0, 0, 1}; class Ghost { public: int x[3], y[3], c; bool r; Ghost(int *i, int *j, int c, bool r) : r(r...
#include <cctype> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> using namespace std; char f[16][16]; int fx, fy, N; int dx[] = {0, 0, -1, 1, 0}; int dy[] = {0, -1, 0, 0, 1}; class Ghost { public: int x[3], y[3], c; bool r; Ghost(int *i, int *j, int c, bool r) : r(r...
replace
50
51
50
51
MLE
p00860
C++
Time Limit Exceeded
#pragma GCC target "avx" #include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(...
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, y...
replace
0
2
0
2
TLE
p00860
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(xs), 0); fill(all(ys)...
#pragma GCC optimize "O3" #include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(...
replace
0
1
0
1
TLE
p00860
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(xs), 0); fill(all(ys),...
#pragma GCC optimize "O3" #include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(...
insert
0
0
0
1
TLE
p00860
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct State { array<int, 3> xs, ys; State() { fill(all(xs), 0); fill(all(ys),...
#pragma GCC optimize "O3" #pragma GCC target "tune=native" #pragma GCC target "avx" #include <bits/stdc++.h> using namespace std; #define rep(i, j) for (int i = 0; i < (int)(j); i++) #define all(v) v.begin(), v.end() const int INF = 1 << 30; const int dx[] = {0, 1, 0, -1, 0}; const int dy[] = {1, 0, -1, 0, 0}; struct...
insert
0
0
0
3
TLE
p00860
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef vector<pair<int, int>> T; const int vy[] = {0, 1, 0, -1, 0}, vx[] = {1, 0, -1, 0, 0}; int tail; vector<pair<int, int>> vec[1000]; int W, H, N; string S[16]; int v[16 * 16 * 16 * 16 * 16 * 16]; bool isover(int y, int x) { return (y < 0 || y >= H || x < 0 || x...
#include <bits/stdc++.h> using namespace std; typedef vector<pair<int, int>> T; const int vy[] = {0, 1, 0, -1, 0}, vx[] = {1, 0, -1, 0, 0}; int tail; vector<pair<int, int>> vec[1000]; int W, H, N; string S[16]; short v[16 * 16 * 16 * 16 * 16 * 16]; bool isover(int y, int x) { return (y < 0 || y >= H || x < 0 ||...
replace
13
14
13
14
MLE
p00861
C++
Runtime Error
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define mp make_pair #define ...
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define mp make_pair #define ...
replace
30
31
30
31
0
p00861
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; map<char, int> declaration; map<pair<char, int>, int> assignment; int expression(string &s, int &idx, int now) { char array_name = s[idx]; if (isalpha(array_name)) { ++idx; ++idx; int get = expression(s, idx, now); if (declaration[array_name] <= get) ...
#include <bits/stdc++.h> using namespace std; map<char, int> declaration; map<pair<char, int>, int> assignment; int expression(string &s, int &idx, int now) { char array_name = s[idx]; if (isalpha(array_name)) { ++idx; ++idx; int get = expression(s, idx, now); if (declaration[array_name] <= get) ...
replace
51
52
51
52
0
p00862
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PI; const double EPS = 1e-6; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define F first #define S second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define SZ(a) (int)((a).size()) #define ALL(a) (a).be...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PI; const double EPS = 1e-6; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define F first #define S second #define mp(a, b) make_pair(a, b) #define pb(a) push_back(a) #define SZ(a) (int)((a).size()) #define ALL(a) (a).be...
replace
125
126
125
126
TLE
p00864
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int n, w; int dat[100]; int maxi; int l, r; double calc() { double ans = 0; l = 0; for (int i = l; i <= r; ++i) { ans += ((double)(r - i) / (r - l)) * ((double)dat[i] / maxi); } return ans + 0.01; } int main() { while ((cin...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int n, w; int dat[101]; int maxi; int l, r; double calc() { double ans = 0; l = 0; for (int i = l; i <= r; ++i) { ans += ((double)(r - i) / (r - l)) * ((double)dat[i] / maxi); } return ans + 0.01; } int main() { while ((cin...
replace
6
7
6
7
0
p00864
C++
Time Limit Exceeded
#include <stdio.h> #include <string.h> #define max(a, b) a > b ? a : b int main(void) { int n, w, v[100], i, j, count[11], num, max; double sum; while (1) { scanf("%d%d", &n, &w); max = 0; for (i = 0; i < n; i++) { scanf("%d", &v[i]); max = max(max, v[i]); } num = max / w + 1; ...
#include <stdio.h> #include <string.h> #define max(a, b) a > b ? a : b int main(void) { int n, w, v[100], i, j, count[11], num, max; double sum; while (1) { scanf("%d%d", &n, &w); if (n == 0 && w == 0) break; max = 0; for (i = 0; i < n; i++) { scanf("%d", &v[i]); max = max(max, ...
insert
9
9
9
11
TLE
p00864
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> using namespace std; #define LOG(x) // cerr << #x << " = " << x << endl int main() { while (true) { int N, W; cin >> N >> W; if (N == 0 && W == 0) break; map<int, int> occ; for (int i = 0; i < N; ++i) { int v; cin >> v; ...
#include <algorithm> #include <iostream> #include <map> using namespace std; #define LOG(x) // cerr << #x << " = " << x << endl int main() { while (true) { int N, W; cin >> N >> W; if (N == 0 && W == 0) break; map<int, int> occ; for (int i = 0; i < N; ++i) { int v; cin >> v; ...
delete
22
23
22
22
0
bar[0] = 1 bar[2] = 2 bar[1] = 1 bar[2] = 2 bar[0] = 5 bar[1] = 3 bar[2] = 1 bar[3] = 1
p00865
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
replace
33
34
33
34
TLE
p00865
C++
Memory Limit Exceeded
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 100000000 #define...
#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 100000000 #define...
replace
17
18
17
18
MLE
p00865
C++
Runtime Error
// Header {{{ // includes {{{ #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 <limits> #include <list> #include <map> #include <numer...
// Header {{{ // includes {{{ #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 <limits> #include <list> #include <map> #include <numer...
replace
329
330
329
330
-11
p00865
C++
Memory 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 each(itr, c) \ for (__typeof(c.begin()) itr = c.begin(); itr != c.end(); ++itr) #define all(x) (x).begin(), (x).end() #define...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i)) #define each(itr, c) \ for (__typeof(c.begin()) itr = c.begin(); itr != c.end(); ++itr) #define all(x) (x).begin(), (x).end() #define...
replace
13
14
13
14
MLE
p00865
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl #define int long long #define first fi #define second se using namespace std; typedef pair<int, int> P; int d[30][300010]; signe...
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define all(a) a.begin(), a.end() #define o(a) cout << a << endl // #define int long long #define first fi #define second se using namespace std; typedef pair<int, int> P; int d[30][300010]; si...
replace
5
6
5
6
MLE
p00865
C++
Time Limit Exceeded
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include...
replace
37
42
37
48
TLE
p00865
C++
Runtime Error
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #inc...
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #inc...
insert
74
74
74
76
0
p00866
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define int long long #define N 100010 using namespace std; const int INF = 1LL << 55; const int mod = (1e9) + 7; const double EPS = 1e-8; const double PI = 6.0 * asin(0.5); template <class T> T Max(T &a, T b) { return a = max(a, b); } template <class T> T Min(T &a, T b) { return a = min(a, b);...
#include <bits/stdc++.h> #define int long long #define N 100010 using namespace std; const int INF = 1LL << 55; const int mod = (1e9) + 7; const double EPS = 1e-8; const double PI = 6.0 * asin(0.5); template <class T> T Max(T &a, T b) { return a = max(a, b); } template <class T> T Min(T &a, T b) { return a = min(a, b);...
replace
30
31
30
31
TLE
p00867
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX_N 1005 typedef complex<double> P; double eps = 1e-6; P calc(P a, P b, P c, P d) { a -= d; b -= d; c -= d; return d + a + (b - a) * imag(a / c) / imag(a / c - b / c); } bool isParallel(P a, P b, P c, P d) { return (abs(imag((a - b) * conj(c - d))) < e...
#include <bits/stdc++.h> using namespace std; #define MAX_N 1005 typedef complex<double> P; double eps = 1e-6; P calc(P a, P b, P c, P d) { a -= d; b -= d; c -= d; return d + a + (b - a) * imag(a / c) / imag(a / c - b / c); } bool isParallel(P a, P b, P c, P d) { return (abs(imag((a - b) * conj(c - d))) < e...
replace
169
170
169
170
1
p00870
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; // #define int ll // #define endl "\n" typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define all(c) (c).begin(), (c).end() #define l...
#define _CRT_SECURE_NO_WARNINGS // #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; // #define int ll // #define endl "\n" typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; #define all(c) (c).begin(), (c).end() #define l...
replace
91
95
91
94
TLE
p00870
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; vector<int> edge[5001]; bool same(string a, string b, int len, int v) { if (a.size() < len || b.size() < len + v) return false; a = a.substr(0, v); b = b.substr(len, v); return (a == b);...
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; vector<int> edge[5001]; bool same(string a, string b, int len, int v) { if (a.size() < len || b.size() < len + v) return false; a = a.substr(0, v); b = b.substr(len, v); return (a == b);...
insert
80
80
80
82
TLE
p00870
C++
Runtime Error
#include <bits/stdc++.h> #define N 12 #define S 5005 #define M 1777771 using namespace std; typedef unsigned long long ull; bool dp[(1 << N)][S]; int n, m; string s[N], t; ull d1[N], d2[S], A[30]; int main() { while (1) { cin >> n >> m; if (!n && !m) break; for (int i = 0; i < n; i++) ci...
#include <bits/stdc++.h> #define N 12 #define S 5005 #define M 1777771 using namespace std; typedef unsigned long long ull; bool dp[(1 << N)][S]; int n, m; string s[N], t; ull d1[N], d2[S], A[30]; int main() { while (1) { cin >> n >> m; if (!n && !m) break; for (int i = 0; i < n; i++) ci...
replace
69
70
69
70
-11
p00870
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <fstream> #include <sys/timeb.h> using namespace std; #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define replrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--) #define reprev(i, n) replrev(i, 0, n) #define repi(itr, ds) for ...
#include "bits/stdc++.h" #include <fstream> #include <sys/timeb.h> using namespace std; #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define replrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--) #define reprev(i, n) replrev(i, 0, n) #define repi(itr, ds) for ...
replace
85
93
85
86
TLE
p00870
C++
Memory 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)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef ...
#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)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef ...
replace
49
50
49
50
MLE
p00872
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) fo...
#include <bits/stdc++.h> using namespace std; #define LOG(...) fprintf(stderr, __VA_ARGS__) // #define LOG(...) #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define RFOR(i, a, b) for (int i = (int)(b - 1); i >= (int)(a); --i) #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define RREP(i, n) fo...
insert
67
67
67
72
-6
double free or corruption (out)
p00874
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdio.h> #includ...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdio.h> #includ...
insert
71
71
71
73
TLE
p00875
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int n; string a[21], b[21]; string f, t; bool used[21]; int res; void dfs(string v, int c) { // cout << v << endl; if (v == t) { res = min(res, c); return; } if (v.size() >= t.size() || c >= res) return; ...
#include <cstdio> #include <cstring> #include <iostream> #include <string> using namespace std; int n; string a[21], b[21]; string f, t; bool used[21]; int res; void dfs(string v, int c) { // cout << v << endl; if (v == t) { res = min(res, c); return; } if (v.size() >= t.size() || c >= res) return; ...
insert
21
21
21
23
0
p00875
C++
Memory Limit Exceeded
#include <iostream> #include <set> #include <string> #include <vector> using namespace std; struct po { string a, b; }; int n; vector<po> str; int ans; string goal; int cnt = 0; set<string> memo; void saiki(string y, int kai) { cnt++; // cout << y << endl; if (y == goal && ans > kai) ans = kai; if (ans ...
#include <iostream> #include <set> #include <string> #include <vector> using namespace std; struct po { string a, b; }; int n; vector<po> str; int ans; string goal; int cnt = 0; set<string> memo; void saiki(string y, int kai) { cnt++; // cout << y << endl; if (y == goal && ans > kai) ans = kai; if (ans ...
replace
21
22
21
22
MLE
p00875
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; string sed(s...
#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; string sed(s...
replace
65
66
65
66
TLE
p00875
C++
Runtime Error
#include <iostream> #include <queue> #include <string> using namespace std; int n; string a[100], b[100], S, T; queue<pair<string, int>> Q; int main() { while (true) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; cin >> S >> T; while (!Q.empty()) ...
#include <iostream> #include <queue> #include <string> using namespace std; int n; string a[100], b[100], S, T; queue<pair<string, int>> Q; int main() { while (true) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; cin >> S >> T; while (!Q.empty()) ...
replace
28
29
28
29
0
p00875
C++
Time Limit Exceeded
//////////////////////////////////////// /// tu3 pro-con template /// //////////////////////////////////////// #include "bits/stdc++.h" using namespace std; // -- loop macros -- // #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, s, n) for (...
//////////////////////////////////////// /// tu3 pro-con template /// //////////////////////////////////////// #include "bits/stdc++.h" using namespace std; // -- loop macros -- // #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, s, n) for (...
insert
227
227
227
230
TLE
p00881
C++
Memory 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
21
22
21
22
MLE
p00881
C++
Memory Limit Exceeded
#include <climits> #include <cstring> #include <iostream> using namespace std; int w, h, dp[3000][3000]; int bit[200]; bool t[200][200]; int solve(int q, int a) { if (dp[q][a] != -1) return dp[q][a]; int cnt = 0; for (int i = 0; i < h; i++) { if ((bit[i] & q) == a) { cnt++; if (cnt > 1) ...
#include <climits> #include <cstring> #include <iostream> using namespace std; int w, h; short dp[1 << 11][1 << 11]; int bit[200]; bool t[200][200]; int solve(int q, int a) { if (dp[q][a] != -1) return dp[q][a]; int cnt = 0; for (int i = 0; i < h; i++) { if ((bit[i] & q) == a) { cnt++; if ...
replace
5
6
5
7
MLE
p00881
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int m, n; int ans[15]; int dp[2050][2050]; // S?????????????????£?????? using Set = bitset<12>; int rec(int asked, int answer) { // ??????????????????aked???answer??¨?????????????????? int &res = dp[asked][answer]; if (res != -1) return res; res = m; ...
#include <bits/stdc++.h> using namespace std; int m, n; int ans[150]; int dp[2050][2050]; // S?????????????????£?????? using Set = bitset<12>; int rec(int asked, int answer) { // ??????????????????aked???answer??¨?????????????????? int &res = dp[asked][answer]; if (res != -1) return res; res = m; ...
replace
4
5
4
5
0
p00881
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; const int inf = 1e9; bool issame(string a, string b) { for (int i = 0; i < (int)a.length(); i++) { if (a[i] != 'x' && b[i] != 'x' && a[i] != b[i]) { return false; } } return true; } int solve(string &str...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; const int inf = 1e9; bool issame(string &a, string &b) { for (int i = 0; i < (int)a.length(); i++) { if (a[i] != 'x' && b[i] != 'x' && a[i] != b[i]) { return false; } } return true; } int solve(string &s...
replace
7
8
7
8
TLE
p00881
C++
Runtime Error
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define mp make_pair #define ...
#include <algorithm> #include <cassert> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #define rep(i, n) for (int i = 0; i < (int)n; i++) #define all(c) (c).begin(), (c).end() #define mp make_pair #define ...
replace
28
29
28
29
0
p00883
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int n; bool onmp(int x, int y) { return x >= 0 && y >= 0 && x < n && y < n; } int count(int x, int y, const vector<string> &A) { int res = 0; for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) { int nx = x + i, ny = y + j; if ((!i && !j) || !o...
#include <bits/stdc++.h> using namespace std; int n; bool onmp(int x, int y) { return x >= 0 && y >= 0 && x < n && y < n; } int count(int x, int y, const vector<string> &A) { int res = 0; for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) { int nx = x + i, ny = y + j; if ((!i && !j) || !o...
insert
75
75
75
76
MLE
p00884
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; int n; vecto...
#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; int n; vecto...
insert
32
32
32
33
TLE
p00884
C++
Runtime Error
#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
50
50
50
52
-11
p00884
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #de...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++) #define rep(i, a) loop(i, 0, a) #de...
insert
41
41
41
42
TLE
p00884
C++
Time Limit Exceeded
#include <cctype> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; map<string, vector<string>> grp; map<string, bool> prn; vector<string> split(string str) { vector<string> vec; string s; for (int i = 0; i < str.size(); i++) { s = ""; while (i < str.size() && ...
#include <cctype> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; map<string, vector<string>> grp; map<string, bool> prn; vector<string> split(string str) { vector<string> vec; string s; for (int i = 0; i < str.size(); i++) { s = ""; while (i < str.size() && ...
replace
29
30
29
30
TLE
p00884
C++
Time Limit Exceeded
#include "bits/stdc++.h" #define REP(i, n) for (ll i = 0; i < n; ++i) #define RREP(i, n) for (ll i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (ll i = m; i < n; ++i) #define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i) #define ALL(v) (v).begin(), (v).end() #define PB(a) push_back(a) #define UNIQUE(v) v.erase(uniqu...
#include "bits/stdc++.h" #define REP(i, n) for (ll i = 0; i < n; ++i) #define RREP(i, n) for (ll i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (ll i = m; i < n; ++i) #define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i) #define ALL(v) (v).begin(), (v).end() #define PB(a) push_back(a) #define UNIQUE(v) v.erase(uniqu...
insert
43
43
43
44
TLE
p00884
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 <queue> #include <set> #include <sstream> #include <st...
#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 <queue> #include <set> #include <sstream> #include <st...
replace
61
62
61
62
TLE
p00884
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
replace
70
72
70
74
TLE
p00884
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <vector> using namespace std; const int maxn = 110; int n, cnt, ans; bool vis[maxn]; map<string, int> mp; vector<int> G[maxn]; void init() { for (int i = 0; i < maxn; i++) G[i].clear(); mp.clea...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <vector> using namespace std; const int maxn = 112345; int n, cnt, ans; bool vis[maxn]; map<string, int> mp; vector<int> G[maxn]; void init() { for (int i = 0; i < maxn; i++) G[i].clear(); mp.c...
replace
8
9
8
9
0