답안 #400342

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
400342 2021-05-07T21:57:39 Z 12tqian IOI 바이러스 (JOI21_fever) C++17
37 / 100
5000 ms 46528 KB
#include <bits/stdc++.h>

using namespace std;

#define f1r(i, a, b) for (int i = a; i < b; ++i)
#define f0r(i, a) f1r(i, 0, a)
#define each(t, a) for (auto& t : a)

#define mp make_pair
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

template <class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template <class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

const int INF = numeric_limits<int>::max();

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n; cin >> n;
    vpi p(n);
    f0r(i, n) cin >> p[i].f >> p[i].s;
    map<int, vi> X;
    map<int, vi> Y;
    map<int, vi> S;
    map<int, vi> D;
    f0r(i, n) {
        X[p[i].f].pb(i);
        Y[p[i].s].pb(i);
        S[p[i].f + p[i].s].pb(i);
        D[p[i].f - p[i].s].pb(i);
    }
    each(v, X) {
        sort(all(v.s), [&](int x, int y) {
            return p[x].s < p[y].s;
        });
    }
    each(v, Y) {
        sort(all(v.s), [&](int x, int y) {
            return p[x].f < p[y].f;
        });
    }
    each(v, S) {
        sort(all(v.s), [&](int x, int y) {
            return p[x].f < p[y].f;
        });
    }
    each(v, D) {
        sort(all(v.s), [&](int x, int y) {
            return p[x].f < p[y].f;
        });
    }
    auto run_dijkstra = [&](int beg) -> int {
        priority_queue<pi, vpi, greater<pi>> pq;
        vi dist(4 * n, INF);
        vector<bool> vis(4 * n);
        
        int cnt = 0;

        auto ad = [&](int a, ll b) {
            if (vis[a] && dist[a] == b) {
                return;
            }
            vis[a] = true;
            cnt++;
            if (dist[a] <= b) return;
            pq.push({dist[a] = b, a});
        };
        ad(beg, 0);
        auto calc = [&](pi x, pi y) -> int {
            int nd = 2 * max(abs(x.f - y.f), abs(x.s - y.s));
            if (x.f == y.f) {
                nd = abs(x.s - y.s);
            } else if (x.s == y.s) {
                nd = abs(x.f - y.f);       
            }
            return nd;
        };
        while (!pq.empty()) {
            auto x = pq.top();
            pq.pop();
            int u = x.s / 4;
            int d = x.s % 4;
            if (dist[4 * u + d] < x.f) {
                continue;
            }
            { // vertical
                auto& v = X[p[u].f];
                if (d == 2) { 
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 0, nd);
                        loc++;
                    }
                }
                if (d == 0) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 2, nd);
                        loc--;
                    }
                }
            }
            { // horizontal
                auto& v = Y[p[u].s];
                if (d == 3) { 
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 1, nd);
                        loc++;
                    }
                }
                if (d == 1) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 3, nd);
                        loc--;
                    }
                }
            }
            { // sum
                auto& v = S[p[u].f + p[u].s];
                if (d == 3) { 
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 2, nd);
                        loc++;
                    }
                }
                if (d == 0) {
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 1, nd);
                        loc++;
                    }
                }
                if (d == 1) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 0, nd);
                        loc--;
                    }
                }
                if (d == 2) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 3, nd);
                        loc--;
                    }
                }
            }
            { // diff
                auto& v = D[p[u].f - p[u].s];
                if (d == 3) { 
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 0, nd);
                        loc++;
                    }
                }
                if (d == 2) {
                    int loc = 0;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 1, nd);
                        loc++;
                    }
                }
                if (d == 0) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 3, nd);
                        loc--;
                    }
                }
                if (d == 1) {
                    int loc = sz(v) - 1;
                    while (v[loc] != u) {
                        int i = v[loc];
                        int nd = calc(p[v[loc]], p[u]);
                        if (nd < x.f) break;
                        ad(4 * i + 2, nd);
                        loc--;
                    }
                }
            }
        }
        int res = 0;
        f0r(i, n) {
            int a = 0;
            f0r(d, 4) {
                a += (dist[4 * i + d] < INF);
            }
            assert(a <= 1);
            res += a;
        }
        return res;
    };
    int ans = 0;
    f0r(d, 4) {
        ckmax(ans, run_dijkstra(d));
    }
    cout << ans << '\n';

    return 0;
}

/**
 * first try n^2 bash
 * 0 - up
 * 1 - right
 * 2 - down
 * 3 - left
 */
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 6 ms 1484 KB Output is correct
67 Correct 5 ms 1488 KB Output is correct
68 Correct 6 ms 1612 KB Output is correct
69 Correct 12 ms 496 KB Output is correct
70 Correct 6 ms 588 KB Output is correct
71 Correct 4 ms 716 KB Output is correct
72 Correct 5 ms 1228 KB Output is correct
73 Correct 6 ms 1612 KB Output is correct
74 Correct 7 ms 1444 KB Output is correct
75 Correct 45 ms 1376 KB Output is correct
76 Correct 7 ms 1484 KB Output is correct
77 Correct 6 ms 1356 KB Output is correct
78 Correct 6 ms 1540 KB Output is correct
79 Correct 6 ms 1568 KB Output is correct
80 Correct 6 ms 1612 KB Output is correct
81 Correct 6 ms 1484 KB Output is correct
82 Correct 13 ms 1356 KB Output is correct
83 Correct 40 ms 1356 KB Output is correct
84 Correct 3 ms 844 KB Output is correct
85 Correct 2 ms 460 KB Output is correct
86 Correct 3 ms 460 KB Output is correct
87 Correct 3 ms 588 KB Output is correct
88 Correct 6 ms 1356 KB Output is correct
89 Correct 8 ms 1484 KB Output is correct
90 Correct 7 ms 1356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 322 ms 32724 KB Output is correct
67 Correct 433 ms 40796 KB Output is correct
68 Correct 436 ms 46528 KB Output is correct
69 Correct 359 ms 37900 KB Output is correct
70 Execution timed out 5097 ms 39096 KB Time limit exceeded
71 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 204 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 1 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 204 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 204 KB Output is correct
37 Correct 1 ms 204 KB Output is correct
38 Correct 1 ms 204 KB Output is correct
39 Correct 1 ms 204 KB Output is correct
40 Correct 1 ms 204 KB Output is correct
41 Correct 1 ms 204 KB Output is correct
42 Correct 1 ms 204 KB Output is correct
43 Correct 1 ms 204 KB Output is correct
44 Correct 1 ms 204 KB Output is correct
45 Correct 1 ms 204 KB Output is correct
46 Correct 1 ms 332 KB Output is correct
47 Correct 1 ms 332 KB Output is correct
48 Correct 1 ms 332 KB Output is correct
49 Correct 1 ms 332 KB Output is correct
50 Correct 1 ms 332 KB Output is correct
51 Correct 1 ms 332 KB Output is correct
52 Correct 1 ms 332 KB Output is correct
53 Correct 1 ms 332 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 332 KB Output is correct
56 Correct 1 ms 332 KB Output is correct
57 Correct 1 ms 332 KB Output is correct
58 Correct 1 ms 332 KB Output is correct
59 Correct 1 ms 332 KB Output is correct
60 Correct 1 ms 332 KB Output is correct
61 Correct 1 ms 332 KB Output is correct
62 Correct 1 ms 332 KB Output is correct
63 Correct 1 ms 332 KB Output is correct
64 Correct 1 ms 332 KB Output is correct
65 Correct 1 ms 332 KB Output is correct
66 Correct 6 ms 1484 KB Output is correct
67 Correct 5 ms 1488 KB Output is correct
68 Correct 6 ms 1612 KB Output is correct
69 Correct 12 ms 496 KB Output is correct
70 Correct 6 ms 588 KB Output is correct
71 Correct 4 ms 716 KB Output is correct
72 Correct 5 ms 1228 KB Output is correct
73 Correct 6 ms 1612 KB Output is correct
74 Correct 7 ms 1444 KB Output is correct
75 Correct 45 ms 1376 KB Output is correct
76 Correct 7 ms 1484 KB Output is correct
77 Correct 6 ms 1356 KB Output is correct
78 Correct 6 ms 1540 KB Output is correct
79 Correct 6 ms 1568 KB Output is correct
80 Correct 6 ms 1612 KB Output is correct
81 Correct 6 ms 1484 KB Output is correct
82 Correct 13 ms 1356 KB Output is correct
83 Correct 40 ms 1356 KB Output is correct
84 Correct 3 ms 844 KB Output is correct
85 Correct 2 ms 460 KB Output is correct
86 Correct 3 ms 460 KB Output is correct
87 Correct 3 ms 588 KB Output is correct
88 Correct 6 ms 1356 KB Output is correct
89 Correct 8 ms 1484 KB Output is correct
90 Correct 7 ms 1356 KB Output is correct
91 Correct 322 ms 32724 KB Output is correct
92 Correct 433 ms 40796 KB Output is correct
93 Correct 436 ms 46528 KB Output is correct
94 Correct 359 ms 37900 KB Output is correct
95 Execution timed out 5097 ms 39096 KB Time limit exceeded
96 Halted 0 ms 0 KB -