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
p01681
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; const double EPS = 1e-8; const double PI = acos(-1); struct point { double x, y; point() : x(0), y(0) {} point(double x, double y) : ...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; const double EPS = 1e-8; const double PI = acos(-1); struct point { double x, y; point() : x(0), y(0) {} point(double x, double y) : ...
replace
203
204
203
204
TLE
p01682
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) typedef long long ll; int const MOD = 1e9 + 7; string line; string::iterator iter; inline void debug() { cout << "Remain: \"" << string(iter, line.end()) << '"' << endl; } void consu...
#include <bits/stdc++.h> using namespace std; #define REP(i, a, b) for (int i = a; i < (int)b; i++) #define rep(i, n) REP(i, 0, n) typedef long long ll; int const MOD = 1e9 + 7; string line; string::iterator iter; inline void debug() { cout << "Remain: \"" << string(iter, line.end()) << '"' << endl; } void consu...
insert
84
84
84
86
TLE
p01682
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).*begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; const int INF = 150000000; const long long M = 1000000007; typedef string::con...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).*begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; const int INF = 150000000; const long long M = 1000000007; typedef string::con...
replace
69
70
69
76
TLE
p01682
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int MOD = 1000000007LL; string s; int expr(int &p); int term(int &p); void sp(int &p); int number(int &p); int expr(int &p) { int res = term(p); sp(p); int q = p; while (q + 1 < (int)s.size() && s[q] == '>' && s[q + 1] == '>') { q += 2; ...
#include <bits/stdc++.h> using namespace std; #define int long long int MOD = 1000000007LL; string s; int expr(int &p); int term(int &p); void sp(int &p); int number(int &p); int expr(int &p) { int res = term(p); sp(p); int q = p; while (q + 1 < (int)s.size() && s[q] == '>' && s[q + 1] == '>') { q += 2; ...
replace
16
17
16
17
0
p01683
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #...
#define _USE_MATH_DEFINES #include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #...
insert
60
60
60
64
0
p01683
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef pair<int, int> P; int main() { int n; while (cin >> n && n > 0) { if (n == 1) { cout << 0 << endl; continue; } if (n == 2) { int p1, t1, p2, t2; cin >> p1 >> t1 >> p2 >> t...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef pair<int, int> P; int main() { int n; while (cin >> n && n > 0) { if (n == 1) { cout << 0 << endl; continue; } if (n == 2) { int p1, t1, p2, t2; cin >> p1 >> t1 >> p2 >> t...
replace
19
21
19
22
TLE
p01687
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i+...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i+...
replace
44
45
44
45
0
p01694
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; int n; void solve() { vector<string> f(n); for (int i = 0; i < n; i++) cin >> f[i]; int l = 0, r = 0; int ans = 0; for (int i = 0; i < n; i++) { if (f[i] == "lu" and f[i + 1] == "ru") ans++; else if (f[i] == "ru"...
#include <iostream> #include <string> #include <vector> using namespace std; int n; void solve() { vector<string> f(n); for (int i = 0; i < n; i++) cin >> f[i]; int l = 0, r = 0; int ans = 0; for (int i = 0; i < n; i++) { if (i + 1 >= n) break; if (f[i] == "lu" and f[i + 1] == "ru") ...
insert
15
15
15
17
-11
p01694
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; /*{{{*/ // template #define rep(i, n) for (int i = 0; i < n; i++) constexpr int INF = numeric_limits<int>::max() / 2; constexpr long long LINF = numeric_limits<long long>::max() / 3; #define mp make_pair #define pb push_back #define eb emplace_back #define fi first #define ...
#include <bits/stdc++.h> using namespace std; /*{{{*/ // template #define rep(i, n) for (int i = 0; i < n; i++) constexpr int INF = numeric_limits<int>::max() / 2; constexpr long long LINF = numeric_limits<long long>::max() / 3; #define mp make_pair #define pb push_back #define eb emplace_back #define fi first #define ...
replace
76
77
76
77
-11
p01695
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { vector<string> s(n); for (auto &e : s) { cin >> e; } for (int i = n - 1; i >= 0; i--) { for (int j = 0; s[i][j] == '.'; j++) { if (j + 1 < s[i].size() && s[i][j + 1] != '.') { s[i][...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n, n) { vector<string> s(n); for (auto &e : s) { cin >> e; } for (int i = n - 1; i >= 0; i--) { for (int j = 0; s[i][j] == '.'; j++) { if (j + 1 < s[i].size() && s[i][j + 1] != '.') { s[i][...
replace
14
15
14
16
-11
p01695
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define all(c) c.begin(), c.end() #define sz(c) ((int)c.size()) using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vector<int>>; signed main() { while (1) { int n...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define all(c) c.begin(), c.end() #define sz(c) ((int)c.size()) using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vector<int>>; signed main() { while (1) { int n...
replace
35
36
35
36
0
p01695
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
53
56
53
58
0
p01695
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define SZ(a) ((int)(a.size())) int n; string in[100]; void solve() { rep(i, n) cin >> in[i]; rep(i, n) { int idx = -1; rep(j, SZ(in[i])) { if (in[i][j] != '.') { if (j) { in[i][j - 1]...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) #define SZ(a) ((int)(a.size())) int n; string in[10000]; void solve() { rep(i, n) cin >> in[i]; rep(i, n) { int idx = -1; rep(j, SZ(in[i])) { if (in[i][j] != '.') { if (j) { in[i][j - ...
replace
7
8
7
8
0
p01696
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string.h> #define MAX_N 1000 using namespace std; char str[100], res[100]; void reverse(char *str, char *res) { for (int i = 0; i < strlen(str); i++) { res[i] = str[strlen...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string.h> #define MAX_N 1000 using namespace std; char str[100], res[100]; void reverse(char *str, char *res) { for (int i = 0; i < strlen(str); i++) { res[i] = str[strlen...
replace
35
36
35
37
TLE
p01697
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define abs(a) max((a), -(a)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repe(i, n) rep(i, (n) + 1) #define per(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define pere(i,...
replace
71
79
71
82
MLE
p01697
C++
Memory Limit Exceeded
//================================= // Created on: 2018/07/04 16:12:54 //================================= #include <bits/stdc++.h> using namespace std; struct CostGraph { CostGraph(const int n) : V{n}, edge(n) {} void addEdge(const int from, const int to, const int cost, const int tim, const int lab...
//================================= // Created on: 2018/07/04 16:12:54 //================================= #include <bits/stdc++.h> using namespace std; struct CostGraph { CostGraph(const int n) : V{n}, edge(n) {} void addEdge(const int from, const int to, const int cost, const int tim, const int lab...
replace
63
64
63
64
MLE
p01697
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using pi = tuple<int, int, int>; const int INF = 100000000; int main() { int N, M, H, K, S, T, P; while (cin >> N >> M >> H >> K, N | M | H | K) { vector<int> a(M), b(M), c(M), h(M), r(M); for (int i = 0; i < M; i++) { cin >> a[i] >> b[i] >> c[i] >> h[i] ...
#include <bits/stdc++.h> using namespace std; using pi = tuple<int, int, int>; const int INF = 100000000; int main() { int N, M, H, K, S, T, P; while (cin >> N >> M >> H >> K, N | M | H | K) { vector<int> a(M), b(M), c(M), h(M), r(M); for (int i = 0; i < M; i++) { cin >> a[i] >> b[i] >> c[i] >> h[i] ...
replace
58
59
58
60
TLE
p01697
C++
Memory Limit Exceeded
#include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define each(i, n) for (auto i : n) #define clr(n) memset(n, 0, sizeof(n)...
#include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define each(i, n) for (auto i : n) #define clr(n) memset(n, 0, sizeof(n)...
replace
109
110
109
110
MLE
p01697
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define N_MAX 100 #define INF (1e9) using namespace std; typedef pair<int, int> P; typedef pair<P, P> P1; typedef pair<int, P> P2; int a, b, c, h, r, s, t, p, l, d, k, ans; int N, M, H, K, dp[300][(1 << 8)]; vector<P1> v[N_MAX]; P L[300]; void dijkstra(int S, int C) { int d[25][N_MAX]; pri...
#include <bits/stdc++.h> #define N_MAX 100 #define INF (1e9) using namespace std; typedef pair<int, int> P; typedef pair<P, P> P1; typedef pair<int, P> P2; int a, b, c, h, r, s, t, p, l, d, k, ans; int N, M, H, K, dp[300][(1 << 8)]; vector<P1> v[N_MAX]; P L[300]; void dijkstra(int S, int C) { int d[25][N_MAX]; pri...
replace
14
15
14
15
TLE
p01697
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define X first #define Y second using namespace std; typedef pair<int, int> pii; const int INF = 1e9; int main() { int N, M, H, K; while (cin >> N >> M >> H >> K, N | M | H | K) { vec...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define X first #define Y second using namespace std; typedef pair<int, int> pii; const int INF = 1e9; int main() { int N, M, H, K; while (cin >> N >> M >> H >> K, N | M | H | K) { vec...
replace
52
53
52
53
TLE
p01698
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using VI = vector<int>; using VVI = vector<VI>; using PII = pair<int, int>; using LL = long long; using VL = vector<LL>; using VVL = vector<VL>; using PLL = pair<LL, LL>; using VS = vector<string>; #define ALL(a) begin((a)), end((a)) #define RALL(a) (a).rbegin(), (a).rend...
#include <bits/stdc++.h> using namespace std; using VI = vector<int>; using VVI = vector<VI>; using PII = pair<int, int>; using LL = long long; using VL = vector<LL>; using VVL = vector<VL>; using PLL = pair<LL, LL>; using VS = vector<string>; #define ALL(a) begin((a)), end((a)) #define RALL(a) (a).rbegin(), (a).rend...
replace
103
122
103
119
TLE
p01703
C++
Time Limit Exceeded
#include <bits/stdc++.h> double ans[100010]; void MAIN(int n) { std::vector<double> prob; for (int i = 0; i < n; ++i) { double p; scanf("%lf", &p); if (p < 0.995) { prob.push_back(p); } else if (prob.empty() || prob.back() < 0.995) { prob.push_back(p); } else { prob[prob.size...
#include <bits/stdc++.h> double ans[100010]; void MAIN(int n) { std::vector<double> prob; for (int i = 0; i < n; ++i) { double p; scanf("%lf", &p); if (p < 0.995) { prob.push_back(p); } else if (prob.empty() || prob.back() < 0.995) { prob.push_back(p); } else { prob[prob.size...
replace
22
23
22
23
TLE
p01704
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { while (1) { int n; cin >> n; if (!n) break; double pw; cin >> pw; vector<double> vw(n); vector<double> pf(n); vector<double> vf(n); vector<double> th(n); for (int i = 0; i < n; i++) { cin >> vw[i] >> pf[i]...
#include <bits/stdc++.h> using namespace std; int main() { while (1) { int n; cin >> n; if (!n) break; double pw; cin >> pw; vector<double> vw(n); vector<double> pf(n); vector<double> vf(n); vector<double> th(n); for (int i = 0; i < n; i++) { cin >> vw[i] >> pf[i]...
replace
23
24
23
24
TLE
p01705
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <map> using namespace std; int main() { for (int N; cin >> N, N;) { int X[51234], R[51234]; for (int i = 0; i < N; i++) { cin >> X[i] >> R[i]; } double l = 0, h = 1e9; for (int i = 0; i < 88; i++) { double m = (l + h) / 2; map<doubl...
#include <cmath> #include <iostream> #include <map> using namespace std; int main() { for (int N; cin >> N, N;) { int X[51234], R[51234]; for (int i = 0; i < N; i++) { cin >> X[i] >> R[i]; } double l = 0, h = 1e9; for (int i = 0; i < 66; i++) { double m = (l + h) / 2; map<doubl...
replace
13
14
13
14
TLE
p01706
C++
Runtime Error
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, ...
#include <algorithm> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, ...
replace
26
27
26
27
0
p01707
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define FR first #define SC second #define all(v) (v).begin(), (v).end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, f, n) for (int i = (int)(f); i < (int)(n); i++) #define each(a, b) for (auto &a : b) typedef pair<int, int>...
#include <bits/stdc++.h> using namespace std; #define int long long #define FR first #define SC second #define all(v) (v).begin(), (v).end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define reps(i, f, n) for (int i = (int)(f); i < (int)(n); i++) #define each(a, b) for (auto &a : b) typedef pair<int, int>...
replace
67
70
67
73
0
p01707
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; void solve(int d, int x, vector<long long> &dp) { if (d == 1) { for (int i = 0; i < dp.size() && i < x; i++) dp[i] = 1; return; } vector<long long> A(dp.size()); if (d & 1) { solve(d - 1, x, A); for (int i = 0; i < x; i...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; void solve(long long d, int x, vector<long long> &dp) { if (d == 1) { for (int i = 0; i < dp.size() && i < x; i++) dp[i] = 1; return; } vector<long long> A(dp.size()); if (d & 1) { solve(d - 1, x, A); for (int i = 0; i ...
replace
3
4
3
4
MLE
p01707
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) const int MOD = 1000000007; typedef long long ll; ll N, D, X; typedef vector<int> Vec; typedef vector<Vec> Mat; void mat_mul(Vec &A, const Vec &B) { const int n = A.size(); Vec col(n); REP(j, n) { ll s = 0; ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) const int MOD = 1000000007; typedef long long ll; ll N, D, X; typedef vector<int> Vec; typedef vector<Vec> Mat; void mat_mul(Vec &A, const Vec &B) { const int n = A.size(); Vec col(n); REP(j, n) { ll s = 0; ...
replace
13
16
13
16
TLE
p01708
C++
Runtime Error
#include <cassert> #include <complex> #include <iomanip> #include <iostream> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef complex<double> vec; typedef pair<vec, vec> line; double ip(vec u, vec v) { return real(u * conj(v)); } double cross(vec u, vec v) { return i...
#include <cassert> #include <complex> #include <iomanip> #include <iostream> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; typedef complex<double> vec; typedef pair<vec, vec> line; double ip(vec u, vec v) { return real(u * conj(v)); } double cross(vec u, vec v) { return i...
replace
86
87
86
87
0
p01710
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, f, n) for (int i = (f); i < (n); i++) #define all(v) (v).begin(), (v).end() #define each(it, v) ...
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, f, n) for (int i = (f); i < (n); i++) #define all(v) (v).begin(), (v).end() #define each(it, v) ...
replace
108
109
108
109
0
p01712
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; // #define int long long #define DBG 1 #define dump(o) \ if (DBG) { \ cerr << #o << " " << o << endl; ...
#include "bits/stdc++.h" using namespace std; // #define int long long #define DBG 0 #define dump(o) \ if (DBG) { \ cerr << #o << " " << o << endl; ...
replace
4
5
4
5
0
h 1 0 0 1 -1 0 1 -1 0 -1 w 1 0 0 1 -1 0 1 -1 0 -1 h 1 1 1 2 1 1 2 1 1 0 w 1 1 1 2 1 1 2 1 1 0
p01712
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int main() { int N, W, H; cin >> N >> W >> H; int vertical[W + 1]; int horizon[H + 1]; for (int i = 0; i < W + 1; i++) { vertical[i] = 0; } for (int i = 0; i < H + 1; i++) { horizon[i] = 0; } for (int times = 0; times < N; times+...
#include <algorithm> #include <iostream> using namespace std; int main() { int N, W, H; cin >> N >> W >> H; int vertical[W + 1]; int horizon[H + 1]; for (int i = 0; i < W + 1; i++) { vertical[i] = 0; } for (int i = 0; i < H + 1; i++) { horizon[i] = 0; } for (int times = 0; times < N; times+...
replace
29
30
29
30
0
p01712
C++
Runtime Error
#include <algorithm> #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 using namespace ...
#include <algorithm> #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 using namespace ...
replace
19
20
19
20
0
p01712
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <utility> using namespace std; class S { public: S(int length) : length(length) { part.insert(make_pair(length + 1, length + 1)); } void add_ap(int pos, int power) { int start = max(pos - power, 0), end = min(pos + power, length); auto ...
#include <algorithm> #include <iostream> #include <map> #include <utility> using namespace std; class S { public: S(int length) : length(length) { part.insert(make_pair(length + 1, length + 1)); } void add_ap(int pos, int power) { int start = max(pos - power, 0), end = min(pos + power, length); auto ...
replace
15
16
15
16
0
p01712
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int mx[10020], my[10020]; int main() { int n, h, w; cin >> n >> w >> h; while (n--) { int x, y, c; cin >> x >> y >> c; mx[max(0, x - c)]++; mx[min(w + 1, x + c)]--; my[max(0, y - c)]++; my[min(h + 1, y + c)]--; } int ans = ...
#include <algorithm> #include <iostream> using namespace std; int mx[100020], my[100020]; int main() { int n, h, w; cin >> n >> w >> h; while (n--) { int x, y, c; cin >> x >> y >> c; mx[max(0, x - c)]++; mx[min(w + 1, x + c)]--; my[max(0, y - c)]++; my[min(h + 1, y + c)]--; } int ans ...
replace
3
4
3
4
0
p01712
C++
Runtime Error
#include <cstdio> #include <iostream> #include <vector> using namespace std; int n, w, h; int r(int a, int b) { int c = a + b; if (c < 0) return 0; else if (c > h) return h; else return c; } int main(void) { cin >> n >> w >> h; vector<int> x(n), y(n), z(n); for (int i = 0; i < n; i++) ...
#include <cstdio> #include <iostream> #include <vector> using namespace std; int n, w, h; int r(int a, int b) { int c = a + b; if (c < 0) return 0; else if (c > h) return h; else return c; } int main(void) { cin >> n >> w >> h; vector<int> x(n), y(n), z(n); for (int i = 0; i < n; i++) ...
delete
23
27
23
23
0
p01712
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[] = {0, 0, 1, -1, 1, 1, -1, -1}; int dx[] = {1, -1, 0, 0, 1, -1, -1, 1}; int miti[10020]; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a...
#include <bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[] = {0, 0, 1, -1, 1, 1, -1, -1}; int dx[] = {1, -1, 0, 0, 1, -1, -1, 1}; int miti[300000]; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (...
replace
7
8
7
8
0
p01712
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int main() { int n, w, h, ans = 0; pair<int, int> han[2][10001]; cin >> n >> w >> h; for (int i = 0, x, y, z; i < n; i++) { cin >> x >> y >> z; han[0][i] = P(x - z, x + z); han[1][i] = P(y - z, y + z); } han[0][n] = P(w, w);...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; int main() { int n, w, h, ans = 0; pair<int, int> han[2][100001]; cin >> n >> w >> h; for (int i = 0, x, y, z; i < n; i++) { cin >> x >> y >> z; han[0][i] = P(x - z, x + z); han[1][i] = P(y - z, y + z); } han[0][n] = P(w, w)...
replace
5
6
5
6
0
p01712
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; int xdp[108000], ydp[108000]; int n, W, H; int x, y, w; int main() { cin >> n >> W >> H; for (int i = 0; i < n; i++) { cin >> x >> y >> w; xdp[max(x - w, 0)]++; xdp[x + w]--; ydp[max(y - w, 0)]++; ydp[y + w]--; } int ok = 2; f...
#include <algorithm> #include <iostream> using namespace std; int xdp[216000], ydp[216000]; int n, W, H; int x, y, w; int main() { cin >> n >> W >> H; for (int i = 0; i < n; i++) { cin >> x >> y >> w; xdp[max(x - w, 0)]++; xdp[x + w]--; ydp[max(y - w, 0)]++; ydp[y + w]--; } int ok = 2; f...
replace
5
6
5
6
0
p01713
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int W; cin >> W; vector<int> a(W), dp1(W + 2, -1e9), dp2(W + 2, -1e9); for (int i = 1; i <= W; i++) cin >> a[i]; for (int i = 1; i <= W; i++) { if (a[i] == 0) dp1[i] = 1e9; else if (a[i] < 0) dp1[i] = min(dp1[i - 1] - 1, -a[i...
#include <bits/stdc++.h> using namespace std; int main() { int W; cin >> W; vector<int> a(W + 2), dp1(W + 2, -1e9), dp2(W + 2, -1e9); for (int i = 1; i <= W; i++) cin >> a[i]; for (int i = 1; i <= W; i++) { if (a[i] == 0) dp1[i] = 1e9; else if (a[i] < 0) dp1[i] = min(dp1[i - 1] - 1, ...
replace
6
7
6
7
0
p01715
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int dp[2222][2222]; int R[2222][2222]; int S, N, M; const int INF = (1000000009); bool update(int &a, int b) { if (a > b) { a = b; return true; } return false; } int solvek() { fill(dp[0], dp[M + 1], INF); dp[0][0] = 0; for (int i = 1; i <= M; i++) { ...
#include <bits/stdc++.h> using namespace std; int dp[2222][2222]; int R[2222][2222]; int S, N, M; const int INF = (1000000009); bool update(int &a, int b) { if (a > b) { a = b; return true; } return false; } int solvek() { fill(dp[0], dp[M + 1], INF); dp[0][0] = 0; for (int i = 1; i <= M; i++) { ...
replace
42
43
42
43
TLE
p01717
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; struct Edge { int v, w; }; typedef vector<vector<Edge>> Graph; const int INF = 1 << 28; const int MAXN = 2020; int N, M, K; Graph G; bool vis[MAXN]; int size; int cost[MAXN]; int dp[MAXN][MAXN][2]; int C; int Size[MAXN]; int V[MAXN][MAXN]; int dp2[MAXN][MAXN]; void df...
#include <bits/stdc++.h> using namespace std; struct Edge { int v, w; }; typedef vector<vector<Edge>> Graph; const int INF = 1 << 28; const int MAXN = 2020; int N, M, K; Graph G; bool vis[MAXN]; int size; int cost[MAXN]; int dp[MAXN][MAXN][2]; int C; int Size[MAXN]; int V[MAXN][MAXN]; int dp2[MAXN][MAXN]; void df...
replace
38
39
38
39
TLE
p01717
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>>; struct Edge { int from; int to; int cost; }; vector<vector<vector<int>>> *dp; int main() { int N, M, K; c...
#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>>; struct Edge { int from; int to; int cost; }; vector<vector<vector<int>>> *dp; int main() { int N, M, K; c...
insert
93
93
93
94
0
p01719
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...
replace
58
59
58
59
0
p01719
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct Item { int value, weight; }; int dp[11][10001]; int knapsack(vector<Item> &items, int W) { fill(dp[0], dp[11], -1); dp[0][0] = 0; int N = items.size(); for (int i = 0; i < N; ++i) { for (int j = 0; j <= W; ++j) { if (dp[i][j] < 0) conti...
#include <bits/stdc++.h> using namespace std; struct Item { int value, weight; }; int dp[11][100001]; int knapsack(vector<Item> &items, int W) { fill(dp[0], dp[11], -1); dp[0][0] = 0; int N = items.size(); for (int i = 0; i < N; ++i) { for (int j = 0; j <= W; ++j) { if (dp[i][j] < 0) cont...
replace
8
9
8
9
0
p01719
C++
Runtime Error
#include <iostream> using namespace std; int n, d, p[10][10], ans; void saiki(int sum, int x, int day, int I) { int f = 1; for (int i = I; i < n; i++) if (p[day][i] / p[day - 1][i] && x / p[day - 1][i]) { f = 0; saiki(sum + p[day][i], x - p[day - 1][i], day, i); } if (f) ans = max(ans, su...
#include <iostream> using namespace std; int n, d, p[10][10], ans; void saiki(int sum, int x, int day, int I) { int f = 1; for (int i = I; i < n; i++) if (p[day][i] / p[day - 1][i] && x / p[day - 1][i]) { f = 0; saiki(sum + p[day][i], x - p[day - 1][i], day, i); } if (f) ans = max(ans, su...
replace
22
23
22
23
-8
p01719
C++
Runtime Error
class in { struct my_iterator { int it; const bool rev; explicit constexpr my_iterator(int it_, bool rev = false) : it(it_), rev(rev) {} int operator*() { return it; } bool operator!=(my_iterator &r) { return it != r.it; } void operator++() { rev ? --it : ++it; } }; const my_iterat...
class in { struct my_iterator { int it; const bool rev; explicit constexpr my_iterator(int it_, bool rev = false) : it(it_), rev(rev) {} int operator*() { return it; } bool operator!=(my_iterator &r) { return it != r.it; } void operator++() { rev ? --it : ++it; } }; const my_iterat...
replace
34
36
34
37
0
p01719
C++
Runtime Error
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <...
replace
63
64
63
64
0
p01719
C++
Time Limit Exceeded
#include <iostream> using namespace std; int n, p[10][10], ans; void saiki(int sum, int x, int day, int I) { int f = 1; for (int i = I + 1; i < n; i++) for (int j = 1; x / (p[day - 1][i] * j); j++) f = 0, saiki(sum + p[day][i] * j, x - p[day - 1][i] * j, day, i); if (f) ans = max(ans, sum + x); } ...
#include <iostream> using namespace std; int n, p[10][10], ans; void saiki(int sum, int x, int day, int I) { int f = 1; for (int i = I + 1; i < n; i++) for (int j = 1; (p[day][i] / p[day - 1][i]) && (x / (p[day - 1][i] * j)); j++) { f = 0; saiki(sum + p[day][i] * j, x - p[day - 1][i] * j, ...
replace
7
10
7
12
TLE
p01719
C++
Memory Limit Exceeded
#include <iostream> using namespace std; #define MAX_N 20 #define MAX_M 20000000 #define MAX_P 300000 int d[MAX_N][MAX_N]; int dp[MAX_M]; int dp2[MAX_M]; int DP[MAX_N]; int main() { int n, m, p; cin >> m >> n >> p; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> d[i][j]; } } ...
#include <iostream> using namespace std; #define MAX_N 20 #define MAX_M 6000000 #define MAX_P 300000 int d[MAX_N][MAX_N]; int dp[MAX_M]; int dp2[MAX_M]; int DP[MAX_N]; int main() { int n, m, p; cin >> m >> n >> p; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> d[i][j]; } } ...
replace
4
5
4
5
MLE
p01723
C++
Memory Limit Exceeded
// Template {{{ #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long LL; #ifdef LOCAL #include "contest.h" #else #define dump(x) #endif class range { struct Iterator { int val, inc; int operator*() { return val; } bool operator!=(Iterator &...
// Template {{{ #include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; typedef long long LL; #ifdef LOCAL #include "contest.h" #else #define dump(x) #endif class range { struct Iterator { int val, inc; int operator*() { return val; } bool operator!=(Iterator &...
replace
46
47
46
47
MLE
p01724
C++
Runtime Error
#include <iostream> #define inf 1000000000 using namespace std; const int W = 15, H = 20; char map[W][H]; int sx, sy; const int vx[] = {1, 1, 0, -1, -1, -1, 0, 1}, vy[] = {0, -1, -1, -1, 0, 1, 1, 1}; int dfs(int x, int y) { int nx, ny; int ret = inf; if (y >= H - 2) return 0; for (int d = 0; d...
#include <iostream> #define inf 1000000000 using namespace std; const int W = 15, H = 20; char map[W][H]; int sx, sy; const int vx[] = {1, 1, 0, -1, -1, -1, 0, 1}, vy[] = {0, -1, -1, -1, 0, 1, 1, 1}; int dfs(int x, int y) { int nx, ny; int ret = inf; if (y >= H - 2) return 0; for (int d = 0; d...
replace
25
27
25
31
0
p01724
C++
Time Limit Exceeded
#include "bits/stdc++.h" using namespace std; // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2612&lang=jp #define INF 1 << 30 #define H 19 #define W 15 typedef long long ll; typedef pair<int, int> pii; int ans = INF; int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1}; bool ch...
#include "bits/stdc++.h" using namespace std; // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2612&lang=jp #define INF 1 << 30 #define H 19 #define W 15 typedef long long ll; typedef pair<int, int> pii; int ans = INF; int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1}; bool ch...
insert
82
82
82
99
TLE
p01724
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { rep(i, ...
#include <bits/stdc++.h> #define range(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, b) for (int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { rep(i, ...
insert
49
49
49
51
TLE
p01724
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; struct State { int x[19][15]; }; State S; int dx[8] = {1, 1, 1, 0, -1, -1, -1, 0}, dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1}; int solve(State p) { int cx = 0, cy = 0; for (int i = 0; i < 285; i++) { if (p.x[i / 15][i % ...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; struct State { int x[19][15]; }; State S; int dx[8] = {1, 1, 1, 0, -1, -1, -1, 0}, dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1}; int solve(State p) { bool OK3 = false; for (int i = 0; i < 15; i++) { if (p.x[18][i] == 1 || ...
insert
11
11
11
18
TLE
p01725
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b)...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b)...
replace
43
44
43
46
-11
p01726
C++
Memory Limit Exceeded
#include "bits/stdc++.h" #include <unordered_map> #include <unordered_set> #pragma warning(disable : 4996) using namespace std; using ld = long double; template <class T> using Table = vector<vector<T>>; const ld eps = 1e-9; // < "D:\D_Download\Visual Studio // 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\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:\D...
replace
14
15
14
15
MLE
p01726
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; #define MOD 1000000007ll #define INF 1000000000ll #define EPS 1e-10 #define FOR(i, n, m) for (ll i = n; i < (ll)m; i++) #define REP(i, n) FOR(i, 0, n) #define DUMP(a) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; #define MOD 1000000007ll #define INF 1000000000ll #define EPS 1e-10 #define FOR(i, n, m) for (ll i = n; i < (ll)m; i++) #define REP(i, n) FOR(i, 0, n) #define DUMP(a) ...
replace
25
27
25
27
MLE
p01726
C++
Runtime Error
#include <algorithm> #include <cassert> #include <iostream> #include <string> #include <vector> using namespace std; int n, k; int rk[300100]; int tmp[300100]; bool compare_sa(int i, int j) { if (rk[i] != rk[j]) return rk[i] < rk[j]; int ri, rj; ri = i + k <= n ? rk[i + k] : -1; rj = j + k <= n ? rk[j + k...
#include <algorithm> #include <cassert> #include <iostream> #include <string> #include <vector> using namespace std; int n, k; int rk[300100]; int tmp[300100]; bool compare_sa(int i, int j) { if (rk[i] != rk[j]) return rk[i] < rk[j]; int ri, rj; ri = i + k <= n ? rk[i + k] : -1; rj = j + k <= n ? rk[j + k...
replace
26
27
26
27
0
p01730
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef pair<double, double> P; double D(P a, P b) { int x1 = floor(a.F / 10) * 10, x2 = floor(b.F / 10) * 10, y1 = floor(a.S / 10) * 10, y2 = floor(b.S / 10) * 10; if (x1 != a.F && x2 != b.F && x1 == x2 && y1 != y2) { double ...
#include <bits/stdc++.h> using namespace std; #define F first #define S second typedef pair<double, double> P; double D(P a, P b) { int x1 = floor(a.F / 10) * 10, x2 = floor(b.F / 10) * 10, y1 = floor(a.S / 10) * 10, y2 = floor(b.S / 10) * 10; if (x1 != a.F && x2 != b.F && x1 == x2 && y1 != y2) { double ...
replace
23
25
23
25
TLE
p01731
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define mp(a, b) make_pair(a, b) #define all(x) (x).begin(), (x).end() #def...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb(s) push_back(s) #define mp(a, b) make_pair(a, b) #define all(x) (x).begin(), (x).end() #def...
replace
30
32
30
32
0
p01732
C++
Runtime Error
#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
41
43
41
43
0
p01732
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pair; struct Edge { int to, w; bool operator<(const Edge &e) const { return w > e.w; } }; typedef vector<vector<Edge>> Graph; const int INF = 1 << 28; const int di[] = {0, 1, 0, -1}; const int dj[] = {1, 0, -1, 0}; int dijkstra(int src, int dst...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> Pair; struct Edge { int to, w; bool operator<(const Edge &e) const { return w > e.w; } }; typedef vector<vector<Edge>> Graph; const int INF = 1 << 28; const int di[] = {0, 1, 0, -1}; const int dj[] = {1, 0, -1, 0}; int dijkstra(int src, int dst...
replace
43
44
43
44
0
p01732
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <queue> #include <unordered_map> using namespace std; #define INF 99999999 typedef int Weight; struct Edge { int src, dst; Weight weight; Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; bool operator<(const Edge &...
#include <algorithm> #include <cstdio> #include <cstring> #include <queue> #include <unordered_map> using namespace std; #define INF 99999999 typedef int Weight; struct Edge { int src, dst; Weight weight; Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; bool operator<(const Edge &...
replace
43
44
43
44
0
p01732
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef pair<int, P> PP; typedef priority_queue<PP, vector<PP>, greater<PP>> QUE; int d[501][501][4]; int main() { int W, H, N; cin >> W >> H >> N; int x1, y1, x2, y2; cin >> y1 >> x1 >> y2 >> x2; map<char, int> dx, dy; dx['U'] = -...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef pair<int, P> PP; typedef priority_queue<PP, vector<PP>, greater<PP>> QUE; int d[501][501][4]; int main() { int W, H, N; cin >> W >> H >> N; int x1, y1, x2, y2; cin >> y1 >> x1 >> y2 >> x2; map<char, int> dx, dy; dx['U'] = -...
replace
56
57
56
57
0
p01733
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; map<int, int> pop[123456]; int x[123456], y[123456]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { int w; cin >> x[i] >> y[i] >> w; pop[y[i]][x[i]] = w; } int ans = 0; for (int i = 0; ...
#include <algorithm> #include <iostream> #include <map> #include <vector> using namespace std; map<int, map<int, int>> pop; int x[123456], y[123456]; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { int w; cin >> x[i] >> y[i] >> w; pop[y[i]][x[i]] = w; } int ans = 0; for (int i = 0...
replace
7
8
7
8
0
p01733
C++
Runtime Error
#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 UNIQUE(v) v.erase(unique(ALL(v)), v.end()); #defin...
#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 UNIQUE(v) v.erase(unique(ALL(v)), v.end()); #defin...
replace
54
57
54
57
0
p01733
C++
Memory Limit Exceeded
#include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++...
#include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define loop(i, a, b) for (int i = a; i < b; i++...
replace
64
65
64
67
MLE
p01736
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
replace
172
173
172
174
0
p01736
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define all(c) c.begin(), c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(...
replace
79
80
79
80
TLE
p01739
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using Int = long long; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }; template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }; template <typename T> struct PrimalDual { struct edge {...
#include <bits/stdc++.h> using namespace std; using Int = long long; template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }; template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }; template <typename T> struct PrimalDual { struct edge {...
replace
41
43
41
50
TLE
p01743
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define show(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define show(x) #endif typedef long long int ll; typedef pair<...
#include <bits/stdc++.h> using namespace std; #define rep(i, x, y) for (int i = (x); i < (y); ++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define show(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define show(x) #endif typedef long long int ll; typedef pair<...
replace
49
50
49
50
TLE
p01744
C++
Runtime Error
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <complex> #include <cassert> #include <funct...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <complex> #include <cassert> #include <funct...
delete
119
120
119
119
0
s[i] = 2 s[i] = 1 s[i] = 0 s[i] = 3
p01749
C++
Memory Limit Exceeded
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
#include <algorithm> #include <array> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <valarray> #include <vector> using namespace ...
replace
117
118
117
118
MLE
p01750
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
replace
37
38
37
38
MLE
p01750
C++
Runtime Error
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = int(a)...
#include <bits/stdc++.h> #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) _range(i, 0, n) #define _range(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__) #define _rrep(i, n) _rrange(i, n, 0) #define _rrange(i, a, b) for (int i = int(a)...
replace
30
32
30
32
0
p01750
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define int long long #define MOD 1000000007 int dp[2][303][90909]; int d, s; int l[303]; int mod_pow(int x, int n, int m) { int res = 1; while (n) { if (n & 1) (res *= x) %= m; x = (x * x) % m; n >>= 1; } return res; } int dfs(int f, int x, int y)...
#include <bits/stdc++.h> using namespace std; #define int long long #define MOD 1000000007 signed dp[2][303][90909]; int d, s; int l[303]; int mod_pow(int x, int n, int m) { int res = 1; while (n) { if (n & 1) (res *= x) %= m; x = (x * x) % m; n >>= 1; } return res; } int dfs(int f, int x, int...
replace
4
5
4
5
MLE
p01750
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mt make_tuple #define mp make_pair template <class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mt make_tuple #define mp make_pair template <class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a ...
replace
241
242
241
242
MLE
p01750
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <...
replace
58
59
58
63
0
p01750
C++
Memory Limit Exceeded
#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 zip(v) sort(all(v)), v.erase(unique(all(v)), v.end()) #define fi first #de...
#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 zip(v) sort(all(v)), v.erase(unique(all(v)), v.end()) #define fi first #de...
replace
31
32
31
32
MLE
p01751
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, m, b, d; long long c; bool a = false; cin >> n >> m >> b; c = b; for (int i = 0; i < 250000000; i++) { if (c % (n + m) <= n && a == false) { a = true; d = i; } c += 60; } if (a == false) { cout << "-1" << endl; } ...
#include <iostream> using namespace std; int main() { int n, m, b, d; long long c; bool a = false; cin >> n >> m >> b; c = b; for (int i = 0; i < 150000000; i++) { if (c % (n + m) <= n && a == false) { a = true; d = i; } c += 60; } if (a == false) { cout << "-1" << endl; } ...
replace
8
9
8
9
TLE
p01751
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; while (c < 1000000) { if (0 <= c % (a + b) && c % (a + b) <= a) { cout << c << endl; return 0; } } cout << -1 << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; while (c < 1000000) { if (0 <= c % (a + b) && c % (a + b) <= a) { cout << c << endl; return 0; } c += 60; } cout << -1 << endl; return 0; }
insert
14
14
14
16
TLE
p01751
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; for (int i = 0;; i += a + b) { if (i <= c && c <= i + a) { cout << i + c % 60 - i % 60 << endl; break; } if (60 < i && 60 % (a + b) == 0) { cout << -1 << endl; bre...
#include <algorithm> #include <iostream> using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; for (int i = 0;; i += a + b) { if (i <= c && c <= i + a) { cout << i + c % 60 - i % 60 << endl; break; } // if(60<i && 60%(a+b)==0){ if (100000 < i) { cout << -1 << ...
replace
14
15
14
16
TLE
p01751
C++
Time Limit Exceeded
// 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...
insert
372
372
372
376
TLE
p01751
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, c; int d = 0; int n = 0; cin >> a >> b >> c; while (true) { if (d <= c && c <= d + a) { cout << n * 60 + c << endl; break; } d += a + b; if (d > 60) { n += d / 60; d %= 60; } if (d == 0) { co...
#include <iostream> using namespace std; int main() { int a, b, c; int d = 0; int n = 0; cin >> a >> b >> c; while (true) { if (d <= c && c <= d + a) { cout << n * 60 + c << endl; break; } d += a + b; if (d >= 60) { n += d / 60; d %= 60; } if (d == 0) { c...
replace
14
15
14
15
TLE
p01751
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define reep(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) reep((i), 0, (n)) typedef long long ll; int main() { ll a, b, c; cin >> a >> b >> c; ll t = 0; while (1) { if (c < (a + b) * t) { c += 60; } else if (c <= (a + b) * t + a) { ...
#include <bits/stdc++.h> using namespace std; #define reep(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) reep((i), 0, (n)) typedef long long ll; int main() { ll a, b, c; cin >> a >> b >> c; ll t = 0; while (1) { if (c < (a + b) * t) { c += 60; } else if (c <= (a + b) * t + a) { ...
insert
22
22
22
24
TLE
p01751
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int st, et, r; int d[60] = {}; for (st = r = 0, et = a;; st = et + b, et = st + a, d[st] = et) { if (st >= 60) { st -= 60; et -= 60; r++; } if (c >= st && c <= et) { cout << r * 60 + c <...
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int st, et, r; int d[60] = {}; for (st = r = 0, et = a;; d[st] = et, st = et + b, et = st + a) { if (st >= 60) { st -= 60; et -= 60; r++; } if (c >= st && c <= et) { cout << r * 60 + c <...
replace
8
9
8
9
TLE
p01751
C++
Runtime Error
#include <bits/stdc++.h> #define range(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; int t = 0; int res = 0; vector<vector<int>> visited(a + b + 1, vector<int>(2, 0)); visited[0][0] = ...
#include <bits/stdc++.h> #define range(i, a, n) for (int(i) = (a); (i) < (n); (i)++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; int main(void) { int a, b, c; cin >> a >> b >> c; int t = 0; int res = 0; vector<vector<int>> visited(121, vector<int>(2, 0)); visited[0][0] = 1; b...
replace
9
10
9
10
0
p01752
C++
Runtime Error
#include <cmath> #include <iostream> #include <queue> #define REP(i, a, n) for (int i = ((int)a); i < ((int)n); i++) using namespace std; struct state { int y, x, d, hy, hx, n; bool operator<(const state &s) const { return n > s.n; } }; int N, M, D, SY, SX, GY, GX; char S[52][52]; int dd[5] = {0, 1, 0, -1, 0}; bo...
#include <cmath> #include <iostream> #include <queue> #define REP(i, a, n) for (int i = ((int)a); i < ((int)n); i++) using namespace std; struct state { int y, x, d, hy, hx, n; bool operator<(const state &s) const { return n > s.n; } }; int N, M, D, SY, SX, GY, GX; char S[52][52]; int dd[5] = {0, 1, 0, -1, 0}; bo...
replace
40
41
40
41
0
p01752
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; int Dx[4] = {0, 1, 0, -1}; int Dy[4] = {1, 0, -1, 0}; int dhx[4][4] = { {0, 1, 1, 1}, {1, 1, 0, -1}, {0, -1, -1, -1}, {-1, -1, 0, 1}, }; int dhy[4][4] = { {1, 1, 0, -1}, {0, -1, -1, -1}, {-1, -1, 0, 1}, {0, 1, 1, 1}, }; struct Node { in...
#include <bits/stdc++.h> using namespace std; int Dx[4] = {0, 1, 0, -1}; int Dy[4] = {1, 0, -1, 0}; int dhx[4][4] = { {0, 1, 1, 1}, {1, 1, 0, -1}, {0, -1, -1, -1}, {-1, -1, 0, 1}, }; int dhy[4][4] = { {1, 1, 0, -1}, {0, -1, -1, -1}, {-1, -1, 0, 1}, {0, 1, 1, 1}, }; struct Node { in...
replace
25
28
25
28
MLE
p01752
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; namespace { typedef double real; typedef long long ll; template <class T> ostream &operator<<(ostream &os, const vector<T> &vs) { if (vs.empty()) return os << "[]"; os << "[" << vs[0]; for (int i = 1; i < vs.size(); i++) os << " " << vs[i]; return os << ...
#include <bits/stdc++.h> using namespace std; namespace { typedef double real; typedef long long ll; template <class T> ostream &operator<<(ostream &os, const vector<T> &vs) { if (vs.empty()) return os << "[]"; os << "[" << vs[0]; for (int i = 1; i < vs.size(); i++) os << " " << vs[i]; return os << ...
insert
87
87
87
88
TLE
p01755
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; #define reps(i, f, n) for (int i = f; i < int(n); i++) #define rep(i, n) reps(i, 0, n) const int H = 55, W = 55; const int L = 1111; string board[H]; int h, w; string in; bool isClear; int walk = 0; ...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; #define reps(i, f, n) for (int i = f; i < int(n); i++) #define rep(i, n) reps(i, 0, n) const int H = 55, W = 55; const int L = 1111; string board[H]; int h, w; string in; bool isClear; int walk = 0; ...
insert
97
97
97
101
TLE
p01755
C++
Time Limit Exceeded
#include <iostream> #include <stack> #include <string> #include <vector> using namespace std; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {-1, 0, 1, 0}; int main() { // ------ Variable, Input ------ // int H, W, ptr, cnt, sec, x, y, d; bool clear; vector<int> Par; vector<string> MAP; string S; ...
#include <iostream> #include <stack> #include <string> #include <vector> using namespace std; const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {-1, 0, 1, 0}; int main() { // ------ Variable, Input ------ // int H, W, ptr, cnt, sec, x, y, d; bool clear; vector<int> Par; vector<string> MAP; string S; ...
replace
67
68
67
68
TLE
p01756
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct SuffixArray { string s; vector<int> sa; SuffixArray(const string &S) { s = S; int n = S.length(); sa.assign(n + 1, 0); vector<int> rnk(n + 1), tmp(n + 1); for (int i = 0; i <= n; i++) { sa[i] = i; rnk[i] =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct SuffixArray { string s; vector<int> sa; SuffixArray(const string &S) { s = S; int n = S.length(); sa.assign(n + 1, 0); vector<int> rnk(n + 1), tmp(n + 1); for (int i = 0; i <= n; i++) { sa[i] = i; rnk[i] =...
replace
78
79
78
79
0
p01756
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define N 100001 using namespace std; typedef pair<string, int> P; typedef set<P>::iterator It; void solve(string str, set<P> A, vector<int> &L) { for (int i = 0; i < str.size(); i++) { string t; t += str[i]; It it; while ((it = A.lower_bound(P(t, -1))) != A.end()) { wh...
#include <bits/stdc++.h> #define N 100001 using namespace std; typedef pair<string, int> P; typedef set<P>::iterator It; void solve(string str, set<P> A, vector<int> &L) { for (int i = 0; i < str.size(); i++) { string t; t += str[i]; It it; while ((it = A.lower_bound(P(t, -1))) != A.end()) { if...
insert
12
12
12
14
TLE
p01758
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int INF = 1e9 + 7; using Weight = int; struct Edge { int src, dst; Weight weight; Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; auto operator<(const Edge &e, const Edge &f) { if (e.weight != f.w...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int INF = 1e9 + 7; using Weight = int; struct Edge { int src, dst; Weight weight; Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {} }; auto operator<(const Edge &e, const Edge &f) { if (e.weight != f.w...
insert
131
131
131
133
TLE
p01764
C++
Time Limit Exceeded
#include <algorithm> #include <stdio.h> using namespace std; int b[310]; long long dp[310][310]; int sum[310]; int pow[10]; long long solve(int l, int r) { if (l == r) return 0; if (~dp[l][r]) return dp[l][r]; long long ret = 99999999999999LL; for (int i = l; i < r; i++) { int L = sum[i + 1] - sum[l...
#include <algorithm> #include <stdio.h> using namespace std; int b[310]; long long dp[310][310]; int sum[310]; int pow[10]; long long solve(int l, int r) { if (l == r) return 0; if (~dp[l][r]) return dp[l][r]; long long ret = 99999999999999LL; for (int i = l; i < r; i++) { int L = sum[i + 1] - sum[l...
replace
23
24
23
25
TLE
p01764
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> using namespace std; #define INF 131211109876543210LL #define MAX_N 350 #define MAX_K 10 #define MAX_NUM 10 long long wa[MAX_N][MAX_N]; long long dp[MAX_N][MAX_N]; long long x[MAX_N], y[MAX_N]; long long power[MAX_K]; long long a1[MAX_K], a2[MAX_K], a3[MAX_K]; long long N; lo...
#include <algorithm> #include <iostream> using namespace std; #define INF 131211109876543210LL #define MAX_N 301 #define MAX_K 9 #define MAX_NUM 10 long long wa[MAX_N][MAX_N]; long long dp[MAX_N][MAX_N]; long long x[MAX_N], y[MAX_N]; long long power[MAX_K]; long long a1[MAX_K], a2[MAX_K], a3[MAX_K]; long long N; lon...
replace
5
7
5
7
TLE
p01767
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define MAX 300001 typedef long long ll; int main() { ll N, M, a; vector<ll> d(MAX, 0), e(MAX + 1, 0); cin >> N; for (int i = 0; i < N; i++) { cin >> a; d[a]++; } for (int i = 0; i < MAX; i++) { d[i] *= (ll)i; } for (int i = 0; i < MAX; i++) {...
#include <bits/stdc++.h> using namespace std; #define MAX 1000001 typedef long long ll; int main() { ll N, M, a; vector<ll> d(MAX, 0), e(MAX + 1, 0); cin >> N; for (int i = 0; i < N; i++) { cin >> a; d[a]++; } for (int i = 0; i < MAX; i++) { d[i] *= (ll)i; } for (int i = 0; i < MAX; i++) ...
replace
4
5
4
5
0
p01767
C++
Memory Limit Exceeded
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, b) FOR(i, 0, b) #define PB push_back #define BE(c) c.begin(), c.end() using namespace std; typedef long long LL; typedef LL ut; typedef vector<ut> VI; const int SIZE = 1 + 1e+7; LL getly[SIZE]; VI nums; LL b[SIZE]; int main() {...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, b) FOR(i, 0, b) #define PB push_back #define BE(c) c.begin(), c.end() using namespace std; typedef long long LL; typedef LL ut; typedef vector<ut> VI; const int SIZE = 1 + 1e+6; LL getly[SIZE]; VI nums; LL b[SIZE]; int main() {...
replace
9
10
9
10
MLE