#include <bits/stdc++.h>
#ifdef __LOCAL__
#include <debug_local.h>
#endif
using namespace std;
const int mxN = 250005;
struct Node {
long long sum, max_suf, pos_sum;
Node() { sum = max_suf = pos_sum = 0; }
} t[4 * mxN];
void propagate(int x, int lx, int rx) {
if (lx == rx) return;
t[x << 1].sum += t[x].sum;
t[x << 1 | 1].sum += t[x].sum;
t[x << 1].max_suf = max({t[x].sum + t[x << 1].max_suf, t[x].max_suf, 0LL});
t[x << 1 | 1].max_suf = max({t[x].sum + t[x << 1 | 1].max_suf, t[x].max_suf, 0LL});
t[x << 1].pos_sum += t[x].pos_sum;
t[x << 1 | 1].pos_sum += t[x].pos_sum;
t[x] = Node();
}
void update(int x, int lx, int rx, int l, int r, int k) {
if (t[x].sum != 0 || t[x].max_suf != 0 || t[x].pos_sum != 0) propagate(x, lx, rx);
if (l > rx || lx > r) return;
if (l <= lx && r >= rx) {
t[x].sum += k;
t[x].pos_sum += max(k, 0);
t[x].max_suf = max(t[x].max_suf + k, 0LL);
return;
}
int mx = (lx + rx) >> 1;
update(x << 1, lx, mx, l, r, k);
update(x << 1 | 1, mx + 1, rx, l, r, k);
}
Node query(int x, int lx, int rx, int i) {
if (t[x].sum != 0 || t[x].max_suf != 0 || t[x].pos_sum != 0) propagate(x, lx, rx);
if (lx == rx) return t[x];
int mx = (lx + rx) >> 1;
if (i <= mx) return query(x << 1, lx, mx, i);
return query(x << 1 | 1, mx + 1, rx, i);
}
long long bit[mxN];
void add(int i, int k) {
for (; i < mxN; i += i & (-i)) bit[i] += k;
}
long long get(int i) {
long long ret = 0;
for (; i > 0; i -= i & (-i)) ret += bit[i];
return ret;
}
void testCase() {
int n, m, q;
cin >> n >> m >> q;
vector<pair<int, long long>> Q;
vector<tuple<int, int, int, int>> updates;
updates.push_back({1, n, 0, 0});
for (int i = 1; i <= q; i++) {
int t;
cin >> t;
if (t == 1) {
int l, r, c, k;
cin >> l >> r >> c >> k;
update(1, 1, n, l, r, k);
updates.push_back({l, r, k, c});
} else if (t == 2) {
int l, r, k;
cin >> l >> r >> k;
update(1, 1, n, l, r, -k);
} else {
int a;
long long b;
cin >> a >> b;
auto x = query(1, 1, n, a);
long long rem = x.max_suf;
long long added = x.pos_sum;
if (rem >= b) {
Q.push_back({a, added - rem + b});
} else {
Q.push_back({a, 0});
}
}
}
q = Q.size();
vector<int> lo(q), hi(q);
for (int i = 0; i < q; i++) {
lo[i] = 0, hi[i] = max(0, (int) updates.size() - 1);
}
for (int iter = 0; iter < 20; iter++) {
for (int i = 0; i < mxN; i++) bit[i] = 0;
vector<tuple<int, long long, int>> qq[updates.size()];
for (int i = 0; i < q; i++) {
qq[(lo[i] + hi[i]) / 2].push_back({Q[i].first, Q[i].second, i});
}
for (int i = 0; i < updates.size(); i++) {
auto [l, r, k, c] = updates[i];
add(l, k);
add(r + 1, -k);
for (auto [a, b, id] : qq[i]) {
auto x = get(a);
if (x >= b) hi[id] = i;
else lo[id] = i + 1;
}
}
}
for (int i = 0; i < q; i++) {
cout << get<3> (updates[lo[i]]) << "\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
testCase();
}
Compilation message
foodcourt.cpp: In function 'void testCase()':
foodcourt.cpp:93:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::tuple<int, int, int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
93 | for (int i = 0; i < updates.size(); i++) {
| ~~^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
25812 KB |
Output is correct |
2 |
Correct |
15 ms |
25812 KB |
Output is correct |
3 |
Correct |
13 ms |
25772 KB |
Output is correct |
4 |
Correct |
15 ms |
25812 KB |
Output is correct |
5 |
Correct |
13 ms |
25812 KB |
Output is correct |
6 |
Correct |
13 ms |
25852 KB |
Output is correct |
7 |
Correct |
13 ms |
25812 KB |
Output is correct |
8 |
Correct |
14 ms |
25812 KB |
Output is correct |
9 |
Correct |
15 ms |
25812 KB |
Output is correct |
10 |
Correct |
15 ms |
25748 KB |
Output is correct |
11 |
Correct |
14 ms |
25840 KB |
Output is correct |
12 |
Correct |
14 ms |
25768 KB |
Output is correct |
13 |
Correct |
15 ms |
25812 KB |
Output is correct |
14 |
Correct |
13 ms |
25860 KB |
Output is correct |
15 |
Correct |
12 ms |
25812 KB |
Output is correct |
16 |
Correct |
15 ms |
25840 KB |
Output is correct |
17 |
Correct |
13 ms |
25788 KB |
Output is correct |
18 |
Correct |
15 ms |
25756 KB |
Output is correct |
19 |
Correct |
14 ms |
25868 KB |
Output is correct |
20 |
Correct |
14 ms |
25868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
25812 KB |
Output is correct |
2 |
Correct |
15 ms |
25812 KB |
Output is correct |
3 |
Correct |
13 ms |
25772 KB |
Output is correct |
4 |
Correct |
15 ms |
25812 KB |
Output is correct |
5 |
Correct |
13 ms |
25812 KB |
Output is correct |
6 |
Correct |
13 ms |
25852 KB |
Output is correct |
7 |
Correct |
13 ms |
25812 KB |
Output is correct |
8 |
Correct |
14 ms |
25812 KB |
Output is correct |
9 |
Correct |
15 ms |
25812 KB |
Output is correct |
10 |
Correct |
15 ms |
25748 KB |
Output is correct |
11 |
Correct |
14 ms |
25840 KB |
Output is correct |
12 |
Correct |
14 ms |
25768 KB |
Output is correct |
13 |
Correct |
15 ms |
25812 KB |
Output is correct |
14 |
Correct |
13 ms |
25860 KB |
Output is correct |
15 |
Correct |
12 ms |
25812 KB |
Output is correct |
16 |
Correct |
15 ms |
25840 KB |
Output is correct |
17 |
Correct |
13 ms |
25788 KB |
Output is correct |
18 |
Correct |
15 ms |
25756 KB |
Output is correct |
19 |
Correct |
14 ms |
25868 KB |
Output is correct |
20 |
Correct |
14 ms |
25868 KB |
Output is correct |
21 |
Correct |
13 ms |
25812 KB |
Output is correct |
22 |
Correct |
14 ms |
25864 KB |
Output is correct |
23 |
Correct |
14 ms |
25788 KB |
Output is correct |
24 |
Correct |
15 ms |
25740 KB |
Output is correct |
25 |
Correct |
15 ms |
25812 KB |
Output is correct |
26 |
Correct |
13 ms |
25828 KB |
Output is correct |
27 |
Correct |
14 ms |
25860 KB |
Output is correct |
28 |
Correct |
14 ms |
25732 KB |
Output is correct |
29 |
Correct |
13 ms |
25812 KB |
Output is correct |
30 |
Correct |
15 ms |
25840 KB |
Output is correct |
31 |
Correct |
14 ms |
25812 KB |
Output is correct |
32 |
Correct |
15 ms |
25740 KB |
Output is correct |
33 |
Correct |
12 ms |
25812 KB |
Output is correct |
34 |
Correct |
13 ms |
25812 KB |
Output is correct |
35 |
Correct |
16 ms |
25736 KB |
Output is correct |
36 |
Correct |
13 ms |
25760 KB |
Output is correct |
37 |
Correct |
14 ms |
25844 KB |
Output is correct |
38 |
Correct |
14 ms |
25836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
95 ms |
28476 KB |
Output is correct |
2 |
Correct |
94 ms |
28196 KB |
Output is correct |
3 |
Correct |
91 ms |
28400 KB |
Output is correct |
4 |
Correct |
90 ms |
28388 KB |
Output is correct |
5 |
Correct |
98 ms |
28124 KB |
Output is correct |
6 |
Correct |
104 ms |
28204 KB |
Output is correct |
7 |
Correct |
66 ms |
28180 KB |
Output is correct |
8 |
Correct |
70 ms |
28208 KB |
Output is correct |
9 |
Correct |
83 ms |
28156 KB |
Output is correct |
10 |
Correct |
88 ms |
27796 KB |
Output is correct |
11 |
Correct |
99 ms |
28040 KB |
Output is correct |
12 |
Correct |
94 ms |
27820 KB |
Output is correct |
13 |
Correct |
86 ms |
28528 KB |
Output is correct |
14 |
Correct |
94 ms |
28780 KB |
Output is correct |
15 |
Correct |
99 ms |
28816 KB |
Output is correct |
16 |
Correct |
101 ms |
28864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
443 ms |
35116 KB |
Output is correct |
2 |
Correct |
340 ms |
36412 KB |
Output is correct |
3 |
Correct |
436 ms |
41524 KB |
Output is correct |
4 |
Correct |
380 ms |
37408 KB |
Output is correct |
5 |
Correct |
419 ms |
37772 KB |
Output is correct |
6 |
Correct |
529 ms |
41272 KB |
Output is correct |
7 |
Correct |
268 ms |
39728 KB |
Output is correct |
8 |
Correct |
265 ms |
39576 KB |
Output is correct |
9 |
Correct |
567 ms |
45128 KB |
Output is correct |
10 |
Correct |
550 ms |
44900 KB |
Output is correct |
11 |
Correct |
432 ms |
40132 KB |
Output is correct |
12 |
Correct |
486 ms |
40156 KB |
Output is correct |
13 |
Correct |
461 ms |
39960 KB |
Output is correct |
14 |
Correct |
434 ms |
39932 KB |
Output is correct |
15 |
Correct |
441 ms |
39872 KB |
Output is correct |
16 |
Correct |
487 ms |
39896 KB |
Output is correct |
17 |
Correct |
436 ms |
39776 KB |
Output is correct |
18 |
Correct |
484 ms |
39960 KB |
Output is correct |
19 |
Correct |
481 ms |
39960 KB |
Output is correct |
20 |
Correct |
504 ms |
39868 KB |
Output is correct |
21 |
Correct |
436 ms |
39944 KB |
Output is correct |
22 |
Correct |
453 ms |
39872 KB |
Output is correct |
23 |
Correct |
428 ms |
39824 KB |
Output is correct |
24 |
Correct |
451 ms |
39800 KB |
Output is correct |
25 |
Correct |
386 ms |
41012 KB |
Output is correct |
26 |
Correct |
397 ms |
41284 KB |
Output is correct |
27 |
Correct |
371 ms |
41908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
25812 KB |
Output is correct |
2 |
Correct |
15 ms |
25812 KB |
Output is correct |
3 |
Correct |
13 ms |
25772 KB |
Output is correct |
4 |
Correct |
15 ms |
25812 KB |
Output is correct |
5 |
Correct |
13 ms |
25812 KB |
Output is correct |
6 |
Correct |
13 ms |
25852 KB |
Output is correct |
7 |
Correct |
13 ms |
25812 KB |
Output is correct |
8 |
Correct |
14 ms |
25812 KB |
Output is correct |
9 |
Correct |
15 ms |
25812 KB |
Output is correct |
10 |
Correct |
15 ms |
25748 KB |
Output is correct |
11 |
Correct |
14 ms |
25840 KB |
Output is correct |
12 |
Correct |
14 ms |
25768 KB |
Output is correct |
13 |
Correct |
15 ms |
25812 KB |
Output is correct |
14 |
Correct |
13 ms |
25860 KB |
Output is correct |
15 |
Correct |
12 ms |
25812 KB |
Output is correct |
16 |
Correct |
15 ms |
25840 KB |
Output is correct |
17 |
Correct |
13 ms |
25788 KB |
Output is correct |
18 |
Correct |
15 ms |
25756 KB |
Output is correct |
19 |
Correct |
14 ms |
25868 KB |
Output is correct |
20 |
Correct |
14 ms |
25868 KB |
Output is correct |
21 |
Correct |
95 ms |
28476 KB |
Output is correct |
22 |
Correct |
94 ms |
28196 KB |
Output is correct |
23 |
Correct |
91 ms |
28400 KB |
Output is correct |
24 |
Correct |
90 ms |
28388 KB |
Output is correct |
25 |
Correct |
98 ms |
28124 KB |
Output is correct |
26 |
Correct |
104 ms |
28204 KB |
Output is correct |
27 |
Correct |
66 ms |
28180 KB |
Output is correct |
28 |
Correct |
70 ms |
28208 KB |
Output is correct |
29 |
Correct |
83 ms |
28156 KB |
Output is correct |
30 |
Correct |
88 ms |
27796 KB |
Output is correct |
31 |
Correct |
99 ms |
28040 KB |
Output is correct |
32 |
Correct |
94 ms |
27820 KB |
Output is correct |
33 |
Correct |
86 ms |
28528 KB |
Output is correct |
34 |
Correct |
94 ms |
28780 KB |
Output is correct |
35 |
Correct |
99 ms |
28816 KB |
Output is correct |
36 |
Correct |
101 ms |
28864 KB |
Output is correct |
37 |
Correct |
98 ms |
28116 KB |
Output is correct |
38 |
Correct |
102 ms |
27720 KB |
Output is correct |
39 |
Correct |
67 ms |
27472 KB |
Output is correct |
40 |
Correct |
72 ms |
27692 KB |
Output is correct |
41 |
Correct |
101 ms |
27848 KB |
Output is correct |
42 |
Correct |
114 ms |
27780 KB |
Output is correct |
43 |
Correct |
99 ms |
27764 KB |
Output is correct |
44 |
Correct |
102 ms |
27760 KB |
Output is correct |
45 |
Correct |
105 ms |
27884 KB |
Output is correct |
46 |
Correct |
103 ms |
27848 KB |
Output is correct |
47 |
Correct |
76 ms |
28164 KB |
Output is correct |
48 |
Correct |
95 ms |
28264 KB |
Output is correct |
49 |
Correct |
88 ms |
27264 KB |
Output is correct |
50 |
Correct |
89 ms |
27444 KB |
Output is correct |
51 |
Correct |
104 ms |
27780 KB |
Output is correct |
52 |
Correct |
106 ms |
27756 KB |
Output is correct |
53 |
Correct |
81 ms |
27908 KB |
Output is correct |
54 |
Correct |
105 ms |
28804 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
127 ms |
28996 KB |
Output is correct |
2 |
Correct |
122 ms |
29236 KB |
Output is correct |
3 |
Correct |
121 ms |
29212 KB |
Output is correct |
4 |
Correct |
94 ms |
28344 KB |
Output is correct |
5 |
Correct |
116 ms |
28924 KB |
Output is correct |
6 |
Correct |
126 ms |
29252 KB |
Output is correct |
7 |
Correct |
93 ms |
28956 KB |
Output is correct |
8 |
Correct |
92 ms |
28736 KB |
Output is correct |
9 |
Correct |
106 ms |
29240 KB |
Output is correct |
10 |
Correct |
93 ms |
28340 KB |
Output is correct |
11 |
Correct |
139 ms |
29276 KB |
Output is correct |
12 |
Correct |
119 ms |
29236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
25812 KB |
Output is correct |
2 |
Correct |
15 ms |
25812 KB |
Output is correct |
3 |
Correct |
13 ms |
25772 KB |
Output is correct |
4 |
Correct |
15 ms |
25812 KB |
Output is correct |
5 |
Correct |
13 ms |
25812 KB |
Output is correct |
6 |
Correct |
13 ms |
25852 KB |
Output is correct |
7 |
Correct |
13 ms |
25812 KB |
Output is correct |
8 |
Correct |
14 ms |
25812 KB |
Output is correct |
9 |
Correct |
15 ms |
25812 KB |
Output is correct |
10 |
Correct |
15 ms |
25748 KB |
Output is correct |
11 |
Correct |
14 ms |
25840 KB |
Output is correct |
12 |
Correct |
14 ms |
25768 KB |
Output is correct |
13 |
Correct |
15 ms |
25812 KB |
Output is correct |
14 |
Correct |
13 ms |
25860 KB |
Output is correct |
15 |
Correct |
12 ms |
25812 KB |
Output is correct |
16 |
Correct |
15 ms |
25840 KB |
Output is correct |
17 |
Correct |
13 ms |
25788 KB |
Output is correct |
18 |
Correct |
15 ms |
25756 KB |
Output is correct |
19 |
Correct |
14 ms |
25868 KB |
Output is correct |
20 |
Correct |
14 ms |
25868 KB |
Output is correct |
21 |
Correct |
13 ms |
25812 KB |
Output is correct |
22 |
Correct |
14 ms |
25864 KB |
Output is correct |
23 |
Correct |
14 ms |
25788 KB |
Output is correct |
24 |
Correct |
15 ms |
25740 KB |
Output is correct |
25 |
Correct |
15 ms |
25812 KB |
Output is correct |
26 |
Correct |
13 ms |
25828 KB |
Output is correct |
27 |
Correct |
14 ms |
25860 KB |
Output is correct |
28 |
Correct |
14 ms |
25732 KB |
Output is correct |
29 |
Correct |
13 ms |
25812 KB |
Output is correct |
30 |
Correct |
15 ms |
25840 KB |
Output is correct |
31 |
Correct |
14 ms |
25812 KB |
Output is correct |
32 |
Correct |
15 ms |
25740 KB |
Output is correct |
33 |
Correct |
12 ms |
25812 KB |
Output is correct |
34 |
Correct |
13 ms |
25812 KB |
Output is correct |
35 |
Correct |
16 ms |
25736 KB |
Output is correct |
36 |
Correct |
13 ms |
25760 KB |
Output is correct |
37 |
Correct |
14 ms |
25844 KB |
Output is correct |
38 |
Correct |
14 ms |
25836 KB |
Output is correct |
39 |
Correct |
95 ms |
28476 KB |
Output is correct |
40 |
Correct |
94 ms |
28196 KB |
Output is correct |
41 |
Correct |
91 ms |
28400 KB |
Output is correct |
42 |
Correct |
90 ms |
28388 KB |
Output is correct |
43 |
Correct |
98 ms |
28124 KB |
Output is correct |
44 |
Correct |
104 ms |
28204 KB |
Output is correct |
45 |
Correct |
66 ms |
28180 KB |
Output is correct |
46 |
Correct |
70 ms |
28208 KB |
Output is correct |
47 |
Correct |
83 ms |
28156 KB |
Output is correct |
48 |
Correct |
88 ms |
27796 KB |
Output is correct |
49 |
Correct |
99 ms |
28040 KB |
Output is correct |
50 |
Correct |
94 ms |
27820 KB |
Output is correct |
51 |
Correct |
86 ms |
28528 KB |
Output is correct |
52 |
Correct |
94 ms |
28780 KB |
Output is correct |
53 |
Correct |
99 ms |
28816 KB |
Output is correct |
54 |
Correct |
101 ms |
28864 KB |
Output is correct |
55 |
Correct |
98 ms |
28116 KB |
Output is correct |
56 |
Correct |
102 ms |
27720 KB |
Output is correct |
57 |
Correct |
67 ms |
27472 KB |
Output is correct |
58 |
Correct |
72 ms |
27692 KB |
Output is correct |
59 |
Correct |
101 ms |
27848 KB |
Output is correct |
60 |
Correct |
114 ms |
27780 KB |
Output is correct |
61 |
Correct |
99 ms |
27764 KB |
Output is correct |
62 |
Correct |
102 ms |
27760 KB |
Output is correct |
63 |
Correct |
105 ms |
27884 KB |
Output is correct |
64 |
Correct |
103 ms |
27848 KB |
Output is correct |
65 |
Correct |
76 ms |
28164 KB |
Output is correct |
66 |
Correct |
95 ms |
28264 KB |
Output is correct |
67 |
Correct |
88 ms |
27264 KB |
Output is correct |
68 |
Correct |
89 ms |
27444 KB |
Output is correct |
69 |
Correct |
104 ms |
27780 KB |
Output is correct |
70 |
Correct |
106 ms |
27756 KB |
Output is correct |
71 |
Correct |
81 ms |
27908 KB |
Output is correct |
72 |
Correct |
105 ms |
28804 KB |
Output is correct |
73 |
Correct |
127 ms |
28996 KB |
Output is correct |
74 |
Correct |
122 ms |
29236 KB |
Output is correct |
75 |
Correct |
121 ms |
29212 KB |
Output is correct |
76 |
Correct |
94 ms |
28344 KB |
Output is correct |
77 |
Correct |
116 ms |
28924 KB |
Output is correct |
78 |
Correct |
126 ms |
29252 KB |
Output is correct |
79 |
Correct |
93 ms |
28956 KB |
Output is correct |
80 |
Correct |
92 ms |
28736 KB |
Output is correct |
81 |
Correct |
106 ms |
29240 KB |
Output is correct |
82 |
Correct |
93 ms |
28340 KB |
Output is correct |
83 |
Correct |
139 ms |
29276 KB |
Output is correct |
84 |
Correct |
119 ms |
29236 KB |
Output is correct |
85 |
Correct |
99 ms |
28108 KB |
Output is correct |
86 |
Correct |
114 ms |
28280 KB |
Output is correct |
87 |
Correct |
105 ms |
27820 KB |
Output is correct |
88 |
Correct |
113 ms |
28160 KB |
Output is correct |
89 |
Correct |
74 ms |
27200 KB |
Output is correct |
90 |
Correct |
112 ms |
27828 KB |
Output is correct |
91 |
Correct |
89 ms |
27548 KB |
Output is correct |
92 |
Correct |
88 ms |
27440 KB |
Output is correct |
93 |
Correct |
110 ms |
27828 KB |
Output is correct |
94 |
Correct |
120 ms |
28236 KB |
Output is correct |
95 |
Correct |
104 ms |
27736 KB |
Output is correct |
96 |
Correct |
110 ms |
27848 KB |
Output is correct |
97 |
Correct |
105 ms |
27836 KB |
Output is correct |
98 |
Correct |
91 ms |
27568 KB |
Output is correct |
99 |
Correct |
82 ms |
28208 KB |
Output is correct |
100 |
Correct |
92 ms |
28004 KB |
Output is correct |
101 |
Correct |
104 ms |
28176 KB |
Output is correct |
102 |
Correct |
95 ms |
28472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
25812 KB |
Output is correct |
2 |
Correct |
15 ms |
25812 KB |
Output is correct |
3 |
Correct |
13 ms |
25772 KB |
Output is correct |
4 |
Correct |
15 ms |
25812 KB |
Output is correct |
5 |
Correct |
13 ms |
25812 KB |
Output is correct |
6 |
Correct |
13 ms |
25852 KB |
Output is correct |
7 |
Correct |
13 ms |
25812 KB |
Output is correct |
8 |
Correct |
14 ms |
25812 KB |
Output is correct |
9 |
Correct |
15 ms |
25812 KB |
Output is correct |
10 |
Correct |
15 ms |
25748 KB |
Output is correct |
11 |
Correct |
14 ms |
25840 KB |
Output is correct |
12 |
Correct |
14 ms |
25768 KB |
Output is correct |
13 |
Correct |
15 ms |
25812 KB |
Output is correct |
14 |
Correct |
13 ms |
25860 KB |
Output is correct |
15 |
Correct |
12 ms |
25812 KB |
Output is correct |
16 |
Correct |
15 ms |
25840 KB |
Output is correct |
17 |
Correct |
13 ms |
25788 KB |
Output is correct |
18 |
Correct |
15 ms |
25756 KB |
Output is correct |
19 |
Correct |
14 ms |
25868 KB |
Output is correct |
20 |
Correct |
14 ms |
25868 KB |
Output is correct |
21 |
Correct |
13 ms |
25812 KB |
Output is correct |
22 |
Correct |
14 ms |
25864 KB |
Output is correct |
23 |
Correct |
14 ms |
25788 KB |
Output is correct |
24 |
Correct |
15 ms |
25740 KB |
Output is correct |
25 |
Correct |
15 ms |
25812 KB |
Output is correct |
26 |
Correct |
13 ms |
25828 KB |
Output is correct |
27 |
Correct |
14 ms |
25860 KB |
Output is correct |
28 |
Correct |
14 ms |
25732 KB |
Output is correct |
29 |
Correct |
13 ms |
25812 KB |
Output is correct |
30 |
Correct |
15 ms |
25840 KB |
Output is correct |
31 |
Correct |
14 ms |
25812 KB |
Output is correct |
32 |
Correct |
15 ms |
25740 KB |
Output is correct |
33 |
Correct |
12 ms |
25812 KB |
Output is correct |
34 |
Correct |
13 ms |
25812 KB |
Output is correct |
35 |
Correct |
16 ms |
25736 KB |
Output is correct |
36 |
Correct |
13 ms |
25760 KB |
Output is correct |
37 |
Correct |
14 ms |
25844 KB |
Output is correct |
38 |
Correct |
14 ms |
25836 KB |
Output is correct |
39 |
Correct |
95 ms |
28476 KB |
Output is correct |
40 |
Correct |
94 ms |
28196 KB |
Output is correct |
41 |
Correct |
91 ms |
28400 KB |
Output is correct |
42 |
Correct |
90 ms |
28388 KB |
Output is correct |
43 |
Correct |
98 ms |
28124 KB |
Output is correct |
44 |
Correct |
104 ms |
28204 KB |
Output is correct |
45 |
Correct |
66 ms |
28180 KB |
Output is correct |
46 |
Correct |
70 ms |
28208 KB |
Output is correct |
47 |
Correct |
83 ms |
28156 KB |
Output is correct |
48 |
Correct |
88 ms |
27796 KB |
Output is correct |
49 |
Correct |
99 ms |
28040 KB |
Output is correct |
50 |
Correct |
94 ms |
27820 KB |
Output is correct |
51 |
Correct |
86 ms |
28528 KB |
Output is correct |
52 |
Correct |
94 ms |
28780 KB |
Output is correct |
53 |
Correct |
99 ms |
28816 KB |
Output is correct |
54 |
Correct |
101 ms |
28864 KB |
Output is correct |
55 |
Correct |
443 ms |
35116 KB |
Output is correct |
56 |
Correct |
340 ms |
36412 KB |
Output is correct |
57 |
Correct |
436 ms |
41524 KB |
Output is correct |
58 |
Correct |
380 ms |
37408 KB |
Output is correct |
59 |
Correct |
419 ms |
37772 KB |
Output is correct |
60 |
Correct |
529 ms |
41272 KB |
Output is correct |
61 |
Correct |
268 ms |
39728 KB |
Output is correct |
62 |
Correct |
265 ms |
39576 KB |
Output is correct |
63 |
Correct |
567 ms |
45128 KB |
Output is correct |
64 |
Correct |
550 ms |
44900 KB |
Output is correct |
65 |
Correct |
432 ms |
40132 KB |
Output is correct |
66 |
Correct |
486 ms |
40156 KB |
Output is correct |
67 |
Correct |
461 ms |
39960 KB |
Output is correct |
68 |
Correct |
434 ms |
39932 KB |
Output is correct |
69 |
Correct |
441 ms |
39872 KB |
Output is correct |
70 |
Correct |
487 ms |
39896 KB |
Output is correct |
71 |
Correct |
436 ms |
39776 KB |
Output is correct |
72 |
Correct |
484 ms |
39960 KB |
Output is correct |
73 |
Correct |
481 ms |
39960 KB |
Output is correct |
74 |
Correct |
504 ms |
39868 KB |
Output is correct |
75 |
Correct |
436 ms |
39944 KB |
Output is correct |
76 |
Correct |
453 ms |
39872 KB |
Output is correct |
77 |
Correct |
428 ms |
39824 KB |
Output is correct |
78 |
Correct |
451 ms |
39800 KB |
Output is correct |
79 |
Correct |
386 ms |
41012 KB |
Output is correct |
80 |
Correct |
397 ms |
41284 KB |
Output is correct |
81 |
Correct |
371 ms |
41908 KB |
Output is correct |
82 |
Correct |
98 ms |
28116 KB |
Output is correct |
83 |
Correct |
102 ms |
27720 KB |
Output is correct |
84 |
Correct |
67 ms |
27472 KB |
Output is correct |
85 |
Correct |
72 ms |
27692 KB |
Output is correct |
86 |
Correct |
101 ms |
27848 KB |
Output is correct |
87 |
Correct |
114 ms |
27780 KB |
Output is correct |
88 |
Correct |
99 ms |
27764 KB |
Output is correct |
89 |
Correct |
102 ms |
27760 KB |
Output is correct |
90 |
Correct |
105 ms |
27884 KB |
Output is correct |
91 |
Correct |
103 ms |
27848 KB |
Output is correct |
92 |
Correct |
76 ms |
28164 KB |
Output is correct |
93 |
Correct |
95 ms |
28264 KB |
Output is correct |
94 |
Correct |
88 ms |
27264 KB |
Output is correct |
95 |
Correct |
89 ms |
27444 KB |
Output is correct |
96 |
Correct |
104 ms |
27780 KB |
Output is correct |
97 |
Correct |
106 ms |
27756 KB |
Output is correct |
98 |
Correct |
81 ms |
27908 KB |
Output is correct |
99 |
Correct |
105 ms |
28804 KB |
Output is correct |
100 |
Correct |
127 ms |
28996 KB |
Output is correct |
101 |
Correct |
122 ms |
29236 KB |
Output is correct |
102 |
Correct |
121 ms |
29212 KB |
Output is correct |
103 |
Correct |
94 ms |
28344 KB |
Output is correct |
104 |
Correct |
116 ms |
28924 KB |
Output is correct |
105 |
Correct |
126 ms |
29252 KB |
Output is correct |
106 |
Correct |
93 ms |
28956 KB |
Output is correct |
107 |
Correct |
92 ms |
28736 KB |
Output is correct |
108 |
Correct |
106 ms |
29240 KB |
Output is correct |
109 |
Correct |
93 ms |
28340 KB |
Output is correct |
110 |
Correct |
139 ms |
29276 KB |
Output is correct |
111 |
Correct |
119 ms |
29236 KB |
Output is correct |
112 |
Correct |
99 ms |
28108 KB |
Output is correct |
113 |
Correct |
114 ms |
28280 KB |
Output is correct |
114 |
Correct |
105 ms |
27820 KB |
Output is correct |
115 |
Correct |
113 ms |
28160 KB |
Output is correct |
116 |
Correct |
74 ms |
27200 KB |
Output is correct |
117 |
Correct |
112 ms |
27828 KB |
Output is correct |
118 |
Correct |
89 ms |
27548 KB |
Output is correct |
119 |
Correct |
88 ms |
27440 KB |
Output is correct |
120 |
Correct |
110 ms |
27828 KB |
Output is correct |
121 |
Correct |
120 ms |
28236 KB |
Output is correct |
122 |
Correct |
104 ms |
27736 KB |
Output is correct |
123 |
Correct |
110 ms |
27848 KB |
Output is correct |
124 |
Correct |
105 ms |
27836 KB |
Output is correct |
125 |
Correct |
91 ms |
27568 KB |
Output is correct |
126 |
Correct |
82 ms |
28208 KB |
Output is correct |
127 |
Correct |
92 ms |
28004 KB |
Output is correct |
128 |
Correct |
104 ms |
28176 KB |
Output is correct |
129 |
Correct |
95 ms |
28472 KB |
Output is correct |
130 |
Correct |
450 ms |
41884 KB |
Output is correct |
131 |
Correct |
307 ms |
36840 KB |
Output is correct |
132 |
Correct |
448 ms |
41748 KB |
Output is correct |
133 |
Correct |
477 ms |
41356 KB |
Output is correct |
134 |
Correct |
443 ms |
39596 KB |
Output is correct |
135 |
Correct |
479 ms |
41944 KB |
Output is correct |
136 |
Correct |
516 ms |
45792 KB |
Output is correct |
137 |
Correct |
526 ms |
45828 KB |
Output is correct |
138 |
Correct |
453 ms |
40608 KB |
Output is correct |
139 |
Correct |
447 ms |
40512 KB |
Output is correct |
140 |
Correct |
453 ms |
40340 KB |
Output is correct |
141 |
Correct |
430 ms |
40324 KB |
Output is correct |
142 |
Correct |
457 ms |
40548 KB |
Output is correct |
143 |
Correct |
435 ms |
40244 KB |
Output is correct |
144 |
Correct |
445 ms |
40400 KB |
Output is correct |
145 |
Correct |
473 ms |
40560 KB |
Output is correct |
146 |
Correct |
433 ms |
40240 KB |
Output is correct |
147 |
Correct |
438 ms |
40404 KB |
Output is correct |
148 |
Correct |
439 ms |
40284 KB |
Output is correct |
149 |
Correct |
451 ms |
40228 KB |
Output is correct |
150 |
Correct |
287 ms |
41208 KB |
Output is correct |
151 |
Correct |
388 ms |
41516 KB |
Output is correct |
152 |
Correct |
390 ms |
41636 KB |
Output is correct |
153 |
Correct |
369 ms |
42840 KB |
Output is correct |