#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define dbg(x) cerr << #x << " " << x << "\n"
struct node_t {
ll sum_max;
ll sum;
};
class segtree {
public:
vector <node_t> seg;
int n;
segtree (int n) {
this->n = n;
seg.resize (1 + 4 * n);
}
node_t combine (node_t lnode, node_t rnode) {
return {
max (rnode.sum_max, rnode.sum + lnode.sum_max),
lnode.sum + rnode.sum
};
}
void update (int node, int lb, int rb, int pos, ll val) {
if (lb == rb) {
seg[node] = {max (0ll, val), val};
return;
}
int mid = (lb + rb) / 2, lnode = node * 2, rnode = node * 2 + 1;
if (pos <= mid)
update (lnode, lb, mid, pos, val);
else
update (rnode, mid + 1, rb, pos, val);
seg[node] = combine (seg[lnode], seg[rnode]);
}
node_t query (int node, int lb, int rb, int ql, int qr) {
if (ql <= lb && rb <= qr) {
return seg[node];
}
int mid = (lb + rb) / 2, lnode = node * 2, rnode = node * 2 + 1;
node_t ans = {0, 0};
if (ql <= mid)
ans = combine (ans, query (lnode, lb, mid, ql, qr));
if (qr > mid)
ans = combine (ans, query (rnode, mid + 1, rb, ql, qr));
return ans;
}
};
class fenwick {
public:
vector <ll> aib;
int n;
fenwick (int n) {
this->n = n;
aib.resize (1 + n);
}
void upd (int pos, ll val) {
while (pos <= n) {
aib[pos] += val;
pos += pos & -pos;
}
}
ll qry (int pos) {
ll ans = 0;
while (pos > 0) {
ans += aib[pos];
pos -= pos & -pos;
}
return ans;
}
ll qry (int l, int r) {
return qry (r) - qry (l - 1);
}
int kth (ll k) {
int ans = 0;
for (int step = (1 << 20); step > 0; step /= 2)
if (ans + step <= n && aib[ans + step] < k) {
ans += step;
k -= aib[ans];
}
return ans + 1;
}
};
const int MAX_N = 25e4;
vector <pair <ll, ll>> qry[1 + MAX_N], upd_seg[1 + MAX_N], upd_fen[1 + MAX_N]; /// first-> pos, second-> value
ll group[1 + MAX_N];
ll sol[1 + MAX_N];
int main () {
ios::sync_with_stdio (false);
cin.tie (0); cout.tie (0);
int n, m, q;
cin >> n >> m >> q;
for (int i = 1; i <= q; i++) {
int type;
cin >> type;
if (type == 1) {
ll l, r, c, k;
cin >> l >> r >> c >> k;
group[i] = c;
upd_seg[l].push_back ({i, k});
if (r < n)
upd_seg[r + 1].push_back ({i, 0});
upd_fen[l].push_back ({i, k});
if (r < n)
upd_fen[r + 1].push_back ({i, -k});
}
else if (type == 2) {
ll l, r, k;
cin >> l >> r >> k;
upd_seg[l].push_back ({i, -k});
if (r < n)
upd_seg[r + 1].push_back ({i, 0});
}
else {
ll a, b;
cin >> a >> b;
qry[a].push_back ({i, b});
}
}
segtree balance (q);
fenwick all (q);
for (int i = 0; i <= q; i++)
sol[i] = -1;
for (int i = 1; i <= n; i++) {
for (auto it : upd_seg[i])
balance.update (1, 1, q, it.first, it.second);
for (auto it : upd_fen[i])
all.upd (it.first, it.second);
for (auto it : qry[i]) {
ll best = balance.query (1, 1, q, 1, it.first).sum_max;
if (best >= it.second) {
sol[it.first] = group[all.kth (all.qry (it.first) - (best - it.second))];
}
else {
sol[it.first] = 0;
}
}
}
for (int i = 1; i <= q; i++)
if (sol[i] >= 0)
cout << sol[i] << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
18124 KB |
Output is correct |
2 |
Correct |
13 ms |
18240 KB |
Output is correct |
3 |
Correct |
12 ms |
18124 KB |
Output is correct |
4 |
Correct |
13 ms |
18252 KB |
Output is correct |
5 |
Correct |
12 ms |
18080 KB |
Output is correct |
6 |
Correct |
12 ms |
18144 KB |
Output is correct |
7 |
Correct |
13 ms |
18240 KB |
Output is correct |
8 |
Correct |
13 ms |
18240 KB |
Output is correct |
9 |
Correct |
13 ms |
18184 KB |
Output is correct |
10 |
Correct |
13 ms |
18252 KB |
Output is correct |
11 |
Correct |
12 ms |
18240 KB |
Output is correct |
12 |
Correct |
13 ms |
18252 KB |
Output is correct |
13 |
Correct |
12 ms |
18132 KB |
Output is correct |
14 |
Correct |
12 ms |
18116 KB |
Output is correct |
15 |
Correct |
13 ms |
18036 KB |
Output is correct |
16 |
Correct |
13 ms |
18260 KB |
Output is correct |
17 |
Correct |
13 ms |
18192 KB |
Output is correct |
18 |
Correct |
13 ms |
18252 KB |
Output is correct |
19 |
Correct |
13 ms |
18252 KB |
Output is correct |
20 |
Correct |
13 ms |
18288 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
18124 KB |
Output is correct |
2 |
Correct |
13 ms |
18240 KB |
Output is correct |
3 |
Correct |
12 ms |
18124 KB |
Output is correct |
4 |
Correct |
13 ms |
18252 KB |
Output is correct |
5 |
Correct |
12 ms |
18080 KB |
Output is correct |
6 |
Correct |
12 ms |
18144 KB |
Output is correct |
7 |
Correct |
13 ms |
18240 KB |
Output is correct |
8 |
Correct |
13 ms |
18240 KB |
Output is correct |
9 |
Correct |
13 ms |
18184 KB |
Output is correct |
10 |
Correct |
13 ms |
18252 KB |
Output is correct |
11 |
Correct |
12 ms |
18240 KB |
Output is correct |
12 |
Correct |
13 ms |
18252 KB |
Output is correct |
13 |
Correct |
12 ms |
18132 KB |
Output is correct |
14 |
Correct |
12 ms |
18116 KB |
Output is correct |
15 |
Correct |
13 ms |
18036 KB |
Output is correct |
16 |
Correct |
13 ms |
18260 KB |
Output is correct |
17 |
Correct |
13 ms |
18192 KB |
Output is correct |
18 |
Correct |
13 ms |
18252 KB |
Output is correct |
19 |
Correct |
13 ms |
18252 KB |
Output is correct |
20 |
Correct |
13 ms |
18288 KB |
Output is correct |
21 |
Correct |
14 ms |
18196 KB |
Output is correct |
22 |
Correct |
13 ms |
18252 KB |
Output is correct |
23 |
Correct |
14 ms |
18256 KB |
Output is correct |
24 |
Correct |
13 ms |
18252 KB |
Output is correct |
25 |
Correct |
13 ms |
18076 KB |
Output is correct |
26 |
Correct |
12 ms |
18216 KB |
Output is correct |
27 |
Correct |
13 ms |
18280 KB |
Output is correct |
28 |
Correct |
13 ms |
18344 KB |
Output is correct |
29 |
Correct |
13 ms |
18204 KB |
Output is correct |
30 |
Correct |
13 ms |
18252 KB |
Output is correct |
31 |
Correct |
14 ms |
18208 KB |
Output is correct |
32 |
Correct |
13 ms |
18252 KB |
Output is correct |
33 |
Correct |
12 ms |
18124 KB |
Output is correct |
34 |
Correct |
12 ms |
18180 KB |
Output is correct |
35 |
Correct |
12 ms |
18252 KB |
Output is correct |
36 |
Correct |
13 ms |
18252 KB |
Output is correct |
37 |
Correct |
13 ms |
18204 KB |
Output is correct |
38 |
Correct |
14 ms |
18324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
101 ms |
27580 KB |
Output is correct |
2 |
Correct |
108 ms |
28216 KB |
Output is correct |
3 |
Correct |
100 ms |
27616 KB |
Output is correct |
4 |
Correct |
93 ms |
27596 KB |
Output is correct |
5 |
Correct |
99 ms |
28272 KB |
Output is correct |
6 |
Correct |
108 ms |
28200 KB |
Output is correct |
7 |
Correct |
49 ms |
24444 KB |
Output is correct |
8 |
Correct |
45 ms |
24976 KB |
Output is correct |
9 |
Correct |
95 ms |
27612 KB |
Output is correct |
10 |
Correct |
94 ms |
27844 KB |
Output is correct |
11 |
Correct |
94 ms |
27720 KB |
Output is correct |
12 |
Correct |
97 ms |
27856 KB |
Output is correct |
13 |
Correct |
84 ms |
27188 KB |
Output is correct |
14 |
Correct |
95 ms |
28228 KB |
Output is correct |
15 |
Correct |
101 ms |
29240 KB |
Output is correct |
16 |
Correct |
135 ms |
29380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
479 ms |
52164 KB |
Output is correct |
2 |
Correct |
380 ms |
49580 KB |
Output is correct |
3 |
Correct |
532 ms |
61132 KB |
Output is correct |
4 |
Correct |
400 ms |
51344 KB |
Output is correct |
5 |
Correct |
395 ms |
51736 KB |
Output is correct |
6 |
Correct |
557 ms |
63724 KB |
Output is correct |
7 |
Correct |
166 ms |
48940 KB |
Output is correct |
8 |
Correct |
178 ms |
51316 KB |
Output is correct |
9 |
Correct |
533 ms |
62388 KB |
Output is correct |
10 |
Correct |
555 ms |
62416 KB |
Output is correct |
11 |
Correct |
512 ms |
61100 KB |
Output is correct |
12 |
Correct |
515 ms |
62096 KB |
Output is correct |
13 |
Correct |
535 ms |
61256 KB |
Output is correct |
14 |
Correct |
542 ms |
62040 KB |
Output is correct |
15 |
Correct |
530 ms |
61976 KB |
Output is correct |
16 |
Correct |
523 ms |
62096 KB |
Output is correct |
17 |
Correct |
525 ms |
62020 KB |
Output is correct |
18 |
Correct |
515 ms |
61552 KB |
Output is correct |
19 |
Correct |
543 ms |
62076 KB |
Output is correct |
20 |
Correct |
537 ms |
61556 KB |
Output is correct |
21 |
Correct |
544 ms |
61980 KB |
Output is correct |
22 |
Correct |
528 ms |
62008 KB |
Output is correct |
23 |
Correct |
526 ms |
62040 KB |
Output is correct |
24 |
Correct |
530 ms |
62020 KB |
Output is correct |
25 |
Correct |
368 ms |
60408 KB |
Output is correct |
26 |
Correct |
351 ms |
61108 KB |
Output is correct |
27 |
Correct |
423 ms |
65888 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
18124 KB |
Output is correct |
2 |
Correct |
13 ms |
18240 KB |
Output is correct |
3 |
Correct |
12 ms |
18124 KB |
Output is correct |
4 |
Correct |
13 ms |
18252 KB |
Output is correct |
5 |
Correct |
12 ms |
18080 KB |
Output is correct |
6 |
Correct |
12 ms |
18144 KB |
Output is correct |
7 |
Correct |
13 ms |
18240 KB |
Output is correct |
8 |
Correct |
13 ms |
18240 KB |
Output is correct |
9 |
Correct |
13 ms |
18184 KB |
Output is correct |
10 |
Correct |
13 ms |
18252 KB |
Output is correct |
11 |
Correct |
12 ms |
18240 KB |
Output is correct |
12 |
Correct |
13 ms |
18252 KB |
Output is correct |
13 |
Correct |
12 ms |
18132 KB |
Output is correct |
14 |
Correct |
12 ms |
18116 KB |
Output is correct |
15 |
Correct |
13 ms |
18036 KB |
Output is correct |
16 |
Correct |
13 ms |
18260 KB |
Output is correct |
17 |
Correct |
13 ms |
18192 KB |
Output is correct |
18 |
Correct |
13 ms |
18252 KB |
Output is correct |
19 |
Correct |
13 ms |
18252 KB |
Output is correct |
20 |
Correct |
13 ms |
18288 KB |
Output is correct |
21 |
Correct |
101 ms |
27580 KB |
Output is correct |
22 |
Correct |
108 ms |
28216 KB |
Output is correct |
23 |
Correct |
100 ms |
27616 KB |
Output is correct |
24 |
Correct |
93 ms |
27596 KB |
Output is correct |
25 |
Correct |
99 ms |
28272 KB |
Output is correct |
26 |
Correct |
108 ms |
28200 KB |
Output is correct |
27 |
Correct |
49 ms |
24444 KB |
Output is correct |
28 |
Correct |
45 ms |
24976 KB |
Output is correct |
29 |
Correct |
95 ms |
27612 KB |
Output is correct |
30 |
Correct |
94 ms |
27844 KB |
Output is correct |
31 |
Correct |
94 ms |
27720 KB |
Output is correct |
32 |
Correct |
97 ms |
27856 KB |
Output is correct |
33 |
Correct |
84 ms |
27188 KB |
Output is correct |
34 |
Correct |
95 ms |
28228 KB |
Output is correct |
35 |
Correct |
101 ms |
29240 KB |
Output is correct |
36 |
Correct |
135 ms |
29380 KB |
Output is correct |
37 |
Correct |
97 ms |
26600 KB |
Output is correct |
38 |
Correct |
97 ms |
26108 KB |
Output is correct |
39 |
Correct |
41 ms |
23916 KB |
Output is correct |
40 |
Correct |
47 ms |
25032 KB |
Output is correct |
41 |
Correct |
100 ms |
27644 KB |
Output is correct |
42 |
Correct |
100 ms |
27908 KB |
Output is correct |
43 |
Correct |
99 ms |
27844 KB |
Output is correct |
44 |
Correct |
103 ms |
27744 KB |
Output is correct |
45 |
Correct |
106 ms |
27868 KB |
Output is correct |
46 |
Correct |
100 ms |
27848 KB |
Output is correct |
47 |
Correct |
56 ms |
25388 KB |
Output is correct |
48 |
Correct |
73 ms |
27692 KB |
Output is correct |
49 |
Correct |
70 ms |
25028 KB |
Output is correct |
50 |
Correct |
85 ms |
26468 KB |
Output is correct |
51 |
Correct |
107 ms |
27956 KB |
Output is correct |
52 |
Correct |
117 ms |
27964 KB |
Output is correct |
53 |
Correct |
93 ms |
26972 KB |
Output is correct |
54 |
Correct |
115 ms |
29532 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
95 ms |
26896 KB |
Output is correct |
2 |
Correct |
105 ms |
29476 KB |
Output is correct |
3 |
Correct |
121 ms |
29744 KB |
Output is correct |
4 |
Correct |
83 ms |
26268 KB |
Output is correct |
5 |
Correct |
101 ms |
28100 KB |
Output is correct |
6 |
Correct |
112 ms |
29608 KB |
Output is correct |
7 |
Correct |
51 ms |
25644 KB |
Output is correct |
8 |
Correct |
51 ms |
25636 KB |
Output is correct |
9 |
Correct |
85 ms |
27120 KB |
Output is correct |
10 |
Correct |
63 ms |
25948 KB |
Output is correct |
11 |
Correct |
104 ms |
28868 KB |
Output is correct |
12 |
Correct |
82 ms |
28988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
18124 KB |
Output is correct |
2 |
Correct |
13 ms |
18240 KB |
Output is correct |
3 |
Correct |
12 ms |
18124 KB |
Output is correct |
4 |
Correct |
13 ms |
18252 KB |
Output is correct |
5 |
Correct |
12 ms |
18080 KB |
Output is correct |
6 |
Correct |
12 ms |
18144 KB |
Output is correct |
7 |
Correct |
13 ms |
18240 KB |
Output is correct |
8 |
Correct |
13 ms |
18240 KB |
Output is correct |
9 |
Correct |
13 ms |
18184 KB |
Output is correct |
10 |
Correct |
13 ms |
18252 KB |
Output is correct |
11 |
Correct |
12 ms |
18240 KB |
Output is correct |
12 |
Correct |
13 ms |
18252 KB |
Output is correct |
13 |
Correct |
12 ms |
18132 KB |
Output is correct |
14 |
Correct |
12 ms |
18116 KB |
Output is correct |
15 |
Correct |
13 ms |
18036 KB |
Output is correct |
16 |
Correct |
13 ms |
18260 KB |
Output is correct |
17 |
Correct |
13 ms |
18192 KB |
Output is correct |
18 |
Correct |
13 ms |
18252 KB |
Output is correct |
19 |
Correct |
13 ms |
18252 KB |
Output is correct |
20 |
Correct |
13 ms |
18288 KB |
Output is correct |
21 |
Correct |
14 ms |
18196 KB |
Output is correct |
22 |
Correct |
13 ms |
18252 KB |
Output is correct |
23 |
Correct |
14 ms |
18256 KB |
Output is correct |
24 |
Correct |
13 ms |
18252 KB |
Output is correct |
25 |
Correct |
13 ms |
18076 KB |
Output is correct |
26 |
Correct |
12 ms |
18216 KB |
Output is correct |
27 |
Correct |
13 ms |
18280 KB |
Output is correct |
28 |
Correct |
13 ms |
18344 KB |
Output is correct |
29 |
Correct |
13 ms |
18204 KB |
Output is correct |
30 |
Correct |
13 ms |
18252 KB |
Output is correct |
31 |
Correct |
14 ms |
18208 KB |
Output is correct |
32 |
Correct |
13 ms |
18252 KB |
Output is correct |
33 |
Correct |
12 ms |
18124 KB |
Output is correct |
34 |
Correct |
12 ms |
18180 KB |
Output is correct |
35 |
Correct |
12 ms |
18252 KB |
Output is correct |
36 |
Correct |
13 ms |
18252 KB |
Output is correct |
37 |
Correct |
13 ms |
18204 KB |
Output is correct |
38 |
Correct |
14 ms |
18324 KB |
Output is correct |
39 |
Correct |
101 ms |
27580 KB |
Output is correct |
40 |
Correct |
108 ms |
28216 KB |
Output is correct |
41 |
Correct |
100 ms |
27616 KB |
Output is correct |
42 |
Correct |
93 ms |
27596 KB |
Output is correct |
43 |
Correct |
99 ms |
28272 KB |
Output is correct |
44 |
Correct |
108 ms |
28200 KB |
Output is correct |
45 |
Correct |
49 ms |
24444 KB |
Output is correct |
46 |
Correct |
45 ms |
24976 KB |
Output is correct |
47 |
Correct |
95 ms |
27612 KB |
Output is correct |
48 |
Correct |
94 ms |
27844 KB |
Output is correct |
49 |
Correct |
94 ms |
27720 KB |
Output is correct |
50 |
Correct |
97 ms |
27856 KB |
Output is correct |
51 |
Correct |
84 ms |
27188 KB |
Output is correct |
52 |
Correct |
95 ms |
28228 KB |
Output is correct |
53 |
Correct |
101 ms |
29240 KB |
Output is correct |
54 |
Correct |
135 ms |
29380 KB |
Output is correct |
55 |
Correct |
97 ms |
26600 KB |
Output is correct |
56 |
Correct |
97 ms |
26108 KB |
Output is correct |
57 |
Correct |
41 ms |
23916 KB |
Output is correct |
58 |
Correct |
47 ms |
25032 KB |
Output is correct |
59 |
Correct |
100 ms |
27644 KB |
Output is correct |
60 |
Correct |
100 ms |
27908 KB |
Output is correct |
61 |
Correct |
99 ms |
27844 KB |
Output is correct |
62 |
Correct |
103 ms |
27744 KB |
Output is correct |
63 |
Correct |
106 ms |
27868 KB |
Output is correct |
64 |
Correct |
100 ms |
27848 KB |
Output is correct |
65 |
Correct |
56 ms |
25388 KB |
Output is correct |
66 |
Correct |
73 ms |
27692 KB |
Output is correct |
67 |
Correct |
70 ms |
25028 KB |
Output is correct |
68 |
Correct |
85 ms |
26468 KB |
Output is correct |
69 |
Correct |
107 ms |
27956 KB |
Output is correct |
70 |
Correct |
117 ms |
27964 KB |
Output is correct |
71 |
Correct |
93 ms |
26972 KB |
Output is correct |
72 |
Correct |
115 ms |
29532 KB |
Output is correct |
73 |
Correct |
95 ms |
26896 KB |
Output is correct |
74 |
Correct |
105 ms |
29476 KB |
Output is correct |
75 |
Correct |
121 ms |
29744 KB |
Output is correct |
76 |
Correct |
83 ms |
26268 KB |
Output is correct |
77 |
Correct |
101 ms |
28100 KB |
Output is correct |
78 |
Correct |
112 ms |
29608 KB |
Output is correct |
79 |
Correct |
51 ms |
25644 KB |
Output is correct |
80 |
Correct |
51 ms |
25636 KB |
Output is correct |
81 |
Correct |
85 ms |
27120 KB |
Output is correct |
82 |
Correct |
63 ms |
25948 KB |
Output is correct |
83 |
Correct |
104 ms |
28868 KB |
Output is correct |
84 |
Correct |
82 ms |
28988 KB |
Output is correct |
85 |
Correct |
110 ms |
28100 KB |
Output is correct |
86 |
Correct |
108 ms |
29176 KB |
Output is correct |
87 |
Correct |
97 ms |
28384 KB |
Output is correct |
88 |
Correct |
111 ms |
29884 KB |
Output is correct |
89 |
Correct |
70 ms |
25544 KB |
Output is correct |
90 |
Correct |
113 ms |
29508 KB |
Output is correct |
91 |
Correct |
84 ms |
27296 KB |
Output is correct |
92 |
Correct |
81 ms |
26844 KB |
Output is correct |
93 |
Correct |
108 ms |
29420 KB |
Output is correct |
94 |
Correct |
110 ms |
29296 KB |
Output is correct |
95 |
Correct |
101 ms |
29144 KB |
Output is correct |
96 |
Correct |
108 ms |
29464 KB |
Output is correct |
97 |
Correct |
102 ms |
29380 KB |
Output is correct |
98 |
Correct |
85 ms |
27752 KB |
Output is correct |
99 |
Correct |
64 ms |
26608 KB |
Output is correct |
100 |
Correct |
69 ms |
26948 KB |
Output is correct |
101 |
Correct |
85 ms |
29172 KB |
Output is correct |
102 |
Correct |
98 ms |
30484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
18124 KB |
Output is correct |
2 |
Correct |
13 ms |
18240 KB |
Output is correct |
3 |
Correct |
12 ms |
18124 KB |
Output is correct |
4 |
Correct |
13 ms |
18252 KB |
Output is correct |
5 |
Correct |
12 ms |
18080 KB |
Output is correct |
6 |
Correct |
12 ms |
18144 KB |
Output is correct |
7 |
Correct |
13 ms |
18240 KB |
Output is correct |
8 |
Correct |
13 ms |
18240 KB |
Output is correct |
9 |
Correct |
13 ms |
18184 KB |
Output is correct |
10 |
Correct |
13 ms |
18252 KB |
Output is correct |
11 |
Correct |
12 ms |
18240 KB |
Output is correct |
12 |
Correct |
13 ms |
18252 KB |
Output is correct |
13 |
Correct |
12 ms |
18132 KB |
Output is correct |
14 |
Correct |
12 ms |
18116 KB |
Output is correct |
15 |
Correct |
13 ms |
18036 KB |
Output is correct |
16 |
Correct |
13 ms |
18260 KB |
Output is correct |
17 |
Correct |
13 ms |
18192 KB |
Output is correct |
18 |
Correct |
13 ms |
18252 KB |
Output is correct |
19 |
Correct |
13 ms |
18252 KB |
Output is correct |
20 |
Correct |
13 ms |
18288 KB |
Output is correct |
21 |
Correct |
14 ms |
18196 KB |
Output is correct |
22 |
Correct |
13 ms |
18252 KB |
Output is correct |
23 |
Correct |
14 ms |
18256 KB |
Output is correct |
24 |
Correct |
13 ms |
18252 KB |
Output is correct |
25 |
Correct |
13 ms |
18076 KB |
Output is correct |
26 |
Correct |
12 ms |
18216 KB |
Output is correct |
27 |
Correct |
13 ms |
18280 KB |
Output is correct |
28 |
Correct |
13 ms |
18344 KB |
Output is correct |
29 |
Correct |
13 ms |
18204 KB |
Output is correct |
30 |
Correct |
13 ms |
18252 KB |
Output is correct |
31 |
Correct |
14 ms |
18208 KB |
Output is correct |
32 |
Correct |
13 ms |
18252 KB |
Output is correct |
33 |
Correct |
12 ms |
18124 KB |
Output is correct |
34 |
Correct |
12 ms |
18180 KB |
Output is correct |
35 |
Correct |
12 ms |
18252 KB |
Output is correct |
36 |
Correct |
13 ms |
18252 KB |
Output is correct |
37 |
Correct |
13 ms |
18204 KB |
Output is correct |
38 |
Correct |
14 ms |
18324 KB |
Output is correct |
39 |
Correct |
101 ms |
27580 KB |
Output is correct |
40 |
Correct |
108 ms |
28216 KB |
Output is correct |
41 |
Correct |
100 ms |
27616 KB |
Output is correct |
42 |
Correct |
93 ms |
27596 KB |
Output is correct |
43 |
Correct |
99 ms |
28272 KB |
Output is correct |
44 |
Correct |
108 ms |
28200 KB |
Output is correct |
45 |
Correct |
49 ms |
24444 KB |
Output is correct |
46 |
Correct |
45 ms |
24976 KB |
Output is correct |
47 |
Correct |
95 ms |
27612 KB |
Output is correct |
48 |
Correct |
94 ms |
27844 KB |
Output is correct |
49 |
Correct |
94 ms |
27720 KB |
Output is correct |
50 |
Correct |
97 ms |
27856 KB |
Output is correct |
51 |
Correct |
84 ms |
27188 KB |
Output is correct |
52 |
Correct |
95 ms |
28228 KB |
Output is correct |
53 |
Correct |
101 ms |
29240 KB |
Output is correct |
54 |
Correct |
135 ms |
29380 KB |
Output is correct |
55 |
Correct |
479 ms |
52164 KB |
Output is correct |
56 |
Correct |
380 ms |
49580 KB |
Output is correct |
57 |
Correct |
532 ms |
61132 KB |
Output is correct |
58 |
Correct |
400 ms |
51344 KB |
Output is correct |
59 |
Correct |
395 ms |
51736 KB |
Output is correct |
60 |
Correct |
557 ms |
63724 KB |
Output is correct |
61 |
Correct |
166 ms |
48940 KB |
Output is correct |
62 |
Correct |
178 ms |
51316 KB |
Output is correct |
63 |
Correct |
533 ms |
62388 KB |
Output is correct |
64 |
Correct |
555 ms |
62416 KB |
Output is correct |
65 |
Correct |
512 ms |
61100 KB |
Output is correct |
66 |
Correct |
515 ms |
62096 KB |
Output is correct |
67 |
Correct |
535 ms |
61256 KB |
Output is correct |
68 |
Correct |
542 ms |
62040 KB |
Output is correct |
69 |
Correct |
530 ms |
61976 KB |
Output is correct |
70 |
Correct |
523 ms |
62096 KB |
Output is correct |
71 |
Correct |
525 ms |
62020 KB |
Output is correct |
72 |
Correct |
515 ms |
61552 KB |
Output is correct |
73 |
Correct |
543 ms |
62076 KB |
Output is correct |
74 |
Correct |
537 ms |
61556 KB |
Output is correct |
75 |
Correct |
544 ms |
61980 KB |
Output is correct |
76 |
Correct |
528 ms |
62008 KB |
Output is correct |
77 |
Correct |
526 ms |
62040 KB |
Output is correct |
78 |
Correct |
530 ms |
62020 KB |
Output is correct |
79 |
Correct |
368 ms |
60408 KB |
Output is correct |
80 |
Correct |
351 ms |
61108 KB |
Output is correct |
81 |
Correct |
423 ms |
65888 KB |
Output is correct |
82 |
Correct |
97 ms |
26600 KB |
Output is correct |
83 |
Correct |
97 ms |
26108 KB |
Output is correct |
84 |
Correct |
41 ms |
23916 KB |
Output is correct |
85 |
Correct |
47 ms |
25032 KB |
Output is correct |
86 |
Correct |
100 ms |
27644 KB |
Output is correct |
87 |
Correct |
100 ms |
27908 KB |
Output is correct |
88 |
Correct |
99 ms |
27844 KB |
Output is correct |
89 |
Correct |
103 ms |
27744 KB |
Output is correct |
90 |
Correct |
106 ms |
27868 KB |
Output is correct |
91 |
Correct |
100 ms |
27848 KB |
Output is correct |
92 |
Correct |
56 ms |
25388 KB |
Output is correct |
93 |
Correct |
73 ms |
27692 KB |
Output is correct |
94 |
Correct |
70 ms |
25028 KB |
Output is correct |
95 |
Correct |
85 ms |
26468 KB |
Output is correct |
96 |
Correct |
107 ms |
27956 KB |
Output is correct |
97 |
Correct |
117 ms |
27964 KB |
Output is correct |
98 |
Correct |
93 ms |
26972 KB |
Output is correct |
99 |
Correct |
115 ms |
29532 KB |
Output is correct |
100 |
Correct |
95 ms |
26896 KB |
Output is correct |
101 |
Correct |
105 ms |
29476 KB |
Output is correct |
102 |
Correct |
121 ms |
29744 KB |
Output is correct |
103 |
Correct |
83 ms |
26268 KB |
Output is correct |
104 |
Correct |
101 ms |
28100 KB |
Output is correct |
105 |
Correct |
112 ms |
29608 KB |
Output is correct |
106 |
Correct |
51 ms |
25644 KB |
Output is correct |
107 |
Correct |
51 ms |
25636 KB |
Output is correct |
108 |
Correct |
85 ms |
27120 KB |
Output is correct |
109 |
Correct |
63 ms |
25948 KB |
Output is correct |
110 |
Correct |
104 ms |
28868 KB |
Output is correct |
111 |
Correct |
82 ms |
28988 KB |
Output is correct |
112 |
Correct |
110 ms |
28100 KB |
Output is correct |
113 |
Correct |
108 ms |
29176 KB |
Output is correct |
114 |
Correct |
97 ms |
28384 KB |
Output is correct |
115 |
Correct |
111 ms |
29884 KB |
Output is correct |
116 |
Correct |
70 ms |
25544 KB |
Output is correct |
117 |
Correct |
113 ms |
29508 KB |
Output is correct |
118 |
Correct |
84 ms |
27296 KB |
Output is correct |
119 |
Correct |
81 ms |
26844 KB |
Output is correct |
120 |
Correct |
108 ms |
29420 KB |
Output is correct |
121 |
Correct |
110 ms |
29296 KB |
Output is correct |
122 |
Correct |
101 ms |
29144 KB |
Output is correct |
123 |
Correct |
108 ms |
29464 KB |
Output is correct |
124 |
Correct |
102 ms |
29380 KB |
Output is correct |
125 |
Correct |
85 ms |
27752 KB |
Output is correct |
126 |
Correct |
64 ms |
26608 KB |
Output is correct |
127 |
Correct |
69 ms |
26948 KB |
Output is correct |
128 |
Correct |
85 ms |
29172 KB |
Output is correct |
129 |
Correct |
98 ms |
30484 KB |
Output is correct |
130 |
Correct |
555 ms |
61748 KB |
Output is correct |
131 |
Correct |
402 ms |
49824 KB |
Output is correct |
132 |
Correct |
521 ms |
61748 KB |
Output is correct |
133 |
Correct |
553 ms |
62532 KB |
Output is correct |
134 |
Correct |
506 ms |
57656 KB |
Output is correct |
135 |
Correct |
613 ms |
64532 KB |
Output is correct |
136 |
Correct |
539 ms |
63500 KB |
Output is correct |
137 |
Correct |
529 ms |
63308 KB |
Output is correct |
138 |
Correct |
527 ms |
61784 KB |
Output is correct |
139 |
Correct |
534 ms |
62772 KB |
Output is correct |
140 |
Correct |
532 ms |
61840 KB |
Output is correct |
141 |
Correct |
548 ms |
62720 KB |
Output is correct |
142 |
Correct |
541 ms |
62676 KB |
Output is correct |
143 |
Correct |
535 ms |
62616 KB |
Output is correct |
144 |
Correct |
529 ms |
62224 KB |
Output is correct |
145 |
Correct |
564 ms |
62788 KB |
Output is correct |
146 |
Correct |
545 ms |
62292 KB |
Output is correct |
147 |
Correct |
538 ms |
62592 KB |
Output is correct |
148 |
Correct |
578 ms |
62804 KB |
Output is correct |
149 |
Correct |
538 ms |
62680 KB |
Output is correct |
150 |
Correct |
247 ms |
52340 KB |
Output is correct |
151 |
Correct |
370 ms |
61740 KB |
Output is correct |
152 |
Correct |
360 ms |
61708 KB |
Output is correct |
153 |
Correct |
423 ms |
66784 KB |
Output is correct |