답안 #397926

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
397926 2021-05-03T11:45:51 Z phathnv IOI 바이러스 (JOI21_fever) C++11
100 / 100
2161 ms 171040 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int N = 1e5 + 7;
const int LOGN = 17;
const int INF = 1e9 + 7;

struct Edge{
    int v, w;
    Edge(int _v, int _w){
        v = _v;
        w = _w;
    }
};

int n, x[N], y[N], curInd, ind[N][4], f[N][3][4], nxt[N][3][4][LOGN], ord[N], dist[N * 16];
vector<Edge> adj[N * 16];
bool imp[N];

int Dist(int a, int b){
    int dx = abs(x[a] - x[b]);
    int dy = abs(y[a] - y[b]);
    assert(dx == dy || !dx || !dy);
    return (dx + dy) / 2;
}

int Calc(int s){
    for(int i = 1; i <= curInd; i++)
        dist[i] = INF;
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
    dist[s] = 0;
    pq.push({0, s});
    while (!pq.empty()){
        int u = pq.top().second;
        int d = pq.top().first;
        pq.pop();
        if (d != dist[u])
            continue;
        for(Edge e : adj[u])
            if (dist[e.v] > dist[u] + e.w){
                dist[e.v] = dist[u] + e.w;
                pq.push({dist[e.v], e.v});
            }
        if (u <= 4 * n){
            int dir = (u - 1) % 4;
            u = (u + 3) / 4;
            for(int type = 0; type < 3; type++){
                int v = u;
                for(int i = 16; i >= 0; i--)
                if (Dist(u, nxt[v][type][dir][i]) < d)
                    v = nxt[v][type][dir][i];
                v = nxt[v][type][dir][0];
                if (u != v && Dist(u, v) >= d && dist[f[v][type][dir]] > Dist(u, v)){
                    dist[f[v][type][dir]] = Dist(u, v);
                    pq.push({Dist(u, v), f[v][type][dir]});
                }
            }
        }
    }
    int res = 0;
    for(int i = 1; i <= n; i++)
        for(int dir = 0; dir < 4; dir++)
            res += (dist[ind[i][dir]] != INF);
    return res;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> x[i] >> y[i];
        x[i] *= 2;
        y[i] *= 2;
        ord[i] = i;
    }
    for(int i = 1; i <= n; i++)
        for(int dir = 0; dir < 4; dir++)
            ind[i][dir] = ++curInd;
    for(int i = 1; i <= n; i++)
        for(int type = 0; type < 3; type++)
            for(int dir = 0; dir < 4; dir++)
                f[i][type][dir] = ++curInd;
    for(int i = 1; i <= n; i++){
        adj[f[i][0][0]].push_back(Edge(ind[i][3], 0));
        adj[f[i][0][1]].push_back(Edge(ind[i][2], 0));
        adj[f[i][0][2]].push_back(Edge(ind[i][1], 0));
        adj[f[i][0][3]].push_back(Edge(ind[i][0], 0));
        adj[f[i][1][0]].push_back(Edge(ind[i][1], 0));
        adj[f[i][1][1]].push_back(Edge(ind[i][0], 0));
        adj[f[i][1][2]].push_back(Edge(ind[i][3], 0));
        adj[f[i][1][3]].push_back(Edge(ind[i][2], 0));
        adj[f[i][2][0]].push_back(Edge(ind[i][2], 0));
        adj[f[i][2][1]].push_back(Edge(ind[i][3], 0));
        adj[f[i][2][2]].push_back(Edge(ind[i][0], 0));
        adj[f[i][2][3]].push_back(Edge(ind[i][1], 0));
    }
    sort(ord + 1, ord + 1 + n, [&](const int &a, const int &b){
            return pair<int, int>(x[a] - y[a], x[a]) < pair<int, int>(x[b] - y[b], x[b]);
         });
    for(int l = 1; l <= n; l++){
        int r = l;
        while (r <= n && x[ord[l]] - y[ord[l]] == x[ord[r]] - y[ord[r]])
            r++;
        r--;
        for(int i = l; i <= r; i++){
            int u = ord[i];
            nxt[u][0][0][0] = (i == r? u : ord[i + 1]);
            nxt[u][0][1][0] = (i == r? u : ord[i + 1]);
            nxt[u][0][2][0] = (i == l? u : ord[i - 1]);
            nxt[u][0][3][0] = (i == l? u : ord[i - 1]);
        }
        for(int i = l; i <= r; i++){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++){
                nxt[u][0][2][j] = nxt[nxt[u][0][2][j - 1]][0][2][j - 1];
                nxt[u][0][3][j] = nxt[nxt[u][0][3][j - 1]][0][3][j - 1];
            }
        }
        for(int i = r; i >= l; i--){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++){
                nxt[u][0][0][j] = nxt[nxt[u][0][0][j - 1]][0][0][j - 1];
                nxt[u][0][1][j] = nxt[nxt[u][0][1][j - 1]][0][1][j - 1];
            }
        }
        for(int i = l; i < r; i++){
            int u = ord[i];
            int v = ord[i + 1];
            int d = Dist(u, v);
            adj[f[u][0][0]].push_back(Edge(f[v][0][0], d));
            adj[f[u][0][1]].push_back(Edge(f[v][0][1], d));
            adj[f[v][0][2]].push_back(Edge(f[u][0][2], d));
            adj[f[v][0][3]].push_back(Edge(f[u][0][3], d));
        }
        l = r;
    }
    sort(ord + 1, ord + 1 + n, [&](const int &a, const int &b){
            return pair<int, int>(x[a] + y[a], x[a]) < pair<int, int>(x[b] + y[b], x[b]);
         });
    for(int l = 1; l <= n; l++){
        int r = l;
        while (r <= n && x[ord[l]] + y[ord[l]] == x[ord[r]] + y[ord[r]])
            r++;
        r--;
        for(int i = l; i <= r; i++){
            int u = ord[i];
            nxt[u][1][0][0] = (i == l? u : ord[i - 1]);
            nxt[u][1][1][0] = (i == r? u : ord[i + 1]);
            nxt[u][1][2][0] = (i == r? u : ord[i + 1]);
            nxt[u][1][3][0] = (i == l? u : ord[i - 1]);
        }
        for(int i = l; i <= r; i++){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++){
                nxt[u][1][0][j] = nxt[nxt[u][1][0][j - 1]][1][0][j - 1];
                nxt[u][1][3][j] = nxt[nxt[u][1][3][j - 1]][1][3][j - 1];
            }
        }
        for(int i = r; i >= l; i--){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++){
                nxt[u][1][1][j] = nxt[nxt[u][1][1][j - 1]][1][1][j - 1];
                nxt[u][1][2][j] = nxt[nxt[u][1][2][j - 1]][1][2][j - 1];
            }
        }
        for(int i = l; i < r; i++){
            int u = ord[i];
            int v = ord[i + 1];
            int d = Dist(u, v);
            adj[f[v][1][0]].push_back(Edge(f[u][1][0], d));
            adj[f[u][1][1]].push_back(Edge(f[v][1][1], d));
            adj[f[u][1][2]].push_back(Edge(f[v][1][2], d));
            adj[f[v][1][3]].push_back(Edge(f[u][1][3], d));
        }
        l = r;
    }
    sort(ord + 1, ord + 1 + n, [&](const int &a, const int &b){
            return pair<int, int>(x[a], y[a]) < pair<int, int>(x[b], y[b]);
         });
    for(int l = 1; l <= n; l++){
        int r = l;
        while (r <= n && x[ord[l]] == x[ord[r]])
            r++;
        r--;
        for(int i = l; i <= r; i++){
            int u = ord[i];
            nxt[u][2][0][0] = (i == r? u : ord[i + 1]);
            nxt[u][2][2][0] = (i == l? u : ord[i - 1]);
        }
        for(int i = l; i <= r; i++){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++)
                nxt[u][2][2][j] = nxt[nxt[u][2][2][j - 1]][2][2][j - 1];
        }
        for(int i = r; i >= l; i--){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++)
                nxt[u][2][0][j] = nxt[nxt[u][2][0][j - 1]][2][0][j - 1];
        }
        for(int i = l; i < r; i++){
            int u = ord[i];
            int v = ord[i + 1];
            int d = Dist(u, v);
            adj[f[u][2][0]].push_back(Edge(f[v][2][0], d));
            adj[f[v][2][2]].push_back(Edge(f[u][2][2], d));
        }
        l = r;
    }
    sort(ord + 1, ord + 1 + n, [&](const int &a, const int &b){
            return pair<int, int>(y[a], x[a]) < pair<int, int>(y[b], x[b]);
         });
    for(int l = 1; l <= n; l++){
        int r = l;
        while (r <= n && y[ord[l]] == y[ord[r]])
            r++;
        r--;
        for(int i = l; i <= r; i++){
            int u = ord[i];
            nxt[u][2][1][0] = (i == r? u : ord[i + 1]);
            nxt[u][2][3][0] = (i == l? u : ord[i - 1]);
        }
        for(int i = l; i <= r; i++){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++)
                nxt[u][2][3][j] = nxt[nxt[u][2][3][j - 1]][2][3][j - 1];
        }
        for(int i = r; i >= l; i--){
            int u = ord[i];
            for(int j = 1; j < LOGN; j++)
                nxt[u][2][1][j] = nxt[nxt[u][2][1][j - 1]][2][1][j - 1];
        }
        for(int i = l; i < r; i++){
            int u = ord[i];
            int v = ord[i + 1];
            int d = Dist(u, v);
            adj[f[u][2][1]].push_back(Edge(f[v][2][1], d));
            adj[f[v][2][3]].push_back(Edge(f[u][2][3], d));
        }
        l = r;
    }
    int res = 0;
    for(int dir = 0; dir < 4; dir++)
        res = max(res, Calc(ind[1][dir]));
    cout << res;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
33 Correct 21 ms 37892 KB Output is correct
34 Correct 20 ms 37964 KB Output is correct
35 Correct 20 ms 37932 KB Output is correct
36 Correct 21 ms 37908 KB Output is correct
37 Correct 21 ms 37912 KB Output is correct
38 Correct 20 ms 37964 KB Output is correct
39 Correct 20 ms 37936 KB Output is correct
40 Correct 22 ms 37940 KB Output is correct
41 Correct 23 ms 37964 KB Output is correct
42 Correct 20 ms 37912 KB Output is correct
43 Correct 21 ms 37952 KB Output is correct
44 Correct 31 ms 37836 KB Output is correct
45 Correct 20 ms 37880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 38032 KB Output is correct
2 Correct 20 ms 38168 KB Output is correct
3 Correct 20 ms 38044 KB Output is correct
4 Correct 21 ms 37964 KB Output is correct
5 Correct 21 ms 38028 KB Output is correct
6 Correct 21 ms 37964 KB Output is correct
7 Correct 21 ms 38044 KB Output is correct
8 Correct 21 ms 37964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
33 Correct 21 ms 37892 KB Output is correct
34 Correct 20 ms 37964 KB Output is correct
35 Correct 20 ms 37932 KB Output is correct
36 Correct 21 ms 37908 KB Output is correct
37 Correct 21 ms 37912 KB Output is correct
38 Correct 20 ms 37964 KB Output is correct
39 Correct 20 ms 37936 KB Output is correct
40 Correct 22 ms 37940 KB Output is correct
41 Correct 23 ms 37964 KB Output is correct
42 Correct 20 ms 37912 KB Output is correct
43 Correct 21 ms 37952 KB Output is correct
44 Correct 31 ms 37836 KB Output is correct
45 Correct 20 ms 37880 KB Output is correct
46 Correct 21 ms 38032 KB Output is correct
47 Correct 20 ms 38168 KB Output is correct
48 Correct 20 ms 38044 KB Output is correct
49 Correct 21 ms 37964 KB Output is correct
50 Correct 21 ms 38028 KB Output is correct
51 Correct 21 ms 37964 KB Output is correct
52 Correct 21 ms 38044 KB Output is correct
53 Correct 21 ms 37964 KB Output is correct
54 Correct 20 ms 37996 KB Output is correct
55 Correct 21 ms 38064 KB Output is correct
56 Correct 21 ms 38048 KB Output is correct
57 Correct 21 ms 38008 KB Output is correct
58 Correct 21 ms 37964 KB Output is correct
59 Correct 21 ms 37964 KB Output is correct
60 Correct 21 ms 37964 KB Output is correct
61 Correct 20 ms 37964 KB Output is correct
62 Correct 23 ms 38020 KB Output is correct
63 Correct 20 ms 38032 KB Output is correct
64 Correct 21 ms 38004 KB Output is correct
65 Correct 21 ms 37956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
33 Correct 21 ms 37892 KB Output is correct
34 Correct 20 ms 37964 KB Output is correct
35 Correct 20 ms 37932 KB Output is correct
36 Correct 21 ms 37908 KB Output is correct
37 Correct 21 ms 37912 KB Output is correct
38 Correct 20 ms 37964 KB Output is correct
39 Correct 20 ms 37936 KB Output is correct
40 Correct 22 ms 37940 KB Output is correct
41 Correct 23 ms 37964 KB Output is correct
42 Correct 20 ms 37912 KB Output is correct
43 Correct 21 ms 37952 KB Output is correct
44 Correct 31 ms 37836 KB Output is correct
45 Correct 20 ms 37880 KB Output is correct
46 Correct 21 ms 38032 KB Output is correct
47 Correct 20 ms 38168 KB Output is correct
48 Correct 20 ms 38044 KB Output is correct
49 Correct 21 ms 37964 KB Output is correct
50 Correct 21 ms 38028 KB Output is correct
51 Correct 21 ms 37964 KB Output is correct
52 Correct 21 ms 38044 KB Output is correct
53 Correct 21 ms 37964 KB Output is correct
54 Correct 20 ms 37996 KB Output is correct
55 Correct 21 ms 38064 KB Output is correct
56 Correct 21 ms 38048 KB Output is correct
57 Correct 21 ms 38008 KB Output is correct
58 Correct 21 ms 37964 KB Output is correct
59 Correct 21 ms 37964 KB Output is correct
60 Correct 21 ms 37964 KB Output is correct
61 Correct 20 ms 37964 KB Output is correct
62 Correct 23 ms 38020 KB Output is correct
63 Correct 20 ms 38032 KB Output is correct
64 Correct 21 ms 38004 KB Output is correct
65 Correct 21 ms 37956 KB Output is correct
66 Correct 29 ms 41848 KB Output is correct
67 Correct 30 ms 41804 KB Output is correct
68 Correct 28 ms 41880 KB Output is correct
69 Correct 53 ms 41796 KB Output is correct
70 Correct 35 ms 41868 KB Output is correct
71 Correct 31 ms 41804 KB Output is correct
72 Correct 29 ms 41804 KB Output is correct
73 Correct 27 ms 41944 KB Output is correct
74 Correct 33 ms 41892 KB Output is correct
75 Correct 40 ms 42052 KB Output is correct
76 Correct 30 ms 41924 KB Output is correct
77 Correct 30 ms 41836 KB Output is correct
78 Correct 34 ms 41868 KB Output is correct
79 Correct 31 ms 41904 KB Output is correct
80 Correct 29 ms 41904 KB Output is correct
81 Correct 29 ms 41932 KB Output is correct
82 Correct 33 ms 41876 KB Output is correct
83 Correct 32 ms 41824 KB Output is correct
84 Correct 29 ms 41932 KB Output is correct
85 Correct 31 ms 41928 KB Output is correct
86 Correct 36 ms 41892 KB Output is correct
87 Correct 34 ms 41896 KB Output is correct
88 Correct 35 ms 41824 KB Output is correct
89 Correct 32 ms 41876 KB Output is correct
90 Correct 32 ms 41876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
33 Correct 21 ms 37892 KB Output is correct
34 Correct 20 ms 37964 KB Output is correct
35 Correct 20 ms 37932 KB Output is correct
36 Correct 21 ms 37908 KB Output is correct
37 Correct 21 ms 37912 KB Output is correct
38 Correct 20 ms 37964 KB Output is correct
39 Correct 20 ms 37936 KB Output is correct
40 Correct 22 ms 37940 KB Output is correct
41 Correct 23 ms 37964 KB Output is correct
42 Correct 20 ms 37912 KB Output is correct
43 Correct 21 ms 37952 KB Output is correct
44 Correct 31 ms 37836 KB Output is correct
45 Correct 20 ms 37880 KB Output is correct
46 Correct 21 ms 38032 KB Output is correct
47 Correct 20 ms 38168 KB Output is correct
48 Correct 20 ms 38044 KB Output is correct
49 Correct 21 ms 37964 KB Output is correct
50 Correct 21 ms 38028 KB Output is correct
51 Correct 21 ms 37964 KB Output is correct
52 Correct 21 ms 38044 KB Output is correct
53 Correct 21 ms 37964 KB Output is correct
54 Correct 20 ms 37996 KB Output is correct
55 Correct 21 ms 38064 KB Output is correct
56 Correct 21 ms 38048 KB Output is correct
57 Correct 21 ms 38008 KB Output is correct
58 Correct 21 ms 37964 KB Output is correct
59 Correct 21 ms 37964 KB Output is correct
60 Correct 21 ms 37964 KB Output is correct
61 Correct 20 ms 37964 KB Output is correct
62 Correct 23 ms 38020 KB Output is correct
63 Correct 20 ms 38032 KB Output is correct
64 Correct 21 ms 38004 KB Output is correct
65 Correct 21 ms 37956 KB Output is correct
66 Correct 318 ms 143728 KB Output is correct
67 Correct 372 ms 170232 KB Output is correct
68 Correct 328 ms 170872 KB Output is correct
69 Correct 825 ms 170156 KB Output is correct
70 Correct 1320 ms 170956 KB Output is correct
71 Correct 333 ms 170912 KB Output is correct
72 Correct 342 ms 170412 KB Output is correct
73 Correct 465 ms 170920 KB Output is correct
74 Correct 328 ms 170804 KB Output is correct
75 Correct 357 ms 170820 KB Output is correct
76 Correct 564 ms 170872 KB Output is correct
77 Correct 338 ms 170844 KB Output is correct
78 Correct 566 ms 171032 KB Output is correct
79 Correct 561 ms 170908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 38076 KB Output is correct
2 Correct 22 ms 37836 KB Output is correct
3 Correct 20 ms 37836 KB Output is correct
4 Correct 20 ms 37836 KB Output is correct
5 Correct 20 ms 37828 KB Output is correct
6 Correct 20 ms 37964 KB Output is correct
7 Correct 20 ms 37848 KB Output is correct
8 Correct 20 ms 37836 KB Output is correct
9 Correct 20 ms 37836 KB Output is correct
10 Correct 20 ms 37912 KB Output is correct
11 Correct 20 ms 37884 KB Output is correct
12 Correct 20 ms 37944 KB Output is correct
13 Correct 20 ms 37828 KB Output is correct
14 Correct 20 ms 37964 KB Output is correct
15 Correct 23 ms 37964 KB Output is correct
16 Correct 20 ms 37824 KB Output is correct
17 Correct 20 ms 37904 KB Output is correct
18 Correct 21 ms 37940 KB Output is correct
19 Correct 20 ms 37964 KB Output is correct
20 Correct 21 ms 37912 KB Output is correct
21 Correct 24 ms 37836 KB Output is correct
22 Correct 20 ms 37912 KB Output is correct
23 Correct 20 ms 37872 KB Output is correct
24 Correct 20 ms 37848 KB Output is correct
25 Correct 20 ms 37904 KB Output is correct
26 Correct 23 ms 37948 KB Output is correct
27 Correct 20 ms 37908 KB Output is correct
28 Correct 20 ms 37848 KB Output is correct
29 Correct 20 ms 37964 KB Output is correct
30 Correct 20 ms 37856 KB Output is correct
31 Correct 20 ms 37912 KB Output is correct
32 Correct 20 ms 37960 KB Output is correct
33 Correct 21 ms 37892 KB Output is correct
34 Correct 20 ms 37964 KB Output is correct
35 Correct 20 ms 37932 KB Output is correct
36 Correct 21 ms 37908 KB Output is correct
37 Correct 21 ms 37912 KB Output is correct
38 Correct 20 ms 37964 KB Output is correct
39 Correct 20 ms 37936 KB Output is correct
40 Correct 22 ms 37940 KB Output is correct
41 Correct 23 ms 37964 KB Output is correct
42 Correct 20 ms 37912 KB Output is correct
43 Correct 21 ms 37952 KB Output is correct
44 Correct 31 ms 37836 KB Output is correct
45 Correct 20 ms 37880 KB Output is correct
46 Correct 21 ms 38032 KB Output is correct
47 Correct 20 ms 38168 KB Output is correct
48 Correct 20 ms 38044 KB Output is correct
49 Correct 21 ms 37964 KB Output is correct
50 Correct 21 ms 38028 KB Output is correct
51 Correct 21 ms 37964 KB Output is correct
52 Correct 21 ms 38044 KB Output is correct
53 Correct 21 ms 37964 KB Output is correct
54 Correct 20 ms 37996 KB Output is correct
55 Correct 21 ms 38064 KB Output is correct
56 Correct 21 ms 38048 KB Output is correct
57 Correct 21 ms 38008 KB Output is correct
58 Correct 21 ms 37964 KB Output is correct
59 Correct 21 ms 37964 KB Output is correct
60 Correct 21 ms 37964 KB Output is correct
61 Correct 20 ms 37964 KB Output is correct
62 Correct 23 ms 38020 KB Output is correct
63 Correct 20 ms 38032 KB Output is correct
64 Correct 21 ms 38004 KB Output is correct
65 Correct 21 ms 37956 KB Output is correct
66 Correct 29 ms 41848 KB Output is correct
67 Correct 30 ms 41804 KB Output is correct
68 Correct 28 ms 41880 KB Output is correct
69 Correct 53 ms 41796 KB Output is correct
70 Correct 35 ms 41868 KB Output is correct
71 Correct 31 ms 41804 KB Output is correct
72 Correct 29 ms 41804 KB Output is correct
73 Correct 27 ms 41944 KB Output is correct
74 Correct 33 ms 41892 KB Output is correct
75 Correct 40 ms 42052 KB Output is correct
76 Correct 30 ms 41924 KB Output is correct
77 Correct 30 ms 41836 KB Output is correct
78 Correct 34 ms 41868 KB Output is correct
79 Correct 31 ms 41904 KB Output is correct
80 Correct 29 ms 41904 KB Output is correct
81 Correct 29 ms 41932 KB Output is correct
82 Correct 33 ms 41876 KB Output is correct
83 Correct 32 ms 41824 KB Output is correct
84 Correct 29 ms 41932 KB Output is correct
85 Correct 31 ms 41928 KB Output is correct
86 Correct 36 ms 41892 KB Output is correct
87 Correct 34 ms 41896 KB Output is correct
88 Correct 35 ms 41824 KB Output is correct
89 Correct 32 ms 41876 KB Output is correct
90 Correct 32 ms 41876 KB Output is correct
91 Correct 318 ms 143728 KB Output is correct
92 Correct 372 ms 170232 KB Output is correct
93 Correct 328 ms 170872 KB Output is correct
94 Correct 825 ms 170156 KB Output is correct
95 Correct 1320 ms 170956 KB Output is correct
96 Correct 333 ms 170912 KB Output is correct
97 Correct 342 ms 170412 KB Output is correct
98 Correct 465 ms 170920 KB Output is correct
99 Correct 328 ms 170804 KB Output is correct
100 Correct 357 ms 170820 KB Output is correct
101 Correct 564 ms 170872 KB Output is correct
102 Correct 338 ms 170844 KB Output is correct
103 Correct 566 ms 171032 KB Output is correct
104 Correct 561 ms 170908 KB Output is correct
105 Correct 1321 ms 143496 KB Output is correct
106 Correct 1595 ms 169824 KB Output is correct
107 Correct 2161 ms 169984 KB Output is correct
108 Correct 1627 ms 169936 KB Output is correct
109 Correct 543 ms 169864 KB Output is correct
110 Correct 430 ms 170140 KB Output is correct
111 Correct 327 ms 170872 KB Output is correct
112 Correct 355 ms 170488 KB Output is correct
113 Correct 384 ms 170276 KB Output is correct
114 Correct 1336 ms 170756 KB Output is correct
115 Correct 475 ms 170848 KB Output is correct
116 Correct 367 ms 170264 KB Output is correct
117 Correct 390 ms 170348 KB Output is correct
118 Correct 1093 ms 170564 KB Output is correct
119 Correct 732 ms 170948 KB Output is correct
120 Correct 357 ms 170420 KB Output is correct
121 Correct 396 ms 170932 KB Output is correct
122 Correct 488 ms 171040 KB Output is correct
123 Correct 791 ms 170308 KB Output is correct
124 Correct 847 ms 170936 KB Output is correct
125 Correct 416 ms 170296 KB Output is correct
126 Correct 416 ms 170444 KB Output is correct
127 Correct 524 ms 170836 KB Output is correct
128 Correct 412 ms 170568 KB Output is correct
129 Correct 388 ms 170256 KB Output is correct