#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2000010;
int N, M;
ll A[maxn], B[maxn], S[maxn], T[maxn], P[maxn], Q[maxn], nA[maxn], nB[maxn], nS[maxn], nT[maxn], nP[maxn], nQ[maxn];
int X[maxn], Y[maxn], inv[maxn], pnt[maxn];
pii ord[maxn];
vector<int> adj1[maxn], adj2[maxn];
ll dp[maxn];
ll offset;
struct BIT {
ll tree[4 * maxn];
ll lazy[4 * maxn];
void init() {
for(int i = 0; i < 4 * N; i++) {
tree[i] = -1e17;
lazy[i] = 0;
}
}
void prop(int l, int r, int n) {
if(l != r) {
tree[2*n] += lazy[n];
lazy[2*n] += lazy[n];
tree[2*n + 1] += lazy[n];
lazy[2*n + 1] += lazy[n];
lazy[n] = 0;
}
}
void upd(int a, int b, ll d, int l, int r, int n) {
if(b < l || r < a) return;
if(a <= l && r <= b) {
tree[n] += d;
lazy[n] += d;
return;
}
prop(l, r, n);
int m = (l + r)>>1;
upd(a, b, d, l, m, 2*n);
upd(a, b, d, m + 1, r, 2*n + 1);
tree[n] = max(tree[2*n], tree[2*n + 1]);
}
void upd2(int x, ll v, int l, int r, int n) {
if(x < l || r < x) return;
if(l == r) {
tree[n] = v;
return;
}
prop(l, r, n);
int m = (l + r)>>1;
upd2(x, v, l, m, 2*n);
upd2(x, v, m + 1, r, 2*n + 1);
tree[n] = max(tree[2*n], tree[2*n + 1]);
}
ll quer(int a, int b, int l, int r, int n) {
if(b < l || r < a) return -1e18;
if(a <= l && r <= b) return tree[n];
prop(l, r, n);
int m = (l + r)>>1;
ll L = quer(a, b, l, m, 2*n);
ll R = quer(a, b, m + 1, r, 2*n + 1);
return max(L, R);
}
} bit;
void proc() {
for(int i = 0; i < N; i++) {
if(A[i] > S[i]) P[i] = 0;
X[i] = upper_bound(B, B + M, S[i] - A[i]) - B;
}
for(int i = 0; i < M; i++) {
if(B[i] > T[i]) Q[i] = 0;
Y[i] = upper_bound(A, A + N, T[i] - B[i]) - A;
}
for(int i = 0; i < M; i++) adj1[i].clear();
for(int i = 0; i < N; i++) adj2[i].clear();
for(int i = 0; i < N; i++) adj1[ X[i] ].push_back(i);
for(int i = 0; i < M; i++) adj2[ Y[i] ].push_back(i);
}
ll getInt() {
ll ret = 0;
bool s = false;
while(1) {
char c = getchar();
if(c == ' ' || c == '\n') break;
if(c == '-') {
s = true;
continue;
}
ret = (ret << 3) + (ret << 1);
ret += c - '0';
}
return s? -ret : ret;
}
int main() {
N = getInt();
M = getInt();
for(int i = 0; i < N; i++) {
A[i] = getInt();
S[i] = getInt();
P[i] = getInt();
}
for(int i = 0; i < M; i++) {
B[i] = getInt();
T[i] = getInt();
Q[i] = getInt();
}
for(int i = 1; i < N; i++) A[i] += A[i - 1];
for(int i = 1; i < M; i++) B[i] += B[i - 1];
proc();
for(int i = 0; i < N; i++) if(P[i] < 0) offset += P[i];
for(int i = 0; i < M; i++) if(Q[i] < 0) offset += Q[i];
int cnt1 = 0;
int cnt2 = 0;
for(int i = 0; i < N; i++) {
if(P[i] >= 0) {
nA[cnt1] = A[i];
nS[cnt1] = S[i];
nP[cnt1] = P[i];
cnt1++;
}
else {
nA[cnt1] = A[i];
nS[cnt1] = S[i];
nP[cnt1] = 0;
cnt1++;
}
for(int j = 0; j < adj2[i].size(); j++) {
int k = adj2[i][j];
if(Q[k] < 0) {
nA[cnt1] = A[i];
nS[cnt1] = A[i] + B[k] - 1;
nP[cnt1] = -Q[k];
cnt1++;
}
}
}
for(int i = 0; i < M; i++) {
if(Q[i] >= 0) {
nB[cnt2] = B[i];
nT[cnt2] = T[i];
nQ[cnt2] = Q[i];
cnt2++;
}
else {
nB[cnt2] = B[i];
nT[cnt2] = T[i];
nQ[cnt2] = 0;
cnt2++;
}
for(int j = 0; j < adj1[i].size(); j++) {
int k = adj1[i][j];
if(P[k] < 0) {
nB[cnt2] = B[i];
nT[cnt2] = B[i] + A[k] - 1;
nQ[cnt2] = -P[k];
cnt2++;
}
}
}
N = cnt1;
M = cnt2;
for(int i = 0; i < N; i++) {
A[i] = nA[i];
S[i] = nS[i];
P[i] = nP[i];
}
for(int i = 0; i < M; i++) {
B[i] = nB[i];
T[i] = nT[i];
Q[i] = nQ[i];
}
proc();
//*/
for(int i = 0; i < N; i++) ord[i] = pii(X[i], -i);
sort(ord, ord + N);
for(int i = 0; i < N; i++) inv[ -ord[i].second ] = i;
int pos = 0;
for(int i = 0; i < M; i++) {
while(pos < N && ord[pos].first <= i) pos++;
pnt[i] = pos - 1;
}
for(int i = 0; i < M; i++) offset += Q[i];
bit.init();
for(int i = N - 1; i >= 0; i--) {
dp[i] = bit.quer(inv[i] + 1, N - 1, 0, N - 1, 1);
dp[i] = max(0LL, dp[i]);
bit.upd2(inv[i], dp[i], 0, N - 1, 1);
bit.upd(0, inv[i], P[i], 0, N - 1, 1);
for(int j = 0; j < adj2[i].size(); j++) {
int k = adj2[i][j];
bit.upd(0, pnt[k], -Q[k], 0, N - 1, 1);
}
}
ll ans = bit.tree[1];
ans = max(0LL, ans);
printf("%lld", ans + offset);
}
Compilation message
dishes.cpp:1:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(linker, "/stack:200000000")
dishes.cpp: In function 'int main()':
dishes.cpp:149:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 0; j < adj2[i].size(); j++) {
~~^~~~~~~~~~~~~~~~
dishes.cpp:174:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 0; j < adj1[i].size(); j++) {
~~^~~~~~~~~~~~~~~~
dishes.cpp:222:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 0; j < adj2[i].size(); j++) {
~~^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
588 ms |
144376 KB |
Output is correct |
2 |
Correct |
569 ms |
149528 KB |
Output is correct |
3 |
Correct |
495 ms |
141664 KB |
Output is correct |
4 |
Correct |
534 ms |
145256 KB |
Output is correct |
5 |
Correct |
102 ms |
94456 KB |
Output is correct |
6 |
Correct |
546 ms |
140816 KB |
Output is correct |
7 |
Correct |
225 ms |
109504 KB |
Output is correct |
8 |
Correct |
350 ms |
125284 KB |
Output is correct |
9 |
Correct |
509 ms |
145124 KB |
Output is correct |
10 |
Correct |
484 ms |
150520 KB |
Output is correct |
11 |
Correct |
423 ms |
142176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
94456 KB |
Output is correct |
2 |
Correct |
99 ms |
94584 KB |
Output is correct |
3 |
Correct |
100 ms |
94456 KB |
Output is correct |
4 |
Correct |
101 ms |
94344 KB |
Output is correct |
5 |
Correct |
99 ms |
94460 KB |
Output is correct |
6 |
Correct |
101 ms |
94584 KB |
Output is correct |
7 |
Correct |
100 ms |
94456 KB |
Output is correct |
8 |
Correct |
101 ms |
94456 KB |
Output is correct |
9 |
Correct |
100 ms |
94456 KB |
Output is correct |
10 |
Correct |
104 ms |
94476 KB |
Output is correct |
11 |
Correct |
100 ms |
94456 KB |
Output is correct |
12 |
Correct |
101 ms |
94628 KB |
Output is correct |
13 |
Correct |
107 ms |
94712 KB |
Output is correct |
14 |
Correct |
102 ms |
94456 KB |
Output is correct |
15 |
Correct |
100 ms |
94456 KB |
Output is correct |
16 |
Correct |
101 ms |
94456 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
94456 KB |
Output is correct |
2 |
Correct |
99 ms |
94584 KB |
Output is correct |
3 |
Correct |
100 ms |
94456 KB |
Output is correct |
4 |
Correct |
101 ms |
94344 KB |
Output is correct |
5 |
Correct |
99 ms |
94460 KB |
Output is correct |
6 |
Correct |
101 ms |
94584 KB |
Output is correct |
7 |
Correct |
100 ms |
94456 KB |
Output is correct |
8 |
Correct |
101 ms |
94456 KB |
Output is correct |
9 |
Correct |
100 ms |
94456 KB |
Output is correct |
10 |
Correct |
104 ms |
94476 KB |
Output is correct |
11 |
Correct |
100 ms |
94456 KB |
Output is correct |
12 |
Correct |
101 ms |
94628 KB |
Output is correct |
13 |
Correct |
107 ms |
94712 KB |
Output is correct |
14 |
Correct |
102 ms |
94456 KB |
Output is correct |
15 |
Correct |
100 ms |
94456 KB |
Output is correct |
16 |
Correct |
101 ms |
94456 KB |
Output is correct |
17 |
Correct |
118 ms |
94840 KB |
Output is correct |
18 |
Correct |
103 ms |
94840 KB |
Output is correct |
19 |
Correct |
107 ms |
94896 KB |
Output is correct |
20 |
Correct |
104 ms |
94968 KB |
Output is correct |
21 |
Correct |
104 ms |
94968 KB |
Output is correct |
22 |
Correct |
103 ms |
94968 KB |
Output is correct |
23 |
Correct |
103 ms |
94948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
94456 KB |
Output is correct |
2 |
Correct |
99 ms |
94584 KB |
Output is correct |
3 |
Correct |
100 ms |
94456 KB |
Output is correct |
4 |
Correct |
101 ms |
94344 KB |
Output is correct |
5 |
Correct |
99 ms |
94460 KB |
Output is correct |
6 |
Correct |
101 ms |
94584 KB |
Output is correct |
7 |
Correct |
100 ms |
94456 KB |
Output is correct |
8 |
Correct |
101 ms |
94456 KB |
Output is correct |
9 |
Correct |
100 ms |
94456 KB |
Output is correct |
10 |
Correct |
104 ms |
94476 KB |
Output is correct |
11 |
Correct |
100 ms |
94456 KB |
Output is correct |
12 |
Correct |
101 ms |
94628 KB |
Output is correct |
13 |
Correct |
107 ms |
94712 KB |
Output is correct |
14 |
Correct |
102 ms |
94456 KB |
Output is correct |
15 |
Correct |
100 ms |
94456 KB |
Output is correct |
16 |
Correct |
101 ms |
94456 KB |
Output is correct |
17 |
Correct |
118 ms |
94840 KB |
Output is correct |
18 |
Correct |
103 ms |
94840 KB |
Output is correct |
19 |
Correct |
107 ms |
94896 KB |
Output is correct |
20 |
Correct |
104 ms |
94968 KB |
Output is correct |
21 |
Correct |
104 ms |
94968 KB |
Output is correct |
22 |
Correct |
103 ms |
94968 KB |
Output is correct |
23 |
Correct |
103 ms |
94948 KB |
Output is correct |
24 |
Correct |
440 ms |
141392 KB |
Output is correct |
25 |
Correct |
501 ms |
138228 KB |
Output is correct |
26 |
Correct |
488 ms |
145984 KB |
Output is correct |
27 |
Correct |
527 ms |
145788 KB |
Output is correct |
28 |
Correct |
739 ms |
141136 KB |
Output is correct |
29 |
Correct |
458 ms |
142980 KB |
Output is correct |
30 |
Correct |
891 ms |
146296 KB |
Output is correct |
31 |
Correct |
206 ms |
111920 KB |
Output is correct |
32 |
Correct |
349 ms |
127660 KB |
Output is correct |
33 |
Correct |
690 ms |
143576 KB |
Output is correct |
34 |
Correct |
718 ms |
143728 KB |
Output is correct |
35 |
Correct |
785 ms |
143864 KB |
Output is correct |
36 |
Correct |
811 ms |
143224 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
94456 KB |
Output is correct |
2 |
Correct |
99 ms |
94584 KB |
Output is correct |
3 |
Correct |
100 ms |
94456 KB |
Output is correct |
4 |
Correct |
101 ms |
94344 KB |
Output is correct |
5 |
Correct |
99 ms |
94460 KB |
Output is correct |
6 |
Correct |
101 ms |
94584 KB |
Output is correct |
7 |
Correct |
100 ms |
94456 KB |
Output is correct |
8 |
Correct |
101 ms |
94456 KB |
Output is correct |
9 |
Correct |
100 ms |
94456 KB |
Output is correct |
10 |
Correct |
104 ms |
94476 KB |
Output is correct |
11 |
Correct |
100 ms |
94456 KB |
Output is correct |
12 |
Correct |
101 ms |
94628 KB |
Output is correct |
13 |
Correct |
107 ms |
94712 KB |
Output is correct |
14 |
Correct |
102 ms |
94456 KB |
Output is correct |
15 |
Correct |
100 ms |
94456 KB |
Output is correct |
16 |
Correct |
101 ms |
94456 KB |
Output is correct |
17 |
Correct |
118 ms |
94840 KB |
Output is correct |
18 |
Correct |
103 ms |
94840 KB |
Output is correct |
19 |
Correct |
107 ms |
94896 KB |
Output is correct |
20 |
Correct |
104 ms |
94968 KB |
Output is correct |
21 |
Correct |
104 ms |
94968 KB |
Output is correct |
22 |
Correct |
103 ms |
94968 KB |
Output is correct |
23 |
Correct |
103 ms |
94948 KB |
Output is correct |
24 |
Correct |
440 ms |
141392 KB |
Output is correct |
25 |
Correct |
501 ms |
138228 KB |
Output is correct |
26 |
Correct |
488 ms |
145984 KB |
Output is correct |
27 |
Correct |
527 ms |
145788 KB |
Output is correct |
28 |
Correct |
739 ms |
141136 KB |
Output is correct |
29 |
Correct |
458 ms |
142980 KB |
Output is correct |
30 |
Correct |
891 ms |
146296 KB |
Output is correct |
31 |
Correct |
206 ms |
111920 KB |
Output is correct |
32 |
Correct |
349 ms |
127660 KB |
Output is correct |
33 |
Correct |
690 ms |
143576 KB |
Output is correct |
34 |
Correct |
718 ms |
143728 KB |
Output is correct |
35 |
Correct |
785 ms |
143864 KB |
Output is correct |
36 |
Correct |
811 ms |
143224 KB |
Output is correct |
37 |
Correct |
548 ms |
144812 KB |
Output is correct |
38 |
Correct |
578 ms |
145508 KB |
Output is correct |
39 |
Correct |
555 ms |
151876 KB |
Output is correct |
40 |
Correct |
557 ms |
151928 KB |
Output is correct |
41 |
Correct |
254 ms |
94456 KB |
Output is correct |
42 |
Correct |
904 ms |
142256 KB |
Output is correct |
43 |
Correct |
718 ms |
142820 KB |
Output is correct |
44 |
Correct |
731 ms |
143776 KB |
Output is correct |
45 |
Correct |
834 ms |
145784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
94456 KB |
Output is correct |
2 |
Correct |
99 ms |
94584 KB |
Output is correct |
3 |
Correct |
100 ms |
94456 KB |
Output is correct |
4 |
Correct |
101 ms |
94344 KB |
Output is correct |
5 |
Correct |
99 ms |
94460 KB |
Output is correct |
6 |
Correct |
101 ms |
94584 KB |
Output is correct |
7 |
Correct |
100 ms |
94456 KB |
Output is correct |
8 |
Correct |
101 ms |
94456 KB |
Output is correct |
9 |
Correct |
100 ms |
94456 KB |
Output is correct |
10 |
Correct |
104 ms |
94476 KB |
Output is correct |
11 |
Correct |
100 ms |
94456 KB |
Output is correct |
12 |
Correct |
101 ms |
94628 KB |
Output is correct |
13 |
Correct |
107 ms |
94712 KB |
Output is correct |
14 |
Correct |
102 ms |
94456 KB |
Output is correct |
15 |
Correct |
100 ms |
94456 KB |
Output is correct |
16 |
Correct |
101 ms |
94456 KB |
Output is correct |
17 |
Correct |
118 ms |
94840 KB |
Output is correct |
18 |
Correct |
103 ms |
94840 KB |
Output is correct |
19 |
Correct |
107 ms |
94896 KB |
Output is correct |
20 |
Correct |
104 ms |
94968 KB |
Output is correct |
21 |
Correct |
104 ms |
94968 KB |
Output is correct |
22 |
Correct |
103 ms |
94968 KB |
Output is correct |
23 |
Correct |
103 ms |
94948 KB |
Output is correct |
24 |
Correct |
440 ms |
141392 KB |
Output is correct |
25 |
Correct |
501 ms |
138228 KB |
Output is correct |
26 |
Correct |
488 ms |
145984 KB |
Output is correct |
27 |
Correct |
527 ms |
145788 KB |
Output is correct |
28 |
Correct |
739 ms |
141136 KB |
Output is correct |
29 |
Correct |
458 ms |
142980 KB |
Output is correct |
30 |
Correct |
891 ms |
146296 KB |
Output is correct |
31 |
Correct |
206 ms |
111920 KB |
Output is correct |
32 |
Correct |
349 ms |
127660 KB |
Output is correct |
33 |
Correct |
690 ms |
143576 KB |
Output is correct |
34 |
Correct |
718 ms |
143728 KB |
Output is correct |
35 |
Correct |
785 ms |
143864 KB |
Output is correct |
36 |
Correct |
811 ms |
143224 KB |
Output is correct |
37 |
Correct |
548 ms |
144812 KB |
Output is correct |
38 |
Correct |
578 ms |
145508 KB |
Output is correct |
39 |
Correct |
555 ms |
151876 KB |
Output is correct |
40 |
Correct |
557 ms |
151928 KB |
Output is correct |
41 |
Correct |
254 ms |
94456 KB |
Output is correct |
42 |
Correct |
904 ms |
142256 KB |
Output is correct |
43 |
Correct |
718 ms |
142820 KB |
Output is correct |
44 |
Correct |
731 ms |
143776 KB |
Output is correct |
45 |
Correct |
834 ms |
145784 KB |
Output is correct |
46 |
Correct |
2439 ms |
324904 KB |
Output is correct |
47 |
Correct |
2693 ms |
328644 KB |
Output is correct |
48 |
Correct |
2428 ms |
353844 KB |
Output is correct |
49 |
Correct |
2441 ms |
351332 KB |
Output is correct |
50 |
Correct |
5542 ms |
332788 KB |
Output is correct |
51 |
Correct |
3809 ms |
303992 KB |
Output is correct |
52 |
Correct |
3872 ms |
309980 KB |
Output is correct |
53 |
Correct |
4820 ms |
326396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
588 ms |
144376 KB |
Output is correct |
2 |
Correct |
569 ms |
149528 KB |
Output is correct |
3 |
Correct |
495 ms |
141664 KB |
Output is correct |
4 |
Correct |
534 ms |
145256 KB |
Output is correct |
5 |
Correct |
102 ms |
94456 KB |
Output is correct |
6 |
Correct |
546 ms |
140816 KB |
Output is correct |
7 |
Correct |
225 ms |
109504 KB |
Output is correct |
8 |
Correct |
350 ms |
125284 KB |
Output is correct |
9 |
Correct |
509 ms |
145124 KB |
Output is correct |
10 |
Correct |
484 ms |
150520 KB |
Output is correct |
11 |
Correct |
423 ms |
142176 KB |
Output is correct |
12 |
Correct |
99 ms |
94456 KB |
Output is correct |
13 |
Correct |
99 ms |
94584 KB |
Output is correct |
14 |
Correct |
100 ms |
94456 KB |
Output is correct |
15 |
Correct |
101 ms |
94344 KB |
Output is correct |
16 |
Correct |
99 ms |
94460 KB |
Output is correct |
17 |
Correct |
101 ms |
94584 KB |
Output is correct |
18 |
Correct |
100 ms |
94456 KB |
Output is correct |
19 |
Correct |
101 ms |
94456 KB |
Output is correct |
20 |
Correct |
100 ms |
94456 KB |
Output is correct |
21 |
Correct |
104 ms |
94476 KB |
Output is correct |
22 |
Correct |
100 ms |
94456 KB |
Output is correct |
23 |
Correct |
101 ms |
94628 KB |
Output is correct |
24 |
Correct |
107 ms |
94712 KB |
Output is correct |
25 |
Correct |
102 ms |
94456 KB |
Output is correct |
26 |
Correct |
100 ms |
94456 KB |
Output is correct |
27 |
Correct |
101 ms |
94456 KB |
Output is correct |
28 |
Correct |
118 ms |
94840 KB |
Output is correct |
29 |
Correct |
103 ms |
94840 KB |
Output is correct |
30 |
Correct |
107 ms |
94896 KB |
Output is correct |
31 |
Correct |
104 ms |
94968 KB |
Output is correct |
32 |
Correct |
104 ms |
94968 KB |
Output is correct |
33 |
Correct |
103 ms |
94968 KB |
Output is correct |
34 |
Correct |
103 ms |
94948 KB |
Output is correct |
35 |
Correct |
440 ms |
141392 KB |
Output is correct |
36 |
Correct |
501 ms |
138228 KB |
Output is correct |
37 |
Correct |
488 ms |
145984 KB |
Output is correct |
38 |
Correct |
527 ms |
145788 KB |
Output is correct |
39 |
Correct |
739 ms |
141136 KB |
Output is correct |
40 |
Correct |
458 ms |
142980 KB |
Output is correct |
41 |
Correct |
891 ms |
146296 KB |
Output is correct |
42 |
Correct |
206 ms |
111920 KB |
Output is correct |
43 |
Correct |
349 ms |
127660 KB |
Output is correct |
44 |
Correct |
690 ms |
143576 KB |
Output is correct |
45 |
Correct |
718 ms |
143728 KB |
Output is correct |
46 |
Correct |
785 ms |
143864 KB |
Output is correct |
47 |
Correct |
811 ms |
143224 KB |
Output is correct |
48 |
Correct |
548 ms |
144812 KB |
Output is correct |
49 |
Correct |
578 ms |
145508 KB |
Output is correct |
50 |
Correct |
555 ms |
151876 KB |
Output is correct |
51 |
Correct |
557 ms |
151928 KB |
Output is correct |
52 |
Correct |
254 ms |
94456 KB |
Output is correct |
53 |
Correct |
904 ms |
142256 KB |
Output is correct |
54 |
Correct |
718 ms |
142820 KB |
Output is correct |
55 |
Correct |
731 ms |
143776 KB |
Output is correct |
56 |
Correct |
834 ms |
145784 KB |
Output is correct |
57 |
Correct |
620 ms |
165256 KB |
Output is correct |
58 |
Correct |
787 ms |
176380 KB |
Output is correct |
59 |
Correct |
726 ms |
178424 KB |
Output is correct |
60 |
Correct |
645 ms |
166008 KB |
Output is correct |
61 |
Correct |
879 ms |
144376 KB |
Output is correct |
62 |
Correct |
100 ms |
94456 KB |
Output is correct |
63 |
Correct |
1138 ms |
156008 KB |
Output is correct |
64 |
Correct |
870 ms |
150072 KB |
Output is correct |
65 |
Correct |
977 ms |
157684 KB |
Output is correct |
66 |
Correct |
1058 ms |
164648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
588 ms |
144376 KB |
Output is correct |
2 |
Correct |
569 ms |
149528 KB |
Output is correct |
3 |
Correct |
495 ms |
141664 KB |
Output is correct |
4 |
Correct |
534 ms |
145256 KB |
Output is correct |
5 |
Correct |
102 ms |
94456 KB |
Output is correct |
6 |
Correct |
546 ms |
140816 KB |
Output is correct |
7 |
Correct |
225 ms |
109504 KB |
Output is correct |
8 |
Correct |
350 ms |
125284 KB |
Output is correct |
9 |
Correct |
509 ms |
145124 KB |
Output is correct |
10 |
Correct |
484 ms |
150520 KB |
Output is correct |
11 |
Correct |
423 ms |
142176 KB |
Output is correct |
12 |
Correct |
99 ms |
94456 KB |
Output is correct |
13 |
Correct |
99 ms |
94584 KB |
Output is correct |
14 |
Correct |
100 ms |
94456 KB |
Output is correct |
15 |
Correct |
101 ms |
94344 KB |
Output is correct |
16 |
Correct |
99 ms |
94460 KB |
Output is correct |
17 |
Correct |
101 ms |
94584 KB |
Output is correct |
18 |
Correct |
100 ms |
94456 KB |
Output is correct |
19 |
Correct |
101 ms |
94456 KB |
Output is correct |
20 |
Correct |
100 ms |
94456 KB |
Output is correct |
21 |
Correct |
104 ms |
94476 KB |
Output is correct |
22 |
Correct |
100 ms |
94456 KB |
Output is correct |
23 |
Correct |
101 ms |
94628 KB |
Output is correct |
24 |
Correct |
107 ms |
94712 KB |
Output is correct |
25 |
Correct |
102 ms |
94456 KB |
Output is correct |
26 |
Correct |
100 ms |
94456 KB |
Output is correct |
27 |
Correct |
101 ms |
94456 KB |
Output is correct |
28 |
Correct |
118 ms |
94840 KB |
Output is correct |
29 |
Correct |
103 ms |
94840 KB |
Output is correct |
30 |
Correct |
107 ms |
94896 KB |
Output is correct |
31 |
Correct |
104 ms |
94968 KB |
Output is correct |
32 |
Correct |
104 ms |
94968 KB |
Output is correct |
33 |
Correct |
103 ms |
94968 KB |
Output is correct |
34 |
Correct |
103 ms |
94948 KB |
Output is correct |
35 |
Correct |
440 ms |
141392 KB |
Output is correct |
36 |
Correct |
501 ms |
138228 KB |
Output is correct |
37 |
Correct |
488 ms |
145984 KB |
Output is correct |
38 |
Correct |
527 ms |
145788 KB |
Output is correct |
39 |
Correct |
739 ms |
141136 KB |
Output is correct |
40 |
Correct |
458 ms |
142980 KB |
Output is correct |
41 |
Correct |
891 ms |
146296 KB |
Output is correct |
42 |
Correct |
206 ms |
111920 KB |
Output is correct |
43 |
Correct |
349 ms |
127660 KB |
Output is correct |
44 |
Correct |
690 ms |
143576 KB |
Output is correct |
45 |
Correct |
718 ms |
143728 KB |
Output is correct |
46 |
Correct |
785 ms |
143864 KB |
Output is correct |
47 |
Correct |
811 ms |
143224 KB |
Output is correct |
48 |
Correct |
548 ms |
144812 KB |
Output is correct |
49 |
Correct |
578 ms |
145508 KB |
Output is correct |
50 |
Correct |
555 ms |
151876 KB |
Output is correct |
51 |
Correct |
557 ms |
151928 KB |
Output is correct |
52 |
Correct |
254 ms |
94456 KB |
Output is correct |
53 |
Correct |
904 ms |
142256 KB |
Output is correct |
54 |
Correct |
718 ms |
142820 KB |
Output is correct |
55 |
Correct |
731 ms |
143776 KB |
Output is correct |
56 |
Correct |
834 ms |
145784 KB |
Output is correct |
57 |
Correct |
2439 ms |
324904 KB |
Output is correct |
58 |
Correct |
2693 ms |
328644 KB |
Output is correct |
59 |
Correct |
2428 ms |
353844 KB |
Output is correct |
60 |
Correct |
2441 ms |
351332 KB |
Output is correct |
61 |
Correct |
5542 ms |
332788 KB |
Output is correct |
62 |
Correct |
3809 ms |
303992 KB |
Output is correct |
63 |
Correct |
3872 ms |
309980 KB |
Output is correct |
64 |
Correct |
4820 ms |
326396 KB |
Output is correct |
65 |
Correct |
620 ms |
165256 KB |
Output is correct |
66 |
Correct |
787 ms |
176380 KB |
Output is correct |
67 |
Correct |
726 ms |
178424 KB |
Output is correct |
68 |
Correct |
645 ms |
166008 KB |
Output is correct |
69 |
Correct |
879 ms |
144376 KB |
Output is correct |
70 |
Correct |
100 ms |
94456 KB |
Output is correct |
71 |
Correct |
1138 ms |
156008 KB |
Output is correct |
72 |
Correct |
870 ms |
150072 KB |
Output is correct |
73 |
Correct |
977 ms |
157684 KB |
Output is correct |
74 |
Correct |
1058 ms |
164648 KB |
Output is correct |
75 |
Correct |
2813 ms |
427568 KB |
Output is correct |
76 |
Correct |
3752 ms |
502352 KB |
Output is correct |
77 |
Correct |
3757 ms |
499508 KB |
Output is correct |
78 |
Correct |
2879 ms |
418176 KB |
Output is correct |
79 |
Correct |
7242 ms |
409132 KB |
Output is correct |
80 |
Correct |
4516 ms |
355268 KB |
Output is correct |
81 |
Correct |
5166 ms |
372488 KB |
Output is correct |
82 |
Correct |
6484 ms |
400492 KB |
Output is correct |
83 |
Correct |
6375 ms |
403344 KB |
Output is correct |