#include <bits/stdc++.h>
#define fi first
#define se second
const int N = 250500;
const int mod = 1e9 + 7;
using namespace std;
struct fenwick {
vector<long long> t;
fenwick(int _N) : t(_N, 0) {}
void upd(int x, long long g) {
while(x < t.size()) {
t[x] += g;
x += x & -x;
}
}
long long get(int x) {
long long res = 0;
while(x > 0) {
res += t[x];
x -= x & -x;
}
return res;
}
int get_f(long long k) {
int res = 0;
for (int i = 20; i >= 0; i--) {
if (res + (1 << i) >= t.size()) {
continue;
} else if (t[res + (1 << i)] < k) {
res += (1 << i);
k -= t[res];
}
}
return res + 1;
}
};
long long t[4 * N];
long long lz[4 * N];
void upd(int x, int l, int r, int tl, int tr, long long y)
{
if (tl > tr) {
return;
} else if (l == tl && r == tr) {
t[x] += y;
lz[x] += y;
return;
}
int m = (l + r) / 2;
upd(x * 2, l, m, tl, min(m, tr), y);
upd(x * 2 + 1, m + 1, r, max(m + 1, tl), tr, y);
t[x] = min(t[x * 2], t[x * 2 + 1]) + lz[x];
}
long long inf = 1e18;
long long get(int x, int l, int r, int tl, int tr)
{
if (tl > tr) {
return inf;
} else if (l == tl && r == tr) {
return t[x];
}
int m = (l + r) / 2;
return min(get(x * 2, l, m, tl, min(m, tr)), get(x * 2 + 1, m + 1, r, max(m + 1, tl), tr)) + lz[x];
}
fenwick A(N), B(N);
int n, m, q;
long long res[N];
long long c[N];
vector<pair<long long, long long>> ad[N];
vector<pair<long long, long long>> del[N];
vector<pair<long long, long long>> qu[N];
int main() {
#ifdef zxc
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(0);
cin >> n >> m >> q;
for (int i = 1; i <= q; i++) {
int t;
cin >> t;
res[i] = -1;
if (t == 1) {
long long l, r, k;
cin >> l >> r >> c[i] >> k;
ad[l].push_back({i, k});
ad[r + 1].push_back({i, -k});
} else if (t == 2) {
long long l, r, k;
cin >> l >> r >> k;
del[l].push_back({i, -k});
del[r + 1].push_back({i, k});
} else {
long long l, b;
cin >> l >> b;
qu[l].push_back({i, b});
}
}
for (int i = 1; i <= n; i++) {
for (auto p: ad[i]) {
A.upd(p.fi, p.se);
B.upd(p.fi, p.se);
upd(1, 0, q, p.fi, q, p.se);
}
for (auto p: del[i]) {
B.upd(p.fi, p.se);
upd(1, 0, q, p.fi, q, p.se);
}
for (auto p: qu[i]) {
long long all = A.get(p.fi);
long long cur = B.get(p.fi) - get(1, 0, q, 0, p.fi);
p.se += all - cur;
if (p.se <= all) {
res[p.fi] = c[A.get_f(p.se)];
} else {
res[p.fi] = 0;
}
}
}
for (int i = 1; i <= q; i++) {
if (res[i] != -1) {
cout << res[i] << "\n";
}
}
}
Compilation message
foodcourt.cpp: In member function 'void fenwick::upd(int, long long int)':
foodcourt.cpp:16:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
16 | while(x < t.size()) {
| ~~^~~~~~~~~~
foodcourt.cpp: In member function 'int fenwick::get_f(long long int)':
foodcourt.cpp:34:44: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
34 | if (res + (1 << i) >= t.size()) {
| ~~~~~~~~~~~~~~~^~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
22100 KB |
Output is correct |
2 |
Correct |
12 ms |
22064 KB |
Output is correct |
3 |
Correct |
12 ms |
21972 KB |
Output is correct |
4 |
Correct |
12 ms |
22100 KB |
Output is correct |
5 |
Correct |
11 ms |
22024 KB |
Output is correct |
6 |
Correct |
11 ms |
22100 KB |
Output is correct |
7 |
Correct |
12 ms |
22028 KB |
Output is correct |
8 |
Correct |
12 ms |
22100 KB |
Output is correct |
9 |
Correct |
11 ms |
22100 KB |
Output is correct |
10 |
Correct |
12 ms |
22100 KB |
Output is correct |
11 |
Correct |
12 ms |
22100 KB |
Output is correct |
12 |
Correct |
12 ms |
22128 KB |
Output is correct |
13 |
Correct |
11 ms |
22064 KB |
Output is correct |
14 |
Correct |
12 ms |
22116 KB |
Output is correct |
15 |
Correct |
11 ms |
22056 KB |
Output is correct |
16 |
Correct |
12 ms |
22100 KB |
Output is correct |
17 |
Correct |
11 ms |
22052 KB |
Output is correct |
18 |
Correct |
12 ms |
22100 KB |
Output is correct |
19 |
Correct |
13 ms |
22116 KB |
Output is correct |
20 |
Correct |
12 ms |
22044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
22100 KB |
Output is correct |
2 |
Correct |
12 ms |
22064 KB |
Output is correct |
3 |
Correct |
12 ms |
21972 KB |
Output is correct |
4 |
Correct |
12 ms |
22100 KB |
Output is correct |
5 |
Correct |
11 ms |
22024 KB |
Output is correct |
6 |
Correct |
11 ms |
22100 KB |
Output is correct |
7 |
Correct |
12 ms |
22028 KB |
Output is correct |
8 |
Correct |
12 ms |
22100 KB |
Output is correct |
9 |
Correct |
11 ms |
22100 KB |
Output is correct |
10 |
Correct |
12 ms |
22100 KB |
Output is correct |
11 |
Correct |
12 ms |
22100 KB |
Output is correct |
12 |
Correct |
12 ms |
22128 KB |
Output is correct |
13 |
Correct |
11 ms |
22064 KB |
Output is correct |
14 |
Correct |
12 ms |
22116 KB |
Output is correct |
15 |
Correct |
11 ms |
22056 KB |
Output is correct |
16 |
Correct |
12 ms |
22100 KB |
Output is correct |
17 |
Correct |
11 ms |
22052 KB |
Output is correct |
18 |
Correct |
12 ms |
22100 KB |
Output is correct |
19 |
Correct |
13 ms |
22116 KB |
Output is correct |
20 |
Correct |
12 ms |
22044 KB |
Output is correct |
21 |
Correct |
12 ms |
22100 KB |
Output is correct |
22 |
Correct |
13 ms |
22064 KB |
Output is correct |
23 |
Correct |
11 ms |
22060 KB |
Output is correct |
24 |
Correct |
12 ms |
22156 KB |
Output is correct |
25 |
Correct |
11 ms |
22152 KB |
Output is correct |
26 |
Correct |
12 ms |
22100 KB |
Output is correct |
27 |
Correct |
12 ms |
22100 KB |
Output is correct |
28 |
Correct |
12 ms |
22080 KB |
Output is correct |
29 |
Correct |
12 ms |
22128 KB |
Output is correct |
30 |
Correct |
12 ms |
22096 KB |
Output is correct |
31 |
Correct |
14 ms |
22228 KB |
Output is correct |
32 |
Correct |
12 ms |
22100 KB |
Output is correct |
33 |
Correct |
11 ms |
22100 KB |
Output is correct |
34 |
Correct |
11 ms |
22112 KB |
Output is correct |
35 |
Correct |
12 ms |
22060 KB |
Output is correct |
36 |
Correct |
12 ms |
22132 KB |
Output is correct |
37 |
Correct |
13 ms |
22064 KB |
Output is correct |
38 |
Correct |
12 ms |
22136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
64 ms |
28024 KB |
Output is correct |
2 |
Correct |
70 ms |
28156 KB |
Output is correct |
3 |
Correct |
62 ms |
27988 KB |
Output is correct |
4 |
Correct |
76 ms |
28032 KB |
Output is correct |
5 |
Correct |
64 ms |
28116 KB |
Output is correct |
6 |
Correct |
66 ms |
28156 KB |
Output is correct |
7 |
Correct |
37 ms |
26696 KB |
Output is correct |
8 |
Correct |
38 ms |
26808 KB |
Output is correct |
9 |
Correct |
64 ms |
27908 KB |
Output is correct |
10 |
Correct |
65 ms |
28108 KB |
Output is correct |
11 |
Correct |
64 ms |
27972 KB |
Output is correct |
12 |
Correct |
80 ms |
28052 KB |
Output is correct |
13 |
Correct |
55 ms |
27476 KB |
Output is correct |
14 |
Correct |
63 ms |
28020 KB |
Output is correct |
15 |
Correct |
66 ms |
27960 KB |
Output is correct |
16 |
Correct |
66 ms |
27988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
308 ms |
44536 KB |
Output is correct |
2 |
Correct |
246 ms |
45900 KB |
Output is correct |
3 |
Correct |
342 ms |
51720 KB |
Output is correct |
4 |
Correct |
240 ms |
46376 KB |
Output is correct |
5 |
Correct |
243 ms |
46540 KB |
Output is correct |
6 |
Correct |
349 ms |
52300 KB |
Output is correct |
7 |
Correct |
127 ms |
44992 KB |
Output is correct |
8 |
Correct |
157 ms |
45192 KB |
Output is correct |
9 |
Correct |
327 ms |
50580 KB |
Output is correct |
10 |
Correct |
321 ms |
50580 KB |
Output is correct |
11 |
Correct |
333 ms |
51276 KB |
Output is correct |
12 |
Correct |
352 ms |
52228 KB |
Output is correct |
13 |
Correct |
352 ms |
51292 KB |
Output is correct |
14 |
Correct |
348 ms |
52188 KB |
Output is correct |
15 |
Correct |
364 ms |
52296 KB |
Output is correct |
16 |
Correct |
347 ms |
52128 KB |
Output is correct |
17 |
Correct |
343 ms |
52096 KB |
Output is correct |
18 |
Correct |
329 ms |
51688 KB |
Output is correct |
19 |
Correct |
347 ms |
52300 KB |
Output is correct |
20 |
Correct |
348 ms |
51788 KB |
Output is correct |
21 |
Correct |
334 ms |
52172 KB |
Output is correct |
22 |
Correct |
350 ms |
52204 KB |
Output is correct |
23 |
Correct |
353 ms |
52112 KB |
Output is correct |
24 |
Correct |
363 ms |
52232 KB |
Output is correct |
25 |
Correct |
251 ms |
50760 KB |
Output is correct |
26 |
Correct |
265 ms |
51264 KB |
Output is correct |
27 |
Correct |
277 ms |
52044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
22100 KB |
Output is correct |
2 |
Correct |
12 ms |
22064 KB |
Output is correct |
3 |
Correct |
12 ms |
21972 KB |
Output is correct |
4 |
Correct |
12 ms |
22100 KB |
Output is correct |
5 |
Correct |
11 ms |
22024 KB |
Output is correct |
6 |
Correct |
11 ms |
22100 KB |
Output is correct |
7 |
Correct |
12 ms |
22028 KB |
Output is correct |
8 |
Correct |
12 ms |
22100 KB |
Output is correct |
9 |
Correct |
11 ms |
22100 KB |
Output is correct |
10 |
Correct |
12 ms |
22100 KB |
Output is correct |
11 |
Correct |
12 ms |
22100 KB |
Output is correct |
12 |
Correct |
12 ms |
22128 KB |
Output is correct |
13 |
Correct |
11 ms |
22064 KB |
Output is correct |
14 |
Correct |
12 ms |
22116 KB |
Output is correct |
15 |
Correct |
11 ms |
22056 KB |
Output is correct |
16 |
Correct |
12 ms |
22100 KB |
Output is correct |
17 |
Correct |
11 ms |
22052 KB |
Output is correct |
18 |
Correct |
12 ms |
22100 KB |
Output is correct |
19 |
Correct |
13 ms |
22116 KB |
Output is correct |
20 |
Correct |
12 ms |
22044 KB |
Output is correct |
21 |
Correct |
64 ms |
28024 KB |
Output is correct |
22 |
Correct |
70 ms |
28156 KB |
Output is correct |
23 |
Correct |
62 ms |
27988 KB |
Output is correct |
24 |
Correct |
76 ms |
28032 KB |
Output is correct |
25 |
Correct |
64 ms |
28116 KB |
Output is correct |
26 |
Correct |
66 ms |
28156 KB |
Output is correct |
27 |
Correct |
37 ms |
26696 KB |
Output is correct |
28 |
Correct |
38 ms |
26808 KB |
Output is correct |
29 |
Correct |
64 ms |
27908 KB |
Output is correct |
30 |
Correct |
65 ms |
28108 KB |
Output is correct |
31 |
Correct |
64 ms |
27972 KB |
Output is correct |
32 |
Correct |
80 ms |
28052 KB |
Output is correct |
33 |
Correct |
55 ms |
27476 KB |
Output is correct |
34 |
Correct |
63 ms |
28020 KB |
Output is correct |
35 |
Correct |
66 ms |
27960 KB |
Output is correct |
36 |
Correct |
66 ms |
27988 KB |
Output is correct |
37 |
Correct |
59 ms |
27600 KB |
Output is correct |
38 |
Correct |
55 ms |
27288 KB |
Output is correct |
39 |
Correct |
35 ms |
26532 KB |
Output is correct |
40 |
Correct |
41 ms |
26688 KB |
Output is correct |
41 |
Correct |
65 ms |
27904 KB |
Output is correct |
42 |
Correct |
66 ms |
28120 KB |
Output is correct |
43 |
Correct |
66 ms |
28108 KB |
Output is correct |
44 |
Correct |
69 ms |
28000 KB |
Output is correct |
45 |
Correct |
68 ms |
28164 KB |
Output is correct |
46 |
Correct |
70 ms |
28120 KB |
Output is correct |
47 |
Correct |
46 ms |
26980 KB |
Output is correct |
48 |
Correct |
58 ms |
28012 KB |
Output is correct |
49 |
Correct |
50 ms |
26956 KB |
Output is correct |
50 |
Correct |
58 ms |
27588 KB |
Output is correct |
51 |
Correct |
68 ms |
28148 KB |
Output is correct |
52 |
Correct |
67 ms |
28212 KB |
Output is correct |
53 |
Correct |
56 ms |
27232 KB |
Output is correct |
54 |
Correct |
65 ms |
28084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
27340 KB |
Output is correct |
2 |
Correct |
69 ms |
29260 KB |
Output is correct |
3 |
Correct |
67 ms |
29348 KB |
Output is correct |
4 |
Correct |
49 ms |
27788 KB |
Output is correct |
5 |
Correct |
67 ms |
28632 KB |
Output is correct |
6 |
Correct |
68 ms |
29388 KB |
Output is correct |
7 |
Correct |
39 ms |
27632 KB |
Output is correct |
8 |
Correct |
39 ms |
27376 KB |
Output is correct |
9 |
Correct |
51 ms |
28604 KB |
Output is correct |
10 |
Correct |
48 ms |
27612 KB |
Output is correct |
11 |
Correct |
61 ms |
28932 KB |
Output is correct |
12 |
Correct |
60 ms |
28992 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
22100 KB |
Output is correct |
2 |
Correct |
12 ms |
22064 KB |
Output is correct |
3 |
Correct |
12 ms |
21972 KB |
Output is correct |
4 |
Correct |
12 ms |
22100 KB |
Output is correct |
5 |
Correct |
11 ms |
22024 KB |
Output is correct |
6 |
Correct |
11 ms |
22100 KB |
Output is correct |
7 |
Correct |
12 ms |
22028 KB |
Output is correct |
8 |
Correct |
12 ms |
22100 KB |
Output is correct |
9 |
Correct |
11 ms |
22100 KB |
Output is correct |
10 |
Correct |
12 ms |
22100 KB |
Output is correct |
11 |
Correct |
12 ms |
22100 KB |
Output is correct |
12 |
Correct |
12 ms |
22128 KB |
Output is correct |
13 |
Correct |
11 ms |
22064 KB |
Output is correct |
14 |
Correct |
12 ms |
22116 KB |
Output is correct |
15 |
Correct |
11 ms |
22056 KB |
Output is correct |
16 |
Correct |
12 ms |
22100 KB |
Output is correct |
17 |
Correct |
11 ms |
22052 KB |
Output is correct |
18 |
Correct |
12 ms |
22100 KB |
Output is correct |
19 |
Correct |
13 ms |
22116 KB |
Output is correct |
20 |
Correct |
12 ms |
22044 KB |
Output is correct |
21 |
Correct |
12 ms |
22100 KB |
Output is correct |
22 |
Correct |
13 ms |
22064 KB |
Output is correct |
23 |
Correct |
11 ms |
22060 KB |
Output is correct |
24 |
Correct |
12 ms |
22156 KB |
Output is correct |
25 |
Correct |
11 ms |
22152 KB |
Output is correct |
26 |
Correct |
12 ms |
22100 KB |
Output is correct |
27 |
Correct |
12 ms |
22100 KB |
Output is correct |
28 |
Correct |
12 ms |
22080 KB |
Output is correct |
29 |
Correct |
12 ms |
22128 KB |
Output is correct |
30 |
Correct |
12 ms |
22096 KB |
Output is correct |
31 |
Correct |
14 ms |
22228 KB |
Output is correct |
32 |
Correct |
12 ms |
22100 KB |
Output is correct |
33 |
Correct |
11 ms |
22100 KB |
Output is correct |
34 |
Correct |
11 ms |
22112 KB |
Output is correct |
35 |
Correct |
12 ms |
22060 KB |
Output is correct |
36 |
Correct |
12 ms |
22132 KB |
Output is correct |
37 |
Correct |
13 ms |
22064 KB |
Output is correct |
38 |
Correct |
12 ms |
22136 KB |
Output is correct |
39 |
Correct |
64 ms |
28024 KB |
Output is correct |
40 |
Correct |
70 ms |
28156 KB |
Output is correct |
41 |
Correct |
62 ms |
27988 KB |
Output is correct |
42 |
Correct |
76 ms |
28032 KB |
Output is correct |
43 |
Correct |
64 ms |
28116 KB |
Output is correct |
44 |
Correct |
66 ms |
28156 KB |
Output is correct |
45 |
Correct |
37 ms |
26696 KB |
Output is correct |
46 |
Correct |
38 ms |
26808 KB |
Output is correct |
47 |
Correct |
64 ms |
27908 KB |
Output is correct |
48 |
Correct |
65 ms |
28108 KB |
Output is correct |
49 |
Correct |
64 ms |
27972 KB |
Output is correct |
50 |
Correct |
80 ms |
28052 KB |
Output is correct |
51 |
Correct |
55 ms |
27476 KB |
Output is correct |
52 |
Correct |
63 ms |
28020 KB |
Output is correct |
53 |
Correct |
66 ms |
27960 KB |
Output is correct |
54 |
Correct |
66 ms |
27988 KB |
Output is correct |
55 |
Correct |
59 ms |
27600 KB |
Output is correct |
56 |
Correct |
55 ms |
27288 KB |
Output is correct |
57 |
Correct |
35 ms |
26532 KB |
Output is correct |
58 |
Correct |
41 ms |
26688 KB |
Output is correct |
59 |
Correct |
65 ms |
27904 KB |
Output is correct |
60 |
Correct |
66 ms |
28120 KB |
Output is correct |
61 |
Correct |
66 ms |
28108 KB |
Output is correct |
62 |
Correct |
69 ms |
28000 KB |
Output is correct |
63 |
Correct |
68 ms |
28164 KB |
Output is correct |
64 |
Correct |
70 ms |
28120 KB |
Output is correct |
65 |
Correct |
46 ms |
26980 KB |
Output is correct |
66 |
Correct |
58 ms |
28012 KB |
Output is correct |
67 |
Correct |
50 ms |
26956 KB |
Output is correct |
68 |
Correct |
58 ms |
27588 KB |
Output is correct |
69 |
Correct |
68 ms |
28148 KB |
Output is correct |
70 |
Correct |
67 ms |
28212 KB |
Output is correct |
71 |
Correct |
56 ms |
27232 KB |
Output is correct |
72 |
Correct |
65 ms |
28084 KB |
Output is correct |
73 |
Correct |
60 ms |
27340 KB |
Output is correct |
74 |
Correct |
69 ms |
29260 KB |
Output is correct |
75 |
Correct |
67 ms |
29348 KB |
Output is correct |
76 |
Correct |
49 ms |
27788 KB |
Output is correct |
77 |
Correct |
67 ms |
28632 KB |
Output is correct |
78 |
Correct |
68 ms |
29388 KB |
Output is correct |
79 |
Correct |
39 ms |
27632 KB |
Output is correct |
80 |
Correct |
39 ms |
27376 KB |
Output is correct |
81 |
Correct |
51 ms |
28604 KB |
Output is correct |
82 |
Correct |
48 ms |
27612 KB |
Output is correct |
83 |
Correct |
61 ms |
28932 KB |
Output is correct |
84 |
Correct |
60 ms |
28992 KB |
Output is correct |
85 |
Correct |
62 ms |
29096 KB |
Output is correct |
86 |
Correct |
72 ms |
29580 KB |
Output is correct |
87 |
Correct |
63 ms |
29052 KB |
Output is correct |
88 |
Correct |
71 ms |
29784 KB |
Output is correct |
89 |
Correct |
53 ms |
27696 KB |
Output is correct |
90 |
Correct |
69 ms |
29724 KB |
Output is correct |
91 |
Correct |
60 ms |
28656 KB |
Output is correct |
92 |
Correct |
56 ms |
28416 KB |
Output is correct |
93 |
Correct |
74 ms |
29696 KB |
Output is correct |
94 |
Correct |
86 ms |
29588 KB |
Output is correct |
95 |
Correct |
67 ms |
29644 KB |
Output is correct |
96 |
Correct |
69 ms |
29772 KB |
Output is correct |
97 |
Correct |
69 ms |
29740 KB |
Output is correct |
98 |
Correct |
62 ms |
28832 KB |
Output is correct |
99 |
Correct |
47 ms |
28456 KB |
Output is correct |
100 |
Correct |
53 ms |
28524 KB |
Output is correct |
101 |
Correct |
63 ms |
29516 KB |
Output is correct |
102 |
Correct |
65 ms |
29836 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
22100 KB |
Output is correct |
2 |
Correct |
12 ms |
22064 KB |
Output is correct |
3 |
Correct |
12 ms |
21972 KB |
Output is correct |
4 |
Correct |
12 ms |
22100 KB |
Output is correct |
5 |
Correct |
11 ms |
22024 KB |
Output is correct |
6 |
Correct |
11 ms |
22100 KB |
Output is correct |
7 |
Correct |
12 ms |
22028 KB |
Output is correct |
8 |
Correct |
12 ms |
22100 KB |
Output is correct |
9 |
Correct |
11 ms |
22100 KB |
Output is correct |
10 |
Correct |
12 ms |
22100 KB |
Output is correct |
11 |
Correct |
12 ms |
22100 KB |
Output is correct |
12 |
Correct |
12 ms |
22128 KB |
Output is correct |
13 |
Correct |
11 ms |
22064 KB |
Output is correct |
14 |
Correct |
12 ms |
22116 KB |
Output is correct |
15 |
Correct |
11 ms |
22056 KB |
Output is correct |
16 |
Correct |
12 ms |
22100 KB |
Output is correct |
17 |
Correct |
11 ms |
22052 KB |
Output is correct |
18 |
Correct |
12 ms |
22100 KB |
Output is correct |
19 |
Correct |
13 ms |
22116 KB |
Output is correct |
20 |
Correct |
12 ms |
22044 KB |
Output is correct |
21 |
Correct |
12 ms |
22100 KB |
Output is correct |
22 |
Correct |
13 ms |
22064 KB |
Output is correct |
23 |
Correct |
11 ms |
22060 KB |
Output is correct |
24 |
Correct |
12 ms |
22156 KB |
Output is correct |
25 |
Correct |
11 ms |
22152 KB |
Output is correct |
26 |
Correct |
12 ms |
22100 KB |
Output is correct |
27 |
Correct |
12 ms |
22100 KB |
Output is correct |
28 |
Correct |
12 ms |
22080 KB |
Output is correct |
29 |
Correct |
12 ms |
22128 KB |
Output is correct |
30 |
Correct |
12 ms |
22096 KB |
Output is correct |
31 |
Correct |
14 ms |
22228 KB |
Output is correct |
32 |
Correct |
12 ms |
22100 KB |
Output is correct |
33 |
Correct |
11 ms |
22100 KB |
Output is correct |
34 |
Correct |
11 ms |
22112 KB |
Output is correct |
35 |
Correct |
12 ms |
22060 KB |
Output is correct |
36 |
Correct |
12 ms |
22132 KB |
Output is correct |
37 |
Correct |
13 ms |
22064 KB |
Output is correct |
38 |
Correct |
12 ms |
22136 KB |
Output is correct |
39 |
Correct |
64 ms |
28024 KB |
Output is correct |
40 |
Correct |
70 ms |
28156 KB |
Output is correct |
41 |
Correct |
62 ms |
27988 KB |
Output is correct |
42 |
Correct |
76 ms |
28032 KB |
Output is correct |
43 |
Correct |
64 ms |
28116 KB |
Output is correct |
44 |
Correct |
66 ms |
28156 KB |
Output is correct |
45 |
Correct |
37 ms |
26696 KB |
Output is correct |
46 |
Correct |
38 ms |
26808 KB |
Output is correct |
47 |
Correct |
64 ms |
27908 KB |
Output is correct |
48 |
Correct |
65 ms |
28108 KB |
Output is correct |
49 |
Correct |
64 ms |
27972 KB |
Output is correct |
50 |
Correct |
80 ms |
28052 KB |
Output is correct |
51 |
Correct |
55 ms |
27476 KB |
Output is correct |
52 |
Correct |
63 ms |
28020 KB |
Output is correct |
53 |
Correct |
66 ms |
27960 KB |
Output is correct |
54 |
Correct |
66 ms |
27988 KB |
Output is correct |
55 |
Correct |
308 ms |
44536 KB |
Output is correct |
56 |
Correct |
246 ms |
45900 KB |
Output is correct |
57 |
Correct |
342 ms |
51720 KB |
Output is correct |
58 |
Correct |
240 ms |
46376 KB |
Output is correct |
59 |
Correct |
243 ms |
46540 KB |
Output is correct |
60 |
Correct |
349 ms |
52300 KB |
Output is correct |
61 |
Correct |
127 ms |
44992 KB |
Output is correct |
62 |
Correct |
157 ms |
45192 KB |
Output is correct |
63 |
Correct |
327 ms |
50580 KB |
Output is correct |
64 |
Correct |
321 ms |
50580 KB |
Output is correct |
65 |
Correct |
333 ms |
51276 KB |
Output is correct |
66 |
Correct |
352 ms |
52228 KB |
Output is correct |
67 |
Correct |
352 ms |
51292 KB |
Output is correct |
68 |
Correct |
348 ms |
52188 KB |
Output is correct |
69 |
Correct |
364 ms |
52296 KB |
Output is correct |
70 |
Correct |
347 ms |
52128 KB |
Output is correct |
71 |
Correct |
343 ms |
52096 KB |
Output is correct |
72 |
Correct |
329 ms |
51688 KB |
Output is correct |
73 |
Correct |
347 ms |
52300 KB |
Output is correct |
74 |
Correct |
348 ms |
51788 KB |
Output is correct |
75 |
Correct |
334 ms |
52172 KB |
Output is correct |
76 |
Correct |
350 ms |
52204 KB |
Output is correct |
77 |
Correct |
353 ms |
52112 KB |
Output is correct |
78 |
Correct |
363 ms |
52232 KB |
Output is correct |
79 |
Correct |
251 ms |
50760 KB |
Output is correct |
80 |
Correct |
265 ms |
51264 KB |
Output is correct |
81 |
Correct |
277 ms |
52044 KB |
Output is correct |
82 |
Correct |
59 ms |
27600 KB |
Output is correct |
83 |
Correct |
55 ms |
27288 KB |
Output is correct |
84 |
Correct |
35 ms |
26532 KB |
Output is correct |
85 |
Correct |
41 ms |
26688 KB |
Output is correct |
86 |
Correct |
65 ms |
27904 KB |
Output is correct |
87 |
Correct |
66 ms |
28120 KB |
Output is correct |
88 |
Correct |
66 ms |
28108 KB |
Output is correct |
89 |
Correct |
69 ms |
28000 KB |
Output is correct |
90 |
Correct |
68 ms |
28164 KB |
Output is correct |
91 |
Correct |
70 ms |
28120 KB |
Output is correct |
92 |
Correct |
46 ms |
26980 KB |
Output is correct |
93 |
Correct |
58 ms |
28012 KB |
Output is correct |
94 |
Correct |
50 ms |
26956 KB |
Output is correct |
95 |
Correct |
58 ms |
27588 KB |
Output is correct |
96 |
Correct |
68 ms |
28148 KB |
Output is correct |
97 |
Correct |
67 ms |
28212 KB |
Output is correct |
98 |
Correct |
56 ms |
27232 KB |
Output is correct |
99 |
Correct |
65 ms |
28084 KB |
Output is correct |
100 |
Correct |
60 ms |
27340 KB |
Output is correct |
101 |
Correct |
69 ms |
29260 KB |
Output is correct |
102 |
Correct |
67 ms |
29348 KB |
Output is correct |
103 |
Correct |
49 ms |
27788 KB |
Output is correct |
104 |
Correct |
67 ms |
28632 KB |
Output is correct |
105 |
Correct |
68 ms |
29388 KB |
Output is correct |
106 |
Correct |
39 ms |
27632 KB |
Output is correct |
107 |
Correct |
39 ms |
27376 KB |
Output is correct |
108 |
Correct |
51 ms |
28604 KB |
Output is correct |
109 |
Correct |
48 ms |
27612 KB |
Output is correct |
110 |
Correct |
61 ms |
28932 KB |
Output is correct |
111 |
Correct |
60 ms |
28992 KB |
Output is correct |
112 |
Correct |
62 ms |
29096 KB |
Output is correct |
113 |
Correct |
72 ms |
29580 KB |
Output is correct |
114 |
Correct |
63 ms |
29052 KB |
Output is correct |
115 |
Correct |
71 ms |
29784 KB |
Output is correct |
116 |
Correct |
53 ms |
27696 KB |
Output is correct |
117 |
Correct |
69 ms |
29724 KB |
Output is correct |
118 |
Correct |
60 ms |
28656 KB |
Output is correct |
119 |
Correct |
56 ms |
28416 KB |
Output is correct |
120 |
Correct |
74 ms |
29696 KB |
Output is correct |
121 |
Correct |
86 ms |
29588 KB |
Output is correct |
122 |
Correct |
67 ms |
29644 KB |
Output is correct |
123 |
Correct |
69 ms |
29772 KB |
Output is correct |
124 |
Correct |
69 ms |
29740 KB |
Output is correct |
125 |
Correct |
62 ms |
28832 KB |
Output is correct |
126 |
Correct |
47 ms |
28456 KB |
Output is correct |
127 |
Correct |
53 ms |
28524 KB |
Output is correct |
128 |
Correct |
63 ms |
29516 KB |
Output is correct |
129 |
Correct |
65 ms |
29836 KB |
Output is correct |
130 |
Correct |
337 ms |
52360 KB |
Output is correct |
131 |
Correct |
231 ms |
46320 KB |
Output is correct |
132 |
Correct |
340 ms |
52380 KB |
Output is correct |
133 |
Correct |
324 ms |
52044 KB |
Output is correct |
134 |
Correct |
308 ms |
49624 KB |
Output is correct |
135 |
Correct |
363 ms |
53068 KB |
Output is correct |
136 |
Correct |
331 ms |
51620 KB |
Output is correct |
137 |
Correct |
314 ms |
51572 KB |
Output is correct |
138 |
Correct |
350 ms |
52048 KB |
Output is correct |
139 |
Correct |
363 ms |
52860 KB |
Output is correct |
140 |
Correct |
350 ms |
51976 KB |
Output is correct |
141 |
Correct |
357 ms |
52824 KB |
Output is correct |
142 |
Correct |
369 ms |
52856 KB |
Output is correct |
143 |
Correct |
347 ms |
52744 KB |
Output is correct |
144 |
Correct |
346 ms |
52428 KB |
Output is correct |
145 |
Correct |
338 ms |
52828 KB |
Output is correct |
146 |
Correct |
347 ms |
52428 KB |
Output is correct |
147 |
Correct |
369 ms |
52784 KB |
Output is correct |
148 |
Correct |
368 ms |
52848 KB |
Output is correct |
149 |
Correct |
349 ms |
52776 KB |
Output is correct |
150 |
Correct |
175 ms |
47668 KB |
Output is correct |
151 |
Correct |
294 ms |
51788 KB |
Output is correct |
152 |
Correct |
274 ms |
51828 KB |
Output is correct |
153 |
Correct |
286 ms |
52868 KB |
Output is correct |