Submission #760966

# Submission time Handle Problem Language Result Execution time Memory
760966 2023-06-19T01:13:31 Z resting IOI Fever (JOI21_fever) C++17
100 / 100
3748 ms 75648 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

const int mx = 1e5 + 5;

void solve() {
    int n; cin >> n;
    vector<pair<int, int>> p(n);
    vector<int> dir(n);
    for (auto& x : p) { cin >> x.first >> x.second; x.first *= 2; x.second *= 2; }
    int ans = 0;
    int x1 = p[0].first, x2 = p[0].second;
    for (auto& x : p) x.first -= x1, x.second -= x2;
    for (int i = 0; i < 4; i++) {
        dir[0] = 0; //u
        for (int j = 1; j < n; j++) {
            auto [x, y] = p[j];
            if (y < -abs(x)) { //d
                dir[j] = 0;
            } else if (y > abs(x)) { //u
                dir[j] = 1;
            } else if (x > abs(y)) { //l
                dir[j] = 2;
            } else if (x < -abs(y)) { //r
                dir[j] = 3;
            } else if (y < 0) { //u
                dir[j] = 0;
            } else if (x == 0) { // d
                dir[j] = 1;
            } else if (x > 0) { // l
                dir[j] = 2;
            } else if (x < 0) { //r
                dir[j] = 3;
            }
        }
        map<int, set<pair<int, int>>> a[4], b[4], c[4], d[4]; //x - y: {x, id}, x + y: {x, id}, x : {y, id}, y : {x, id}

        auto ad = [&](int dir, int x, int y, int id) {
            a[dir][x - y].insert({ x,id });
            b[dir][x + y].insert({ x,id });
            if (dir == 0 || dir == 1) c[dir][x].insert({ y, id });
            if (dir == 2 || dir == 3) d[dir][y].insert({ x, id });
        };

        auto rem = [&](int dir, int x, int y, int id) {
            a[dir][x - y].erase({ x,id });
            b[dir][x + y].erase({ x,id });
            if (dir == 0 || dir == 1) c[dir][x].erase({ y, id });
            if (dir == 2 || dir == 3) d[dir][y].erase({ x, id });
        };

        for (int j = 0; j < n; j++) {
            ad(dir[j], p[j].first, p[j].second, j);
        }

        vector<int> vis(n, 0);
        vector<vector<int>> vis2(12, vector<int>(n, 0));
        set<pair<int, pair<int, pair<int, int>>>> s; // {time, {id, prev}}

        auto add = [&](int id, int t) {
            if (id == -1) return;
            auto [x, y] = p[id];
            if (dir[id] == 0) { //u
                auto e = a[2][x - y].lower_bound({ x + t, 0 });
                if (e != a[2][x - y].end()) s.insert({ e->first - x, {e->second, {id, 0}} });

                auto f = b[3][x + y].upper_bound({ x - t, mx });
                f = (!b[3][x + y].size() || f == b[3][x + y].begin()) ? b[3][x + y].end() : prev(f);
                if (f != b[3][x + y].end()) s.insert({ x - f->first , {f->second, {id, 1}} });

                auto g = c[1][x].lower_bound({ y + t * 2, 0 });
                if (g != c[1][x].end()) s.insert({ (g->first - y) / 2, {g->second,{ id, 2}} });

            } else if (dir[id] == 1) { //d
                auto e = b[2][x + y].lower_bound({ x + t, 0 });
                if (e != b[2][x + y].end()) s.insert({ e->first - x, {e->second, {id, 3}} });

                auto f = a[3][x - y].upper_bound({ x - t, mx });
                f = (!a[3][x - y].size() || f == a[3][x - y].begin()) ? a[3][x - y].end() : prev(f);
                if (f != a[3][x - y].end()) s.insert({ x - f->first , {f->second, {id, 4}} });

                auto g = c[0][x].upper_bound({ y - t * 2, mx });
                g = (!c[0][x].size() || g == c[0][x].begin()) ? c[0][x].end() : prev(g);
                if (g != c[0][x].end()) s.insert({ (y - g->first) / 2, {g->second,{id, 5}} });

            } else if (dir[id] == 2) { //l
                auto e = a[0][x - y].upper_bound({ x - t, mx });
                e = (!a[0][x - y].size() || e == a[0][x - y].begin()) ? a[0][x - y].end() : prev(e);
                if (e != a[0][x - y].end()) s.insert({ x - e->first, {e->second, {id, 6}} });

                auto f = b[1][x + y].upper_bound({ x - t, mx });
                f = (!b[1][x + y].size() || f == b[1][x + y].begin()) ? b[1][x + y].end() : prev(f);
                if (f != b[1][x + y].end()) s.insert({ x - f->first , {f->second, {id, 7}} });

                auto g = d[3][y].upper_bound({ x - t * 2, mx });
                g = (!d[3][y].size() || g == d[3][y].begin()) ? d[3][y].end() : prev(g);
                if (g != d[3][y].end()) s.insert({ (x - g->first) / 2, {g->second, {id,8}} });

            } else { //r

                auto e = b[0][x + y].lower_bound({ x + t, 0 });
                if (e != b[0][x + y].end()) s.insert({ e->first - x, {e->second,{id, 9}} });

                auto f = a[1][x - y].lower_bound({ x + t, 0 });
                if (f != a[1][x - y].end()) s.insert({ f->first - x, {f->second,{id, 10}} });

                auto g = d[2][y].lower_bound({ x + t * 2, 0 });
                if (g != d[2][y].end()) s.insert({ (g->first - x) / 2, {g->second, {id, 11}} });
            }
        };

        s.insert({ 0, { 0, {-1, 9} } });
        int res = 0;
        while (s.size()) {
            auto [a, b] = *s.begin();
            auto [c, d] = b;
            auto [e, f] = d;
            a++;
            s.erase(s.begin());
            if (vis2[f][c]) continue;
            vis2[f][c] = 1;
            add(e, a);
            if (vis[c]) continue;
            rem(dir[c], p[c].first, p[c].second, c);
            vis[c] = 1; res++;
            add(c, a);
        }

        ans = max(ans, res);
        //rotate
        for (auto& x : p) x = { -x.second, x.first };
    }
    cout << ans << endl;
}

int32_t main() {
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 9 ms 2000 KB Output is correct
67 Correct 9 ms 1976 KB Output is correct
68 Correct 10 ms 2108 KB Output is correct
69 Correct 33 ms 1364 KB Output is correct
70 Correct 20 ms 1596 KB Output is correct
71 Correct 10 ms 1620 KB Output is correct
72 Correct 10 ms 1984 KB Output is correct
73 Correct 10 ms 2180 KB Output is correct
74 Correct 13 ms 2528 KB Output is correct
75 Correct 20 ms 2440 KB Output is correct
76 Correct 12 ms 2156 KB Output is correct
77 Correct 11 ms 1876 KB Output is correct
78 Correct 11 ms 2160 KB Output is correct
79 Correct 12 ms 2320 KB Output is correct
80 Correct 10 ms 2140 KB Output is correct
81 Correct 12 ms 2252 KB Output is correct
82 Correct 14 ms 2468 KB Output is correct
83 Correct 14 ms 2468 KB Output is correct
84 Correct 7 ms 1852 KB Output is correct
85 Correct 6 ms 1364 KB Output is correct
86 Correct 9 ms 1376 KB Output is correct
87 Correct 6 ms 1492 KB Output is correct
88 Correct 12 ms 2536 KB Output is correct
89 Correct 16 ms 2548 KB Output is correct
90 Correct 14 ms 2388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1046 ms 46184 KB Output is correct
67 Correct 1268 ms 56964 KB Output is correct
68 Correct 1408 ms 60552 KB Output is correct
69 Correct 1526 ms 70628 KB Output is correct
70 Correct 2103 ms 75648 KB Output is correct
71 Correct 1410 ms 60580 KB Output is correct
72 Correct 1412 ms 60636 KB Output is correct
73 Correct 1311 ms 52968 KB Output is correct
74 Correct 1400 ms 60644 KB Output is correct
75 Correct 1448 ms 60680 KB Output is correct
76 Correct 1372 ms 59876 KB Output is correct
77 Correct 1397 ms 60528 KB Output is correct
78 Correct 1640 ms 69892 KB Output is correct
79 Correct 1626 ms 69900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 9 ms 2000 KB Output is correct
67 Correct 9 ms 1976 KB Output is correct
68 Correct 10 ms 2108 KB Output is correct
69 Correct 33 ms 1364 KB Output is correct
70 Correct 20 ms 1596 KB Output is correct
71 Correct 10 ms 1620 KB Output is correct
72 Correct 10 ms 1984 KB Output is correct
73 Correct 10 ms 2180 KB Output is correct
74 Correct 13 ms 2528 KB Output is correct
75 Correct 20 ms 2440 KB Output is correct
76 Correct 12 ms 2156 KB Output is correct
77 Correct 11 ms 1876 KB Output is correct
78 Correct 11 ms 2160 KB Output is correct
79 Correct 12 ms 2320 KB Output is correct
80 Correct 10 ms 2140 KB Output is correct
81 Correct 12 ms 2252 KB Output is correct
82 Correct 14 ms 2468 KB Output is correct
83 Correct 14 ms 2468 KB Output is correct
84 Correct 7 ms 1852 KB Output is correct
85 Correct 6 ms 1364 KB Output is correct
86 Correct 9 ms 1376 KB Output is correct
87 Correct 6 ms 1492 KB Output is correct
88 Correct 12 ms 2536 KB Output is correct
89 Correct 16 ms 2548 KB Output is correct
90 Correct 14 ms 2388 KB Output is correct
91 Correct 1046 ms 46184 KB Output is correct
92 Correct 1268 ms 56964 KB Output is correct
93 Correct 1408 ms 60552 KB Output is correct
94 Correct 1526 ms 70628 KB Output is correct
95 Correct 2103 ms 75648 KB Output is correct
96 Correct 1410 ms 60580 KB Output is correct
97 Correct 1412 ms 60636 KB Output is correct
98 Correct 1311 ms 52968 KB Output is correct
99 Correct 1400 ms 60644 KB Output is correct
100 Correct 1448 ms 60680 KB Output is correct
101 Correct 1372 ms 59876 KB Output is correct
102 Correct 1397 ms 60528 KB Output is correct
103 Correct 1640 ms 69892 KB Output is correct
104 Correct 1626 ms 69900 KB Output is correct
105 Correct 1369 ms 28200 KB Output is correct
106 Correct 1730 ms 35172 KB Output is correct
107 Correct 3748 ms 35644 KB Output is correct
108 Correct 2135 ms 36656 KB Output is correct
109 Correct 954 ms 41300 KB Output is correct
110 Correct 1211 ms 55752 KB Output is correct
111 Correct 1357 ms 62552 KB Output is correct
112 Correct 1334 ms 60884 KB Output is correct
113 Correct 1306 ms 61180 KB Output is correct
114 Correct 2545 ms 54124 KB Output is correct
115 Correct 1352 ms 56340 KB Output is correct
116 Correct 1299 ms 60908 KB Output is correct
117 Correct 1351 ms 62348 KB Output is correct
118 Correct 1960 ms 63248 KB Output is correct
119 Correct 1685 ms 62680 KB Output is correct
120 Correct 1291 ms 60940 KB Output is correct
121 Correct 1447 ms 63580 KB Output is correct
122 Correct 1552 ms 64356 KB Output is correct
123 Correct 1489 ms 69188 KB Output is correct
124 Correct 1526 ms 73580 KB Output is correct
125 Correct 550 ms 53608 KB Output is correct
126 Correct 440 ms 37596 KB Output is correct
127 Correct 592 ms 34516 KB Output is correct
128 Correct 515 ms 34768 KB Output is correct
129 Correct 498 ms 40620 KB Output is correct