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
p00494
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; string s; int index = 0, ci = 0; int ans = 0; int c[200001]; int main() { cin >> s; while (index < s.length()) { for (int i = 0; i < 3; i++) { char ct; if (i == 0) ct = 'J'; else if (i...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; string s; int index = 0, ci = 0; int ans = 0; int c[2000000]; int main() { cin >> s; while (index < s.length()) { for (int i = 0; i < 3; i++) { char ct; if (i == 0) ct = 'J'; else if (...
replace
10
11
10
11
0
p00494
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; char str[1000005]; int main() { scanf("%s", &str); int leng = strlen(str); int ans = 0, i = 0; for (;;) { if (str[i] == 'J') { int a = 0, b = 0, c = 0; while (str[i] == 'J' && i < leng) { i++...
#include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; char str[1000005]; int main() { scanf("%s", &str); int leng = strlen(str); int ans = 0, i = 0; for (;;) { if (str[i] == 'J') { int a = 0, b = 0, c = 0; while (str[i] == 'J' && i < leng) { i++...
insert
33
33
33
35
0
p00494
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; char a[1000000]; int b; int g = 0; struct JOI { int J, O, I; }; JOI c(int d) { JOI e; e.J = e.O = e.I = 0; int f; for (f = d; f < b; f++) { if (a[f] != 'J') break; } e.J = f - d; d = f; for (f = d; f < b; f++) { if (a[f] != 'O') break;...
#include <bits/stdc++.h> using namespace std; char a[1000000]; int b; int g = 0; struct JOI { int J, O, I; }; JOI c(int d) { JOI e; e.J = e.O = e.I = 0; int f; for (f = d; f < b; f++) { if (a[f] != 'J') break; } e.J = f - d; d = f; for (f = d; f < b; f++) { if (a[f] != 'O') break;...
insert
30
30
30
31
TLE
p00494
C++
Time Limit Exceeded
#include <algorithm> #include <stdio.h> #include <string.h> #include <utility> #include <vector> using namespace std; char s[1234567]; vector<pair<char, int>> ss; int main() { scanf("%s", s); int lastsame = 1; char thlett = s[0]; for (int i = 1; i < strlen(s); ++i) { if (thlett != s[i]) { ss.push_...
#include <algorithm> #include <stdio.h> #include <string.h> #include <utility> #include <vector> using namespace std; char s[1234567]; vector<pair<char, int>> ss; int main() { scanf("%s", s); int lastsame = 1; char thlett = s[0]; int n = strlen(s); for (int i = 1; i < n; ++i) { if (thlett != s[i]) { ...
replace
16
17
16
18
TLE
p00494
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; #define loop(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, b) loop(i, 0, b) char s[100010]; int l[100010]; int main() { scanf("%s", s); int n = strlen(s); l[0] = 1; rep(i, n - 1) { if (s[i + 1] == s[i]) l[i + 1]...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; #define loop(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, b) loop(i, 0, b) char s[1000100]; int l[1000100]; int main() { scanf("%s", s); int n = strlen(s); l[0] = 1; rep(i, n - 1) { if (s[i + 1] == s[i]) l[i + ...
replace
7
9
7
9
0
p00494
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define INF (2 << 28) #define fr first #define...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define INF (2 << 28) #define fr first #define...
insert
54
54
54
55
TLE
p00494
C++
Runtime Error
#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<short, short> P;...
#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<short, short> P;...
replace
48
52
48
55
0
p00494
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<char, int> P; int main() { vector<P> v; string s; cin >> s; if (s.size() <= 2) { puts("0"); return 0; } int cnt = 0; char back = s[0]; for (char c : s) { if (c == b...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; typedef pair<char, int> P; int main() { vector<P> v; string s; cin >> s; if (s.size() <= 2) { puts("0"); return 0; } int cnt = 0; char back = s[0]; for (char c : s) { if (c == b...
insert
27
27
27
31
0
p00494
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; char c[1000000]; int main() { int o, flag, ma = 0; scanf("%s", c); for (int i = 1; i < strlen(c) - 1; i++) { if (c[i] == 'O') { o = 1; for (int j = i + 1; j < strlen(c) - 1; j++) { if (c[j] == 'O') o...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; char c[1000000]; int main() { int o, flag, ma = 0; scanf("%s", c); for (int i = 1; i < strlen(c) - 1; i++) { if (c[i] == 'O') { o = 1; for (int j = i + 1; j < strlen(c) - 1; j++) { if (c[j] == 'O') o...
insert
29
29
29
30
TLE
p00494
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define mp(a, b) make_pair((a), (b)) #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 ty...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define mp(a, b) make_pair((a), (b)) #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 ty...
replace
55
56
55
56
0
p00495
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; vector<int> an(a), br(b); for (auto &i : an) cin >> i; for (auto &i : br) cin >> i; vector<vector<int>> dp(a + 1, vector<int>(b + 1)); int res = 0; for (auto i = 0; i < b; i++) { int use = 0; for (auto &...
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; vector<int> an(a), br(b); for (auto &i : an) cin >> i; for (auto &i : br) cin >> i; int res = 0; for (auto i = 0; i < b; i++) { int use = 0; for (auto &j : an) { if (j == br[use + i]) use++; ...
delete
11
12
11
11
MLE
p00495
C++
Runtime Error
#include <cstdio> #include <cstdlib> using namespace std; int field[2][5001] = {0}; int main(void) { int current = 1; int n_a, n_b; scanf("%d%d", &n_a, &n_b); int a[5001]; for (int i = 1; i <= n_a; i++) scanf("%d", &a[i]); int b[5001]; for (int i = 1; i <= n_b; i++) scanf("%d", &b[i]); for (int ...
#include <cstdio> #include <cstdlib> using namespace std; int field[2][5001] = {0}; int main(void) { int current = 1; int n_a, n_b; scanf("%d%d", &n_a, &n_b); int a[5001]; for (int i = 1; i <= n_a; i++) scanf("%d", &a[i]); int b[5001]; for (int i = 1; i <= n_b; i++) scanf("%d", &b[i]); for (int ...
replace
24
25
24
25
0
p00495
C++
Memory Limit Exceeded
#include <cstdio> #include <cstring> #define rep(i, n) for (int i = 1; i <= (n); i++) #define max(a, b) (((a) > (b)) ? (a) : (b)) int dat[5005][2]; int dp[5005][5005]; int A, B; int main(void) { scanf("%d%d", &A, &B); rep(i, A) scanf("%d", &(dat[i][0])); rep(i, B) scanf("%d", &(dat[i][1])); rep(i, A) { rep...
#include <cstdio> #include <cstring> #define rep(i, n) for (int i = 1; i <= (n); i++) #define max(a, b) (((a) > (b)) ? (a) : (b)) int dat[5005][2]; short int dp[5005][5005]; int A, B; int main(void) { scanf("%d%d", &A, &B); rep(i, A) scanf("%d", &(dat[i][0])); rep(i, B) scanf("%d", &(dat[i][1])); rep(i, A) { ...
replace
6
7
6
7
MLE
p00495
C++
Memory Limit Exceeded
#include <stdio.h> int dp[5001][5001]; int a[5000]; int b[5000]; int max(int a, int b) { return a > b ? a : b; } int main() { int n, m; scanf("%d %d", &n, &m); int i, j; for (i = 0; i < n; i++) scanf("%d", &a[i]); for (i = 0; i < m; i++) scanf("%d", &b[i]); for (i = 0; i <= n; i++) for (j = 0; j...
#include <stdio.h> short dp[5001][5001]; int a[5000]; int b[5000]; int max(int a, int b) { return a > b ? a : b; } int main() { int n, m; scanf("%d %d", &n, &m); int i, j; for (i = 0; i < n; i++) scanf("%d", &a[i]); for (i = 0; i < m; i++) scanf("%d", &b[i]); for (i = 0; i <= n; i++) for (j = 0;...
replace
1
2
1
2
MLE
p00495
C++
Memory Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int m, n, a[5000], b[5000]; int dp[5000][5000]; int dfs(int i, int j) { if (i == m || j == n) return 0; if (dp[i][j] != -1) return dp[i][j]; if (a[i] == b[j]) return dp[i]...
#include <algorithm> #include <cstdio> #include <cstring> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int m, n, a[5000], b[5000]; short dp[5000][5000]; int dfs(int i, int j) { if (i == m || j == n) return 0; if (dp[i][j] != -1) return dp[i][j]; if (a[i] == b[j]) return dp[...
replace
10
11
10
11
MLE
p00496
C++
Memory Limit Exceeded
#include <algorithm> #include <chrono> //1e+9??§?????? auto end= chrono::system_clock::now()-st; cout<<end.count()%1e+9<<endl; #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef long lo...
#include <algorithm> #include <chrono> //1e+9??§?????? auto end= chrono::system_clock::now()-st; cout<<end.count()%1e+9<<endl; #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; typedef int ll;...
replace
12
13
12
13
MLE
p00496
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define int long long #define PB push_back #define MP make_pair #define F first #define S second using namespace std; int n, t, s, a[3010], b[3010]; int dp[3010][3010]; signed main() { cin >> n >> t >> s; for (int i = 1; i <= n; i++) { cin >> a[i] >> b[i]; } for (int i = 1; i <= ...
#include <bits/stdc++.h> // #define int long long #define PB push_back #define MP make_pair #define F first #define S second using namespace std; int n, t, s, a[3010], b[3010]; int dp[3010][3010]; signed main() { cin >> n >> t >> s; for (int i = 1; i <= n; i++) { cin >> a[i] >> b[i]; } for (int i = 1; i ...
replace
1
2
1
2
MLE
p00496
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int mem[10000][10000], A[10000], B[10000], N, T, S; int main() { int ans = 0; cin >> N >> T >> S; for (int i = 1; i <= N; i++) cin >> A[i] >> B[i]; for (int n = 1; n <= N; n++) { for (int t = 1; t <= T; t++) { mem[n][t] = max(mem[n -...
#include <algorithm> #include <iostream> using namespace std; int mem[5000][5000], A[5000], B[5000], N, T, S; int main() { int ans = 0; cin >> N >> T >> S; for (int i = 1; i <= N; i++) cin >> A[i] >> B[i]; for (int n = 1; n <= N; n++) { for (int t = 1; t <= T; t++) { mem[n][t] = max(mem[n - 1][...
replace
5
6
5
6
MLE
p00496
C++
Memory Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define rep(i, j) for (int i = 0; i < (j); i++) int N, T, S; int A[4096], B[4096]; int dp[4096][4096]; int dfs(int n, int t) { if (n >= N) return 0; if (t > T) return 0; int &res = dp[n][t]; if (res >...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define rep(i, j) for (int i = 0; i < (j); i++) int N, T, S; int A[3001], B[3001]; int dp[3001][3001]; int dfs(int n, int t) { if (n >= N) return 0; if (t > T) return 0; int &res = dp[n][t]; if (res >...
replace
10
12
10
12
MLE
p00496
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstring> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <vector> #define V...
#include <algorithm> #include <bitset> #include <cctype> #include <complex> #include <cstring> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <vector> #define V...
replace
36
37
36
37
0
p00496
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define mp(a, b) make_pair((a), (b)) #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 ty...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define mp(a, b) make_pair((a), (b)) #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 ty...
replace
39
41
39
41
MLE
p00497
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int64; short flag[5000][5000]; int main() { int N, M; scanf("%d %d", &N, &M); for (int i = 0; i < M; i++) { int A, B, C; scanf("%d %d %d", &A, &B, &C); flag[A][B] = max<short>(flag[A][B], C + 1); } int ret = 0; for (int i = 1; i <= ...
#include <bits/stdc++.h> using namespace std; typedef long long int64; short flag[5005][5005]; int main() { int N, M; scanf("%d %d", &N, &M); for (int i = 0; i < M; i++) { int A, B, C; scanf("%d %d %d", &A, &B, &C); flag[A][B] = max<short>(flag[A][B], C + 1); } int ret = 0; for (int i = 1; i <= ...
replace
3
4
3
4
0
p00497
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; #define N 2020 vector<int> x[N]; int n, m, a, b, c, cnt; int V[N]; int main() { for (int i = 0; i < N; i++) { for (int j = 0; j < i + 5; j++) { x[i].push_back(0); V[i] = j; } } cin >> n >> m; for (int i = 0; i < m; i++) { cin...
#include <iostream> #include <vector> using namespace std; #define N 5100 vector<int> x[N]; int n, m, a, b, c, cnt; int V[N]; int main() { for (int i = 0; i < N; i++) { for (int j = 0; j < i + 5; j++) { x[i].push_back(0); V[i] = j; } } cin >> n >> m; for (int i = 0; i < m; i++) { cin...
replace
4
5
4
5
0
p00497
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; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" > "D:...
#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" > "D:...
replace
27
28
27
31
0
p00497
C++
Runtime Error
#include <stdio.h> #include <string.h> int plate[5002][5002]; int n, m; int main() { memset(plate, 0, sizeof(plate)); scanf("%d %d", &n, &m); for (int i = 0; i < m; ++i) { int a, b, x; scanf("%d %d %d", &a, &b, &x); --a; --b; ++plate[a][b]; --plate[a][b + 1]; --plate[a + x + 1][b];...
#include <stdio.h> #include <string.h> int plate[5678][5678]; int n, m; int main() { memset(plate, 0, sizeof(plate)); scanf("%d %d", &n, &m); for (int i = 0; i < m; ++i) { int a, b, x; scanf("%d %d %d", &a, &b, &x); --a; --b; ++plate[a][b]; --plate[a][b + 1]; --plate[a + x + 1][b];...
replace
4
5
4
5
0
p00497
C++
Runtime Error
#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; const d...
#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; const d...
replace
25
26
25
26
0
p00497
C++
Memory Limit Exceeded
#include <algorithm> #include <climits> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; vector<int> plus_[5001], minus_[5001]; int main() { int N, M, A, B, X; cin >> N >> M; for (int i = 0; i <= N; i++) { plus_[i].assign(i + 2, 0); minus_[i].assign(i + 2, 0...
#include <algorithm> #include <climits> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; vector<short> plus_[5001], minus_[5001]; int main() { int N, M, A, B, X; cin >> N >> M; for (int i = 0; i <= N; i++) { plus_[i].assign(i + 2, 0); minus_[i].assign(i + 2,...
replace
8
9
8
9
MLE
p00497
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; short dp[5000][5000]; int main() { int N, M; cin >> N >> M; for (int i = 0; i < M; i++) { int x, y, c; cin >> y >> x >> c; dp[y - 1][x - 1] = c + 1; } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { dp[i + 1][j] =...
#include <algorithm> #include <iostream> using namespace std; short dp[5010][5010]; int main() { int N, M; cin >> N >> M; for (int i = 0; i < M; i++) { int x, y, c; cin >> y >> x >> c; dp[y - 1][x - 1] = c + 1; } for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { dp[i + 1][j] =...
replace
4
5
4
5
0
p00497
C++
Runtime Error
#include <cstdio> #define S 5002 using namespace std; int l[S][S] = {0}; int main() { int N, M, a, b, x, i, j; scanf("%d %d", &N, &M); for (i = 0; i < M; i++) { scanf("%d %d %d", &a, &b, &x); l[a][b]++; l[a][b + 1]--; l[a + x + 1][b]--; l[a + x + 2][b + 1]++; l[a + x + 2][b + x + 2]--; ...
#include <cstdio> #define S 5010 using namespace std; int l[S][S] = {0}; int main() { int N, M, a, b, x, i, j; scanf("%d %d", &N, &M); for (i = 0; i < M; i++) { scanf("%d %d %d", &a, &b, &x); l[a][b]++; l[a][b + 1]--; l[a + x + 1][b]--; l[a + x + 2][b + 1]++; l[a + x + 2][b + x + 2]--; ...
replace
1
2
1
2
0
p00497
C++
Memory Limit Exceeded
#include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; const int size = n + 3; vector<vector<int>> triangle(size, vector<int>(size, 0)); for (int i = 0; i < m; ++i) { int a, b, x; cin >> a >> ...
#include <cstdlib> #include <iostream> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; const int size = n + 3; vector<vector<int>> triangle; for (int i = 0; i < size; ++i) triangle.emplace_back(i + 2, 0); for (int i = 0; i < m...
replace
13
14
13
16
MLE
p00497
C++
Memory Limit Exceeded
#include <stdio.h> int t[5000][5000]; int max(int a, int b) { return a > b ? a : b; } int main() { int n, k; int i, j; scanf("%d %d", &n, &k); for (i = 0; i < n; i++) for (j = 0; j < n; j++) t[i][j] = -1; for (i = 0; i < k; i++) { int a, b, c; scanf("%d %d %d", &a, &b, &c); t[a - 1][b - ...
#include <stdio.h> short t[5000][5000]; int max(int a, int b) { return a > b ? a : b; } int main() { int n, k; int i, j; scanf("%d %d", &n, &k); for (i = 0; i < n; i++) for (j = 0; j < n; j++) t[i][j] = -1; for (i = 0; i < k; i++) { int a, b, c; scanf("%d %d %d", &a, &b, &c); t[a - 1][b ...
replace
1
2
1
2
MLE
p00497
C++
Runtime Error
#include <iostream> using namespace std; int main() { int a, b, x, n, m, field[5001][5001] = {}; cin >> n >> m; for (int i = 0; i < m; i++) { cin >> a >> b >> x; field[a - 1][b - 1] = x + 1; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { field[i + 1][j] = max(field[i + 1][j],...
#include <iostream> using namespace std; int main() { int a, b, x, n, m; static int field[5001][5001] = {}; cin >> n >> m; for (int i = 0; i < m; i++) { cin >> a >> b >> x; field[a - 1][b - 1] = x + 1; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { field[i + 1][j] = max(fie...
replace
4
5
4
6
-11
p00497
C++
Runtime Error
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <vector> #define rep(i, s, n) for (in...
#include <algorithm> #include <array> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <vector> #define rep(i, s, n) for (in...
replace
45
46
45
46
-11
p00497
C++
Runtime Error
#include <stdio.h> #define calc(x, y) ((((x) * ((x) + 1)) / 2) + (y)) #define safe_calc(x, y) ((((x) + 2) * ((x) + 3) / 2) + (y) + 1) int n; int sum; int nails[12517506]; void process() { int i; for (i = 1; i < n + 3; i++) { int j; for (j = 1; j <= i; j++) { nails[calc(i, j)] += nails[calc(i, j) -...
#include <stdio.h> #define calc(x, y) ((((x) * ((x) + 1)) / 2) + (y)) #define safe_calc(x, y) ((((x) + 2) * ((x) + 3) / 2) + (y) + 1) int n; int sum; int nails[13000000]; void process() { int i; for (i = 1; i < n + 3; i++) { int j; for (j = 1; j <= i; j++) { nails[calc(i, j)] += nails[calc(i, j) -...
replace
7
8
7
8
0
p00498
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <functional> #include <queue> #include <vector> #pragma warning(disable : 4996) FILE *in = freopen("./input.txt", "r", stdin); using namespace std; struct edge { int to, cost; }; bool operator<(const edge &e1, const edge &e2) { return e1.cost < e2.cost; } vector<int> pa...
#include <algorithm> #include <cstdio> #include <functional> #include <queue> #include <vector> using namespace std; struct edge { int to, cost; }; bool operator<(const edge &e1, const edge &e2) { return e1.cost < e2.cost; } vector<int> par; int root(int x) { if (x == par[x]) return x; return par[x] = root(pa...
delete
5
7
5
5
-11
p00498
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define foru(i, a, b) for (int i = int(a); i <= int(b); i++) #define ford(i, a, b) for (int i = int(a); i >= int(b); i--) #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (int)a.size() using namespace std; typedef pair<int, int> pii; typedef pair<int, p...
#include <bits/stdc++.h> #define foru(i, a, b) for (int i = int(a); i <= int(b); i++) #define ford(i, a, b) for (int i = int(a); i >= int(b); i--) #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (int)a.size() using namespace std; typedef pair<int, int> pii; typedef pair<int, p...
replace
12
13
12
13
MLE
p00498
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int64; struct UnionFind { vector<int> data; UnionFind(int sz) { data.resize(sz, -1); } int Find(int a) { return (data[a] < 0 ? a : data[a] = Find(data[a])); } void Union(int a, int b) { a = Find(a), b = Find(b); if (a == b) return; ...
#include <bits/stdc++.h> using namespace std; typedef long long int64; struct UnionFind { vector<int> data; UnionFind(int sz) { data.resize(sz, -1); } int Find(int a) { return (data[a] < 0 ? a : data[a] = Find(data[a])); } void Union(int a, int b) { a = Find(a), b = Find(b); if (a == b) return; ...
replace
12
13
12
13
MLE
p00498
C++
Memory Limit Exceeded
#include <cstdio> #include <functional> #include <queue> #include <set> #include <utility> #include <vector> using namespace std; typedef pair<int, int> P; const int INF = 1 << 30; struct edge { int p, q, c; edge(int p, int q, int c) { this->p = p; this->q = q; this->c = c; } bool operator<(const ed...
#include <cstdio> #include <functional> #include <queue> #include <set> #include <utility> #include <vector> using namespace std; typedef pair<int, int> P; const int INF = 1 << 30; struct edge { int p, q, c; edge(int p, int q, int c) { this->p = p; this->q = q; this->c = c; } bool operator<(const ed...
insert
42
42
42
43
MLE
p00498
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <v...
replace
117
118
117
118
0
p00499
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int A, B, C, D, L; int date_langue, date_math, date_play; int tmp; while (1) { cin >> L >> A >> B >> C >> D; date_langue = A / C; tmp = A % C; if (tmp > 0) date_langue++; date_math = B / D; tmp = B % D; if (tmp > 0) ...
#include <iostream> using namespace std; int main() { int A, B, C, D, L; int date_langue, date_math, date_play; int tmp; while (1) { cin >> L >> A >> B >> C >> D; date_langue = A / C; tmp = A % C; if (tmp > 0) date_langue++; date_math = B / D; tmp = B % D; if (tmp > 0) ...
insert
30
30
30
31
TLE
p00499
C++
Time Limit Exceeded
#include <stdio.h> int main(void) { int a[101], temp = 0, ruio = 0; for (int i = 1; i <= 5; i++) { scanf("%d", &a[i]); } if (a[4] < a[5]) { a[4] = a[5]; } temp = a[2] + a[3]; while (temp > 0) { temp - a[4]; ruio++; } printf("%d\n", a[1] - ruio); return 0; }
#include <stdio.h> int main(void) { int a[101], temp = 0, ruio = 0; for (int i = 1; i <= 5; i++) { scanf("%d", &a[i]); } while (a[2] > 0 || a[3] > 0) { a[2] -= a[4]; a[3] -= a[5]; ruio++; } printf("%d\n", a[1] - ruio); return 0; }
replace
6
12
6
9
TLE
p00500
C++
Runtime Error
#include <algorithm> #include <functional> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; int main(void) { int n, a[100][100], G[100][100]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < ...
#include <algorithm> #include <functional> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <time.h> #include <vector> using namespace std; int main(void) { int n, a[200][200], G[200][200]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < ...
replace
13
14
13
14
0
p00500
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> using namespace std; #define PI 4 * atan(1); int main() { int card[200][3] = {0}; int n, score[100] = {0}; cin >> n; for (int i = 0; i < n; i++)...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <stack> #include <string> #include <vector> using namespace std; #define PI 4 * atan(1); int main() { int card[200][3] = {0}; int n, score[200] = {0}; cin >> n; for (int i = 0; i < n; i++)...
replace
15
16
15
16
0
p00500
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; bool check(vector<int>, int); int main() { int n, num[101][3], score[101] = {0}; bool bo = false; cin >> n; for (int i = 0; i < n; ++i) { cin >> num[i][0] >> num[i][1] >> num[i][2]; } for (int i = 0; i < 3; ++i) { for (int j = 0; j < n; ++j)...
#include <iostream> #include <vector> using namespace std; bool check(vector<int>, int); int main() { int n, num[1001][5], score[1001] = {0}; bool bo = false; cin >> n; for (int i = 0; i < n; ++i) { cin >> num[i][0] >> num[i][1] >> num[i][2]; } for (int i = 0; i < 3; ++i) { for (int j = 0; j < n; ++...
replace
5
6
5
6
0
p00502
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int temp[201]; int a[201], b[201], c[201]; int dp[101][201]; int main() { int D, N; cin >> D >> N; for (int i = 0; i < D; ++i) cin >> temp[i]; for (int i = 0; i < N; ++i) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i...
#include <algorithm> #include <cstring> #include <iostream> using namespace std; int temp[201]; int a[201], b[201], c[201]; int dp[201][201]; int main() { int D, N; cin >> D >> N; for (int i = 0; i < D; ++i) cin >> temp[i]; for (int i = 0; i < N; ++i) cin >> a[i] >> b[i] >> c[i]; for (int i = 0; i...
replace
8
9
8
9
0
p00502
C++
Time Limit Exceeded
// // main.cpp #include <cmath> #include <iostream> using namespace std; struct status { int toptemp; int bottomtemp; int fancy; }; status dress[201]; int dp[201][201]; // i??\???????????????j????????????????????§????´??????? int temp[201]; int D, N; int MAX(int i, int j) { // i??\?????????j??????????????????...
// // main.cpp #include <cmath> #include <iostream> using namespace std; struct status { int toptemp; int bottomtemp; int fancy; }; status dress[201]; int dp[201][201]; // i??\???????????????j????????????????????§????´??????? int temp[201]; int D, N; int MAX(int i, int j) { // i??\?????????j??????????????????...
insert
21
21
21
24
TLE
p00502
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int wear[200][3], day[200]; int mem[200][200]; int D, N; int dp(int d, int b) { if (d == D) return 0; if (mem[d][b] != -1) return mem[d][b]; int ans = 0; for (int i = 0; i < N; i++) { if (wear[i][0] <= day[d] && wear[i][1] >= day[d]) ...
#include <algorithm> #include <iostream> using namespace std; int wear[200][3], day[200]; int mem[200][200]; int D, N; int dp(int d, int b) { if (d == D) return 0; if (mem[d][b] != -1) return mem[d][b]; int ans = 0; for (int i = 0; i < N; i++) { if (wear[i][0] <= day[d] && wear[i][1] >= day[d]) ...
insert
17
17
17
18
TLE
p00502
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define REP(i, s, n) for (int i = (s); i < int(n); i++) #define rep(i, n) REP(i, 0, n) #define all(co) co.begin(), co.end() int dp[201][201]; int main() { int d, n; cin >> d >> n; vector<int> ts(n), as(n), bs(n), cs(n); rep(i, d) cin >> ts[i]; rep(i, n) cin >> ...
#include "bits/stdc++.h" using namespace std; #define REP(i, s, n) for (int i = (s); i < int(n); i++) #define rep(i, n) REP(i, 0, n) #define all(co) co.begin(), co.end() int dp[201][201]; int main() { int d, n; cin >> d >> n; vector<int> ts(d), as(n), bs(n), cs(n); rep(i, d) cin >> ts[i]; rep(i, n) cin >> ...
replace
12
13
12
13
0
p00502
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <ss...
replace
45
46
45
46
0
p00502
C++
Runtime Error
// AOJ 0579: Hot days #include <algorithm> #include <iostream> #include <queue> using namespace std; typedef pair<int, int> P; const int INF = 10000000; int n, d, ans, c[200][61], save[3], dt[200], plan[101][2], s[200][101]; void solve() { for (int i = 1; i < d; i++) { if (plan[i][0] == plan[i][1]) { s[i][p...
// AOJ 0579: Hot days #include <algorithm> #include <iostream> #include <queue> using namespace std; typedef pair<int, int> P; const int INF = 10000000; int n, d, ans, c[201][61], save[3], dt[201], plan[200][2], s[200][101]; void solve() { for (int i = 1; i < d; i++) { if (plan[i][0] == plan[i][1]) { s[i][p...
replace
7
8
7
8
0
p00502
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; struct P { int min, max, hade; }; P b[200]; int d, n, t[200]; vector<int> a[200];...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; struct P { int min, max, hade; }; P b[300]; int d, n, t[300]; vector<int> a[300];...
replace
16
20
16
20
0
p00503
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll n, K; vector<ll> unzipx, unzipy, unzipz; int x, y, z; vector<ll> bx, by, bz, ex, ey, ez; int sum[55][55][55]; int press(vector<ll> &v1, vector<ll> &v2, vector<ll> &unzip) { auto t1 = v1, t2 = v2; t1.insert(t1...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; ll n, K; vector<ll> unzipx, unzipy, unzipz; int x, y, z; vector<ll> bx, by, bz, ex, ey, ez; int sum[105][105][105]; int press(vector<ll> &v1, vector<ll> &v2, vector<ll> &unzip) { auto t1 = v1, t2 = v2; t1.insert...
replace
11
12
11
12
0
p00503
C++
Memory Limit Exceeded
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #inclu...
replace
35
36
35
36
MLE
p00503
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; //// < "D:\D_Download\Visual Studio ///2015\Projects\programing_contest_c++\Debug\a.txt" > "D:...
#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" > "D:...
replace
69
70
69
70
0
p00503
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <queue> #include <vector> using namespace std; typedef long long ll; int main() { int N, K; scanf("%d%d", &N, &K); int x[2][50], y[2][50], z[2][50]; vector<int> dx, dy, dz; for (int i = 0; i < N; i++) { scanf("%d%d%d%d%d%d", &x[0][i], &y[0][i], &z[0]...
#include <algorithm> #include <bits/stdc++.h> #include <queue> #include <vector> using namespace std; typedef long long ll; int main() { int N, K; scanf("%d%d", &N, &K); int x[2][50], y[2][50], z[2][50]; vector<int> dx, dy, dz; for (int i = 0; i < N; i++) { scanf("%d%d%d%d%d%d", &x[0][i], &y[0][i], &z[0]...
replace
29
32
29
32
TLE
p00503
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; typedef long long lli; const int MAX = 300; int a[MAX][MAX][MAX]; int main() { int n, m; while (cin >> n >> m) { lli v[50][6], ans = 0; vector<lli> v2[3]; set<lli> s[3]; map<lli, int> v3[3...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; typedef long long lli; const int MAX = 100; int a[MAX][MAX][MAX]; int main() { int n, m; while (cin >> n >> m) { lli v[50][6], ans = 0; vector<lli> v2[3]; set<lli> s[3]; map<lli, int> v3[3...
replace
8
9
8
9
MLE
p00504
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> typedef long long ll; using namespace std; #define mod 1000000007 #define INF 1000...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> typedef long long ll; using namespace std; #define mod 1000000007 #define INF 1000...
replace
39
40
39
40
TLE
p00504
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; int dx[] = {-1, 0, 1, 0}; int dy[] = {0, -1, 0, 1}; int H, W; char c[50][50]; map<vector<pair<int, int>>, int> dp[50][50][3]; int dfs(int x, int y, int k, vector<pair<int, int>> vis) { if (k < 0) retu...
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; int dx[] = {-1, 0, 1, 0}; int dy[] = {0, -1, 0, 1}; int H, W; char c[50][50]; map<vector<pair<int, int>>, int> dp[50][50][4]; int dfs(int x, int y, int k, vector<pair<int, int>> vis) { if (k < 0) retu...
replace
11
12
11
12
0
p00504
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <valarray> #include <vector> using names...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <valarray> #include <vector> using names...
replace
45
46
45
46
TLE
p00504
C++
Memory Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int w, h, k; short memo[1 << 12][4][50][50]; int mask; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; char field[64][64]; bool check(int ny, int nx) { return (0 <= ny && ny < h && 0 <= nx && nx < w); } int getMax(int bit, int left, int ...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int w, h, k; int memo[1 << 12][4][50][50]; int mask; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}; char field[64][64]; bool check(int ny, int nx) { return (0 <= ny && ny < h && 0 <= nx && nx < w); } int getMax(int bit, int left, int ty...
replace
7
8
7
8
MLE
p00505
C++
Time Limit Exceeded
#include <bits/stdc++.h> //--------------------------- using namespace std; //--------------------------- #define REP(i, n) for (int i = 0; i < (n); i++) #define P(x) cout << (x) << "\n" #define MOD 1000000007 // 1e9+7 #define PI 3.1415926525 #define ll long long int // 10^18 #define INF 1000000001 // 1e9+1 int dx[...
#include <bits/stdc++.h> //--------------------------- using namespace std; //--------------------------- #define REP(i, n) for (int i = 0; i < (n); i++) #define P(x) cout << (x) << "\n" #define MOD 1000000007 // 1e9+7 #define PI 3.1415926525 #define ll long long int // 10^18 #define INF 1000000001 // 1e9+1 int dx[...
replace
27
28
27
28
TLE
p00505
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int a[3], p, q, r; int main() { while (true) { cin >> a[0] >> a[1] >> a[2]; sort(a, a + 3); if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << ' ' << endl; } if (a[0] * a[0] + a[1]...
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int a[3], p, q, r; int main() { while (true) { cin >> a[0] >> a[1] >> a[2]; sort(a, a + 3); if (a[0] + a[1] <= a[2]) { cout << p + q + r << ' ' << p << ' ' << q << ' ' << r << endl; break; } if (a[0] * a[0] ...
replace
10
11
10
12
TLE
p00505
Python
Runtime Error
result = [0] * 3 while 1: a, b, c = sorted(list(map(int, input().split()))) if a + b > c: flag = c * c - b * b - a * a if flag == 0: result[0] += 1 elif flag > 0: result[1] += 1 else: result[2] += 1 print(sum(result), *result)
acute, right, obtuse = 0, 0, 0 while True: a, b, c = sorted(map(int, input().split())) if a + b <= c: print(acute + right + obtuse, right, acute, obtuse) break d = a**2 + b**2 e = c**2 if d == e: right += 1 elif d < e: obtuse += 1 else: acute += 1
replace
0
12
0
14
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p00505/Python/s014459241.py", line 3, in <module> a, b, c = sorted(list(map(int, input().split()))) EOFError: EOF when reading a line
p00506
C++
Runtime Error
#include <stdio.h> int GCD(int a, int b) { int A, B, buff; // A >= B if (b > a) { A = b; B = a; } else { A = a; B = b; } while (A % B) { buff = B; B = A % B; A = buff; } return B; } int main() { int N, a, b, c; int G; int GC[100000000]; scanf("%d", &N); if (!(N - ...
#include <stdio.h> int GCD(int a, int b) { int A, B, buff; // A >= B if (b > a) { A = b; B = a; } else { A = a; B = b; } while (A % B) { buff = B; B = A % B; A = buff; } return B; } int main() { int N, a, b, c; int G; int GC[1000000]; scanf("%d", &N); if (!(N - 2)...
replace
23
24
23
24
-11
p00507
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a, b(N); for (int i = 0; i < N; i++) { cin >> b[i]; } sort(b.begin(), b.end()); for (int i = 0; i < min(N, 5); i++) { a.push_back(b[i]); } vector<int> v; for (int i = 0; i < N; i++) { for (int j =...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a, b(N); for (int i = 0; i < N; i++) { cin >> b[i]; } sort(b.begin(), b.end()); for (int i = 0; i < min(N, 5); i++) { a.push_back(b[i]); } vector<int> v; for (int i = 0; i < (int)a.size(); i++) { ...
replace
18
20
18
20
0
p00507
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int a[10234]; vector<int> v; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < 3; i++) v.push_back(1 << 30); for (int i = 0; i < n; i++) { for (int j = 0; j ...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int a[10234]; vector<int> v; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < 3; i++) v.push_back(1 << 30); sort(a, a + n); for (int i = 0; i < min(n, 8); i++...
replace
16
18
16
19
TLE
p00507
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> using namespace std; priority_queue<int> Q; int a[1010], n; int P(int x, int y) { int r = 10; while (x >= r) r *= 10; return r * y + x; } int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; for (int j = 0; j < i; j++) { ...
#include <algorithm> #include <iostream> #include <queue> using namespace std; priority_queue<int> Q; int a[10010], n; int P(int x, int y) { int r = 10; while (x >= r) r *= 10; return r * y + x; } int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; for (int j = 0; j < i; j++) { ...
replace
5
6
5
6
0
p00507
C++
Memory Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; const int MAX = 1000000; typedef long long ll; vector<ll> V; ll make(ll a, ll b) { for (int i = 0; i <= log10(b); i++) a *= 10LL; return a + b; } ll solve() { vector<ll> ans; int LIM = min(MAX, (int)V.si...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; const int MAX = 1000; typedef long long ll; vector<ll> V; ll make(ll a, ll b) { for (int i = 0; i <= log10(b); i++) a *= 10LL; return a + b; } ll solve() { vector<ll> ans; int LIM = min(MAX, (int)V.size(...
replace
7
8
7
8
MLE
p00507
C++
Time Limit Exceeded
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 #define pb push_back #define mp make_pair ...
#include <algorithm> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 #define pb push_back #define mp make_pair ...
replace
34
37
34
41
TLE
p00507
C++
Memory Limit Exceeded
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } int main() { int n; c...
#include <algorithm> #include <iostream> #include <sstream> #include <vector> using namespace std; inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } int main() { int n; c...
replace
25
27
25
27
MLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cstdio> #include <vector> using namespace std; int N; typedef pair<int, int> P; P pt[500000]; bool cmpy(P a, P b) { return (a.second < b.second); } int getMin(P *p, int n) { if (n <= 1) return (INT_MAX); int m = n / 2; int x = p[m].first; int d = min(ge...
#include <algorithm> #include <climits> #include <cstdio> #include <vector> using namespace std; int N; typedef pair<int, int> P; P pt[500000]; bool cmpy(P a, P b) { return (a.second < b.second); } int getMin(P *p, int n) { if (n <= 1) return (INT_MAX); int m = n / 2; int x = p[m].first; int d = min(ge...
insert
31
31
31
33
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll INF = 1000000000009; bool comp(const P &a, const P &b) { return a.second < b.second; } ll closest_pair(P *a, int n) { if (n <= 1) retu...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <vector> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll INF = 1000000000009; bool comp(const P &a, const P &b) { return a.second < b.second; } ll closest_pair(P *a, int n) { if (n <= 1) retu...
replace
28
29
28
29
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <iostream> #include <vector> using namespace std; typedef complex<double> P; typedef vector<P> VP; #define X real() #define Y imag() namespace std { bool operator<(const P &a, const P &b) { return (a.X != b.X) ? a.X < b.X : a.Y < b.Y; } } // namespace std int main() {...
#include <algorithm> #include <complex> #include <iostream> #include <vector> using namespace std; typedef complex<double> P; typedef vector<P> VP; #define X real() #define Y imag() namespace std { bool operator<(const P &a, const P &b) { return (a.X != b.X) ? a.X < b.X : a.Y < b.Y; } } // namespace std int main() {...
replace
29
30
29
30
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using names...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using names...
replace
44
45
44
47
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <vector> using namespace std; #define all(c) (c).begin(), (c).end() #define loop(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, b) loop(i, 0, b) typedef long long ll; struct P : public complex<ll> { P() {} P(ll x, ...
#include <algorithm> #include <complex> #include <iostream> #include <map> #include <vector> using namespace std; #define all(c) (c).begin(), (c).end() #define loop(i, a, b) for (int i = (a); i < (int)(b); i++) #define rep(i, b) loop(i, 0, b) typedef long long ll; struct P : public complex<ll> { P() {} P(ll x, ...
insert
46
46
46
50
TLE
p00508
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <ctime> #include <iostream> #include <vector> using namespace std; #define eps 0.0000000001 struct vec { double x, y; void nextvec() { scanf("%lf %lf", &x, &y); return; } vec operator+(const vec &a) const { return (vec){x + a.x, y + a.y...
#include <algorithm> #include <cmath> #include <cstdio> #include <ctime> #include <iostream> #include <vector> using namespace std; #define eps 0.0000000001 struct vec { double x, y; void nextvec() { scanf("%lf %lf", &x, &y); return; } vec operator+(const vec &a) const { return (vec){x + a.x, y + a.y...
replace
30
33
30
33
0
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <limits> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <cstdio> #include <queue> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; template <typename T> inline T dbl(T x) { return x * x; } int main() { const int n = ge...
#include <algorithm> #include <limits> #define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <cstdio> #include <queue> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; template <typename T> inline T dbl(T x) { return x * x; } int main() { const int n = ge...
replace
34
35
34
35
TLE
p00508
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <map> #include <vector> using namespace std; #define INF (1LL << 60) pair<int, int> points[100000]; long long int dist(int a, int b) { long long int x = points[a].first - points[b].first; long long int y = points[a].second - points[b].second; return x * x + y * y; ...
#include <algorithm> #include <cstdio> #include <map> #include <vector> using namespace std; #define INF (1LL << 60) pair<int, int> points[1000000]; long long int dist(int a, int b) { long long int x = points[a].first - points[b].first; long long int y = points[a].second - points[b].second; return x * x + y * y;...
replace
6
7
6
7
0
p00508
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
replace
39
40
39
40
-11
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <map> using namespace std; typedef pair<short, short> Pi; #define y first #define x second #define INF (1 << 30) #define SQR(x) ((x) * (x)) Pi p[500000]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%hd %hd", &p[i].x, &p[i].y); } ...
#include <algorithm> #include <cstdio> #include <map> using namespace std; typedef pair<short, short> Pi; #define y first #define x second #define INF (1 << 30) #define SQR(x) ((x) * (x)) Pi p[500000]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%hd %hd", &p[i].x, &p[i].y); } ...
insert
20
20
20
22
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
replace
39
40
39
40
TLE
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; struct P { int x, y; P(int x_, int y_) { x = x_; y = y_; } P() {} }; bool operator<(const P &p, const P &q) { return p.x < q.x; } P operator-(const P &p, const P &q) { return P(p.x - q.x, p.y - q.y); } int n...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; struct P { int x, y; P(int x_, int y_) { x = x_; y = y_; } P() {} }; bool operator<(const P &p, const P &q) { return p.x < q.x; } P operator-(const P &p, const P &q) { return P(p.x - q.x, p.y - q.y); } int n...
insert
45
45
45
49
TLE
p00508
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; const int INF = (1 << 29); class Point { public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} bool operator<(const Point a) const { if (x != a.x) return x < a.x; } }; bool compare(Poi...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; const int INF = (1 << 29); class Point { public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} bool operator<(const Point a) const { if (x != a.x) return x < a.x; return y < a.y; } ...
insert
16
16
16
17
0
p00508
C++
Runtime Error
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<double, double> P; typedef pair<P, double> P2; P rot(P p, double a) { a = a * M_PI / 180.0; return P(p.first * cos(a) + p.second * (-sin(a)), p.first * sin(a) + p.second * cos(a)); } double abss(P a,...
#include <bits/stdc++.h> #define r(i, n) for (int i = 0; i < n; i++) using namespace std; typedef pair<double, double> P; typedef pair<P, double> P2; P rot(P p, double a) { a = a * M_PI / 180.0; return P(p.first * cos(a) + p.second * (-sin(a)), p.first * sin(a) + p.second * cos(a)); } double abss(P a,...
replace
35
36
35
36
0
p00508
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n, bx, by; pair<int, int> p[100009]; int main() { scanf("%d", &n); int sq = 7, cq = 24; for (int i = 0; i < n; i++) { scanf("%d%d", &bx, &by); int ex = bx * cq - by * sq; int ey = bx * sq + by * cq; p[i] = make_pair(ex, ey); } sort(p, p + n); ...
#include <bits/stdc++.h> using namespace std; int n, bx, by; pair<int, int> p[500009]; int main() { scanf("%d", &n); int sq = 7, cq = 24; for (int i = 0; i < n; i++) { scanf("%d%d", &bx, &by); int ex = bx * cq - by * sq; int ey = bx * sq + by * cq; p[i] = make_pair(ex, ey); } sort(p, p + n); ...
replace
3
4
3
4
0
p00508
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <stdlib.h> #include <st...
replace
37
38
37
38
TLE
p00509
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; string toString(int a) { stringstream ss; ss << a; return ss.str(); } int toInt(string s) { stringstream ss(s); int res; ss >> res; return res; } bool is_prime(int a) { if (a <= 1) return false; for (int i = 2; i * i <= a; i++) { if (a % i == 0)...
#include <bits/stdc++.h> using namespace std; string toString(int a) { stringstream ss; ss << a; return ss.str(); } int toInt(string s) { stringstream ss(s); int res; ss >> res; return res; } bool is_prime(int a) { if (a <= 1) return false; for (int i = 2; i * i <= a; i++) { if (a % i == 0)...
insert
27
27
27
29
TLE
p00509
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = long long; using ull = unsigned long long; using P = std::tuple<int, int>; const int dx[8] = {-1, 1, 0, 0, -1, ...
#include <bits/stdc++.h> using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) #define unless(p) if (!(p)) #define until(p) while (!(p)) using ll = long long; using ull = unsigned long long; using P = std::tuple<int, int>; const int dx[8] = {-1, 1, 0, 0, -1, ...
replace
94
95
94
95
TLE
p00512
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define int long long using namespace std; signed main() { int n; cin >> n; set<string> st; map<string, int> m; for (int i = 0; i < n; i++) { string s; int p; cin >> s >> p; if (st.lower_...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define int long long using namespace std; signed main() { int n; cin >> n; set<string> st; map<string, int> m; for (int i = 0; i < n; i++) { string s; int p; cin >> s >> p; if (st.lower_...
replace
17
18
17
21
0
p00512
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <string> #include <vector> using namespace std; int main() { int n; scanf("%d", &n); vector<pair<int, pair<string, int>>> v; for (int i = 0; i < n; i++) { char pName[8]; int num; scanf("%s %d", pName, num); v.push_back(make_p...
#include <algorithm> #include <cstdio> #include <cstring> #include <string> #include <vector> using namespace std; int main() { int n; scanf("%d", &n); vector<pair<int, pair<string, int>>> v; for (int i = 0; i < n; i++) { char pName[8]; int num; scanf("%s %d", pName, &num); v.push_back(make_...
replace
17
18
17
18
-11
p00513
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vecto...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vecto...
replace
31
32
31
32
TLE
p00513
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; typedef long long ll; const int SIZE = 1E6; vector<int> primes; vector<bool> bits(SIZE); void sieve() { for (int i = 3; i < SIZ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <queue> #include <utility> #include <vector> using namespace std; typedef long long ll; const int SIZE = 1E6; vector<int> primes; vector<bool> bits(SIZE); void sieve() { for (int i = 3; i < SIZ...
replace
41
42
41
42
0
p00513
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; bool judge(long long int x, int n) { if ((n - x) % (2 * x + 1) == 0) { return true; } return false; } int main() { int count = 0; int m; cin >> m; for (int t = 0; t < m; t++) { int n; cin >> n; if (n == 0) { break; } bool j = t...
#include <bits/stdc++.h> using namespace std; bool judge(long long int x, int n) { if ((n - x) % (2 * x + 1) == 0) { return true; } return false; } int main() { int count = 0; int m; cin >> m; for (int t = 0; t < m; t++) { int n; cin >> n; if (n == 0) { break; } bool j = t...
replace
22
23
22
23
TLE
p00513
C++
Time Limit Exceeded
#define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <cstdio> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; bool check(int s) { for (int i = 1; s - i >= 2 * i + 1; i++) if ((s - i) % (2 * i + 1) == 0) return true; return false; } int main...
#define REP(i, n) for (int i = 0; i < (int)(n); i++) #include <cstdio> inline int getInt() { int s; scanf("%d", &s); return s; } #include <set> using namespace std; bool check(int s) { for (int i = 1; i * i <= s; i++) if ((s - i) % (2 * i + 1) == 0) return true; return false; } int main() { c...
replace
14
15
14
15
TLE
p00513
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 #define pb push_back #define mp make_pair ...
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> #define REP(i, k, n) for (int i = k; i < n; i++) #define rep(i, n) for (int i = 0; i < n; i++) #define INF 1 << 30 #define pb push_back #define mp make_pair ...
replace
30
31
30
31
TLE
p00513
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> #define int long long using namespace std; signed main() { int n, s; int ans = 0; cin >> n; while (cin >> s) { for (int x = 1; x * x <= s; x++) { for (int y = 1; 2 * x * y <= s; y++) { if (2 * x * y + x + y == s) { ans++; x = s + 1; ...
#include <cstdio> #include <iostream> #define int long long using namespace std; signed main() { int n, s; int ans = 0; cin >> n; while (cin >> s) { for (int x = 1; x * x <= s; x++) { if ((s - x) % (2 * x + 1) == 0 && (s - x) >= (2 * x + 1)) { ans++; break; } } } ans = ...
replace
12
18
12
15
TLE
p00513
C++
Time Limit Exceeded
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(c) c.begin(), c.end() #define RALL(c) c.rbegin(), c....
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define ALL(c) c.begin(), c.end() #define RALL(c) c.rbegin(), c....
replace
32
33
32
33
TLE
p00513
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define INF (2 << 28) #define fr first #define...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define INF (2 << 28) #define fr first #define...
replace
32
33
32
33
TLE
p00513
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define mod 1000000007 #define INF 2000000000 #define LLINF 4000000000000000000 ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define mod 1000000007 #define INF 2000000000 #define LLINF 4000000000000000000 ...
replace
29
30
29
30
TLE
p00513
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define PB push_back #define MP make_pair #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define ALL(a) (a).begin(), (a).end() #define MOD 10000 using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int...
#include <bits/stdc++.h> #define PB push_back #define MP make_pair #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define ALL(a) (a).begin(), (a).end() #define MOD 10000 using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int...
replace
19
20
19
20
TLE