답안 #806824

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
806824 2023-08-04T10:07:19 Z someone Maze (JOI23_ho_t3) C++14
51 / 100
2000 ms 1217076 KB
#include <bits/stdc++.h>
//#define int long long
#define x first
#define y second
using namespace std;

const int N = 6e6 + 42, INF = 1e9 + 42;

int dl[] = {0, 0, 1, -1},
    dc[] = {1, -1, 0, 0},
    trans[] = {0, 0, 0, 0};

bool etat[N], vu[N];
int row, col, n, ldeb, cdeb, lfin, cfin, ans = INF, dist[N], lhor[N], rhor[N], lver[N], rver[N];

inline bool valid(int l, int c) {
    return -1 < l && l < row && -1 < c && c < col;
}

void BFS() {
    deque<pair<int, int>> dq;
    dist[ldeb * col + cdeb] = 0;
    dq.push_front({ldeb, cdeb});
    while(!dq.empty()) {
        auto act = dq[0];
        dq.pop_front();
        int id = act.x * col + act.y;
        if(!vu[id]) {
            vu[id] = true;
            int dx = abs(lfin - act.x), dy = abs(cfin - act.y);
            if(dx <= n && dy <= n && dx + dy != 2*n)
                ans = min(ans, dist[id]+1);
            for(int i = 0; i < 4; i++) {
                int x = act.x + dl[i], y = act.y + dc[i], j = id + trans[i];
                if(valid(x, y) && etat[j] && !vu[j]) {
                    dq.push_front({x, y});
                    dist[j] = dist[id];
                }
            }

            //(act.x - n, act.y - n + 1) - (act.x - n, act.y + n - 1)
            //(act.x + n, act.y - n + 1) - (act.x + n, act.y + n - 1)
            for(int j = act.y - n + 1; j <= act.y + n - 1; j++) {
                if(valid(act.x - n, j)) {
                    dq.push_back({act.x - n, j});
                    dist[(act.x - n) * col + j] = min(dist[(act.x - n) * col + j], dist[id]+1);
                }
                if(valid(act.x + n, j)) {
                    dq.push_back({act.x + n, j});
                    dist[(act.x + n) * col + j] = min(dist[(act.x + n) * col + j], dist[id]+1);
                }
            }
            //(act.x - n + 1, act.y - n) - (act.x + n - 1, act.y - n)
            //(act.x - n + 1, act.y + n) - (act.x + n - 1, act.y + n)
            for(int i = act.x - n + 1; i <= act.x + n - 1; i++) {
                if(valid(i, act.y - n)) {
                    dq.push_back({i, act.y - n});
                    dist[i * col + act.y - n] = min(dist[i * col + act.y - n], dist[id]+1);
                }
                if(valid(i, act.y + n)) {
                    dq.push_back({i, act.y + n});
                    dist[i * col + act.y + n] = min(dist[i * col + act.y + n], dist[id]+1);
                }
            }

            //(act.x - n, act.y - n + 1) - (act.x - n, act.y + n - 1)
            /*int l = (act.y + n) / (2 * n - 1) - 1;
            if(act.x >= n) {
                int i = (act.x - n) * col + l;
                if(l != -1) {
                    int pos = (act.x - n) * col + rhor[i],
                        sup = max(lhor[i], act.y - n + 1);
                    while(rhor[i] >= sup) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({act.x - n, rhor[i]});
                        pos--;
                        rhor[i]--;
                    }
                }
                i++;
                if((2 * n - 1) * (l+1) < col) {
                    int pos = (act.x - n) * col + lhor[i],
                        inf = min(rhor[i], act.y + n - 1);
                    while(lhor[i] <= inf) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({act.x - n, lhor[i]});
                        pos++;
                        lhor[i]++;
                    }
                }
            }
            //(act.x + n, act.y - n + 1) - (act.x + n, act.y + n - 1)
            if(act.x + n < row) {
                int i = (act.x + n) * col + l;
                if(l != -1) {
                    int pos = (act.x + n) * col + rhor[i],
                        sup = max(lhor[i], act.y - n + 1);
                    while(rhor[i] >= sup) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({act.x + n, rhor[i]});
                        pos--;
                        rhor[i]--;
                    }
                }
                i++;
                if((2 * n - 1) * (l+1) < col) {
                    int pos = (act.x + n) * col + lhor[i],
                        inf = min(rhor[i], act.y + n - 1);
                    while(lhor[i] <= inf) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({act.x + n, lhor[i]});
                        pos++;
                        lhor[i]++;
                    }
                }
            }


            //(act.x - n + 1, act.y - n) - (act.x + n - 1, act.y - n)
            int h = (act.x + n) / (2 * n - 1) - 1;
            if(act.y >= n) {
                int i = h * col + (act.y - n);
                if(h != -1) {
                    int pos = rver[i] * col + act.y - n,
                        sup = max(lver[i], act.x - n + 1);
                    while(rver[i] >= sup) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({rver[i], act.y - n});
                        pos -= col;
                        rver[i]--;
                    }
                }
                i += col;
                if((2 * n - 1) * (h+1) < row) {
                    int pos = lver[i] * col + act.y - n,
                        inf = min(rver[i], act.x + n - 1);
                    while(lver[i] <= inf) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({lver[i], act.y - n});
                        pos += col;
                        lver[i]++;
                    }
                }
            }
            //(act.x - n + 1, act.y + n) - (act.x + n - 1, act.y + n)
            if(act.y + n < col) {
                int i = h * col + (act.y + n);
                if(h != -1) {
                    int pos = rver[i] * col + act.y + n,
                        sup = max(lver[i], act.x - n + 1);
                    while(rver[i] >= sup) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({rver[i], act.y + n});
                        pos -= col;
                        rver[i]--;
                    }
                }
                i += col;
                if((2 * n - 1) * (h+1) < row) {
                    int pos = lver[i] * col + act.y + n,
                        inf = min(rver[i], act.x + n - 1);
                    while(lver[i] <= inf) {
                        dist[pos] = min(dist[pos], dist[id]+1);
                        dq.push_back({lver[i], act.y + n});
                        pos += col;
                        lver[i]++;
                    }
                }
            }*/
        }
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> row >> col >> n >> ldeb >> cdeb >> lfin >> cfin;
    ldeb--, cdeb--, lfin--, cfin--;

    for(int i = 0; i < 4; i++)
        trans[i] = dl[i] * col + dc[i];
    for(int i = 0; i < row*col; i++)
        dist[i] = INF;
    for(int i = 0; i < row; i++)
        for(int j = 0; j < col; j++) {
            char c; cin >> c;
            etat[i * col + j] = (c == '.');
        }
    /*
    for(int i = 0; i < row; i++)
        for(int j = 0; (2*n-1)*j < col; j++) {
            lhor[i * col + j] = (2*n-1)*j;
            rhor[i * col + j] = min((2*n-1)*(j+1), col)-1;
        }
    for(int i = 0; (2*n-1)*i < row; i++)
        for(int j = 0; j < col; j++) {
            lver[i * col + j] = (2*n-1)*i;
            rver[i * col + j] = min((2*n-1)*(i+1), row)-1;
        }
    */
    BFS();
    ans = min(ans, dist[lfin * col + cfin]);
    cout << ans << '\n';
}
# 결과 실행 시간 메모리 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 328 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 324 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 724 KB Output is correct
20 Correct 2 ms 596 KB Output is correct
21 Correct 7 ms 2772 KB Output is correct
22 Correct 6 ms 724 KB Output is correct
23 Correct 4 ms 724 KB Output is correct
24 Correct 3 ms 720 KB Output is correct
25 Correct 4 ms 724 KB Output is correct
26 Correct 6 ms 1080 KB Output is correct
27 Correct 5 ms 904 KB Output is correct
28 Correct 4 ms 796 KB Output is correct
29 Correct 15 ms 1364 KB Output is correct
30 Correct 5 ms 724 KB Output is correct
31 Correct 15 ms 6348 KB Output is correct
32 Correct 12 ms 1476 KB Output is correct
33 Correct 10 ms 1364 KB Output is correct
34 Correct 11 ms 1364 KB Output is correct
35 Correct 8 ms 1316 KB Output is correct
36 Correct 16 ms 1748 KB Output is correct
37 Correct 14 ms 1572 KB Output is correct
38 Correct 12 ms 1432 KB Output is correct
39 Correct 164 ms 10548 KB Output is correct
40 Correct 15 ms 1516 KB Output is correct
41 Correct 9 ms 1620 KB Output is correct
42 Correct 16 ms 1820 KB Output is correct
43 Correct 15 ms 1940 KB Output is correct
44 Correct 60 ms 5340 KB Output is correct
45 Correct 72 ms 5784 KB Output is correct
46 Correct 193 ms 63224 KB Output is correct
47 Correct 155 ms 10860 KB Output is correct
48 Correct 102 ms 10612 KB Output is correct
49 Correct 69 ms 10576 KB Output is correct
50 Correct 70 ms 10572 KB Output is correct
51 Correct 152 ms 12548 KB Output is correct
52 Correct 149 ms 11316 KB Output is correct
53 Correct 112 ms 10792 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 328 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 332 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 328 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 1 ms 324 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 360 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 324 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 328 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 328 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 324 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 320 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 0 ms 324 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 3 ms 1364 KB Output is correct
25 Correct 9 ms 800 KB Output is correct
26 Correct 25 ms 12408 KB Output is correct
27 Correct 6 ms 2772 KB Output is correct
28 Correct 69 ms 1816 KB Output is correct
29 Correct 1 ms 596 KB Output is correct
30 Correct 1 ms 596 KB Output is correct
31 Correct 92 ms 9736 KB Output is correct
32 Correct 5 ms 980 KB Output is correct
33 Correct 5 ms 856 KB Output is correct
34 Correct 554 ms 280544 KB Output is correct
35 Correct 20 ms 6348 KB Output is correct
36 Correct 312 ms 2352 KB Output is correct
37 Correct 2 ms 1236 KB Output is correct
38 Correct 2 ms 1108 KB Output is correct
39 Correct 1084 ms 502436 KB Output is correct
40 Execution timed out 2142 ms 1217076 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 328 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 332 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 328 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 1 ms 324 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 360 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 324 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 328 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 4 ms 724 KB Output is correct
34 Correct 3 ms 1364 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 9 ms 724 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 27 ms 12480 KB Output is correct
39 Correct 6 ms 2772 KB Output is correct
40 Correct 6 ms 724 KB Output is correct
41 Correct 6 ms 724 KB Output is correct
42 Correct 70 ms 1820 KB Output is correct
43 Correct 1 ms 596 KB Output is correct
44 Correct 1 ms 596 KB Output is correct
45 Correct 4 ms 724 KB Output is correct
46 Correct 3 ms 724 KB Output is correct
47 Correct 5 ms 724 KB Output is correct
48 Correct 24 ms 1048 KB Output is correct
49 Correct 41 ms 1620 KB Output is correct
50 Correct 57 ms 2976 KB Output is correct
51 Correct 86 ms 9780 KB Output is correct
52 Correct 5 ms 980 KB Output is correct
53 Correct 8 ms 852 KB Output is correct
54 Correct 4 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 328 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 332 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 328 KB Output is correct
13 Correct 2 ms 340 KB Output is correct
14 Correct 1 ms 324 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 360 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 324 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 328 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 0 ms 340 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 4 ms 724 KB Output is correct
34 Correct 3 ms 1364 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 9 ms 724 KB Output is correct
37 Correct 2 ms 596 KB Output is correct
38 Correct 27 ms 12480 KB Output is correct
39 Correct 6 ms 2772 KB Output is correct
40 Correct 6 ms 724 KB Output is correct
41 Correct 6 ms 724 KB Output is correct
42 Correct 70 ms 1820 KB Output is correct
43 Correct 1 ms 596 KB Output is correct
44 Correct 1 ms 596 KB Output is correct
45 Correct 4 ms 724 KB Output is correct
46 Correct 3 ms 724 KB Output is correct
47 Correct 5 ms 724 KB Output is correct
48 Correct 24 ms 1048 KB Output is correct
49 Correct 41 ms 1620 KB Output is correct
50 Correct 57 ms 2976 KB Output is correct
51 Correct 86 ms 9780 KB Output is correct
52 Correct 5 ms 980 KB Output is correct
53 Correct 8 ms 852 KB Output is correct
54 Correct 4 ms 724 KB Output is correct
55 Correct 10 ms 1364 KB Output is correct
56 Correct 5 ms 724 KB Output is correct
57 Correct 535 ms 280540 KB Output is correct
58 Correct 29 ms 1260 KB Output is correct
59 Correct 14 ms 6356 KB Output is correct
60 Correct 12 ms 1492 KB Output is correct
61 Correct 10 ms 1404 KB Output is correct
62 Correct 299 ms 2268 KB Output is correct
63 Correct 2 ms 1236 KB Output is correct
64 Correct 3 ms 1236 KB Output is correct
65 Correct 9 ms 1376 KB Output is correct
66 Correct 6 ms 1364 KB Output is correct
67 Correct 17 ms 1368 KB Output is correct
68 Correct 88 ms 2036 KB Output is correct
69 Correct 133 ms 3988 KB Output is correct
70 Correct 192 ms 9116 KB Output is correct
71 Correct 330 ms 30356 KB Output is correct
72 Correct 12 ms 1808 KB Output is correct
73 Correct 13 ms 1620 KB Output is correct
74 Correct 10 ms 1440 KB Output is correct
# 결과 실행 시간 메모리 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 328 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 324 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 724 KB Output is correct
20 Correct 2 ms 596 KB Output is correct
21 Correct 7 ms 2772 KB Output is correct
22 Correct 6 ms 724 KB Output is correct
23 Correct 4 ms 724 KB Output is correct
24 Correct 3 ms 720 KB Output is correct
25 Correct 4 ms 724 KB Output is correct
26 Correct 6 ms 1080 KB Output is correct
27 Correct 5 ms 904 KB Output is correct
28 Correct 4 ms 796 KB Output is correct
29 Correct 15 ms 1364 KB Output is correct
30 Correct 5 ms 724 KB Output is correct
31 Correct 15 ms 6348 KB Output is correct
32 Correct 12 ms 1476 KB Output is correct
33 Correct 10 ms 1364 KB Output is correct
34 Correct 11 ms 1364 KB Output is correct
35 Correct 8 ms 1316 KB Output is correct
36 Correct 16 ms 1748 KB Output is correct
37 Correct 14 ms 1572 KB Output is correct
38 Correct 12 ms 1432 KB Output is correct
39 Correct 164 ms 10548 KB Output is correct
40 Correct 15 ms 1516 KB Output is correct
41 Correct 9 ms 1620 KB Output is correct
42 Correct 16 ms 1820 KB Output is correct
43 Correct 15 ms 1940 KB Output is correct
44 Correct 60 ms 5340 KB Output is correct
45 Correct 72 ms 5784 KB Output is correct
46 Correct 193 ms 63224 KB Output is correct
47 Correct 155 ms 10860 KB Output is correct
48 Correct 102 ms 10612 KB Output is correct
49 Correct 69 ms 10576 KB Output is correct
50 Correct 70 ms 10572 KB Output is correct
51 Correct 152 ms 12548 KB Output is correct
52 Correct 149 ms 11316 KB Output is correct
53 Correct 112 ms 10792 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 328 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 332 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 328 KB Output is correct
66 Correct 2 ms 340 KB Output is correct
67 Correct 1 ms 324 KB Output is correct
68 Correct 1 ms 332 KB Output is correct
69 Correct 1 ms 384 KB Output is correct
70 Correct 1 ms 360 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 324 KB Output is correct
75 Correct 1 ms 328 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 1 ms 328 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 328 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 0 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 324 KB Output is correct
93 Correct 1 ms 324 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 320 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 324 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 340 KB Output is correct
105 Correct 1 ms 340 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 332 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 3 ms 1364 KB Output is correct
110 Correct 9 ms 800 KB Output is correct
111 Correct 25 ms 12408 KB Output is correct
112 Correct 6 ms 2772 KB Output is correct
113 Correct 69 ms 1816 KB Output is correct
114 Correct 1 ms 596 KB Output is correct
115 Correct 1 ms 596 KB Output is correct
116 Correct 92 ms 9736 KB Output is correct
117 Correct 5 ms 980 KB Output is correct
118 Correct 5 ms 856 KB Output is correct
119 Correct 554 ms 280544 KB Output is correct
120 Correct 20 ms 6348 KB Output is correct
121 Correct 312 ms 2352 KB Output is correct
122 Correct 2 ms 1236 KB Output is correct
123 Correct 2 ms 1108 KB Output is correct
124 Correct 1084 ms 502436 KB Output is correct
125 Execution timed out 2142 ms 1217076 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 328 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 324 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 724 KB Output is correct
20 Correct 2 ms 596 KB Output is correct
21 Correct 7 ms 2772 KB Output is correct
22 Correct 6 ms 724 KB Output is correct
23 Correct 4 ms 724 KB Output is correct
24 Correct 3 ms 720 KB Output is correct
25 Correct 4 ms 724 KB Output is correct
26 Correct 6 ms 1080 KB Output is correct
27 Correct 5 ms 904 KB Output is correct
28 Correct 4 ms 796 KB Output is correct
29 Correct 15 ms 1364 KB Output is correct
30 Correct 5 ms 724 KB Output is correct
31 Correct 15 ms 6348 KB Output is correct
32 Correct 12 ms 1476 KB Output is correct
33 Correct 10 ms 1364 KB Output is correct
34 Correct 11 ms 1364 KB Output is correct
35 Correct 8 ms 1316 KB Output is correct
36 Correct 16 ms 1748 KB Output is correct
37 Correct 14 ms 1572 KB Output is correct
38 Correct 12 ms 1432 KB Output is correct
39 Correct 164 ms 10548 KB Output is correct
40 Correct 15 ms 1516 KB Output is correct
41 Correct 9 ms 1620 KB Output is correct
42 Correct 16 ms 1820 KB Output is correct
43 Correct 15 ms 1940 KB Output is correct
44 Correct 60 ms 5340 KB Output is correct
45 Correct 72 ms 5784 KB Output is correct
46 Correct 193 ms 63224 KB Output is correct
47 Correct 155 ms 10860 KB Output is correct
48 Correct 102 ms 10612 KB Output is correct
49 Correct 69 ms 10576 KB Output is correct
50 Correct 70 ms 10572 KB Output is correct
51 Correct 152 ms 12548 KB Output is correct
52 Correct 149 ms 11316 KB Output is correct
53 Correct 112 ms 10792 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 328 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 332 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 328 KB Output is correct
66 Correct 2 ms 340 KB Output is correct
67 Correct 1 ms 324 KB Output is correct
68 Correct 1 ms 332 KB Output is correct
69 Correct 1 ms 384 KB Output is correct
70 Correct 1 ms 360 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 324 KB Output is correct
75 Correct 1 ms 328 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 1 ms 328 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 328 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 0 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 324 KB Output is correct
93 Correct 1 ms 324 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 320 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 324 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 340 KB Output is correct
105 Correct 1 ms 340 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 332 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 3 ms 1364 KB Output is correct
110 Correct 9 ms 800 KB Output is correct
111 Correct 25 ms 12408 KB Output is correct
112 Correct 6 ms 2772 KB Output is correct
113 Correct 69 ms 1816 KB Output is correct
114 Correct 1 ms 596 KB Output is correct
115 Correct 1 ms 596 KB Output is correct
116 Correct 92 ms 9736 KB Output is correct
117 Correct 5 ms 980 KB Output is correct
118 Correct 5 ms 856 KB Output is correct
119 Correct 554 ms 280544 KB Output is correct
120 Correct 20 ms 6348 KB Output is correct
121 Correct 312 ms 2352 KB Output is correct
122 Correct 2 ms 1236 KB Output is correct
123 Correct 2 ms 1108 KB Output is correct
124 Correct 1084 ms 502436 KB Output is correct
125 Execution timed out 2142 ms 1217076 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 328 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 324 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 328 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 4 ms 724 KB Output is correct
20 Correct 2 ms 596 KB Output is correct
21 Correct 7 ms 2772 KB Output is correct
22 Correct 6 ms 724 KB Output is correct
23 Correct 4 ms 724 KB Output is correct
24 Correct 3 ms 720 KB Output is correct
25 Correct 4 ms 724 KB Output is correct
26 Correct 6 ms 1080 KB Output is correct
27 Correct 5 ms 904 KB Output is correct
28 Correct 4 ms 796 KB Output is correct
29 Correct 15 ms 1364 KB Output is correct
30 Correct 5 ms 724 KB Output is correct
31 Correct 15 ms 6348 KB Output is correct
32 Correct 12 ms 1476 KB Output is correct
33 Correct 10 ms 1364 KB Output is correct
34 Correct 11 ms 1364 KB Output is correct
35 Correct 8 ms 1316 KB Output is correct
36 Correct 16 ms 1748 KB Output is correct
37 Correct 14 ms 1572 KB Output is correct
38 Correct 12 ms 1432 KB Output is correct
39 Correct 164 ms 10548 KB Output is correct
40 Correct 15 ms 1516 KB Output is correct
41 Correct 9 ms 1620 KB Output is correct
42 Correct 16 ms 1820 KB Output is correct
43 Correct 15 ms 1940 KB Output is correct
44 Correct 60 ms 5340 KB Output is correct
45 Correct 72 ms 5784 KB Output is correct
46 Correct 193 ms 63224 KB Output is correct
47 Correct 155 ms 10860 KB Output is correct
48 Correct 102 ms 10612 KB Output is correct
49 Correct 69 ms 10576 KB Output is correct
50 Correct 70 ms 10572 KB Output is correct
51 Correct 152 ms 12548 KB Output is correct
52 Correct 149 ms 11316 KB Output is correct
53 Correct 112 ms 10792 KB Output is correct
54 Correct 1 ms 332 KB Output is correct
55 Correct 1 ms 328 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 332 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 328 KB Output is correct
66 Correct 2 ms 340 KB Output is correct
67 Correct 1 ms 324 KB Output is correct
68 Correct 1 ms 332 KB Output is correct
69 Correct 1 ms 384 KB Output is correct
70 Correct 1 ms 360 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 340 KB Output is correct
74 Correct 1 ms 324 KB Output is correct
75 Correct 1 ms 328 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 1 ms 328 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 0 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 328 KB Output is correct
89 Correct 0 ms 340 KB Output is correct
90 Correct 0 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 324 KB Output is correct
93 Correct 1 ms 324 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 ms 320 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 1 ms 340 KB Output is correct
100 Correct 0 ms 324 KB Output is correct
101 Correct 1 ms 340 KB Output is correct
102 Correct 1 ms 340 KB Output is correct
103 Correct 1 ms 340 KB Output is correct
104 Correct 1 ms 340 KB Output is correct
105 Correct 1 ms 340 KB Output is correct
106 Correct 1 ms 340 KB Output is correct
107 Correct 1 ms 332 KB Output is correct
108 Correct 1 ms 340 KB Output is correct
109 Correct 3 ms 1364 KB Output is correct
110 Correct 9 ms 800 KB Output is correct
111 Correct 25 ms 12408 KB Output is correct
112 Correct 6 ms 2772 KB Output is correct
113 Correct 69 ms 1816 KB Output is correct
114 Correct 1 ms 596 KB Output is correct
115 Correct 1 ms 596 KB Output is correct
116 Correct 92 ms 9736 KB Output is correct
117 Correct 5 ms 980 KB Output is correct
118 Correct 5 ms 856 KB Output is correct
119 Correct 554 ms 280544 KB Output is correct
120 Correct 20 ms 6348 KB Output is correct
121 Correct 312 ms 2352 KB Output is correct
122 Correct 2 ms 1236 KB Output is correct
123 Correct 2 ms 1108 KB Output is correct
124 Correct 1084 ms 502436 KB Output is correct
125 Execution timed out 2142 ms 1217076 KB Time limit exceeded
126 Halted 0 ms 0 KB -