#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) begin(v), end(v)
#define sz(v) (int)(v).size()
#define fi first
#define se second
struct info {
ll x = 0, y = 0;
info operator + (const info& o) const {
info r;
if(y >= o.x) r.y = y - o.x, r.x = x;
else r.y = 0, r.x = x + (o.x - y);
r.y += o.y;
return r;
}
};
struct Node {
Node *l = 0, *r = 0;
info lz;
int lo, hi;
Node(int _lo, int _hi) : lo(_lo), hi(_hi) {
if(lo < hi) {
int mid = (lo + hi) >> 1;
l = new Node(lo, mid), r = new Node(mid+1, hi);
}
}
void update(int L, int R, info v) {
if(lo > R or hi < L) return;
if(L <= lo and hi <= R) {
lz = lz + v;
} else {
push();
l -> update(L, R, v);
r -> update(L, R, v);
}
}
ll query(int pos) {
if(lo == hi) return lz.y;
else {
push();
return pos <= l -> hi ? l -> query(pos) : r -> query(pos);
}
}
void push() {
if(lo < hi) {
l -> lz = l -> lz + lz;
r -> lz = r -> lz + lz;
}
lz = info();
}
};
const int N = 250005;
const int lg = 19;
int n, m, q;
int type[N], L[N], R[N], A[N], C[N], K[N];
int lo[N], hi[N], mid[N];
ll B[N];
vi upds[N], ask[N];
int ans[N];
namespace bit {
ll ft[N];
void update(int p, ll x) {
for(; p <= q; p += p & -p) ft[p] += x;
}
int query(ll x) { // minimum i such that sum(1, i) <= x
int idx = 0;
ll sm = 0;
for(int pw = 1 << (lg-1); pw; pw >>= 1) {
if((idx|pw) <= q and sm + ft[idx|pw] < x) {
idx |= pw;
sm += ft[idx];
}
}
return idx+1;
}
}
namespace bit2 {
ll ft[N];
void update(int l, int r, ll x) {
for(; l <= n; l += l & -l) ft[l] += x;
for(++r; r <= n; r += r & -r) ft[r] -= x;
}
ll query(int p, ll ret = 0) {
for(; p > 0; p -= p & -p) ret += ft[p];
return ret;
}
}
Node* tr;
void Join(int l, int r, int c, int k) {
tr -> update(l, r, info{0, k});
bit2::update(l, r, k);
}
void Leave(int l, int r, int k) {
tr -> update(l, r, info{k, 0});
}
ll Service(int a, ll b) {
ll tmp = tr -> query(a);
return tmp < b ? ll(1e15) : b + bit2::query(a) - tmp;
// return tr -> query(a) >= b;
}
int main(int argc, char const *argv[])
{
#ifdef LOCAL
freopen("in", "r", stdin);
#endif
scanf("%d %d %d", &n, &m, &q);
// assert(m == 1);
tr = new Node(1, n);
for(int i = 1; i <= q; ++i) {
int &t = type[i]; scanf("%d", &t);
if(t == 1) {
int &l = L[i], &r = R[i], &c = C[i], &k = K[i];
scanf("%d %d %d %d", &l, &r, &c, &k);
Join(l, r, c, k);
upds[l].emplace_back(i);
upds[r+1].emplace_back(-i);
} else if(t == 2) {
int &l = L[i], &r = R[i], &k = K[i];
scanf("%d %d %d", &l, &r, &k);
Leave(l, r, k);
} else {
int &a = A[i]; ll &b = B[i];
scanf("%d %lld", &a, &b);
b = Service(a, b);
ask[a].emplace_back(i);
// printf("%d\n", Service(a, b));
}
}
for(int i = 1; i <= n; ++i) {
for(int j : upds[i]) {
if(j > 0) bit::update(j, K[j]);
else bit::update(-j, -K[-j]);
}
for(int j : ask[i]) {
ans[j] = bit::query(B[j]);
}
}
for(int i = 1; i <= q; ++i) if(type[i] == 3) {
printf("%d\n", ans[i] > q ? 0 : C[ans[i]]);
}
return 0;
}
Compilation message
foodcourt.cpp: In function 'int main(int, const char**)':
foodcourt.cpp:120:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
120 | scanf("%d %d %d", &n, &m, &q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:124:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
124 | int &t = type[i]; scanf("%d", &t);
| ~~~~~^~~~~~~~~~
foodcourt.cpp:127:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
127 | scanf("%d %d %d %d", &l, &r, &c, &k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:133:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
133 | scanf("%d %d %d", &l, &r, &k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:137:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
137 | scanf("%d %lld", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12524 KB |
Output is correct |
2 |
Correct |
11 ms |
12524 KB |
Output is correct |
3 |
Correct |
11 ms |
12396 KB |
Output is correct |
4 |
Correct |
11 ms |
12524 KB |
Output is correct |
5 |
Correct |
10 ms |
12268 KB |
Output is correct |
6 |
Correct |
11 ms |
12268 KB |
Output is correct |
7 |
Correct |
11 ms |
12524 KB |
Output is correct |
8 |
Correct |
11 ms |
12524 KB |
Output is correct |
9 |
Correct |
11 ms |
12524 KB |
Output is correct |
10 |
Correct |
11 ms |
12524 KB |
Output is correct |
11 |
Correct |
11 ms |
12524 KB |
Output is correct |
12 |
Correct |
11 ms |
12524 KB |
Output is correct |
13 |
Correct |
10 ms |
12396 KB |
Output is correct |
14 |
Correct |
11 ms |
12396 KB |
Output is correct |
15 |
Correct |
10 ms |
12396 KB |
Output is correct |
16 |
Correct |
11 ms |
12396 KB |
Output is correct |
17 |
Correct |
11 ms |
12396 KB |
Output is correct |
18 |
Correct |
12 ms |
12524 KB |
Output is correct |
19 |
Correct |
11 ms |
12396 KB |
Output is correct |
20 |
Correct |
11 ms |
12524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12524 KB |
Output is correct |
2 |
Correct |
11 ms |
12524 KB |
Output is correct |
3 |
Correct |
11 ms |
12396 KB |
Output is correct |
4 |
Correct |
11 ms |
12524 KB |
Output is correct |
5 |
Correct |
10 ms |
12268 KB |
Output is correct |
6 |
Correct |
11 ms |
12268 KB |
Output is correct |
7 |
Correct |
11 ms |
12524 KB |
Output is correct |
8 |
Correct |
11 ms |
12524 KB |
Output is correct |
9 |
Correct |
11 ms |
12524 KB |
Output is correct |
10 |
Correct |
11 ms |
12524 KB |
Output is correct |
11 |
Correct |
11 ms |
12524 KB |
Output is correct |
12 |
Correct |
11 ms |
12524 KB |
Output is correct |
13 |
Correct |
10 ms |
12396 KB |
Output is correct |
14 |
Correct |
11 ms |
12396 KB |
Output is correct |
15 |
Correct |
10 ms |
12396 KB |
Output is correct |
16 |
Correct |
11 ms |
12396 KB |
Output is correct |
17 |
Correct |
11 ms |
12396 KB |
Output is correct |
18 |
Correct |
12 ms |
12524 KB |
Output is correct |
19 |
Correct |
11 ms |
12396 KB |
Output is correct |
20 |
Correct |
11 ms |
12524 KB |
Output is correct |
21 |
Correct |
11 ms |
12524 KB |
Output is correct |
22 |
Correct |
11 ms |
12524 KB |
Output is correct |
23 |
Correct |
13 ms |
12396 KB |
Output is correct |
24 |
Correct |
13 ms |
12524 KB |
Output is correct |
25 |
Correct |
10 ms |
12268 KB |
Output is correct |
26 |
Correct |
10 ms |
12268 KB |
Output is correct |
27 |
Correct |
14 ms |
12524 KB |
Output is correct |
28 |
Correct |
11 ms |
12524 KB |
Output is correct |
29 |
Correct |
11 ms |
12524 KB |
Output is correct |
30 |
Correct |
11 ms |
12524 KB |
Output is correct |
31 |
Correct |
11 ms |
12524 KB |
Output is correct |
32 |
Correct |
11 ms |
12524 KB |
Output is correct |
33 |
Correct |
10 ms |
12396 KB |
Output is correct |
34 |
Correct |
11 ms |
12524 KB |
Output is correct |
35 |
Correct |
11 ms |
12396 KB |
Output is correct |
36 |
Correct |
11 ms |
12524 KB |
Output is correct |
37 |
Correct |
11 ms |
12396 KB |
Output is correct |
38 |
Correct |
11 ms |
12524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
24428 KB |
Output is correct |
2 |
Correct |
120 ms |
24684 KB |
Output is correct |
3 |
Correct |
113 ms |
24384 KB |
Output is correct |
4 |
Correct |
110 ms |
24300 KB |
Output is correct |
5 |
Correct |
118 ms |
24556 KB |
Output is correct |
6 |
Correct |
124 ms |
24556 KB |
Output is correct |
7 |
Correct |
39 ms |
15980 KB |
Output is correct |
8 |
Correct |
41 ms |
16236 KB |
Output is correct |
9 |
Correct |
110 ms |
24044 KB |
Output is correct |
10 |
Correct |
116 ms |
24300 KB |
Output is correct |
11 |
Correct |
110 ms |
24300 KB |
Output is correct |
12 |
Correct |
113 ms |
24332 KB |
Output is correct |
13 |
Correct |
92 ms |
21612 KB |
Output is correct |
14 |
Correct |
113 ms |
24556 KB |
Output is correct |
15 |
Correct |
117 ms |
22380 KB |
Output is correct |
16 |
Correct |
119 ms |
24812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
577 ms |
55916 KB |
Output is correct |
2 |
Correct |
452 ms |
48876 KB |
Output is correct |
3 |
Correct |
658 ms |
60368 KB |
Output is correct |
4 |
Correct |
487 ms |
54912 KB |
Output is correct |
5 |
Correct |
475 ms |
48620 KB |
Output is correct |
6 |
Correct |
670 ms |
61232 KB |
Output is correct |
7 |
Correct |
152 ms |
28256 KB |
Output is correct |
8 |
Correct |
146 ms |
28384 KB |
Output is correct |
9 |
Correct |
663 ms |
62444 KB |
Output is correct |
10 |
Correct |
658 ms |
62444 KB |
Output is correct |
11 |
Correct |
604 ms |
58988 KB |
Output is correct |
12 |
Correct |
634 ms |
60396 KB |
Output is correct |
13 |
Correct |
614 ms |
59056 KB |
Output is correct |
14 |
Correct |
642 ms |
60396 KB |
Output is correct |
15 |
Correct |
639 ms |
60140 KB |
Output is correct |
16 |
Correct |
641 ms |
60268 KB |
Output is correct |
17 |
Correct |
665 ms |
60268 KB |
Output is correct |
18 |
Correct |
635 ms |
59676 KB |
Output is correct |
19 |
Correct |
648 ms |
60172 KB |
Output is correct |
20 |
Correct |
635 ms |
59756 KB |
Output is correct |
21 |
Correct |
643 ms |
60396 KB |
Output is correct |
22 |
Correct |
643 ms |
60140 KB |
Output is correct |
23 |
Correct |
670 ms |
60140 KB |
Output is correct |
24 |
Correct |
642 ms |
60140 KB |
Output is correct |
25 |
Correct |
425 ms |
49960 KB |
Output is correct |
26 |
Correct |
447 ms |
55660 KB |
Output is correct |
27 |
Correct |
454 ms |
58440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12524 KB |
Output is correct |
2 |
Correct |
11 ms |
12524 KB |
Output is correct |
3 |
Correct |
11 ms |
12396 KB |
Output is correct |
4 |
Correct |
11 ms |
12524 KB |
Output is correct |
5 |
Correct |
10 ms |
12268 KB |
Output is correct |
6 |
Correct |
11 ms |
12268 KB |
Output is correct |
7 |
Correct |
11 ms |
12524 KB |
Output is correct |
8 |
Correct |
11 ms |
12524 KB |
Output is correct |
9 |
Correct |
11 ms |
12524 KB |
Output is correct |
10 |
Correct |
11 ms |
12524 KB |
Output is correct |
11 |
Correct |
11 ms |
12524 KB |
Output is correct |
12 |
Correct |
11 ms |
12524 KB |
Output is correct |
13 |
Correct |
10 ms |
12396 KB |
Output is correct |
14 |
Correct |
11 ms |
12396 KB |
Output is correct |
15 |
Correct |
10 ms |
12396 KB |
Output is correct |
16 |
Correct |
11 ms |
12396 KB |
Output is correct |
17 |
Correct |
11 ms |
12396 KB |
Output is correct |
18 |
Correct |
12 ms |
12524 KB |
Output is correct |
19 |
Correct |
11 ms |
12396 KB |
Output is correct |
20 |
Correct |
11 ms |
12524 KB |
Output is correct |
21 |
Correct |
116 ms |
24428 KB |
Output is correct |
22 |
Correct |
120 ms |
24684 KB |
Output is correct |
23 |
Correct |
113 ms |
24384 KB |
Output is correct |
24 |
Correct |
110 ms |
24300 KB |
Output is correct |
25 |
Correct |
118 ms |
24556 KB |
Output is correct |
26 |
Correct |
124 ms |
24556 KB |
Output is correct |
27 |
Correct |
39 ms |
15980 KB |
Output is correct |
28 |
Correct |
41 ms |
16236 KB |
Output is correct |
29 |
Correct |
110 ms |
24044 KB |
Output is correct |
30 |
Correct |
116 ms |
24300 KB |
Output is correct |
31 |
Correct |
110 ms |
24300 KB |
Output is correct |
32 |
Correct |
113 ms |
24332 KB |
Output is correct |
33 |
Correct |
92 ms |
21612 KB |
Output is correct |
34 |
Correct |
113 ms |
24556 KB |
Output is correct |
35 |
Correct |
117 ms |
22380 KB |
Output is correct |
36 |
Correct |
119 ms |
24812 KB |
Output is correct |
37 |
Correct |
115 ms |
23020 KB |
Output is correct |
38 |
Correct |
105 ms |
22636 KB |
Output is correct |
39 |
Correct |
35 ms |
15596 KB |
Output is correct |
40 |
Correct |
39 ms |
15812 KB |
Output is correct |
41 |
Correct |
121 ms |
23916 KB |
Output is correct |
42 |
Correct |
121 ms |
24172 KB |
Output is correct |
43 |
Correct |
129 ms |
24172 KB |
Output is correct |
44 |
Correct |
122 ms |
24044 KB |
Output is correct |
45 |
Correct |
125 ms |
24172 KB |
Output is correct |
46 |
Correct |
131 ms |
24284 KB |
Output is correct |
47 |
Correct |
68 ms |
22764 KB |
Output is correct |
48 |
Correct |
97 ms |
23020 KB |
Output is correct |
49 |
Correct |
85 ms |
20588 KB |
Output is correct |
50 |
Correct |
109 ms |
23276 KB |
Output is correct |
51 |
Correct |
125 ms |
24172 KB |
Output is correct |
52 |
Correct |
125 ms |
24172 KB |
Output is correct |
53 |
Correct |
92 ms |
22636 KB |
Output is correct |
54 |
Correct |
121 ms |
24812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
125 ms |
24576 KB |
Output is correct |
2 |
Correct |
132 ms |
24076 KB |
Output is correct |
3 |
Correct |
136 ms |
25580 KB |
Output is correct |
4 |
Correct |
96 ms |
23148 KB |
Output is correct |
5 |
Correct |
114 ms |
24300 KB |
Output is correct |
6 |
Correct |
133 ms |
25324 KB |
Output is correct |
7 |
Correct |
45 ms |
16492 KB |
Output is correct |
8 |
Correct |
43 ms |
16236 KB |
Output is correct |
9 |
Correct |
81 ms |
23788 KB |
Output is correct |
10 |
Correct |
74 ms |
21612 KB |
Output is correct |
11 |
Correct |
108 ms |
24048 KB |
Output is correct |
12 |
Correct |
108 ms |
24172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12524 KB |
Output is correct |
2 |
Correct |
11 ms |
12524 KB |
Output is correct |
3 |
Correct |
11 ms |
12396 KB |
Output is correct |
4 |
Correct |
11 ms |
12524 KB |
Output is correct |
5 |
Correct |
10 ms |
12268 KB |
Output is correct |
6 |
Correct |
11 ms |
12268 KB |
Output is correct |
7 |
Correct |
11 ms |
12524 KB |
Output is correct |
8 |
Correct |
11 ms |
12524 KB |
Output is correct |
9 |
Correct |
11 ms |
12524 KB |
Output is correct |
10 |
Correct |
11 ms |
12524 KB |
Output is correct |
11 |
Correct |
11 ms |
12524 KB |
Output is correct |
12 |
Correct |
11 ms |
12524 KB |
Output is correct |
13 |
Correct |
10 ms |
12396 KB |
Output is correct |
14 |
Correct |
11 ms |
12396 KB |
Output is correct |
15 |
Correct |
10 ms |
12396 KB |
Output is correct |
16 |
Correct |
11 ms |
12396 KB |
Output is correct |
17 |
Correct |
11 ms |
12396 KB |
Output is correct |
18 |
Correct |
12 ms |
12524 KB |
Output is correct |
19 |
Correct |
11 ms |
12396 KB |
Output is correct |
20 |
Correct |
11 ms |
12524 KB |
Output is correct |
21 |
Correct |
11 ms |
12524 KB |
Output is correct |
22 |
Correct |
11 ms |
12524 KB |
Output is correct |
23 |
Correct |
13 ms |
12396 KB |
Output is correct |
24 |
Correct |
13 ms |
12524 KB |
Output is correct |
25 |
Correct |
10 ms |
12268 KB |
Output is correct |
26 |
Correct |
10 ms |
12268 KB |
Output is correct |
27 |
Correct |
14 ms |
12524 KB |
Output is correct |
28 |
Correct |
11 ms |
12524 KB |
Output is correct |
29 |
Correct |
11 ms |
12524 KB |
Output is correct |
30 |
Correct |
11 ms |
12524 KB |
Output is correct |
31 |
Correct |
11 ms |
12524 KB |
Output is correct |
32 |
Correct |
11 ms |
12524 KB |
Output is correct |
33 |
Correct |
10 ms |
12396 KB |
Output is correct |
34 |
Correct |
11 ms |
12524 KB |
Output is correct |
35 |
Correct |
11 ms |
12396 KB |
Output is correct |
36 |
Correct |
11 ms |
12524 KB |
Output is correct |
37 |
Correct |
11 ms |
12396 KB |
Output is correct |
38 |
Correct |
11 ms |
12524 KB |
Output is correct |
39 |
Correct |
116 ms |
24428 KB |
Output is correct |
40 |
Correct |
120 ms |
24684 KB |
Output is correct |
41 |
Correct |
113 ms |
24384 KB |
Output is correct |
42 |
Correct |
110 ms |
24300 KB |
Output is correct |
43 |
Correct |
118 ms |
24556 KB |
Output is correct |
44 |
Correct |
124 ms |
24556 KB |
Output is correct |
45 |
Correct |
39 ms |
15980 KB |
Output is correct |
46 |
Correct |
41 ms |
16236 KB |
Output is correct |
47 |
Correct |
110 ms |
24044 KB |
Output is correct |
48 |
Correct |
116 ms |
24300 KB |
Output is correct |
49 |
Correct |
110 ms |
24300 KB |
Output is correct |
50 |
Correct |
113 ms |
24332 KB |
Output is correct |
51 |
Correct |
92 ms |
21612 KB |
Output is correct |
52 |
Correct |
113 ms |
24556 KB |
Output is correct |
53 |
Correct |
117 ms |
22380 KB |
Output is correct |
54 |
Correct |
119 ms |
24812 KB |
Output is correct |
55 |
Correct |
115 ms |
23020 KB |
Output is correct |
56 |
Correct |
105 ms |
22636 KB |
Output is correct |
57 |
Correct |
35 ms |
15596 KB |
Output is correct |
58 |
Correct |
39 ms |
15812 KB |
Output is correct |
59 |
Correct |
121 ms |
23916 KB |
Output is correct |
60 |
Correct |
121 ms |
24172 KB |
Output is correct |
61 |
Correct |
129 ms |
24172 KB |
Output is correct |
62 |
Correct |
122 ms |
24044 KB |
Output is correct |
63 |
Correct |
125 ms |
24172 KB |
Output is correct |
64 |
Correct |
131 ms |
24284 KB |
Output is correct |
65 |
Correct |
68 ms |
22764 KB |
Output is correct |
66 |
Correct |
97 ms |
23020 KB |
Output is correct |
67 |
Correct |
85 ms |
20588 KB |
Output is correct |
68 |
Correct |
109 ms |
23276 KB |
Output is correct |
69 |
Correct |
125 ms |
24172 KB |
Output is correct |
70 |
Correct |
125 ms |
24172 KB |
Output is correct |
71 |
Correct |
92 ms |
22636 KB |
Output is correct |
72 |
Correct |
121 ms |
24812 KB |
Output is correct |
73 |
Correct |
125 ms |
24576 KB |
Output is correct |
74 |
Correct |
132 ms |
24076 KB |
Output is correct |
75 |
Correct |
136 ms |
25580 KB |
Output is correct |
76 |
Correct |
96 ms |
23148 KB |
Output is correct |
77 |
Correct |
114 ms |
24300 KB |
Output is correct |
78 |
Correct |
133 ms |
25324 KB |
Output is correct |
79 |
Correct |
45 ms |
16492 KB |
Output is correct |
80 |
Correct |
43 ms |
16236 KB |
Output is correct |
81 |
Correct |
81 ms |
23788 KB |
Output is correct |
82 |
Correct |
74 ms |
21612 KB |
Output is correct |
83 |
Correct |
108 ms |
24048 KB |
Output is correct |
84 |
Correct |
108 ms |
24172 KB |
Output is correct |
85 |
Correct |
123 ms |
22764 KB |
Output is correct |
86 |
Correct |
133 ms |
24812 KB |
Output is correct |
87 |
Correct |
121 ms |
23788 KB |
Output is correct |
88 |
Correct |
139 ms |
25016 KB |
Output is correct |
89 |
Correct |
83 ms |
21228 KB |
Output is correct |
90 |
Correct |
128 ms |
24684 KB |
Output is correct |
91 |
Correct |
102 ms |
21356 KB |
Output is correct |
92 |
Correct |
101 ms |
21228 KB |
Output is correct |
93 |
Correct |
142 ms |
24684 KB |
Output is correct |
94 |
Correct |
137 ms |
24556 KB |
Output is correct |
95 |
Correct |
124 ms |
24044 KB |
Output is correct |
96 |
Correct |
136 ms |
24764 KB |
Output is correct |
97 |
Correct |
139 ms |
24684 KB |
Output is correct |
98 |
Correct |
112 ms |
21868 KB |
Output is correct |
99 |
Correct |
76 ms |
23276 KB |
Output is correct |
100 |
Correct |
86 ms |
21868 KB |
Output is correct |
101 |
Correct |
105 ms |
23520 KB |
Output is correct |
102 |
Correct |
105 ms |
24300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
12524 KB |
Output is correct |
2 |
Correct |
11 ms |
12524 KB |
Output is correct |
3 |
Correct |
11 ms |
12396 KB |
Output is correct |
4 |
Correct |
11 ms |
12524 KB |
Output is correct |
5 |
Correct |
10 ms |
12268 KB |
Output is correct |
6 |
Correct |
11 ms |
12268 KB |
Output is correct |
7 |
Correct |
11 ms |
12524 KB |
Output is correct |
8 |
Correct |
11 ms |
12524 KB |
Output is correct |
9 |
Correct |
11 ms |
12524 KB |
Output is correct |
10 |
Correct |
11 ms |
12524 KB |
Output is correct |
11 |
Correct |
11 ms |
12524 KB |
Output is correct |
12 |
Correct |
11 ms |
12524 KB |
Output is correct |
13 |
Correct |
10 ms |
12396 KB |
Output is correct |
14 |
Correct |
11 ms |
12396 KB |
Output is correct |
15 |
Correct |
10 ms |
12396 KB |
Output is correct |
16 |
Correct |
11 ms |
12396 KB |
Output is correct |
17 |
Correct |
11 ms |
12396 KB |
Output is correct |
18 |
Correct |
12 ms |
12524 KB |
Output is correct |
19 |
Correct |
11 ms |
12396 KB |
Output is correct |
20 |
Correct |
11 ms |
12524 KB |
Output is correct |
21 |
Correct |
11 ms |
12524 KB |
Output is correct |
22 |
Correct |
11 ms |
12524 KB |
Output is correct |
23 |
Correct |
13 ms |
12396 KB |
Output is correct |
24 |
Correct |
13 ms |
12524 KB |
Output is correct |
25 |
Correct |
10 ms |
12268 KB |
Output is correct |
26 |
Correct |
10 ms |
12268 KB |
Output is correct |
27 |
Correct |
14 ms |
12524 KB |
Output is correct |
28 |
Correct |
11 ms |
12524 KB |
Output is correct |
29 |
Correct |
11 ms |
12524 KB |
Output is correct |
30 |
Correct |
11 ms |
12524 KB |
Output is correct |
31 |
Correct |
11 ms |
12524 KB |
Output is correct |
32 |
Correct |
11 ms |
12524 KB |
Output is correct |
33 |
Correct |
10 ms |
12396 KB |
Output is correct |
34 |
Correct |
11 ms |
12524 KB |
Output is correct |
35 |
Correct |
11 ms |
12396 KB |
Output is correct |
36 |
Correct |
11 ms |
12524 KB |
Output is correct |
37 |
Correct |
11 ms |
12396 KB |
Output is correct |
38 |
Correct |
11 ms |
12524 KB |
Output is correct |
39 |
Correct |
116 ms |
24428 KB |
Output is correct |
40 |
Correct |
120 ms |
24684 KB |
Output is correct |
41 |
Correct |
113 ms |
24384 KB |
Output is correct |
42 |
Correct |
110 ms |
24300 KB |
Output is correct |
43 |
Correct |
118 ms |
24556 KB |
Output is correct |
44 |
Correct |
124 ms |
24556 KB |
Output is correct |
45 |
Correct |
39 ms |
15980 KB |
Output is correct |
46 |
Correct |
41 ms |
16236 KB |
Output is correct |
47 |
Correct |
110 ms |
24044 KB |
Output is correct |
48 |
Correct |
116 ms |
24300 KB |
Output is correct |
49 |
Correct |
110 ms |
24300 KB |
Output is correct |
50 |
Correct |
113 ms |
24332 KB |
Output is correct |
51 |
Correct |
92 ms |
21612 KB |
Output is correct |
52 |
Correct |
113 ms |
24556 KB |
Output is correct |
53 |
Correct |
117 ms |
22380 KB |
Output is correct |
54 |
Correct |
119 ms |
24812 KB |
Output is correct |
55 |
Correct |
577 ms |
55916 KB |
Output is correct |
56 |
Correct |
452 ms |
48876 KB |
Output is correct |
57 |
Correct |
658 ms |
60368 KB |
Output is correct |
58 |
Correct |
487 ms |
54912 KB |
Output is correct |
59 |
Correct |
475 ms |
48620 KB |
Output is correct |
60 |
Correct |
670 ms |
61232 KB |
Output is correct |
61 |
Correct |
152 ms |
28256 KB |
Output is correct |
62 |
Correct |
146 ms |
28384 KB |
Output is correct |
63 |
Correct |
663 ms |
62444 KB |
Output is correct |
64 |
Correct |
658 ms |
62444 KB |
Output is correct |
65 |
Correct |
604 ms |
58988 KB |
Output is correct |
66 |
Correct |
634 ms |
60396 KB |
Output is correct |
67 |
Correct |
614 ms |
59056 KB |
Output is correct |
68 |
Correct |
642 ms |
60396 KB |
Output is correct |
69 |
Correct |
639 ms |
60140 KB |
Output is correct |
70 |
Correct |
641 ms |
60268 KB |
Output is correct |
71 |
Correct |
665 ms |
60268 KB |
Output is correct |
72 |
Correct |
635 ms |
59676 KB |
Output is correct |
73 |
Correct |
648 ms |
60172 KB |
Output is correct |
74 |
Correct |
635 ms |
59756 KB |
Output is correct |
75 |
Correct |
643 ms |
60396 KB |
Output is correct |
76 |
Correct |
643 ms |
60140 KB |
Output is correct |
77 |
Correct |
670 ms |
60140 KB |
Output is correct |
78 |
Correct |
642 ms |
60140 KB |
Output is correct |
79 |
Correct |
425 ms |
49960 KB |
Output is correct |
80 |
Correct |
447 ms |
55660 KB |
Output is correct |
81 |
Correct |
454 ms |
58440 KB |
Output is correct |
82 |
Correct |
115 ms |
23020 KB |
Output is correct |
83 |
Correct |
105 ms |
22636 KB |
Output is correct |
84 |
Correct |
35 ms |
15596 KB |
Output is correct |
85 |
Correct |
39 ms |
15812 KB |
Output is correct |
86 |
Correct |
121 ms |
23916 KB |
Output is correct |
87 |
Correct |
121 ms |
24172 KB |
Output is correct |
88 |
Correct |
129 ms |
24172 KB |
Output is correct |
89 |
Correct |
122 ms |
24044 KB |
Output is correct |
90 |
Correct |
125 ms |
24172 KB |
Output is correct |
91 |
Correct |
131 ms |
24284 KB |
Output is correct |
92 |
Correct |
68 ms |
22764 KB |
Output is correct |
93 |
Correct |
97 ms |
23020 KB |
Output is correct |
94 |
Correct |
85 ms |
20588 KB |
Output is correct |
95 |
Correct |
109 ms |
23276 KB |
Output is correct |
96 |
Correct |
125 ms |
24172 KB |
Output is correct |
97 |
Correct |
125 ms |
24172 KB |
Output is correct |
98 |
Correct |
92 ms |
22636 KB |
Output is correct |
99 |
Correct |
121 ms |
24812 KB |
Output is correct |
100 |
Correct |
125 ms |
24576 KB |
Output is correct |
101 |
Correct |
132 ms |
24076 KB |
Output is correct |
102 |
Correct |
136 ms |
25580 KB |
Output is correct |
103 |
Correct |
96 ms |
23148 KB |
Output is correct |
104 |
Correct |
114 ms |
24300 KB |
Output is correct |
105 |
Correct |
133 ms |
25324 KB |
Output is correct |
106 |
Correct |
45 ms |
16492 KB |
Output is correct |
107 |
Correct |
43 ms |
16236 KB |
Output is correct |
108 |
Correct |
81 ms |
23788 KB |
Output is correct |
109 |
Correct |
74 ms |
21612 KB |
Output is correct |
110 |
Correct |
108 ms |
24048 KB |
Output is correct |
111 |
Correct |
108 ms |
24172 KB |
Output is correct |
112 |
Correct |
123 ms |
22764 KB |
Output is correct |
113 |
Correct |
133 ms |
24812 KB |
Output is correct |
114 |
Correct |
121 ms |
23788 KB |
Output is correct |
115 |
Correct |
139 ms |
25016 KB |
Output is correct |
116 |
Correct |
83 ms |
21228 KB |
Output is correct |
117 |
Correct |
128 ms |
24684 KB |
Output is correct |
118 |
Correct |
102 ms |
21356 KB |
Output is correct |
119 |
Correct |
101 ms |
21228 KB |
Output is correct |
120 |
Correct |
142 ms |
24684 KB |
Output is correct |
121 |
Correct |
137 ms |
24556 KB |
Output is correct |
122 |
Correct |
124 ms |
24044 KB |
Output is correct |
123 |
Correct |
136 ms |
24764 KB |
Output is correct |
124 |
Correct |
139 ms |
24684 KB |
Output is correct |
125 |
Correct |
112 ms |
21868 KB |
Output is correct |
126 |
Correct |
76 ms |
23276 KB |
Output is correct |
127 |
Correct |
86 ms |
21868 KB |
Output is correct |
128 |
Correct |
105 ms |
23520 KB |
Output is correct |
129 |
Correct |
105 ms |
24300 KB |
Output is correct |
130 |
Correct |
658 ms |
60524 KB |
Output is correct |
131 |
Correct |
451 ms |
48108 KB |
Output is correct |
132 |
Correct |
644 ms |
60984 KB |
Output is correct |
133 |
Correct |
653 ms |
59756 KB |
Output is correct |
134 |
Correct |
585 ms |
57452 KB |
Output is correct |
135 |
Correct |
684 ms |
62188 KB |
Output is correct |
136 |
Correct |
674 ms |
63380 KB |
Output is correct |
137 |
Correct |
686 ms |
63276 KB |
Output is correct |
138 |
Correct |
617 ms |
59412 KB |
Output is correct |
139 |
Correct |
643 ms |
60908 KB |
Output is correct |
140 |
Correct |
635 ms |
60012 KB |
Output is correct |
141 |
Correct |
641 ms |
60908 KB |
Output is correct |
142 |
Correct |
662 ms |
60780 KB |
Output is correct |
143 |
Correct |
649 ms |
60780 KB |
Output is correct |
144 |
Correct |
647 ms |
60140 KB |
Output is correct |
145 |
Correct |
637 ms |
60780 KB |
Output is correct |
146 |
Correct |
649 ms |
60524 KB |
Output is correct |
147 |
Correct |
651 ms |
60892 KB |
Output is correct |
148 |
Correct |
656 ms |
60908 KB |
Output is correct |
149 |
Correct |
645 ms |
60908 KB |
Output is correct |
150 |
Correct |
306 ms |
55268 KB |
Output is correct |
151 |
Correct |
445 ms |
56172 KB |
Output is correct |
152 |
Correct |
452 ms |
56300 KB |
Output is correct |
153 |
Correct |
458 ms |
59372 KB |
Output is correct |