Submission #659083

# Submission time Handle Problem Language Result Execution time Memory
659083 2022-11-16T12:21:30 Z keta_tsimakuridze Radio Towers (IOI22_towers) C++17
100 / 100
2100 ms 159456 KB
#include "towers.h"
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N = 2e5 + 5, inf = 1e9;
int T[20 * N][3], lc[20 * N][3], rc[20 * N][3];
int c[3], r[N][3], n,  A[N], tree[4 * N][2];
vector<int> x, a, ll, rr;
vector<pair<int,int>>add[N][3];
void build(int u, int l, int r) {
    if(l == r) {
        tree[u][0] = l;
        tree[u][1] = a[l];
        return;
    }
    int mid = (l + r) / 2;
    build(2 * u, l, mid); build(2 * u + 1, mid + 1, r);
    tree[u][0] = (a[tree[2 * u][0]] < a[tree[2 * u + 1][0]] ? tree[2 * u][0] : tree[2 * u + 1][0]);
    tree[u][1] = max(tree[2 * u][1], tree[2 * u + 1][1]);
}
int MX(int u, int st, int en,int l,int r,int t) {
    if(l > en || r < st) return (t == 0 ? n : 0);
    if(st <= l && r <= en) return tree[u][t];
    int mid = (l + r) / 2;
    int x = MX(2 * u, st, en, l, mid, t), y =  MX(2 * u + 1, st, en, mid + 1, r, t);
    if(t == 0) return (a[x] < a[y] ? x : y);
    return max(x, y);
}
void build(int u, int l, int r, int t) {
    T[u][t] = (t == 1 ? n : 0);
    if(l == r) return;
    lc[u][t] = ++c[t]; rc[u][t] = ++c[t];
    build(lc[u][t], l, (l + r) / 2, t); build(rc[u][t], (l + r) / 2 + 1, r, t);
}
int merge(int a, int b, int t) {
    return (t == 0 ? max(a, b) : t == 1 ? min(a, b) : a + b);
}
void upd(int u, int id, int l, int r, int t, int v) {
    if(l == r) {
        T[c[t]][t] = v;
        return;
    }
    int mid = (l + r) / 2, x = c[t];
    lc[x][t] = lc[u][t], rc[x][t] = rc[u][t];
    if(id <= mid) lc[x][t] = ++c[t], upd(lc[u][t], id, l, mid, t, v);
    else rc[x][t] = ++c[t], upd(rc[u][t], id, mid + 1, r, t, v);
    T[x][t] = merge(T[lc[x][t]][t], T[rc[x][t]][t], t);
}
int get(int u, int st, int en, int l, int r, int t) {
    if(l > en || r < st || l > r) return (t == 1 ? n : 0);
    if(st <= l && r <= en) return T[u][t];
    int mid = (l + r) / 2;
    return merge(get(lc[u][t], st, en, l, mid, t), get(rc[u][t], st, en, mid + 1, r, t), t);
}
void init(int nn, std::vector<int> A) {
    n = nn;
    vector<int> L(n), R(n), f(n);
    stack<int> st;
    a = A; a.push_back(inf);
    for(int i = 0; i < n; i++) {
        while(st.size() && a[st.top()] > a[i]) st.pop();
        L[i] = (st.size() ? st.top() : -1);
        st.push(i);
    }
    build(1, 0, n - 1);
    while(st.size()) st.pop();

    for(int i = n - 1; i >= 0; i--) {
        while(st.size() && a[st.top()] > a[i]) st.pop();
        R[i] = (st.size() ? st.top(): n );
        st.push(i);

        int dl = (L[i] != -1 ? MX(1, L[i], i - 1, 0, n - 1, 1) - a[i] : inf),
            dr = (R[i] != n ? MX(1, i + 1, R[i], 0, n - 1, 1) - a[i] : inf);
        x.push_back(dl);
        x.push_back(dr);
    }
    sort(x.begin(), x.end());
    x.erase(unique(x.begin(), x.end()), x.end());
    for(int i = 0; i < n; i++) {

        int dl = (L[i] != -1 ? MX(1, L[i], i - 1, 0, n - 1, 1) - a[i] : inf),
            dr = (R[i] != n ? MX(1, i + 1, R[i], 0, n - 1, 1) - a[i] : inf);

        dl = lower_bound(x.begin(), x.end(), dl) - x.begin();
        dr = lower_bound(x.begin(), x.end(), dr) - x.begin();
        // x <= min(dl, dr)

        add[min(dl, dr)][2].push_back({i,  1});
        if(dl == dr) continue;
        if(dl < dr) {
            // x <= dr
            add[dr][1].push_back({i, L[i]});
            add[dl][1].push_back({i, n});
            continue;
        }
        add[dl][0].push_back({i, R[i]});
        add[dr][0].push_back({i, 0});
    }
    // <=
    ll = L; rr = R;
    for(int t = 0; t <= 2; t++) r[x.size()][t] = ++c[t], build(c[t], 0, n - 1, t);
    for(int i = (int)x.size() - 1; i >= 0; i--) {
        for(int t = 0; t <= 2; t++) {
            r[i][t] = r[i + 1][t];
            for(int j = 0; j < add[i][t].size(); j++) {
                int x = ++c[t];

                upd(r[i][t], add[i][t][j].f, 0, n - 1, t, add[i][t][j].s);
                r[i][t] = x;
            }
        }
    }

}

int max_towers(int L, int R, int D) {
    int Dd = D;
    D = lower_bound(x.begin(), x.end(), D) - x.begin();
    assert(r[D][1]);
    int ans = get(r[D][2], L, R, 0, n - 1, 2);
    int id = MX(1, L, R, 0, n - 1, 0);
    ans += (!get(r[D][2], id, id, 0, n - 1, 2));
    /*
    int cl = 0, cr = 0;
    for(int i = id - 1; i >= L; i--) {
       if(get(r[D][2], i, i, 0, n - 1, 2)) continue;
       int dl = (ll[i] >= L ? MX(1, ll[i], i - 1, 0, n - 1, 1) - a[i] : inf), dr = (rr[i] != n ? MX(1, i + 1, rr[i], 0, n - 1, 1) - a[i] : inf);
        if(ll[i] < L && dr >= Dd) ++cl;
    }
    for(int i = id + 1; i <= R; i++) {
        if(get(r[D][2], i, i, 0, n - 1, 2)) continue;
        int dl = (ll[i] != -1 ? MX(1, ll[i], i - 1, 0, n - 1, 1) - a[i] : inf), dr = (rr[i] <= R ? MX(1, i + 1, rr[i], 0, n - 1, 1) - a[i] : inf);
        if(min(dl, dr) >= Dd) ++cr;
    } */
    ans += (get(r[D][1], L, id - 1, 0, n - 1, 1) < L)  + (get(r[D][0], id + 1, R, 0, n - 1, 0) > R);
    return ans;
}

Compilation message

towers.cpp: In function 'void init(int, std::vector<int>)':
towers.cpp:107:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |             for(int j = 0; j < add[i][t].size(); j++) {
      |                            ~~^~~~~~~~~~~~~~~~~~
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:119:9: warning: unused variable 'Dd' [-Wunused-variable]
  119 |     int Dd = D;
      |         ^~
# Verdict Execution time Memory Grader output
1 Correct 774 ms 85592 KB Output is correct
2 Correct 1508 ms 152996 KB Output is correct
3 Correct 1586 ms 154556 KB Output is correct
4 Correct 1548 ms 156144 KB Output is correct
5 Correct 1427 ms 156556 KB Output is correct
6 Correct 1391 ms 158812 KB Output is correct
7 Correct 1401 ms 156540 KB Output is correct
8 Correct 7 ms 14416 KB Output is correct
9 Correct 13 ms 16272 KB Output is correct
10 Correct 10 ms 16440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14672 KB Output is correct
2 Correct 11 ms 15696 KB Output is correct
3 Correct 11 ms 15696 KB Output is correct
4 Correct 11 ms 15696 KB Output is correct
5 Correct 11 ms 15696 KB Output is correct
6 Correct 11 ms 15696 KB Output is correct
7 Correct 12 ms 15660 KB Output is correct
8 Correct 12 ms 16464 KB Output is correct
9 Correct 14 ms 16468 KB Output is correct
10 Correct 10 ms 16528 KB Output is correct
11 Correct 10 ms 16532 KB Output is correct
12 Correct 7 ms 14416 KB Output is correct
13 Correct 13 ms 16208 KB Output is correct
14 Correct 11 ms 16464 KB Output is correct
15 Correct 11 ms 15704 KB Output is correct
16 Correct 11 ms 15696 KB Output is correct
17 Correct 11 ms 15696 KB Output is correct
18 Correct 11 ms 16464 KB Output is correct
19 Correct 11 ms 16464 KB Output is correct
20 Correct 11 ms 15696 KB Output is correct
21 Correct 13 ms 15704 KB Output is correct
22 Correct 11 ms 15700 KB Output is correct
23 Correct 10 ms 16464 KB Output is correct
24 Correct 10 ms 16484 KB Output is correct
25 Correct 10 ms 14880 KB Output is correct
26 Correct 11 ms 15696 KB Output is correct
27 Correct 11 ms 15768 KB Output is correct
28 Correct 11 ms 15696 KB Output is correct
29 Correct 12 ms 15700 KB Output is correct
30 Correct 11 ms 15696 KB Output is correct
31 Correct 12 ms 15704 KB Output is correct
32 Correct 11 ms 16472 KB Output is correct
33 Correct 15 ms 16468 KB Output is correct
34 Correct 12 ms 16440 KB Output is correct
35 Correct 10 ms 16464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14672 KB Output is correct
2 Correct 11 ms 15696 KB Output is correct
3 Correct 11 ms 15696 KB Output is correct
4 Correct 11 ms 15696 KB Output is correct
5 Correct 11 ms 15696 KB Output is correct
6 Correct 11 ms 15696 KB Output is correct
7 Correct 12 ms 15660 KB Output is correct
8 Correct 12 ms 16464 KB Output is correct
9 Correct 14 ms 16468 KB Output is correct
10 Correct 10 ms 16528 KB Output is correct
11 Correct 10 ms 16532 KB Output is correct
12 Correct 7 ms 14416 KB Output is correct
13 Correct 13 ms 16208 KB Output is correct
14 Correct 11 ms 16464 KB Output is correct
15 Correct 11 ms 15704 KB Output is correct
16 Correct 11 ms 15696 KB Output is correct
17 Correct 11 ms 15696 KB Output is correct
18 Correct 11 ms 16464 KB Output is correct
19 Correct 11 ms 16464 KB Output is correct
20 Correct 11 ms 15696 KB Output is correct
21 Correct 13 ms 15704 KB Output is correct
22 Correct 11 ms 15700 KB Output is correct
23 Correct 10 ms 16464 KB Output is correct
24 Correct 10 ms 16484 KB Output is correct
25 Correct 10 ms 14880 KB Output is correct
26 Correct 11 ms 15696 KB Output is correct
27 Correct 11 ms 15768 KB Output is correct
28 Correct 11 ms 15696 KB Output is correct
29 Correct 12 ms 15700 KB Output is correct
30 Correct 11 ms 15696 KB Output is correct
31 Correct 12 ms 15704 KB Output is correct
32 Correct 11 ms 16472 KB Output is correct
33 Correct 15 ms 16468 KB Output is correct
34 Correct 12 ms 16440 KB Output is correct
35 Correct 10 ms 16464 KB Output is correct
36 Correct 264 ms 69292 KB Output is correct
37 Correct 444 ms 101988 KB Output is correct
38 Correct 427 ms 101564 KB Output is correct
39 Correct 425 ms 101512 KB Output is correct
40 Correct 407 ms 101488 KB Output is correct
41 Correct 427 ms 101612 KB Output is correct
42 Correct 415 ms 101672 KB Output is correct
43 Correct 281 ms 156232 KB Output is correct
44 Correct 293 ms 156616 KB Output is correct
45 Correct 329 ms 157988 KB Output is correct
46 Correct 325 ms 157852 KB Output is correct
47 Correct 435 ms 101640 KB Output is correct
48 Correct 428 ms 101564 KB Output is correct
49 Correct 413 ms 101488 KB Output is correct
50 Correct 278 ms 156628 KB Output is correct
51 Correct 286 ms 156284 KB Output is correct
52 Correct 423 ms 101500 KB Output is correct
53 Correct 410 ms 101420 KB Output is correct
54 Correct 415 ms 101544 KB Output is correct
55 Correct 282 ms 156556 KB Output is correct
56 Correct 319 ms 158372 KB Output is correct
57 Correct 414 ms 98456 KB Output is correct
58 Correct 428 ms 101408 KB Output is correct
59 Correct 425 ms 101644 KB Output is correct
60 Correct 413 ms 101452 KB Output is correct
61 Correct 415 ms 101544 KB Output is correct
62 Correct 424 ms 101548 KB Output is correct
63 Correct 410 ms 101564 KB Output is correct
64 Correct 301 ms 156304 KB Output is correct
65 Correct 278 ms 156560 KB Output is correct
66 Correct 330 ms 158624 KB Output is correct
67 Correct 295 ms 156796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1342 ms 101048 KB Output is correct
2 Correct 1648 ms 101476 KB Output is correct
3 Correct 1658 ms 101712 KB Output is correct
4 Correct 1588 ms 101600 KB Output is correct
5 Correct 1611 ms 101436 KB Output is correct
6 Correct 1573 ms 101408 KB Output is correct
7 Correct 1663 ms 101584 KB Output is correct
8 Correct 1427 ms 156128 KB Output is correct
9 Correct 1427 ms 156560 KB Output is correct
10 Correct 1348 ms 157392 KB Output is correct
11 Correct 1384 ms 158332 KB Output is correct
12 Correct 1511 ms 158784 KB Output is correct
13 Correct 1438 ms 156736 KB Output is correct
14 Correct 7 ms 14416 KB Output is correct
15 Correct 12 ms 16336 KB Output is correct
16 Correct 11 ms 16444 KB Output is correct
17 Correct 435 ms 101580 KB Output is correct
18 Correct 416 ms 101516 KB Output is correct
19 Correct 430 ms 101500 KB Output is correct
20 Correct 276 ms 156556 KB Output is correct
21 Correct 298 ms 156328 KB Output is correct
22 Correct 432 ms 101564 KB Output is correct
23 Correct 443 ms 101612 KB Output is correct
24 Correct 418 ms 101448 KB Output is correct
25 Correct 293 ms 156712 KB Output is correct
26 Correct 329 ms 158264 KB Output is correct
27 Correct 11 ms 15696 KB Output is correct
28 Correct 11 ms 15696 KB Output is correct
29 Correct 13 ms 15736 KB Output is correct
30 Correct 11 ms 16464 KB Output is correct
31 Correct 11 ms 16464 KB Output is correct
32 Correct 11 ms 15696 KB Output is correct
33 Correct 12 ms 15684 KB Output is correct
34 Correct 12 ms 15696 KB Output is correct
35 Correct 13 ms 16500 KB Output is correct
36 Correct 11 ms 16464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 380 ms 33564 KB Output is correct
2 Correct 1377 ms 101680 KB Output is correct
3 Correct 1442 ms 101636 KB Output is correct
4 Correct 1525 ms 101516 KB Output is correct
5 Correct 1310 ms 101496 KB Output is correct
6 Correct 1526 ms 101496 KB Output is correct
7 Correct 1418 ms 101544 KB Output is correct
8 Correct 1141 ms 156132 KB Output is correct
9 Correct 1187 ms 156804 KB Output is correct
10 Correct 1269 ms 158796 KB Output is correct
11 Correct 1157 ms 159220 KB Output is correct
12 Correct 445 ms 101532 KB Output is correct
13 Correct 425 ms 101432 KB Output is correct
14 Correct 421 ms 101552 KB Output is correct
15 Correct 281 ms 156556 KB Output is correct
16 Correct 353 ms 158380 KB Output is correct
17 Correct 443 ms 98460 KB Output is correct
18 Correct 426 ms 101532 KB Output is correct
19 Correct 475 ms 101716 KB Output is correct
20 Correct 407 ms 101564 KB Output is correct
21 Correct 425 ms 101640 KB Output is correct
22 Correct 415 ms 101484 KB Output is correct
23 Correct 430 ms 101564 KB Output is correct
24 Correct 292 ms 156140 KB Output is correct
25 Correct 296 ms 156592 KB Output is correct
26 Correct 341 ms 158552 KB Output is correct
27 Correct 314 ms 156708 KB Output is correct
28 Correct 12 ms 15696 KB Output is correct
29 Correct 12 ms 15696 KB Output is correct
30 Correct 16 ms 15764 KB Output is correct
31 Correct 12 ms 16464 KB Output is correct
32 Correct 12 ms 16548 KB Output is correct
33 Correct 11 ms 14928 KB Output is correct
34 Correct 13 ms 15660 KB Output is correct
35 Correct 13 ms 15696 KB Output is correct
36 Correct 13 ms 15696 KB Output is correct
37 Correct 15 ms 15652 KB Output is correct
38 Correct 13 ms 15696 KB Output is correct
39 Correct 12 ms 15696 KB Output is correct
40 Correct 11 ms 16464 KB Output is correct
41 Correct 12 ms 16464 KB Output is correct
42 Correct 13 ms 16556 KB Output is correct
43 Correct 12 ms 16464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 14672 KB Output is correct
2 Correct 11 ms 15696 KB Output is correct
3 Correct 11 ms 15696 KB Output is correct
4 Correct 11 ms 15696 KB Output is correct
5 Correct 11 ms 15696 KB Output is correct
6 Correct 11 ms 15696 KB Output is correct
7 Correct 12 ms 15660 KB Output is correct
8 Correct 12 ms 16464 KB Output is correct
9 Correct 14 ms 16468 KB Output is correct
10 Correct 10 ms 16528 KB Output is correct
11 Correct 10 ms 16532 KB Output is correct
12 Correct 7 ms 14416 KB Output is correct
13 Correct 13 ms 16208 KB Output is correct
14 Correct 11 ms 16464 KB Output is correct
15 Correct 11 ms 15704 KB Output is correct
16 Correct 11 ms 15696 KB Output is correct
17 Correct 11 ms 15696 KB Output is correct
18 Correct 11 ms 16464 KB Output is correct
19 Correct 11 ms 16464 KB Output is correct
20 Correct 11 ms 15696 KB Output is correct
21 Correct 13 ms 15704 KB Output is correct
22 Correct 11 ms 15700 KB Output is correct
23 Correct 10 ms 16464 KB Output is correct
24 Correct 10 ms 16484 KB Output is correct
25 Correct 10 ms 14880 KB Output is correct
26 Correct 11 ms 15696 KB Output is correct
27 Correct 11 ms 15768 KB Output is correct
28 Correct 11 ms 15696 KB Output is correct
29 Correct 12 ms 15700 KB Output is correct
30 Correct 11 ms 15696 KB Output is correct
31 Correct 12 ms 15704 KB Output is correct
32 Correct 11 ms 16472 KB Output is correct
33 Correct 15 ms 16468 KB Output is correct
34 Correct 12 ms 16440 KB Output is correct
35 Correct 10 ms 16464 KB Output is correct
36 Correct 264 ms 69292 KB Output is correct
37 Correct 444 ms 101988 KB Output is correct
38 Correct 427 ms 101564 KB Output is correct
39 Correct 425 ms 101512 KB Output is correct
40 Correct 407 ms 101488 KB Output is correct
41 Correct 427 ms 101612 KB Output is correct
42 Correct 415 ms 101672 KB Output is correct
43 Correct 281 ms 156232 KB Output is correct
44 Correct 293 ms 156616 KB Output is correct
45 Correct 329 ms 157988 KB Output is correct
46 Correct 325 ms 157852 KB Output is correct
47 Correct 435 ms 101640 KB Output is correct
48 Correct 428 ms 101564 KB Output is correct
49 Correct 413 ms 101488 KB Output is correct
50 Correct 278 ms 156628 KB Output is correct
51 Correct 286 ms 156284 KB Output is correct
52 Correct 423 ms 101500 KB Output is correct
53 Correct 410 ms 101420 KB Output is correct
54 Correct 415 ms 101544 KB Output is correct
55 Correct 282 ms 156556 KB Output is correct
56 Correct 319 ms 158372 KB Output is correct
57 Correct 414 ms 98456 KB Output is correct
58 Correct 428 ms 101408 KB Output is correct
59 Correct 425 ms 101644 KB Output is correct
60 Correct 413 ms 101452 KB Output is correct
61 Correct 415 ms 101544 KB Output is correct
62 Correct 424 ms 101548 KB Output is correct
63 Correct 410 ms 101564 KB Output is correct
64 Correct 301 ms 156304 KB Output is correct
65 Correct 278 ms 156560 KB Output is correct
66 Correct 330 ms 158624 KB Output is correct
67 Correct 295 ms 156796 KB Output is correct
68 Correct 1342 ms 101048 KB Output is correct
69 Correct 1648 ms 101476 KB Output is correct
70 Correct 1658 ms 101712 KB Output is correct
71 Correct 1588 ms 101600 KB Output is correct
72 Correct 1611 ms 101436 KB Output is correct
73 Correct 1573 ms 101408 KB Output is correct
74 Correct 1663 ms 101584 KB Output is correct
75 Correct 1427 ms 156128 KB Output is correct
76 Correct 1427 ms 156560 KB Output is correct
77 Correct 1348 ms 157392 KB Output is correct
78 Correct 1384 ms 158332 KB Output is correct
79 Correct 1511 ms 158784 KB Output is correct
80 Correct 1438 ms 156736 KB Output is correct
81 Correct 7 ms 14416 KB Output is correct
82 Correct 12 ms 16336 KB Output is correct
83 Correct 11 ms 16444 KB Output is correct
84 Correct 435 ms 101580 KB Output is correct
85 Correct 416 ms 101516 KB Output is correct
86 Correct 430 ms 101500 KB Output is correct
87 Correct 276 ms 156556 KB Output is correct
88 Correct 298 ms 156328 KB Output is correct
89 Correct 432 ms 101564 KB Output is correct
90 Correct 443 ms 101612 KB Output is correct
91 Correct 418 ms 101448 KB Output is correct
92 Correct 293 ms 156712 KB Output is correct
93 Correct 329 ms 158264 KB Output is correct
94 Correct 11 ms 15696 KB Output is correct
95 Correct 11 ms 15696 KB Output is correct
96 Correct 13 ms 15736 KB Output is correct
97 Correct 11 ms 16464 KB Output is correct
98 Correct 11 ms 16464 KB Output is correct
99 Correct 11 ms 15696 KB Output is correct
100 Correct 12 ms 15684 KB Output is correct
101 Correct 12 ms 15696 KB Output is correct
102 Correct 13 ms 16500 KB Output is correct
103 Correct 11 ms 16464 KB Output is correct
104 Correct 1488 ms 91580 KB Output is correct
105 Correct 1658 ms 101436 KB Output is correct
106 Correct 1630 ms 101544 KB Output is correct
107 Correct 1555 ms 101544 KB Output is correct
108 Correct 1564 ms 101720 KB Output is correct
109 Correct 1623 ms 101692 KB Output is correct
110 Correct 1664 ms 101656 KB Output is correct
111 Correct 1164 ms 156152 KB Output is correct
112 Correct 1409 ms 156536 KB Output is correct
113 Correct 1333 ms 159120 KB Output is correct
114 Correct 1466 ms 158260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 774 ms 85592 KB Output is correct
2 Correct 1508 ms 152996 KB Output is correct
3 Correct 1586 ms 154556 KB Output is correct
4 Correct 1548 ms 156144 KB Output is correct
5 Correct 1427 ms 156556 KB Output is correct
6 Correct 1391 ms 158812 KB Output is correct
7 Correct 1401 ms 156540 KB Output is correct
8 Correct 7 ms 14416 KB Output is correct
9 Correct 13 ms 16272 KB Output is correct
10 Correct 10 ms 16440 KB Output is correct
11 Correct 8 ms 14672 KB Output is correct
12 Correct 11 ms 15696 KB Output is correct
13 Correct 11 ms 15696 KB Output is correct
14 Correct 11 ms 15696 KB Output is correct
15 Correct 11 ms 15696 KB Output is correct
16 Correct 11 ms 15696 KB Output is correct
17 Correct 12 ms 15660 KB Output is correct
18 Correct 12 ms 16464 KB Output is correct
19 Correct 14 ms 16468 KB Output is correct
20 Correct 10 ms 16528 KB Output is correct
21 Correct 10 ms 16532 KB Output is correct
22 Correct 7 ms 14416 KB Output is correct
23 Correct 13 ms 16208 KB Output is correct
24 Correct 11 ms 16464 KB Output is correct
25 Correct 11 ms 15704 KB Output is correct
26 Correct 11 ms 15696 KB Output is correct
27 Correct 11 ms 15696 KB Output is correct
28 Correct 11 ms 16464 KB Output is correct
29 Correct 11 ms 16464 KB Output is correct
30 Correct 11 ms 15696 KB Output is correct
31 Correct 13 ms 15704 KB Output is correct
32 Correct 11 ms 15700 KB Output is correct
33 Correct 10 ms 16464 KB Output is correct
34 Correct 10 ms 16484 KB Output is correct
35 Correct 10 ms 14880 KB Output is correct
36 Correct 11 ms 15696 KB Output is correct
37 Correct 11 ms 15768 KB Output is correct
38 Correct 11 ms 15696 KB Output is correct
39 Correct 12 ms 15700 KB Output is correct
40 Correct 11 ms 15696 KB Output is correct
41 Correct 12 ms 15704 KB Output is correct
42 Correct 11 ms 16472 KB Output is correct
43 Correct 15 ms 16468 KB Output is correct
44 Correct 12 ms 16440 KB Output is correct
45 Correct 10 ms 16464 KB Output is correct
46 Correct 264 ms 69292 KB Output is correct
47 Correct 444 ms 101988 KB Output is correct
48 Correct 427 ms 101564 KB Output is correct
49 Correct 425 ms 101512 KB Output is correct
50 Correct 407 ms 101488 KB Output is correct
51 Correct 427 ms 101612 KB Output is correct
52 Correct 415 ms 101672 KB Output is correct
53 Correct 281 ms 156232 KB Output is correct
54 Correct 293 ms 156616 KB Output is correct
55 Correct 329 ms 157988 KB Output is correct
56 Correct 325 ms 157852 KB Output is correct
57 Correct 435 ms 101640 KB Output is correct
58 Correct 428 ms 101564 KB Output is correct
59 Correct 413 ms 101488 KB Output is correct
60 Correct 278 ms 156628 KB Output is correct
61 Correct 286 ms 156284 KB Output is correct
62 Correct 423 ms 101500 KB Output is correct
63 Correct 410 ms 101420 KB Output is correct
64 Correct 415 ms 101544 KB Output is correct
65 Correct 282 ms 156556 KB Output is correct
66 Correct 319 ms 158372 KB Output is correct
67 Correct 414 ms 98456 KB Output is correct
68 Correct 428 ms 101408 KB Output is correct
69 Correct 425 ms 101644 KB Output is correct
70 Correct 413 ms 101452 KB Output is correct
71 Correct 415 ms 101544 KB Output is correct
72 Correct 424 ms 101548 KB Output is correct
73 Correct 410 ms 101564 KB Output is correct
74 Correct 301 ms 156304 KB Output is correct
75 Correct 278 ms 156560 KB Output is correct
76 Correct 330 ms 158624 KB Output is correct
77 Correct 295 ms 156796 KB Output is correct
78 Correct 1342 ms 101048 KB Output is correct
79 Correct 1648 ms 101476 KB Output is correct
80 Correct 1658 ms 101712 KB Output is correct
81 Correct 1588 ms 101600 KB Output is correct
82 Correct 1611 ms 101436 KB Output is correct
83 Correct 1573 ms 101408 KB Output is correct
84 Correct 1663 ms 101584 KB Output is correct
85 Correct 1427 ms 156128 KB Output is correct
86 Correct 1427 ms 156560 KB Output is correct
87 Correct 1348 ms 157392 KB Output is correct
88 Correct 1384 ms 158332 KB Output is correct
89 Correct 1511 ms 158784 KB Output is correct
90 Correct 1438 ms 156736 KB Output is correct
91 Correct 7 ms 14416 KB Output is correct
92 Correct 12 ms 16336 KB Output is correct
93 Correct 11 ms 16444 KB Output is correct
94 Correct 435 ms 101580 KB Output is correct
95 Correct 416 ms 101516 KB Output is correct
96 Correct 430 ms 101500 KB Output is correct
97 Correct 276 ms 156556 KB Output is correct
98 Correct 298 ms 156328 KB Output is correct
99 Correct 432 ms 101564 KB Output is correct
100 Correct 443 ms 101612 KB Output is correct
101 Correct 418 ms 101448 KB Output is correct
102 Correct 293 ms 156712 KB Output is correct
103 Correct 329 ms 158264 KB Output is correct
104 Correct 11 ms 15696 KB Output is correct
105 Correct 11 ms 15696 KB Output is correct
106 Correct 13 ms 15736 KB Output is correct
107 Correct 11 ms 16464 KB Output is correct
108 Correct 11 ms 16464 KB Output is correct
109 Correct 11 ms 15696 KB Output is correct
110 Correct 12 ms 15684 KB Output is correct
111 Correct 12 ms 15696 KB Output is correct
112 Correct 13 ms 16500 KB Output is correct
113 Correct 11 ms 16464 KB Output is correct
114 Correct 380 ms 33564 KB Output is correct
115 Correct 1377 ms 101680 KB Output is correct
116 Correct 1442 ms 101636 KB Output is correct
117 Correct 1525 ms 101516 KB Output is correct
118 Correct 1310 ms 101496 KB Output is correct
119 Correct 1526 ms 101496 KB Output is correct
120 Correct 1418 ms 101544 KB Output is correct
121 Correct 1141 ms 156132 KB Output is correct
122 Correct 1187 ms 156804 KB Output is correct
123 Correct 1269 ms 158796 KB Output is correct
124 Correct 1157 ms 159220 KB Output is correct
125 Correct 445 ms 101532 KB Output is correct
126 Correct 425 ms 101432 KB Output is correct
127 Correct 421 ms 101552 KB Output is correct
128 Correct 281 ms 156556 KB Output is correct
129 Correct 353 ms 158380 KB Output is correct
130 Correct 443 ms 98460 KB Output is correct
131 Correct 426 ms 101532 KB Output is correct
132 Correct 475 ms 101716 KB Output is correct
133 Correct 407 ms 101564 KB Output is correct
134 Correct 425 ms 101640 KB Output is correct
135 Correct 415 ms 101484 KB Output is correct
136 Correct 430 ms 101564 KB Output is correct
137 Correct 292 ms 156140 KB Output is correct
138 Correct 296 ms 156592 KB Output is correct
139 Correct 341 ms 158552 KB Output is correct
140 Correct 314 ms 156708 KB Output is correct
141 Correct 12 ms 15696 KB Output is correct
142 Correct 12 ms 15696 KB Output is correct
143 Correct 16 ms 15764 KB Output is correct
144 Correct 12 ms 16464 KB Output is correct
145 Correct 12 ms 16548 KB Output is correct
146 Correct 11 ms 14928 KB Output is correct
147 Correct 13 ms 15660 KB Output is correct
148 Correct 13 ms 15696 KB Output is correct
149 Correct 13 ms 15696 KB Output is correct
150 Correct 15 ms 15652 KB Output is correct
151 Correct 13 ms 15696 KB Output is correct
152 Correct 12 ms 15696 KB Output is correct
153 Correct 11 ms 16464 KB Output is correct
154 Correct 12 ms 16464 KB Output is correct
155 Correct 13 ms 16556 KB Output is correct
156 Correct 12 ms 16464 KB Output is correct
157 Correct 1488 ms 91580 KB Output is correct
158 Correct 1658 ms 101436 KB Output is correct
159 Correct 1630 ms 101544 KB Output is correct
160 Correct 1555 ms 101544 KB Output is correct
161 Correct 1564 ms 101720 KB Output is correct
162 Correct 1623 ms 101692 KB Output is correct
163 Correct 1664 ms 101656 KB Output is correct
164 Correct 1164 ms 156152 KB Output is correct
165 Correct 1409 ms 156536 KB Output is correct
166 Correct 1333 ms 159120 KB Output is correct
167 Correct 1466 ms 158260 KB Output is correct
168 Correct 7 ms 14416 KB Output is correct
169 Correct 989 ms 42948 KB Output is correct
170 Correct 1867 ms 101808 KB Output is correct
171 Correct 1933 ms 101516 KB Output is correct
172 Correct 1776 ms 101568 KB Output is correct
173 Correct 2100 ms 101488 KB Output is correct
174 Correct 2092 ms 101668 KB Output is correct
175 Correct 1983 ms 101812 KB Output is correct
176 Correct 1340 ms 156304 KB Output is correct
177 Correct 1487 ms 156696 KB Output is correct
178 Correct 1268 ms 159456 KB Output is correct
179 Correct 1434 ms 158344 KB Output is correct