#include <bits/stdc++.h>
constexpr const int MXH = (int) 1e9 + 5;
struct Sparse {
struct Item {
int mn = MXH, mx = -MXH, anl = 0, anr = 0, mn_ind = -1;
static Item merge(const Item& l, const Item& r) {
return {
std::min(l.mn, r.mn), std::max(l.mx, r.mx),
std::max({ l.anl, r.anl, r.mx - l.mn }), std::max({ l.anr, r.anr, l.mx - r.mn }),
l.mn < r.mn ? l.mn_ind : r.mn_ind
};
}
};
int size;
std::vector <std::vector <Item>> bin;
void init(const std::vector <int>& v) {
bin.resize(17, std::vector <Item> (size = v.size()));
for (int i = 0; i < size; i++) bin[0][i].mn = bin[0][i].mx = v[i], bin[0][i].mn_ind = i;
for (int b = 1; b < 17; b++)
for (int i = 0; i + (1 << (b - 1)) < size; i++)
bin[b][i] = Item::merge(bin[b - 1][i], bin[b - 1][i + (1 << (b - 1))]);
}
Item query(int l, int r) {
Item res;
if (l >= r || l < 0 || r >= size) return res;
for (int b = 31 - __builtin_clz(r - l), range = r - l; ~b; l += ((range >> b) & 1) << b, b--)
if (range & (1 << b))
res = Item::merge(res, bin[b][l]);
return res;
}
};
struct PNode {
struct Item {
int sum = 0;
int mn = MXH, mx = -MXH;
static Item merge(const Item& l, const Item& r) {
return { l.sum + r.sum, std::min(l.mn, r.mn), std::max(l.mx, r.mx) };
}
};
typedef std::shared_ptr <PNode> PPNode;
Item item;
PPNode lc = nullptr, rc = nullptr;
PNode(const Item& _item) : item(_item) { }
PNode(PPNode _lc, PPNode _rc) : item(Item::merge(_lc->item, _rc->item)), lc(_lc), rc(_rc) { }
static PPNode build(int l, int r) {
if (!(r - l - 1)) return PPNode(new PNode({ }));
int mid = (l + r) >> 1;
return PPNode(new PNode(build(l, mid), build(mid, r)));
}
static PPNode set(PPNode node, int ind, int l, int r) {
if (!(r - l - 1)) return PPNode(new PNode({ 1, ind, ind }));
int mid = (l + r) >> 1;
if (ind < mid) return PPNode(new PNode(set(node->lc, ind, l, mid), node->rc));
return PPNode(new PNode(node->lc, set(node->rc, ind, mid, r)));
}
Item query(int tl, int tr, int l, int r) {
if (l >= tr || r <= tl) return { };
if (l >= tl && r <= tr) return item;
int mid = (l + r) >> 1;
return Item::merge(lc->query(tl, tr, l, mid), rc->query(tl, tr, mid, r));
}
};
int n;
std::vector <int> h;
Sparse sparse;
std::vector <std::shared_ptr <PNode>> pst;
std::map <int, int> smp;
void init(int N, std::vector <int> H) {
n = N + 4;
h = H;
h.insert(h.begin(), { 0, MXH });
h.insert(h.end(), { MXH, 0 });
sparse.init(h);
std::vector <std::pair <int, int>> ord(N);
for (int i = 2; i < n - 2; i++) ord[i - 2] = { h[i], i };
std::sort(ord.begin(), ord.end());
std::set <int> st = { 0, n - 1 };
std::vector <int> tmon(n);
for (auto [hei, i] : ord) {
auto it = st.lower_bound(i);
tmon[i] = std::max(0, std::min(sparse.query(*prev(it) + 1, i).mx, sparse.query(i + 1, *it).mx) - hei);
st.insert(i);
}
smp[MXH] = 0;
pst.push_back(PNode::build(0, 4 * n));
for (int i = 2; i < n - 2; i++) ord[i - 2] = { tmon[i], i };
std::sort(ord.rbegin(), ord.rend());
for (auto [dv, i] : ord) {
pst.push_back(PNode::set(pst.back(), i, 0, 4 * n));
smp[dv] = (int) pst.size() - 1;
}
}
int max_towers(int L, int R, int D) {
L += 2, R += 2;
std::shared_ptr <PNode> node = pst[smp.lower_bound(D)->second];
PNode::Item pit = node->query(L, R + 1, 0, 4 * n);
if (!pit.sum) {
pit.sum++;
pit.mn = pit.mx = sparse.query(L, R + 1).mn_ind;
}
int ans = pit.sum;
ans += sparse.query(L, pit.mn).anl >= D;
ans += sparse.query(pit.mx + 1, R + 1).anr >= D;
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
739 ms |
176024 KB |
Output is correct |
2 |
Correct |
1298 ms |
302304 KB |
Output is correct |
3 |
Correct |
1375 ms |
302232 KB |
Output is correct |
4 |
Correct |
1321 ms |
302204 KB |
Output is correct |
5 |
Correct |
1270 ms |
302312 KB |
Output is correct |
6 |
Correct |
1148 ms |
302212 KB |
Output is correct |
7 |
Correct |
1312 ms |
302236 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
6 ms |
5200 KB |
Output is correct |
10 |
Correct |
6 ms |
5200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
7 ms |
5200 KB |
Output is correct |
3 |
Correct |
8 ms |
5200 KB |
Output is correct |
4 |
Correct |
6 ms |
5200 KB |
Output is correct |
5 |
Correct |
6 ms |
5200 KB |
Output is correct |
6 |
Correct |
6 ms |
5296 KB |
Output is correct |
7 |
Correct |
7 ms |
5200 KB |
Output is correct |
8 |
Correct |
6 ms |
5200 KB |
Output is correct |
9 |
Correct |
6 ms |
5236 KB |
Output is correct |
10 |
Correct |
6 ms |
5200 KB |
Output is correct |
11 |
Correct |
6 ms |
5200 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
6 ms |
5144 KB |
Output is correct |
14 |
Correct |
6 ms |
5200 KB |
Output is correct |
15 |
Correct |
6 ms |
5200 KB |
Output is correct |
16 |
Correct |
7 ms |
5200 KB |
Output is correct |
17 |
Correct |
6 ms |
5200 KB |
Output is correct |
18 |
Correct |
6 ms |
5200 KB |
Output is correct |
19 |
Correct |
6 ms |
5216 KB |
Output is correct |
20 |
Correct |
6 ms |
5200 KB |
Output is correct |
21 |
Correct |
7 ms |
5200 KB |
Output is correct |
22 |
Correct |
6 ms |
5200 KB |
Output is correct |
23 |
Correct |
6 ms |
5200 KB |
Output is correct |
24 |
Correct |
6 ms |
5200 KB |
Output is correct |
25 |
Correct |
3 ms |
2384 KB |
Output is correct |
26 |
Correct |
6 ms |
5200 KB |
Output is correct |
27 |
Correct |
6 ms |
5200 KB |
Output is correct |
28 |
Correct |
6 ms |
5200 KB |
Output is correct |
29 |
Correct |
6 ms |
5200 KB |
Output is correct |
30 |
Correct |
7 ms |
5200 KB |
Output is correct |
31 |
Correct |
6 ms |
5200 KB |
Output is correct |
32 |
Correct |
6 ms |
5276 KB |
Output is correct |
33 |
Correct |
6 ms |
5200 KB |
Output is correct |
34 |
Correct |
6 ms |
5176 KB |
Output is correct |
35 |
Correct |
6 ms |
5200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
7 ms |
5200 KB |
Output is correct |
3 |
Correct |
8 ms |
5200 KB |
Output is correct |
4 |
Correct |
6 ms |
5200 KB |
Output is correct |
5 |
Correct |
6 ms |
5200 KB |
Output is correct |
6 |
Correct |
6 ms |
5296 KB |
Output is correct |
7 |
Correct |
7 ms |
5200 KB |
Output is correct |
8 |
Correct |
6 ms |
5200 KB |
Output is correct |
9 |
Correct |
6 ms |
5236 KB |
Output is correct |
10 |
Correct |
6 ms |
5200 KB |
Output is correct |
11 |
Correct |
6 ms |
5200 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
6 ms |
5144 KB |
Output is correct |
14 |
Correct |
6 ms |
5200 KB |
Output is correct |
15 |
Correct |
6 ms |
5200 KB |
Output is correct |
16 |
Correct |
7 ms |
5200 KB |
Output is correct |
17 |
Correct |
6 ms |
5200 KB |
Output is correct |
18 |
Correct |
6 ms |
5200 KB |
Output is correct |
19 |
Correct |
6 ms |
5216 KB |
Output is correct |
20 |
Correct |
6 ms |
5200 KB |
Output is correct |
21 |
Correct |
7 ms |
5200 KB |
Output is correct |
22 |
Correct |
6 ms |
5200 KB |
Output is correct |
23 |
Correct |
6 ms |
5200 KB |
Output is correct |
24 |
Correct |
6 ms |
5200 KB |
Output is correct |
25 |
Correct |
3 ms |
2384 KB |
Output is correct |
26 |
Correct |
6 ms |
5200 KB |
Output is correct |
27 |
Correct |
6 ms |
5200 KB |
Output is correct |
28 |
Correct |
6 ms |
5200 KB |
Output is correct |
29 |
Correct |
6 ms |
5200 KB |
Output is correct |
30 |
Correct |
7 ms |
5200 KB |
Output is correct |
31 |
Correct |
6 ms |
5200 KB |
Output is correct |
32 |
Correct |
6 ms |
5276 KB |
Output is correct |
33 |
Correct |
6 ms |
5200 KB |
Output is correct |
34 |
Correct |
6 ms |
5176 KB |
Output is correct |
35 |
Correct |
6 ms |
5200 KB |
Output is correct |
36 |
Correct |
419 ms |
193596 KB |
Output is correct |
37 |
Correct |
480 ms |
304000 KB |
Output is correct |
38 |
Correct |
472 ms |
303772 KB |
Output is correct |
39 |
Correct |
517 ms |
304696 KB |
Output is correct |
40 |
Correct |
521 ms |
304636 KB |
Output is correct |
41 |
Correct |
522 ms |
304636 KB |
Output is correct |
42 |
Correct |
522 ms |
304668 KB |
Output is correct |
43 |
Correct |
390 ms |
302208 KB |
Output is correct |
44 |
Correct |
386 ms |
302204 KB |
Output is correct |
45 |
Correct |
387 ms |
302236 KB |
Output is correct |
46 |
Correct |
385 ms |
302232 KB |
Output is correct |
47 |
Correct |
482 ms |
303884 KB |
Output is correct |
48 |
Correct |
511 ms |
304672 KB |
Output is correct |
49 |
Correct |
517 ms |
304652 KB |
Output is correct |
50 |
Correct |
381 ms |
302324 KB |
Output is correct |
51 |
Correct |
385 ms |
302308 KB |
Output is correct |
52 |
Correct |
489 ms |
303808 KB |
Output is correct |
53 |
Correct |
510 ms |
304664 KB |
Output is correct |
54 |
Correct |
529 ms |
304752 KB |
Output is correct |
55 |
Correct |
380 ms |
302320 KB |
Output is correct |
56 |
Correct |
386 ms |
302208 KB |
Output is correct |
57 |
Correct |
467 ms |
293112 KB |
Output is correct |
58 |
Correct |
478 ms |
303852 KB |
Output is correct |
59 |
Correct |
476 ms |
303896 KB |
Output is correct |
60 |
Correct |
512 ms |
304640 KB |
Output is correct |
61 |
Correct |
508 ms |
304604 KB |
Output is correct |
62 |
Correct |
526 ms |
304660 KB |
Output is correct |
63 |
Correct |
520 ms |
304612 KB |
Output is correct |
64 |
Correct |
396 ms |
302228 KB |
Output is correct |
65 |
Correct |
393 ms |
302324 KB |
Output is correct |
66 |
Correct |
382 ms |
302236 KB |
Output is correct |
67 |
Correct |
387 ms |
302208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1033 ms |
301636 KB |
Output is correct |
2 |
Correct |
1091 ms |
303900 KB |
Output is correct |
3 |
Correct |
1279 ms |
303924 KB |
Output is correct |
4 |
Correct |
1260 ms |
304668 KB |
Output is correct |
5 |
Correct |
1302 ms |
304644 KB |
Output is correct |
6 |
Correct |
1357 ms |
304744 KB |
Output is correct |
7 |
Correct |
1247 ms |
304568 KB |
Output is correct |
8 |
Correct |
1206 ms |
302212 KB |
Output is correct |
9 |
Correct |
1225 ms |
302268 KB |
Output is correct |
10 |
Correct |
1218 ms |
302284 KB |
Output is correct |
11 |
Correct |
1217 ms |
302304 KB |
Output is correct |
12 |
Correct |
1372 ms |
302244 KB |
Output is correct |
13 |
Correct |
1567 ms |
302320 KB |
Output is correct |
14 |
Correct |
1 ms |
208 KB |
Output is correct |
15 |
Correct |
7 ms |
5220 KB |
Output is correct |
16 |
Correct |
6 ms |
5280 KB |
Output is correct |
17 |
Correct |
550 ms |
303836 KB |
Output is correct |
18 |
Correct |
579 ms |
304620 KB |
Output is correct |
19 |
Correct |
587 ms |
304560 KB |
Output is correct |
20 |
Correct |
425 ms |
302232 KB |
Output is correct |
21 |
Correct |
407 ms |
302252 KB |
Output is correct |
22 |
Correct |
522 ms |
303872 KB |
Output is correct |
23 |
Correct |
594 ms |
304612 KB |
Output is correct |
24 |
Correct |
546 ms |
304632 KB |
Output is correct |
25 |
Correct |
411 ms |
302248 KB |
Output is correct |
26 |
Correct |
428 ms |
302212 KB |
Output is correct |
27 |
Correct |
10 ms |
5200 KB |
Output is correct |
28 |
Correct |
7 ms |
5324 KB |
Output is correct |
29 |
Correct |
7 ms |
5200 KB |
Output is correct |
30 |
Correct |
6 ms |
5200 KB |
Output is correct |
31 |
Correct |
6 ms |
5200 KB |
Output is correct |
32 |
Correct |
7 ms |
5304 KB |
Output is correct |
33 |
Correct |
6 ms |
5316 KB |
Output is correct |
34 |
Correct |
7 ms |
5320 KB |
Output is correct |
35 |
Correct |
8 ms |
5272 KB |
Output is correct |
36 |
Correct |
7 ms |
5200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
379 ms |
68192 KB |
Output is correct |
2 |
Correct |
1541 ms |
303780 KB |
Output is correct |
3 |
Correct |
1441 ms |
303888 KB |
Output is correct |
4 |
Correct |
1496 ms |
304672 KB |
Output is correct |
5 |
Correct |
1833 ms |
304636 KB |
Output is correct |
6 |
Correct |
1325 ms |
304676 KB |
Output is correct |
7 |
Correct |
1353 ms |
304576 KB |
Output is correct |
8 |
Correct |
1125 ms |
302332 KB |
Output is correct |
9 |
Correct |
1089 ms |
302280 KB |
Output is correct |
10 |
Correct |
1098 ms |
302240 KB |
Output is correct |
11 |
Correct |
1110 ms |
302208 KB |
Output is correct |
12 |
Correct |
552 ms |
303852 KB |
Output is correct |
13 |
Correct |
609 ms |
304672 KB |
Output is correct |
14 |
Correct |
575 ms |
304564 KB |
Output is correct |
15 |
Correct |
424 ms |
302208 KB |
Output is correct |
16 |
Correct |
452 ms |
302288 KB |
Output is correct |
17 |
Correct |
572 ms |
293024 KB |
Output is correct |
18 |
Correct |
548 ms |
303784 KB |
Output is correct |
19 |
Correct |
546 ms |
303792 KB |
Output is correct |
20 |
Correct |
601 ms |
304648 KB |
Output is correct |
21 |
Correct |
606 ms |
304608 KB |
Output is correct |
22 |
Correct |
557 ms |
304608 KB |
Output is correct |
23 |
Correct |
620 ms |
304564 KB |
Output is correct |
24 |
Correct |
426 ms |
302208 KB |
Output is correct |
25 |
Correct |
419 ms |
302260 KB |
Output is correct |
26 |
Correct |
459 ms |
302256 KB |
Output is correct |
27 |
Correct |
440 ms |
302312 KB |
Output is correct |
28 |
Correct |
7 ms |
5216 KB |
Output is correct |
29 |
Correct |
7 ms |
5344 KB |
Output is correct |
30 |
Correct |
7 ms |
5320 KB |
Output is correct |
31 |
Correct |
7 ms |
5200 KB |
Output is correct |
32 |
Correct |
11 ms |
5200 KB |
Output is correct |
33 |
Correct |
4 ms |
2384 KB |
Output is correct |
34 |
Correct |
11 ms |
5256 KB |
Output is correct |
35 |
Correct |
7 ms |
5304 KB |
Output is correct |
36 |
Correct |
10 ms |
5272 KB |
Output is correct |
37 |
Correct |
10 ms |
5200 KB |
Output is correct |
38 |
Correct |
7 ms |
5304 KB |
Output is correct |
39 |
Correct |
7 ms |
5200 KB |
Output is correct |
40 |
Correct |
7 ms |
5272 KB |
Output is correct |
41 |
Correct |
6 ms |
5200 KB |
Output is correct |
42 |
Correct |
6 ms |
5272 KB |
Output is correct |
43 |
Correct |
6 ms |
5200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
7 ms |
5200 KB |
Output is correct |
3 |
Correct |
8 ms |
5200 KB |
Output is correct |
4 |
Correct |
6 ms |
5200 KB |
Output is correct |
5 |
Correct |
6 ms |
5200 KB |
Output is correct |
6 |
Correct |
6 ms |
5296 KB |
Output is correct |
7 |
Correct |
7 ms |
5200 KB |
Output is correct |
8 |
Correct |
6 ms |
5200 KB |
Output is correct |
9 |
Correct |
6 ms |
5236 KB |
Output is correct |
10 |
Correct |
6 ms |
5200 KB |
Output is correct |
11 |
Correct |
6 ms |
5200 KB |
Output is correct |
12 |
Correct |
0 ms |
208 KB |
Output is correct |
13 |
Correct |
6 ms |
5144 KB |
Output is correct |
14 |
Correct |
6 ms |
5200 KB |
Output is correct |
15 |
Correct |
6 ms |
5200 KB |
Output is correct |
16 |
Correct |
7 ms |
5200 KB |
Output is correct |
17 |
Correct |
6 ms |
5200 KB |
Output is correct |
18 |
Correct |
6 ms |
5200 KB |
Output is correct |
19 |
Correct |
6 ms |
5216 KB |
Output is correct |
20 |
Correct |
6 ms |
5200 KB |
Output is correct |
21 |
Correct |
7 ms |
5200 KB |
Output is correct |
22 |
Correct |
6 ms |
5200 KB |
Output is correct |
23 |
Correct |
6 ms |
5200 KB |
Output is correct |
24 |
Correct |
6 ms |
5200 KB |
Output is correct |
25 |
Correct |
3 ms |
2384 KB |
Output is correct |
26 |
Correct |
6 ms |
5200 KB |
Output is correct |
27 |
Correct |
6 ms |
5200 KB |
Output is correct |
28 |
Correct |
6 ms |
5200 KB |
Output is correct |
29 |
Correct |
6 ms |
5200 KB |
Output is correct |
30 |
Correct |
7 ms |
5200 KB |
Output is correct |
31 |
Correct |
6 ms |
5200 KB |
Output is correct |
32 |
Correct |
6 ms |
5276 KB |
Output is correct |
33 |
Correct |
6 ms |
5200 KB |
Output is correct |
34 |
Correct |
6 ms |
5176 KB |
Output is correct |
35 |
Correct |
6 ms |
5200 KB |
Output is correct |
36 |
Correct |
419 ms |
193596 KB |
Output is correct |
37 |
Correct |
480 ms |
304000 KB |
Output is correct |
38 |
Correct |
472 ms |
303772 KB |
Output is correct |
39 |
Correct |
517 ms |
304696 KB |
Output is correct |
40 |
Correct |
521 ms |
304636 KB |
Output is correct |
41 |
Correct |
522 ms |
304636 KB |
Output is correct |
42 |
Correct |
522 ms |
304668 KB |
Output is correct |
43 |
Correct |
390 ms |
302208 KB |
Output is correct |
44 |
Correct |
386 ms |
302204 KB |
Output is correct |
45 |
Correct |
387 ms |
302236 KB |
Output is correct |
46 |
Correct |
385 ms |
302232 KB |
Output is correct |
47 |
Correct |
482 ms |
303884 KB |
Output is correct |
48 |
Correct |
511 ms |
304672 KB |
Output is correct |
49 |
Correct |
517 ms |
304652 KB |
Output is correct |
50 |
Correct |
381 ms |
302324 KB |
Output is correct |
51 |
Correct |
385 ms |
302308 KB |
Output is correct |
52 |
Correct |
489 ms |
303808 KB |
Output is correct |
53 |
Correct |
510 ms |
304664 KB |
Output is correct |
54 |
Correct |
529 ms |
304752 KB |
Output is correct |
55 |
Correct |
380 ms |
302320 KB |
Output is correct |
56 |
Correct |
386 ms |
302208 KB |
Output is correct |
57 |
Correct |
467 ms |
293112 KB |
Output is correct |
58 |
Correct |
478 ms |
303852 KB |
Output is correct |
59 |
Correct |
476 ms |
303896 KB |
Output is correct |
60 |
Correct |
512 ms |
304640 KB |
Output is correct |
61 |
Correct |
508 ms |
304604 KB |
Output is correct |
62 |
Correct |
526 ms |
304660 KB |
Output is correct |
63 |
Correct |
520 ms |
304612 KB |
Output is correct |
64 |
Correct |
396 ms |
302228 KB |
Output is correct |
65 |
Correct |
393 ms |
302324 KB |
Output is correct |
66 |
Correct |
382 ms |
302236 KB |
Output is correct |
67 |
Correct |
387 ms |
302208 KB |
Output is correct |
68 |
Correct |
1033 ms |
301636 KB |
Output is correct |
69 |
Correct |
1091 ms |
303900 KB |
Output is correct |
70 |
Correct |
1279 ms |
303924 KB |
Output is correct |
71 |
Correct |
1260 ms |
304668 KB |
Output is correct |
72 |
Correct |
1302 ms |
304644 KB |
Output is correct |
73 |
Correct |
1357 ms |
304744 KB |
Output is correct |
74 |
Correct |
1247 ms |
304568 KB |
Output is correct |
75 |
Correct |
1206 ms |
302212 KB |
Output is correct |
76 |
Correct |
1225 ms |
302268 KB |
Output is correct |
77 |
Correct |
1218 ms |
302284 KB |
Output is correct |
78 |
Correct |
1217 ms |
302304 KB |
Output is correct |
79 |
Correct |
1372 ms |
302244 KB |
Output is correct |
80 |
Correct |
1567 ms |
302320 KB |
Output is correct |
81 |
Correct |
1 ms |
208 KB |
Output is correct |
82 |
Correct |
7 ms |
5220 KB |
Output is correct |
83 |
Correct |
6 ms |
5280 KB |
Output is correct |
84 |
Correct |
550 ms |
303836 KB |
Output is correct |
85 |
Correct |
579 ms |
304620 KB |
Output is correct |
86 |
Correct |
587 ms |
304560 KB |
Output is correct |
87 |
Correct |
425 ms |
302232 KB |
Output is correct |
88 |
Correct |
407 ms |
302252 KB |
Output is correct |
89 |
Correct |
522 ms |
303872 KB |
Output is correct |
90 |
Correct |
594 ms |
304612 KB |
Output is correct |
91 |
Correct |
546 ms |
304632 KB |
Output is correct |
92 |
Correct |
411 ms |
302248 KB |
Output is correct |
93 |
Correct |
428 ms |
302212 KB |
Output is correct |
94 |
Correct |
10 ms |
5200 KB |
Output is correct |
95 |
Correct |
7 ms |
5324 KB |
Output is correct |
96 |
Correct |
7 ms |
5200 KB |
Output is correct |
97 |
Correct |
6 ms |
5200 KB |
Output is correct |
98 |
Correct |
6 ms |
5200 KB |
Output is correct |
99 |
Correct |
7 ms |
5304 KB |
Output is correct |
100 |
Correct |
6 ms |
5316 KB |
Output is correct |
101 |
Correct |
7 ms |
5320 KB |
Output is correct |
102 |
Correct |
8 ms |
5272 KB |
Output is correct |
103 |
Correct |
7 ms |
5200 KB |
Output is correct |
104 |
Correct |
1190 ms |
268288 KB |
Output is correct |
105 |
Correct |
1292 ms |
303848 KB |
Output is correct |
106 |
Correct |
1425 ms |
303912 KB |
Output is correct |
107 |
Correct |
1407 ms |
304652 KB |
Output is correct |
108 |
Correct |
1474 ms |
304552 KB |
Output is correct |
109 |
Correct |
1251 ms |
304660 KB |
Output is correct |
110 |
Correct |
1437 ms |
304584 KB |
Output is correct |
111 |
Correct |
1259 ms |
302236 KB |
Output is correct |
112 |
Correct |
1214 ms |
302292 KB |
Output is correct |
113 |
Correct |
1165 ms |
302380 KB |
Output is correct |
114 |
Correct |
1361 ms |
302308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
739 ms |
176024 KB |
Output is correct |
2 |
Correct |
1298 ms |
302304 KB |
Output is correct |
3 |
Correct |
1375 ms |
302232 KB |
Output is correct |
4 |
Correct |
1321 ms |
302204 KB |
Output is correct |
5 |
Correct |
1270 ms |
302312 KB |
Output is correct |
6 |
Correct |
1148 ms |
302212 KB |
Output is correct |
7 |
Correct |
1312 ms |
302236 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
6 ms |
5200 KB |
Output is correct |
10 |
Correct |
6 ms |
5200 KB |
Output is correct |
11 |
Correct |
1 ms |
1232 KB |
Output is correct |
12 |
Correct |
7 ms |
5200 KB |
Output is correct |
13 |
Correct |
8 ms |
5200 KB |
Output is correct |
14 |
Correct |
6 ms |
5200 KB |
Output is correct |
15 |
Correct |
6 ms |
5200 KB |
Output is correct |
16 |
Correct |
6 ms |
5296 KB |
Output is correct |
17 |
Correct |
7 ms |
5200 KB |
Output is correct |
18 |
Correct |
6 ms |
5200 KB |
Output is correct |
19 |
Correct |
6 ms |
5236 KB |
Output is correct |
20 |
Correct |
6 ms |
5200 KB |
Output is correct |
21 |
Correct |
6 ms |
5200 KB |
Output is correct |
22 |
Correct |
0 ms |
208 KB |
Output is correct |
23 |
Correct |
6 ms |
5144 KB |
Output is correct |
24 |
Correct |
6 ms |
5200 KB |
Output is correct |
25 |
Correct |
6 ms |
5200 KB |
Output is correct |
26 |
Correct |
7 ms |
5200 KB |
Output is correct |
27 |
Correct |
6 ms |
5200 KB |
Output is correct |
28 |
Correct |
6 ms |
5200 KB |
Output is correct |
29 |
Correct |
6 ms |
5216 KB |
Output is correct |
30 |
Correct |
6 ms |
5200 KB |
Output is correct |
31 |
Correct |
7 ms |
5200 KB |
Output is correct |
32 |
Correct |
6 ms |
5200 KB |
Output is correct |
33 |
Correct |
6 ms |
5200 KB |
Output is correct |
34 |
Correct |
6 ms |
5200 KB |
Output is correct |
35 |
Correct |
3 ms |
2384 KB |
Output is correct |
36 |
Correct |
6 ms |
5200 KB |
Output is correct |
37 |
Correct |
6 ms |
5200 KB |
Output is correct |
38 |
Correct |
6 ms |
5200 KB |
Output is correct |
39 |
Correct |
6 ms |
5200 KB |
Output is correct |
40 |
Correct |
7 ms |
5200 KB |
Output is correct |
41 |
Correct |
6 ms |
5200 KB |
Output is correct |
42 |
Correct |
6 ms |
5276 KB |
Output is correct |
43 |
Correct |
6 ms |
5200 KB |
Output is correct |
44 |
Correct |
6 ms |
5176 KB |
Output is correct |
45 |
Correct |
6 ms |
5200 KB |
Output is correct |
46 |
Correct |
419 ms |
193596 KB |
Output is correct |
47 |
Correct |
480 ms |
304000 KB |
Output is correct |
48 |
Correct |
472 ms |
303772 KB |
Output is correct |
49 |
Correct |
517 ms |
304696 KB |
Output is correct |
50 |
Correct |
521 ms |
304636 KB |
Output is correct |
51 |
Correct |
522 ms |
304636 KB |
Output is correct |
52 |
Correct |
522 ms |
304668 KB |
Output is correct |
53 |
Correct |
390 ms |
302208 KB |
Output is correct |
54 |
Correct |
386 ms |
302204 KB |
Output is correct |
55 |
Correct |
387 ms |
302236 KB |
Output is correct |
56 |
Correct |
385 ms |
302232 KB |
Output is correct |
57 |
Correct |
482 ms |
303884 KB |
Output is correct |
58 |
Correct |
511 ms |
304672 KB |
Output is correct |
59 |
Correct |
517 ms |
304652 KB |
Output is correct |
60 |
Correct |
381 ms |
302324 KB |
Output is correct |
61 |
Correct |
385 ms |
302308 KB |
Output is correct |
62 |
Correct |
489 ms |
303808 KB |
Output is correct |
63 |
Correct |
510 ms |
304664 KB |
Output is correct |
64 |
Correct |
529 ms |
304752 KB |
Output is correct |
65 |
Correct |
380 ms |
302320 KB |
Output is correct |
66 |
Correct |
386 ms |
302208 KB |
Output is correct |
67 |
Correct |
467 ms |
293112 KB |
Output is correct |
68 |
Correct |
478 ms |
303852 KB |
Output is correct |
69 |
Correct |
476 ms |
303896 KB |
Output is correct |
70 |
Correct |
512 ms |
304640 KB |
Output is correct |
71 |
Correct |
508 ms |
304604 KB |
Output is correct |
72 |
Correct |
526 ms |
304660 KB |
Output is correct |
73 |
Correct |
520 ms |
304612 KB |
Output is correct |
74 |
Correct |
396 ms |
302228 KB |
Output is correct |
75 |
Correct |
393 ms |
302324 KB |
Output is correct |
76 |
Correct |
382 ms |
302236 KB |
Output is correct |
77 |
Correct |
387 ms |
302208 KB |
Output is correct |
78 |
Correct |
1033 ms |
301636 KB |
Output is correct |
79 |
Correct |
1091 ms |
303900 KB |
Output is correct |
80 |
Correct |
1279 ms |
303924 KB |
Output is correct |
81 |
Correct |
1260 ms |
304668 KB |
Output is correct |
82 |
Correct |
1302 ms |
304644 KB |
Output is correct |
83 |
Correct |
1357 ms |
304744 KB |
Output is correct |
84 |
Correct |
1247 ms |
304568 KB |
Output is correct |
85 |
Correct |
1206 ms |
302212 KB |
Output is correct |
86 |
Correct |
1225 ms |
302268 KB |
Output is correct |
87 |
Correct |
1218 ms |
302284 KB |
Output is correct |
88 |
Correct |
1217 ms |
302304 KB |
Output is correct |
89 |
Correct |
1372 ms |
302244 KB |
Output is correct |
90 |
Correct |
1567 ms |
302320 KB |
Output is correct |
91 |
Correct |
1 ms |
208 KB |
Output is correct |
92 |
Correct |
7 ms |
5220 KB |
Output is correct |
93 |
Correct |
6 ms |
5280 KB |
Output is correct |
94 |
Correct |
550 ms |
303836 KB |
Output is correct |
95 |
Correct |
579 ms |
304620 KB |
Output is correct |
96 |
Correct |
587 ms |
304560 KB |
Output is correct |
97 |
Correct |
425 ms |
302232 KB |
Output is correct |
98 |
Correct |
407 ms |
302252 KB |
Output is correct |
99 |
Correct |
522 ms |
303872 KB |
Output is correct |
100 |
Correct |
594 ms |
304612 KB |
Output is correct |
101 |
Correct |
546 ms |
304632 KB |
Output is correct |
102 |
Correct |
411 ms |
302248 KB |
Output is correct |
103 |
Correct |
428 ms |
302212 KB |
Output is correct |
104 |
Correct |
10 ms |
5200 KB |
Output is correct |
105 |
Correct |
7 ms |
5324 KB |
Output is correct |
106 |
Correct |
7 ms |
5200 KB |
Output is correct |
107 |
Correct |
6 ms |
5200 KB |
Output is correct |
108 |
Correct |
6 ms |
5200 KB |
Output is correct |
109 |
Correct |
7 ms |
5304 KB |
Output is correct |
110 |
Correct |
6 ms |
5316 KB |
Output is correct |
111 |
Correct |
7 ms |
5320 KB |
Output is correct |
112 |
Correct |
8 ms |
5272 KB |
Output is correct |
113 |
Correct |
7 ms |
5200 KB |
Output is correct |
114 |
Correct |
379 ms |
68192 KB |
Output is correct |
115 |
Correct |
1541 ms |
303780 KB |
Output is correct |
116 |
Correct |
1441 ms |
303888 KB |
Output is correct |
117 |
Correct |
1496 ms |
304672 KB |
Output is correct |
118 |
Correct |
1833 ms |
304636 KB |
Output is correct |
119 |
Correct |
1325 ms |
304676 KB |
Output is correct |
120 |
Correct |
1353 ms |
304576 KB |
Output is correct |
121 |
Correct |
1125 ms |
302332 KB |
Output is correct |
122 |
Correct |
1089 ms |
302280 KB |
Output is correct |
123 |
Correct |
1098 ms |
302240 KB |
Output is correct |
124 |
Correct |
1110 ms |
302208 KB |
Output is correct |
125 |
Correct |
552 ms |
303852 KB |
Output is correct |
126 |
Correct |
609 ms |
304672 KB |
Output is correct |
127 |
Correct |
575 ms |
304564 KB |
Output is correct |
128 |
Correct |
424 ms |
302208 KB |
Output is correct |
129 |
Correct |
452 ms |
302288 KB |
Output is correct |
130 |
Correct |
572 ms |
293024 KB |
Output is correct |
131 |
Correct |
548 ms |
303784 KB |
Output is correct |
132 |
Correct |
546 ms |
303792 KB |
Output is correct |
133 |
Correct |
601 ms |
304648 KB |
Output is correct |
134 |
Correct |
606 ms |
304608 KB |
Output is correct |
135 |
Correct |
557 ms |
304608 KB |
Output is correct |
136 |
Correct |
620 ms |
304564 KB |
Output is correct |
137 |
Correct |
426 ms |
302208 KB |
Output is correct |
138 |
Correct |
419 ms |
302260 KB |
Output is correct |
139 |
Correct |
459 ms |
302256 KB |
Output is correct |
140 |
Correct |
440 ms |
302312 KB |
Output is correct |
141 |
Correct |
7 ms |
5216 KB |
Output is correct |
142 |
Correct |
7 ms |
5344 KB |
Output is correct |
143 |
Correct |
7 ms |
5320 KB |
Output is correct |
144 |
Correct |
7 ms |
5200 KB |
Output is correct |
145 |
Correct |
11 ms |
5200 KB |
Output is correct |
146 |
Correct |
4 ms |
2384 KB |
Output is correct |
147 |
Correct |
11 ms |
5256 KB |
Output is correct |
148 |
Correct |
7 ms |
5304 KB |
Output is correct |
149 |
Correct |
10 ms |
5272 KB |
Output is correct |
150 |
Correct |
10 ms |
5200 KB |
Output is correct |
151 |
Correct |
7 ms |
5304 KB |
Output is correct |
152 |
Correct |
7 ms |
5200 KB |
Output is correct |
153 |
Correct |
7 ms |
5272 KB |
Output is correct |
154 |
Correct |
6 ms |
5200 KB |
Output is correct |
155 |
Correct |
6 ms |
5272 KB |
Output is correct |
156 |
Correct |
6 ms |
5200 KB |
Output is correct |
157 |
Correct |
1190 ms |
268288 KB |
Output is correct |
158 |
Correct |
1292 ms |
303848 KB |
Output is correct |
159 |
Correct |
1425 ms |
303912 KB |
Output is correct |
160 |
Correct |
1407 ms |
304652 KB |
Output is correct |
161 |
Correct |
1474 ms |
304552 KB |
Output is correct |
162 |
Correct |
1251 ms |
304660 KB |
Output is correct |
163 |
Correct |
1437 ms |
304584 KB |
Output is correct |
164 |
Correct |
1259 ms |
302236 KB |
Output is correct |
165 |
Correct |
1214 ms |
302292 KB |
Output is correct |
166 |
Correct |
1165 ms |
302380 KB |
Output is correct |
167 |
Correct |
1361 ms |
302308 KB |
Output is correct |
168 |
Correct |
0 ms |
208 KB |
Output is correct |
169 |
Correct |
911 ms |
100444 KB |
Output is correct |
170 |
Correct |
1575 ms |
303812 KB |
Output is correct |
171 |
Correct |
1529 ms |
303888 KB |
Output is correct |
172 |
Correct |
1563 ms |
304668 KB |
Output is correct |
173 |
Correct |
1716 ms |
304620 KB |
Output is correct |
174 |
Correct |
1535 ms |
304612 KB |
Output is correct |
175 |
Correct |
1510 ms |
304628 KB |
Output is correct |
176 |
Correct |
1267 ms |
302248 KB |
Output is correct |
177 |
Correct |
1125 ms |
302344 KB |
Output is correct |
178 |
Correct |
1116 ms |
302312 KB |
Output is correct |
179 |
Correct |
1343 ms |
302208 KB |
Output is correct |