Submission #566572

# Submission time Handle Problem Language Result Execution time Memory
566572 2022-05-22T12:24:23 Z kartel Fountain Parks (IOI21_parks) C++17
100 / 100
1562 ms 128528 KB
#include <bits/stdc++.h>
//#include "grader.cpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "parks.h"
#define F first
#define S second
#define pb push_back
#define sz(x) (int)x.size()
#define el "\n"
#define all(x) (x).begin(), (x).end()

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;

const int N = 2e5 + 500;

mt19937 rnd(time(0));

const int steps[4][2] = {{0, 2}, {2, 0}, {0, -2}, {-2, 0}};
const int dsteps[4][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};

pair <int, int> road[10][10];

pair <int, int> block[N * 2];
int pr[N];
int cmp[2 * N], to[2 * N];
vector <int> g[2 * N], gr[2 * N], ord;
bool mk[2 * N];

int f(int v) {return (pr[v] == v ? v : pr[v] = f(pr[v]));}
void link(int v, int u) {
    v = f(v); u = f(u);
    if (v == u) {
        return;
    }
    pr[u] = v;
}

int nt(int x) {return (x < N ? x + N : x - N);}

void add_impl(int a, int b) {
    int na = nt(a), nb = nt(b);

    g[na].pb(b); gr[b].pb(na);
    g[nb].pb(a); gr[a].pb(nb);
}

void dfs(int v) {
    mk[v] = 1;
    for (auto &u : g[v]) {
        if (mk[u]) {
            continue;
        }
        dfs(u);
    }
    ord.pb(v);
}
vector <pair <int, int> > pts;

void dfsd(int v) {
    mk[v] = 1;
    for (auto &u : g[v]) {
        if (mk[u]) {
            continue;
        }
        int dx = pts[v].F - pts[u].F;
        int dy = pts[v].S - pts[u].S;
        block[u] = road[dx + 4][dy + 4];
        dfsd(u);
    }
}

inline ll geth(int a, int b) {return ((ll)a << 20) + b;}

void get_erased_2x2(vector <int> &x, vector <int> &y, unordered_map<ll, int> &del) {
    unordered_map <ll, int> cnt, who;

    for (int i = 0; i < sz(x); i++) {
        who[geth(x[i], y[i])] = i;
        for (int j = 0; j < 4; j++) {
            int cx = x[i] + dsteps[j][0];
            int cy = y[i] + dsteps[j][1];

            cnt[geth(cx, cy)]++;
            if (cnt[geth(cx, cy)] == 4) {
                pts.pb({cx, cy});
            }
        }
    }
    sort(all(pts));
    cnt.clear();
    int ptr = 0;
    for (auto &[x, y] : pts) {
        cnt[geth(x, y)] = ptr++;
    }

    ptr = 0;
    for (auto &[x, y] : pts) {
        int par = (x / 2 + y / 2) % 2;
        for (int i = 0; i < 2; i++) {
            int cx = x + steps[i * 2 + par][0];
            int cy = y + steps[i * 2 + par][1];

            if (cnt.find(geth(cx, cy)) == cnt.end()) {
                continue;
            }
            g[cnt[geth(cx, cy)]].pb(ptr);
        }
        ptr++;
    }

    queue <int> q;
    for (int i = 0; i < sz(pts); i++) {
        if (mk[i]) {
            continue;
        }

        int par = (pts[i].F / 2 + pts[i].S / 2) & 1;
        if (par & 1) {
            block[i] = road[-2 + 4][0 + 4];
        } else {
            block[i] = road[0 + 4][-2 + 4];
        }
        dfsd(i);
    }

    for (int i = 0; i < sz(pts); i++) {
        auto &[x, y] = pts[i];

        auto &[a, b] = block[i];
        int v = who[geth(x + dsteps[a][0], y + dsteps[a][1])];
        int u = who[geth(x + dsteps[b][0], y + dsteps[b][1])];

        del[geth(v, u)] = del[geth(u, v)] = 1;
    }
}

int construct_roads(vector <int> x, vector <int> y) {
    int n = sz(x);

    road[0 + 4][2 + 4]  = {2, 0}; road[2 + 4][0 + 4]  = {0, 1};
    road[0 + 4][-2 + 4] = {1, 3}; road[-2 + 4][0 + 4] = {3, 2};

    unordered_map <ll, int> mp;
    vector <pair <int, int> > r;
    unordered_map <ll, int> del;

    bool sd = 1;
    for (int i = 0; i < n; i++) {
        mp[geth(x[i], y[i])] = i;
        pr[i] = i;
        sd &= (x[i] >= 2 && x[i] <= 4);
    }

    get_erased_2x2(x, y, del);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 4; j++) {
            int cx = x[i] + steps[j][0];
            int cy = y[i] + steps[j][1];

            if (mp.find(geth(cx, cy)) != mp.end() && f(i) != f(mp[geth(cx, cy)])) {
                int to = mp[geth(cx, cy)];
                if (del.find(geth(i, to)) != del.end()) {
                    continue;
                }
                link(i, to);
                r.pb({i, to});
            }
        }
    }
    sort(all(r));
    r.resize(unique(all(r)) - r.begin());

    for (int i = 0; i < n; i++) {
        if (f(i) != f(0)) {
            return 0;
        }
    }
    vector <int> u, v, A, B;
    unordered_map <ll, vector <int> > e;

    for (int i = 0; i < sz(r); i++) {
        int a = r[i].F, b = r[i].S;
        u.pb(a); v.pb(b);
        if (abs(x[a] - x[b]) == 0) {
            int lx = x[a];
            int ly = min(y[a], y[b]);

            e[geth(lx - 1, ly + 1)].pb(i);
            e[geth(lx + 1, ly + 1)].pb(nt(i));
        } else {
            int lx = min(x[a], x[b]);
            int ly = y[a];

            e[geth(lx + 1, ly + 1)].pb(i);
            e[geth(lx + 1, ly - 1)].pb(nt(i));
        }
    }
    for (int i = 0; i < 2 * N; i++) {
        mk[i] = 0;
        g[i].clear();
    }
    for (auto &[p, v] : e) {
        if (sz(v) == 1) {
            continue;
        }
        for (auto &a : v) {
            for (auto &b : v) {
                if (a == b) {
                    continue;
                }
                add_impl(a, b);
            }
        }
    }

    for (int i = 0; i < 2 * N; i++) {
        cmp[i] = -1;
        if (mk[i]) {
            continue;
        }
        dfs(i);
    }
    reverse(all(ord));

    int C = 0;
    for (auto v : ord) {
        function <void(int)> dfsr = [&](int v) {
            if (cmp[v] != -1) {
                return;
            }
            cmp[v] = C;
            for (auto u : gr[v]) {
                dfsr(u);
            }
        };

        dfsr(v);
        C++;
    }

    for (int i = 0; i < N; i++) {
        if (cmp[i] == cmp[nt(i)]) {
            return 0;
        }
        to[i] = (cmp[i] > cmp[nt(i)]);
    }

    for (int i = 0; i < sz(r); i++) {
        int a = r[i].F, b = r[i].S;
        if (abs(x[a] - x[b]) == 0) {
            int lx = x[a];
            int ly = min(y[a], y[b]);

            if (to[i]) {
                A.pb(lx + 1);
            } else {
                A.pb(lx - 1);
            }
            B.pb(ly + 1);
        } else {
            int lx = min(x[a], x[b]);
            int ly = y[a];

            if (to[i]) {
                B.pb(ly - 1);
            } else {
                B.pb(ly + 1);
            }
            A.pb(lx + 1);
        }
    }

    build(u, v, A, B);
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
17 Correct 19 ms 23512 KB Output is correct
18 Correct 17 ms 23620 KB Output is correct
19 Correct 17 ms 23620 KB Output is correct
20 Correct 18 ms 23620 KB Output is correct
21 Correct 10 ms 19156 KB Output is correct
22 Correct 20 ms 23620 KB Output is correct
23 Correct 1285 ms 97892 KB Output is correct
24 Correct 17 ms 23620 KB Output is correct
25 Correct 23 ms 24004 KB Output is correct
26 Correct 13 ms 19724 KB Output is correct
27 Correct 17 ms 19956 KB Output is correct
28 Correct 367 ms 53352 KB Output is correct
29 Correct 686 ms 67536 KB Output is correct
30 Correct 979 ms 82636 KB Output is correct
31 Correct 1333 ms 97876 KB Output is correct
32 Correct 19 ms 23492 KB Output is correct
33 Correct 17 ms 23492 KB Output is correct
34 Correct 19 ms 23536 KB Output is correct
35 Correct 12 ms 19108 KB Output is correct
36 Correct 11 ms 19156 KB Output is correct
37 Correct 17 ms 23492 KB Output is correct
38 Correct 18 ms 23492 KB Output is correct
39 Correct 18 ms 23484 KB Output is correct
40 Correct 18 ms 23600 KB Output is correct
41 Correct 11 ms 19124 KB Output is correct
42 Correct 17 ms 23488 KB Output is correct
43 Correct 11 ms 19432 KB Output is correct
44 Correct 13 ms 19672 KB Output is correct
45 Correct 366 ms 56432 KB Output is correct
46 Correct 602 ms 72236 KB Output is correct
47 Correct 623 ms 71600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
17 Correct 19 ms 23512 KB Output is correct
18 Correct 17 ms 23620 KB Output is correct
19 Correct 17 ms 23620 KB Output is correct
20 Correct 18 ms 23620 KB Output is correct
21 Correct 10 ms 19156 KB Output is correct
22 Correct 20 ms 23620 KB Output is correct
23 Correct 1285 ms 97892 KB Output is correct
24 Correct 17 ms 23620 KB Output is correct
25 Correct 23 ms 24004 KB Output is correct
26 Correct 13 ms 19724 KB Output is correct
27 Correct 17 ms 19956 KB Output is correct
28 Correct 367 ms 53352 KB Output is correct
29 Correct 686 ms 67536 KB Output is correct
30 Correct 979 ms 82636 KB Output is correct
31 Correct 1333 ms 97876 KB Output is correct
32 Correct 19 ms 23492 KB Output is correct
33 Correct 17 ms 23492 KB Output is correct
34 Correct 19 ms 23536 KB Output is correct
35 Correct 12 ms 19108 KB Output is correct
36 Correct 11 ms 19156 KB Output is correct
37 Correct 17 ms 23492 KB Output is correct
38 Correct 18 ms 23492 KB Output is correct
39 Correct 18 ms 23484 KB Output is correct
40 Correct 18 ms 23600 KB Output is correct
41 Correct 11 ms 19124 KB Output is correct
42 Correct 17 ms 23488 KB Output is correct
43 Correct 11 ms 19432 KB Output is correct
44 Correct 13 ms 19672 KB Output is correct
45 Correct 366 ms 56432 KB Output is correct
46 Correct 602 ms 72236 KB Output is correct
47 Correct 623 ms 71600 KB Output is correct
48 Correct 17 ms 23620 KB Output is correct
49 Correct 17 ms 23524 KB Output is correct
50 Correct 17 ms 23596 KB Output is correct
51 Correct 17 ms 23608 KB Output is correct
52 Correct 18 ms 23544 KB Output is correct
53 Correct 17 ms 23620 KB Output is correct
54 Correct 18 ms 23588 KB Output is correct
55 Correct 1444 ms 114368 KB Output is correct
56 Correct 17 ms 23492 KB Output is correct
57 Correct 20 ms 24348 KB Output is correct
58 Correct 33 ms 26220 KB Output is correct
59 Correct 28 ms 21464 KB Output is correct
60 Correct 517 ms 68532 KB Output is correct
61 Correct 845 ms 86296 KB Output is correct
62 Correct 1123 ms 98260 KB Output is correct
63 Correct 1450 ms 113584 KB Output is correct
64 Correct 10 ms 19156 KB Output is correct
65 Correct 17 ms 23492 KB Output is correct
66 Correct 10 ms 19132 KB Output is correct
67 Correct 926 ms 86028 KB Output is correct
68 Correct 1010 ms 86036 KB Output is correct
69 Correct 927 ms 85932 KB Output is correct
70 Correct 13 ms 19772 KB Output is correct
71 Correct 18 ms 20564 KB Output is correct
72 Correct 397 ms 56604 KB Output is correct
73 Correct 720 ms 74636 KB Output is correct
74 Correct 1060 ms 88728 KB Output is correct
75 Correct 960 ms 87568 KB Output is correct
76 Correct 958 ms 86036 KB Output is correct
77 Correct 15 ms 19924 KB Output is correct
78 Correct 20 ms 20692 KB Output is correct
79 Correct 370 ms 56484 KB Output is correct
80 Correct 687 ms 73280 KB Output is correct
81 Correct 1077 ms 88524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
17 Correct 17 ms 23584 KB Output is correct
18 Correct 17 ms 23592 KB Output is correct
19 Correct 10 ms 19124 KB Output is correct
20 Correct 1028 ms 98972 KB Output is correct
21 Correct 1006 ms 94560 KB Output is correct
22 Correct 1099 ms 94924 KB Output is correct
23 Correct 605 ms 74252 KB Output is correct
24 Correct 477 ms 80148 KB Output is correct
25 Correct 490 ms 59492 KB Output is correct
26 Correct 511 ms 59508 KB Output is correct
27 Correct 831 ms 85976 KB Output is correct
28 Correct 820 ms 85980 KB Output is correct
29 Correct 760 ms 86040 KB Output is correct
30 Correct 754 ms 86008 KB Output is correct
31 Correct 18 ms 23492 KB Output is correct
32 Correct 51 ms 28108 KB Output is correct
33 Correct 145 ms 42128 KB Output is correct
34 Correct 911 ms 98024 KB Output is correct
35 Correct 20 ms 20820 KB Output is correct
36 Correct 81 ms 27932 KB Output is correct
37 Correct 200 ms 36764 KB Output is correct
38 Correct 337 ms 51100 KB Output is correct
39 Correct 497 ms 60284 KB Output is correct
40 Correct 652 ms 71244 KB Output is correct
41 Correct 887 ms 81136 KB Output is correct
42 Correct 1033 ms 91768 KB Output is correct
43 Correct 18 ms 23492 KB Output is correct
44 Correct 18 ms 23612 KB Output is correct
45 Correct 19 ms 23584 KB Output is correct
46 Correct 12 ms 19156 KB Output is correct
47 Correct 11 ms 19156 KB Output is correct
48 Correct 18 ms 23568 KB Output is correct
49 Correct 19 ms 23592 KB Output is correct
50 Correct 17 ms 23580 KB Output is correct
51 Correct 17 ms 23492 KB Output is correct
52 Correct 11 ms 19156 KB Output is correct
53 Correct 18 ms 23544 KB Output is correct
54 Correct 13 ms 19536 KB Output is correct
55 Correct 13 ms 19668 KB Output is correct
56 Correct 353 ms 56368 KB Output is correct
57 Correct 642 ms 72196 KB Output is correct
58 Correct 655 ms 71628 KB Output is correct
59 Correct 11 ms 19160 KB Output is correct
60 Correct 19 ms 23492 KB Output is correct
61 Correct 13 ms 19136 KB Output is correct
62 Correct 937 ms 86132 KB Output is correct
63 Correct 923 ms 85988 KB Output is correct
64 Correct 976 ms 85896 KB Output is correct
65 Correct 15 ms 19864 KB Output is correct
66 Correct 18 ms 20596 KB Output is correct
67 Correct 374 ms 56660 KB Output is correct
68 Correct 719 ms 74608 KB Output is correct
69 Correct 1084 ms 88716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
17 Correct 856 ms 85544 KB Output is correct
18 Correct 889 ms 85696 KB Output is correct
19 Correct 1016 ms 98624 KB Output is correct
20 Correct 930 ms 88684 KB Output is correct
21 Correct 693 ms 79224 KB Output is correct
22 Correct 17 ms 23596 KB Output is correct
23 Correct 93 ms 33732 KB Output is correct
24 Correct 34 ms 22448 KB Output is correct
25 Correct 108 ms 30832 KB Output is correct
26 Correct 209 ms 40684 KB Output is correct
27 Correct 389 ms 57200 KB Output is correct
28 Correct 534 ms 64980 KB Output is correct
29 Correct 704 ms 76052 KB Output is correct
30 Correct 831 ms 83328 KB Output is correct
31 Correct 952 ms 90776 KB Output is correct
32 Correct 953 ms 87576 KB Output is correct
33 Correct 906 ms 86012 KB Output is correct
34 Correct 15 ms 19924 KB Output is correct
35 Correct 20 ms 20692 KB Output is correct
36 Correct 384 ms 56580 KB Output is correct
37 Correct 761 ms 73248 KB Output is correct
38 Correct 1205 ms 88540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 23492 KB Output is correct
2 Correct 17 ms 23500 KB Output is correct
3 Correct 10 ms 19156 KB Output is correct
4 Correct 19 ms 23492 KB Output is correct
5 Correct 19 ms 23536 KB Output is correct
6 Correct 13 ms 19156 KB Output is correct
7 Correct 10 ms 19156 KB Output is correct
8 Correct 12 ms 19104 KB Output is correct
9 Correct 343 ms 54896 KB Output is correct
10 Correct 39 ms 26500 KB Output is correct
11 Correct 88 ms 39896 KB Output is correct
12 Correct 35 ms 28040 KB Output is correct
13 Correct 38 ms 29020 KB Output is correct
14 Correct 11 ms 19284 KB Output is correct
15 Correct 12 ms 19452 KB Output is correct
16 Correct 332 ms 54884 KB Output is correct
17 Correct 19 ms 23512 KB Output is correct
18 Correct 17 ms 23620 KB Output is correct
19 Correct 17 ms 23620 KB Output is correct
20 Correct 18 ms 23620 KB Output is correct
21 Correct 10 ms 19156 KB Output is correct
22 Correct 20 ms 23620 KB Output is correct
23 Correct 1285 ms 97892 KB Output is correct
24 Correct 17 ms 23620 KB Output is correct
25 Correct 23 ms 24004 KB Output is correct
26 Correct 13 ms 19724 KB Output is correct
27 Correct 17 ms 19956 KB Output is correct
28 Correct 367 ms 53352 KB Output is correct
29 Correct 686 ms 67536 KB Output is correct
30 Correct 979 ms 82636 KB Output is correct
31 Correct 1333 ms 97876 KB Output is correct
32 Correct 19 ms 23492 KB Output is correct
33 Correct 17 ms 23492 KB Output is correct
34 Correct 19 ms 23536 KB Output is correct
35 Correct 12 ms 19108 KB Output is correct
36 Correct 11 ms 19156 KB Output is correct
37 Correct 17 ms 23492 KB Output is correct
38 Correct 18 ms 23492 KB Output is correct
39 Correct 18 ms 23484 KB Output is correct
40 Correct 18 ms 23600 KB Output is correct
41 Correct 11 ms 19124 KB Output is correct
42 Correct 17 ms 23488 KB Output is correct
43 Correct 11 ms 19432 KB Output is correct
44 Correct 13 ms 19672 KB Output is correct
45 Correct 366 ms 56432 KB Output is correct
46 Correct 602 ms 72236 KB Output is correct
47 Correct 623 ms 71600 KB Output is correct
48 Correct 17 ms 23620 KB Output is correct
49 Correct 17 ms 23524 KB Output is correct
50 Correct 17 ms 23596 KB Output is correct
51 Correct 17 ms 23608 KB Output is correct
52 Correct 18 ms 23544 KB Output is correct
53 Correct 17 ms 23620 KB Output is correct
54 Correct 18 ms 23588 KB Output is correct
55 Correct 1444 ms 114368 KB Output is correct
56 Correct 17 ms 23492 KB Output is correct
57 Correct 20 ms 24348 KB Output is correct
58 Correct 33 ms 26220 KB Output is correct
59 Correct 28 ms 21464 KB Output is correct
60 Correct 517 ms 68532 KB Output is correct
61 Correct 845 ms 86296 KB Output is correct
62 Correct 1123 ms 98260 KB Output is correct
63 Correct 1450 ms 113584 KB Output is correct
64 Correct 10 ms 19156 KB Output is correct
65 Correct 17 ms 23492 KB Output is correct
66 Correct 10 ms 19132 KB Output is correct
67 Correct 926 ms 86028 KB Output is correct
68 Correct 1010 ms 86036 KB Output is correct
69 Correct 927 ms 85932 KB Output is correct
70 Correct 13 ms 19772 KB Output is correct
71 Correct 18 ms 20564 KB Output is correct
72 Correct 397 ms 56604 KB Output is correct
73 Correct 720 ms 74636 KB Output is correct
74 Correct 1060 ms 88728 KB Output is correct
75 Correct 960 ms 87568 KB Output is correct
76 Correct 958 ms 86036 KB Output is correct
77 Correct 15 ms 19924 KB Output is correct
78 Correct 20 ms 20692 KB Output is correct
79 Correct 370 ms 56484 KB Output is correct
80 Correct 687 ms 73280 KB Output is correct
81 Correct 1077 ms 88524 KB Output is correct
82 Correct 17 ms 23584 KB Output is correct
83 Correct 17 ms 23592 KB Output is correct
84 Correct 10 ms 19124 KB Output is correct
85 Correct 1028 ms 98972 KB Output is correct
86 Correct 1006 ms 94560 KB Output is correct
87 Correct 1099 ms 94924 KB Output is correct
88 Correct 605 ms 74252 KB Output is correct
89 Correct 477 ms 80148 KB Output is correct
90 Correct 490 ms 59492 KB Output is correct
91 Correct 511 ms 59508 KB Output is correct
92 Correct 831 ms 85976 KB Output is correct
93 Correct 820 ms 85980 KB Output is correct
94 Correct 760 ms 86040 KB Output is correct
95 Correct 754 ms 86008 KB Output is correct
96 Correct 18 ms 23492 KB Output is correct
97 Correct 51 ms 28108 KB Output is correct
98 Correct 145 ms 42128 KB Output is correct
99 Correct 911 ms 98024 KB Output is correct
100 Correct 20 ms 20820 KB Output is correct
101 Correct 81 ms 27932 KB Output is correct
102 Correct 200 ms 36764 KB Output is correct
103 Correct 337 ms 51100 KB Output is correct
104 Correct 497 ms 60284 KB Output is correct
105 Correct 652 ms 71244 KB Output is correct
106 Correct 887 ms 81136 KB Output is correct
107 Correct 1033 ms 91768 KB Output is correct
108 Correct 18 ms 23492 KB Output is correct
109 Correct 18 ms 23612 KB Output is correct
110 Correct 19 ms 23584 KB Output is correct
111 Correct 12 ms 19156 KB Output is correct
112 Correct 11 ms 19156 KB Output is correct
113 Correct 18 ms 23568 KB Output is correct
114 Correct 19 ms 23592 KB Output is correct
115 Correct 17 ms 23580 KB Output is correct
116 Correct 17 ms 23492 KB Output is correct
117 Correct 11 ms 19156 KB Output is correct
118 Correct 18 ms 23544 KB Output is correct
119 Correct 13 ms 19536 KB Output is correct
120 Correct 13 ms 19668 KB Output is correct
121 Correct 353 ms 56368 KB Output is correct
122 Correct 642 ms 72196 KB Output is correct
123 Correct 655 ms 71628 KB Output is correct
124 Correct 11 ms 19160 KB Output is correct
125 Correct 19 ms 23492 KB Output is correct
126 Correct 13 ms 19136 KB Output is correct
127 Correct 937 ms 86132 KB Output is correct
128 Correct 923 ms 85988 KB Output is correct
129 Correct 976 ms 85896 KB Output is correct
130 Correct 15 ms 19864 KB Output is correct
131 Correct 18 ms 20596 KB Output is correct
132 Correct 374 ms 56660 KB Output is correct
133 Correct 719 ms 74608 KB Output is correct
134 Correct 1084 ms 88716 KB Output is correct
135 Correct 856 ms 85544 KB Output is correct
136 Correct 889 ms 85696 KB Output is correct
137 Correct 1016 ms 98624 KB Output is correct
138 Correct 930 ms 88684 KB Output is correct
139 Correct 693 ms 79224 KB Output is correct
140 Correct 17 ms 23596 KB Output is correct
141 Correct 93 ms 33732 KB Output is correct
142 Correct 34 ms 22448 KB Output is correct
143 Correct 108 ms 30832 KB Output is correct
144 Correct 209 ms 40684 KB Output is correct
145 Correct 389 ms 57200 KB Output is correct
146 Correct 534 ms 64980 KB Output is correct
147 Correct 704 ms 76052 KB Output is correct
148 Correct 831 ms 83328 KB Output is correct
149 Correct 952 ms 90776 KB Output is correct
150 Correct 953 ms 87576 KB Output is correct
151 Correct 906 ms 86012 KB Output is correct
152 Correct 15 ms 19924 KB Output is correct
153 Correct 20 ms 20692 KB Output is correct
154 Correct 384 ms 56580 KB Output is correct
155 Correct 761 ms 73248 KB Output is correct
156 Correct 1205 ms 88540 KB Output is correct
157 Correct 17 ms 23496 KB Output is correct
158 Correct 10 ms 19156 KB Output is correct
159 Correct 18 ms 23496 KB Output is correct
160 Correct 18 ms 23620 KB Output is correct
161 Correct 1562 ms 128528 KB Output is correct
162 Correct 899 ms 97008 KB Output is correct
163 Correct 1110 ms 98092 KB Output is correct
164 Correct 1301 ms 97132 KB Output is correct
165 Correct 1460 ms 113036 KB Output is correct
166 Correct 1274 ms 118956 KB Output is correct
167 Correct 198 ms 42656 KB Output is correct
168 Correct 66 ms 27972 KB Output is correct
169 Correct 255 ms 40484 KB Output is correct
170 Correct 517 ms 58740 KB Output is correct
171 Correct 795 ms 77956 KB Output is correct
172 Correct 582 ms 72160 KB Output is correct
173 Correct 766 ms 80768 KB Output is correct
174 Correct 974 ms 89172 KB Output is correct
175 Correct 1088 ms 98036 KB Output is correct
176 Correct 1244 ms 112792 KB Output is correct
177 Correct 1387 ms 121732 KB Output is correct