Submission #1069272

# Submission time Handle Problem Language Result Execution time Memory
1069272 2024-08-21T18:37:08 Z juicy IOI Fever (JOI21_fever) C++17
100 / 100
2436 ms 94816 KB
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif

const int N = 1e5 + 5, inf = 1e9 + 7;
const int U = 0, R = 1, D = 2, L = 3;
const int RU = 4, RD = 5, LD = 6, LU = 7;

int n, cnt;
int x[N], y[N], dir[N], ord[N];
array<int, 8> d[N];
bool vis[N];
array<map<int, vector<int>>, 8> mp;
priority_queue<array<int, 3>, vector<array<int, 3>>, greater<array<int, 3>>> pq;

void psh(int u, int dr, int c) {
    if (d[u][dr] > c) {
        pq.push({d[u][dr] = c, u, dr});
    }
}

int lower(vector<int> &cands, int x, int *a) {
    int l = 0, r = cands.size() - 1, p = cands.size();
    while (l <= r) {
        int md = (l + r) / 2;
        if (a[cands[md]] <= x) {
            p = md;
            r = md - 1;
        } else {
            l = md + 1;
        }
    }
    return p;
}

int higher(vector<int> &cands, int x, int *a) {
    int l = 0, r = cands.size() - 1, p = cands.size();
    while (l <= r) {
        int md = (l + r) / 2;
        if (x <= a[cands[md]]) {
            p = md;
            r = md - 1;
        } else {
            l = md + 1;;
        }
    }
    return p;
} 

void solve(int u, int dr) {
    for (int i = 0; i < 8; ++i) {
        bool valid = !vis[u], pos;
        int k;
        if (i < 4) {
            valid &= i == dir[u];
            pos = i < 2;
            k = i % 2 == 0 ? x[u] : y[u];
        } else {
            valid &= i - 4 == dir[u] || (i - 4 + 1) % 4 == dir[u];
            pos = i < 6;
            k = i % 2 == 0 ? x[u] - y[u] : x[u] + y[u]; 
        }
        auto &cands = mp[i][k];
        int *a = i == U || i == D ? y : x;
        int v = i < 4 ? 1 : 2;
        if (i == dr) {
            auto it = (pos ? higher(cands, a[u], a) : lower(cands, a[u], a)) + 1;
            if (it < cands.size()) {
                psh(cands[it], dr, d[u][dr] + v * abs(a[cands[it]] - a[u]));
            }
        }
        if (valid) {
            int cur = dr == -1 ? 0 : (v == 1 ? d[u][dr] : (d[u][dr] + 1) / 2);
            int it;
            if (pos) {
                it = higher(cands, a[u] + cur, a);
            } else {
                it = lower(cands, a[u] - cur, a);
            }
            if (it < cands.size()) {
                psh(cands[it], i, v * abs(a[cands[it]] - a[u]));
            }
        }
    }
    if (!vis[u]) {
        vis[u] = 1;
        ++cnt;
    }
}

void init() {
    for (int j = 0; j < 8; ++j) {
        map<int, vector<int>>().swap(mp[j]);
    }
    dir[1] = 1;
    for (int i = 1; i <= n; ++i) {
        if (i > 1) {
            if (abs(x[i] - x[1]) > abs(y[i] - y[1])) {
                dir[i] = x[i] < x[1] ? R : L;
            } else if (abs(y[i] - y[1]) > abs(x[i] - x[1])) {
                dir[i] = y[i] < y[1] ? U : D;
            } else {
                if (x[i] < x[1]) {
                    dir[i] = R;
                } else {
                    dir[i] = y[i] < y[1] ? U : D;
                }
            }
        }
        vis[i] = 0;
        for (int j = 0; j < 8; ++j) {
            d[i][j] = inf;
        }
    }
    sort(ord + 1, ord + n + 1, [&](int i, int j) {
        return tie(x[i], y[i]) < tie(x[j], y[j]);
    });
    for (int i = 1; i <= n; ++i) {
        int u = ord[i];
        mp[U][x[u]].push_back(u);
        mp[R][y[u]].push_back(u);
        mp[RU][x[u] - y[u]].push_back(u);
        mp[RD][x[u] + y[u]].push_back(u);
    }
    for (int i = n; i; --i) {
        int u = ord[i];
        mp[D][x[u]].push_back(u);
        mp[L][y[u]].push_back(u);
        mp[LD][x[u] - y[u]].push_back(u);
        mp[LU][x[u] + y[u]].push_back(u);
    }
}

int qry() {
    init();
    cnt = 0;
    solve(1, -1);
    while (pq.size()) {
        auto [c, u, dr] = pq.top(); pq.pop();
        if (d[u][dr] != c) {
            continue;
        }
        solve(u, dr);
    }
    return cnt;
}

void rot() {
    for (int i = 1; i <= n; ++i) {
        swap(x[i], y[i]);
        x[i] *= -1;
    }
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> x[i] >> y[i];
    } 
    iota(ord + 1, ord + n + 1, 1);
    int res = 0;
    for (int i = 0; i < 4; ++i) {
        res = max(res, qry());
        rot();
    }
    cout << res;
    return 0;
}

Compilation message

fever.cpp: In function 'void solve(int, int)':
fever.cpp:74:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   74 |             if (it < cands.size()) {
      |                 ~~~^~~~~~~~~~~~~~
fever.cpp:86:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |             if (it < cands.size()) {
      |                 ~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 1 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 1 ms 2396 KB Output is correct
37 Correct 1 ms 2392 KB Output is correct
38 Correct 1 ms 2512 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 1 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 1 ms 2396 KB Output is correct
43 Correct 1 ms 2396 KB Output is correct
44 Correct 0 ms 2396 KB Output is correct
45 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2412 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2396 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 1 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 1 ms 2396 KB Output is correct
37 Correct 1 ms 2392 KB Output is correct
38 Correct 1 ms 2512 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 1 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 1 ms 2396 KB Output is correct
43 Correct 1 ms 2396 KB Output is correct
44 Correct 0 ms 2396 KB Output is correct
45 Correct 1 ms 2396 KB Output is correct
46 Correct 1 ms 2392 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 1 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2412 KB Output is correct
51 Correct 1 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
54 Correct 1 ms 2396 KB Output is correct
55 Correct 1 ms 2396 KB Output is correct
56 Correct 1 ms 2396 KB Output is correct
57 Correct 1 ms 2396 KB Output is correct
58 Correct 1 ms 2396 KB Output is correct
59 Correct 1 ms 2396 KB Output is correct
60 Correct 1 ms 2396 KB Output is correct
61 Correct 1 ms 2396 KB Output is correct
62 Correct 1 ms 2472 KB Output is correct
63 Correct 1 ms 2396 KB Output is correct
64 Correct 1 ms 2396 KB Output is correct
65 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 1 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 1 ms 2396 KB Output is correct
37 Correct 1 ms 2392 KB Output is correct
38 Correct 1 ms 2512 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 1 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 1 ms 2396 KB Output is correct
43 Correct 1 ms 2396 KB Output is correct
44 Correct 0 ms 2396 KB Output is correct
45 Correct 1 ms 2396 KB Output is correct
46 Correct 1 ms 2392 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 1 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2412 KB Output is correct
51 Correct 1 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
54 Correct 1 ms 2396 KB Output is correct
55 Correct 1 ms 2396 KB Output is correct
56 Correct 1 ms 2396 KB Output is correct
57 Correct 1 ms 2396 KB Output is correct
58 Correct 1 ms 2396 KB Output is correct
59 Correct 1 ms 2396 KB Output is correct
60 Correct 1 ms 2396 KB Output is correct
61 Correct 1 ms 2396 KB Output is correct
62 Correct 1 ms 2472 KB Output is correct
63 Correct 1 ms 2396 KB Output is correct
64 Correct 1 ms 2396 KB Output is correct
65 Correct 1 ms 2396 KB Output is correct
66 Correct 20 ms 4700 KB Output is correct
67 Correct 20 ms 6748 KB Output is correct
68 Correct 20 ms 5120 KB Output is correct
69 Correct 22 ms 4956 KB Output is correct
70 Correct 15 ms 2908 KB Output is correct
71 Correct 12 ms 3420 KB Output is correct
72 Correct 19 ms 4452 KB Output is correct
73 Correct 20 ms 3164 KB Output is correct
74 Correct 12 ms 2652 KB Output is correct
75 Correct 15 ms 2528 KB Output is correct
76 Correct 20 ms 2908 KB Output is correct
77 Correct 19 ms 2652 KB Output is correct
78 Correct 19 ms 2852 KB Output is correct
79 Correct 21 ms 4956 KB Output is correct
80 Correct 24 ms 3160 KB Output is correct
81 Correct 26 ms 2960 KB Output is correct
82 Correct 12 ms 2648 KB Output is correct
83 Correct 12 ms 2652 KB Output is correct
84 Correct 8 ms 1708 KB Output is correct
85 Correct 5 ms 856 KB Output is correct
86 Correct 6 ms 856 KB Output is correct
87 Correct 6 ms 1116 KB Output is correct
88 Correct 11 ms 2696 KB Output is correct
89 Correct 20 ms 6492 KB Output is correct
90 Correct 19 ms 6492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 1 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 1 ms 2396 KB Output is correct
37 Correct 1 ms 2392 KB Output is correct
38 Correct 1 ms 2512 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 1 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 1 ms 2396 KB Output is correct
43 Correct 1 ms 2396 KB Output is correct
44 Correct 0 ms 2396 KB Output is correct
45 Correct 1 ms 2396 KB Output is correct
46 Correct 1 ms 2392 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 1 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2412 KB Output is correct
51 Correct 1 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
54 Correct 1 ms 2396 KB Output is correct
55 Correct 1 ms 2396 KB Output is correct
56 Correct 1 ms 2396 KB Output is correct
57 Correct 1 ms 2396 KB Output is correct
58 Correct 1 ms 2396 KB Output is correct
59 Correct 1 ms 2396 KB Output is correct
60 Correct 1 ms 2396 KB Output is correct
61 Correct 1 ms 2396 KB Output is correct
62 Correct 1 ms 2472 KB Output is correct
63 Correct 1 ms 2396 KB Output is correct
64 Correct 1 ms 2396 KB Output is correct
65 Correct 1 ms 2396 KB Output is correct
66 Correct 1921 ms 66892 KB Output is correct
67 Correct 2379 ms 82500 KB Output is correct
68 Correct 2423 ms 94816 KB Output is correct
69 Correct 740 ms 73168 KB Output is correct
70 Correct 928 ms 73896 KB Output is correct
71 Correct 2421 ms 94608 KB Output is correct
72 Correct 2268 ms 93728 KB Output is correct
73 Correct 1266 ms 73996 KB Output is correct
74 Correct 2436 ms 94788 KB Output is correct
75 Correct 2184 ms 93308 KB Output is correct
76 Correct 1020 ms 74324 KB Output is correct
77 Correct 2409 ms 94780 KB Output is correct
78 Correct 1789 ms 72940 KB Output is correct
79 Correct 1718 ms 72876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2512 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2392 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Correct 0 ms 2396 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 0 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 1 ms 2396 KB Output is correct
19 Correct 1 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 1 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 1 ms 2396 KB Output is correct
24 Correct 0 ms 2396 KB Output is correct
25 Correct 1 ms 2392 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 1 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 1 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 1 ms 2396 KB Output is correct
37 Correct 1 ms 2392 KB Output is correct
38 Correct 1 ms 2512 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 1 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 1 ms 2396 KB Output is correct
43 Correct 1 ms 2396 KB Output is correct
44 Correct 0 ms 2396 KB Output is correct
45 Correct 1 ms 2396 KB Output is correct
46 Correct 1 ms 2392 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 1 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2412 KB Output is correct
51 Correct 1 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
54 Correct 1 ms 2396 KB Output is correct
55 Correct 1 ms 2396 KB Output is correct
56 Correct 1 ms 2396 KB Output is correct
57 Correct 1 ms 2396 KB Output is correct
58 Correct 1 ms 2396 KB Output is correct
59 Correct 1 ms 2396 KB Output is correct
60 Correct 1 ms 2396 KB Output is correct
61 Correct 1 ms 2396 KB Output is correct
62 Correct 1 ms 2472 KB Output is correct
63 Correct 1 ms 2396 KB Output is correct
64 Correct 1 ms 2396 KB Output is correct
65 Correct 1 ms 2396 KB Output is correct
66 Correct 20 ms 4700 KB Output is correct
67 Correct 20 ms 6748 KB Output is correct
68 Correct 20 ms 5120 KB Output is correct
69 Correct 22 ms 4956 KB Output is correct
70 Correct 15 ms 2908 KB Output is correct
71 Correct 12 ms 3420 KB Output is correct
72 Correct 19 ms 4452 KB Output is correct
73 Correct 20 ms 3164 KB Output is correct
74 Correct 12 ms 2652 KB Output is correct
75 Correct 15 ms 2528 KB Output is correct
76 Correct 20 ms 2908 KB Output is correct
77 Correct 19 ms 2652 KB Output is correct
78 Correct 19 ms 2852 KB Output is correct
79 Correct 21 ms 4956 KB Output is correct
80 Correct 24 ms 3160 KB Output is correct
81 Correct 26 ms 2960 KB Output is correct
82 Correct 12 ms 2648 KB Output is correct
83 Correct 12 ms 2652 KB Output is correct
84 Correct 8 ms 1708 KB Output is correct
85 Correct 5 ms 856 KB Output is correct
86 Correct 6 ms 856 KB Output is correct
87 Correct 6 ms 1116 KB Output is correct
88 Correct 11 ms 2696 KB Output is correct
89 Correct 20 ms 6492 KB Output is correct
90 Correct 19 ms 6492 KB Output is correct
91 Correct 1921 ms 66892 KB Output is correct
92 Correct 2379 ms 82500 KB Output is correct
93 Correct 2423 ms 94816 KB Output is correct
94 Correct 740 ms 73168 KB Output is correct
95 Correct 928 ms 73896 KB Output is correct
96 Correct 2421 ms 94608 KB Output is correct
97 Correct 2268 ms 93728 KB Output is correct
98 Correct 1266 ms 73996 KB Output is correct
99 Correct 2436 ms 94788 KB Output is correct
100 Correct 2184 ms 93308 KB Output is correct
101 Correct 1020 ms 74324 KB Output is correct
102 Correct 2409 ms 94780 KB Output is correct
103 Correct 1789 ms 72940 KB Output is correct
104 Correct 1718 ms 72876 KB Output is correct
105 Correct 593 ms 10408 KB Output is correct
106 Correct 786 ms 10840 KB Output is correct
107 Correct 1427 ms 12240 KB Output is correct
108 Correct 1174 ms 12624 KB Output is correct
109 Correct 771 ms 21588 KB Output is correct
110 Correct 1965 ms 66132 KB Output is correct
111 Correct 2336 ms 94720 KB Output is correct
112 Correct 2320 ms 87076 KB Output is correct
113 Correct 2234 ms 87044 KB Output is correct
114 Correct 1706 ms 38676 KB Output is correct
115 Correct 1312 ms 74064 KB Output is correct
116 Correct 2357 ms 87124 KB Output is correct
117 Correct 2013 ms 85844 KB Output is correct
118 Correct 1439 ms 62040 KB Output is correct
119 Correct 1181 ms 74068 KB Output is correct
120 Correct 2291 ms 87120 KB Output is correct
121 Correct 2145 ms 89624 KB Output is correct
122 Correct 2157 ms 87124 KB Output is correct
123 Correct 787 ms 73364 KB Output is correct
124 Correct 778 ms 73900 KB Output is correct
125 Correct 409 ms 40488 KB Output is correct
126 Correct 185 ms 17144 KB Output is correct
127 Correct 165 ms 12368 KB Output is correct
128 Correct 148 ms 14224 KB Output is correct
129 Correct 252 ms 24096 KB Output is correct