Submission #987718

# Submission time Handle Problem Language Result Execution time Memory
987718 2024-05-23T12:14:43 Z Zero_OP Maze (JOI23_ho_t3) C++14
62 / 100
98 ms 15840 KB
//no template practicing
#include<bits/stdc++.h>

using namespace std;

const int dx[4] = {0, 0, -1, +1};
const int dy[4] = {-1, 1, 0, 0};

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int R, C, N, rs, cs, rt, ct;
    cin >> R >> C >> N >> rs >> cs >> rt >> ct;
    --rs, --cs, --rt, --ct;
    vector<vector<char>> a(R, vector<char>(C));
    vector<vector<int>> d(R, vector<int>(C, -1));

    for(int i = 0; i < R; ++i){
        for(int j = 0; j < C; ++j){
            cin >> a[i][j];
        }
    }

    queue<pair<int, int>> white_queue;
    queue<tuple<int, int, int, int>> black_queue;

    white_queue.push({rs, cs});
    d[rs][cs] = 0;

    auto inside = [&](int r, int c){
        return -1 < r && r < R && -1 < c && c < C;
    };

    while(!white_queue.empty() || !black_queue.empty()){
        while(!white_queue.empty()){
            int r, c;
            tie(r, c) = white_queue.front(); white_queue.pop();

            for(int i = 0; i < 4; ++i){
                int nr = r + dx[i], nc = c + dy[i];
                if(inside(nr, nc) && d[nr][nc] == -1){
                    if(a[nr][nc] == '.'){
                        d[nr][nc] = d[r][c];
                        white_queue.push({nr, nc});
                    }
                    else{
                        d[nr][nc] = d[r][c] + 1;
                        black_queue.push({nr, nc, N - 1, N - 1});
                    }
                }
            }
        }

        while(!black_queue.empty()){
            int r, c, dist_r, dist_c;
            tie(r, c, dist_r, dist_c) = black_queue.front(); black_queue.pop();

            if(dist_r == 0 || dist_c == 0){
                white_queue.push({r, c});
            }

            for(int i = 0; i < 4; ++i){
                int nr = r + dx[i], nc = c + dy[i];
                int n_dist_r = dist_r - abs(dx[i]), n_dist_c = dist_c - abs(dy[i]);
                if(inside(nr, nc) && d[nr][nc] == -1 && n_dist_r >= 0 && n_dist_c >= 0){
                    d[nr][nc] = d[r][c];
                    black_queue.push({nr, nc, n_dist_r, n_dist_c});
                }
            }
        }
    }

    cout << d[rt][ct] << '\n';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 3 ms 604 KB Output is correct
20 Correct 2 ms 856 KB Output is correct
21 Correct 2 ms 604 KB Output is correct
22 Correct 4 ms 600 KB Output is correct
23 Correct 4 ms 600 KB Output is correct
24 Correct 2 ms 856 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 604 KB Output is correct
27 Correct 4 ms 604 KB Output is correct
28 Correct 3 ms 780 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 860 KB Output is correct
31 Correct 4 ms 1116 KB Output is correct
32 Correct 8 ms 1256 KB Output is correct
33 Correct 7 ms 1116 KB Output is correct
34 Correct 5 ms 1736 KB Output is correct
35 Correct 6 ms 1736 KB Output is correct
36 Correct 8 ms 1116 KB Output is correct
37 Correct 8 ms 1112 KB Output is correct
38 Correct 8 ms 1116 KB Output is correct
39 Correct 76 ms 7912 KB Output is correct
40 Correct 9 ms 1116 KB Output is correct
41 Correct 7 ms 1956 KB Output is correct
42 Correct 12 ms 1372 KB Output is correct
43 Correct 11 ms 2140 KB Output is correct
44 Correct 33 ms 4700 KB Output is correct
45 Correct 44 ms 4796 KB Output is correct
46 Correct 58 ms 7976 KB Output is correct
47 Correct 98 ms 7920 KB Output is correct
48 Correct 83 ms 7768 KB Output is correct
49 Correct 46 ms 13472 KB Output is correct
50 Correct 54 ms 13724 KB Output is correct
51 Correct 88 ms 8376 KB Output is correct
52 Correct 87 ms 8024 KB Output is correct
53 Correct 79 ms 7772 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 408 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 3 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 2 ms 600 KB Output is correct
29 Correct 2 ms 604 KB Output is correct
30 Correct 3 ms 600 KB Output is correct
31 Correct 3 ms 600 KB Output is correct
32 Correct 4 ms 604 KB Output is correct
33 Correct 4 ms 604 KB Output is correct
34 Correct 5 ms 1368 KB Output is correct
35 Correct 4 ms 1116 KB Output is correct
36 Correct 6 ms 1116 KB Output is correct
37 Correct 5 ms 1112 KB Output is correct
38 Correct 5 ms 1116 KB Output is correct
39 Correct 18 ms 4444 KB Output is correct
40 Correct 58 ms 11984 KB Output is correct
41 Correct 39 ms 8020 KB Output is correct
42 Correct 41 ms 8016 KB Output is correct
43 Correct 45 ms 7896 KB Output is correct
44 Correct 44 ms 7772 KB Output is correct
45 Correct 70 ms 15592 KB Output is correct
46 Correct 70 ms 15840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 3 ms 604 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 2 ms 604 KB Output is correct
37 Correct 3 ms 1112 KB Output is correct
38 Correct 2 ms 860 KB Output is correct
39 Correct 2 ms 604 KB Output is correct
40 Correct 3 ms 604 KB Output is correct
41 Correct 3 ms 600 KB Output is correct
42 Correct 2 ms 604 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 2 ms 604 KB Output is correct
45 Correct 2 ms 860 KB Output is correct
46 Correct 3 ms 856 KB Output is correct
47 Correct 3 ms 860 KB Output is correct
48 Correct 3 ms 604 KB Output is correct
49 Correct 2 ms 604 KB Output is correct
50 Correct 2 ms 604 KB Output is correct
51 Correct 2 ms 604 KB Output is correct
52 Correct 4 ms 600 KB Output is correct
53 Correct 4 ms 604 KB Output is correct
54 Correct 3 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 344 KB Output is correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 3 ms 604 KB Output is correct
34 Correct 1 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 2 ms 604 KB Output is correct
37 Correct 3 ms 1112 KB Output is correct
38 Correct 2 ms 860 KB Output is correct
39 Correct 2 ms 604 KB Output is correct
40 Correct 3 ms 604 KB Output is correct
41 Correct 3 ms 600 KB Output is correct
42 Correct 2 ms 604 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 2 ms 604 KB Output is correct
45 Correct 2 ms 860 KB Output is correct
46 Correct 3 ms 856 KB Output is correct
47 Correct 3 ms 860 KB Output is correct
48 Correct 3 ms 604 KB Output is correct
49 Correct 2 ms 604 KB Output is correct
50 Correct 2 ms 604 KB Output is correct
51 Correct 2 ms 604 KB Output is correct
52 Correct 4 ms 600 KB Output is correct
53 Correct 4 ms 604 KB Output is correct
54 Correct 3 ms 600 KB Output is correct
55 Correct 9 ms 1116 KB Output is correct
56 Correct 4 ms 860 KB Output is correct
57 Correct 5 ms 1368 KB Output is correct
58 Incorrect 7 ms 1116 KB Output isn't correct
59 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 3 ms 604 KB Output is correct
20 Correct 2 ms 856 KB Output is correct
21 Correct 2 ms 604 KB Output is correct
22 Correct 4 ms 600 KB Output is correct
23 Correct 4 ms 600 KB Output is correct
24 Correct 2 ms 856 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 604 KB Output is correct
27 Correct 4 ms 604 KB Output is correct
28 Correct 3 ms 780 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 860 KB Output is correct
31 Correct 4 ms 1116 KB Output is correct
32 Correct 8 ms 1256 KB Output is correct
33 Correct 7 ms 1116 KB Output is correct
34 Correct 5 ms 1736 KB Output is correct
35 Correct 6 ms 1736 KB Output is correct
36 Correct 8 ms 1116 KB Output is correct
37 Correct 8 ms 1112 KB Output is correct
38 Correct 8 ms 1116 KB Output is correct
39 Correct 76 ms 7912 KB Output is correct
40 Correct 9 ms 1116 KB Output is correct
41 Correct 7 ms 1956 KB Output is correct
42 Correct 12 ms 1372 KB Output is correct
43 Correct 11 ms 2140 KB Output is correct
44 Correct 33 ms 4700 KB Output is correct
45 Correct 44 ms 4796 KB Output is correct
46 Correct 58 ms 7976 KB Output is correct
47 Correct 98 ms 7920 KB Output is correct
48 Correct 83 ms 7768 KB Output is correct
49 Correct 46 ms 13472 KB Output is correct
50 Correct 54 ms 13724 KB Output is correct
51 Correct 88 ms 8376 KB Output is correct
52 Correct 87 ms 8024 KB Output is correct
53 Correct 79 ms 7772 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 344 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 1 ms 344 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 0 ms 408 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 1 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 3 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 600 KB Output is correct
114 Correct 2 ms 604 KB Output is correct
115 Correct 3 ms 600 KB Output is correct
116 Correct 3 ms 600 KB Output is correct
117 Correct 4 ms 604 KB Output is correct
118 Correct 4 ms 604 KB Output is correct
119 Correct 5 ms 1368 KB Output is correct
120 Correct 4 ms 1116 KB Output is correct
121 Correct 6 ms 1116 KB Output is correct
122 Correct 5 ms 1112 KB Output is correct
123 Correct 5 ms 1116 KB Output is correct
124 Correct 18 ms 4444 KB Output is correct
125 Correct 58 ms 11984 KB Output is correct
126 Correct 39 ms 8020 KB Output is correct
127 Correct 41 ms 8016 KB Output is correct
128 Correct 45 ms 7896 KB Output is correct
129 Correct 44 ms 7772 KB Output is correct
130 Correct 70 ms 15592 KB Output is correct
131 Correct 70 ms 15840 KB Output is correct
132 Correct 3 ms 604 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 604 KB Output is correct
136 Correct 3 ms 1112 KB Output is correct
137 Correct 2 ms 860 KB Output is correct
138 Correct 2 ms 604 KB Output is correct
139 Correct 3 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 2 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 2 ms 604 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 856 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 2 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 604 KB Output is correct
151 Correct 4 ms 600 KB Output is correct
152 Correct 4 ms 604 KB Output is correct
153 Correct 3 ms 600 KB Output is correct
154 Correct 9 ms 1116 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 5 ms 1368 KB Output is correct
157 Incorrect 7 ms 1116 KB Output isn't correct
158 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 3 ms 604 KB Output is correct
20 Correct 2 ms 856 KB Output is correct
21 Correct 2 ms 604 KB Output is correct
22 Correct 4 ms 600 KB Output is correct
23 Correct 4 ms 600 KB Output is correct
24 Correct 2 ms 856 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 604 KB Output is correct
27 Correct 4 ms 604 KB Output is correct
28 Correct 3 ms 780 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 860 KB Output is correct
31 Correct 4 ms 1116 KB Output is correct
32 Correct 8 ms 1256 KB Output is correct
33 Correct 7 ms 1116 KB Output is correct
34 Correct 5 ms 1736 KB Output is correct
35 Correct 6 ms 1736 KB Output is correct
36 Correct 8 ms 1116 KB Output is correct
37 Correct 8 ms 1112 KB Output is correct
38 Correct 8 ms 1116 KB Output is correct
39 Correct 76 ms 7912 KB Output is correct
40 Correct 9 ms 1116 KB Output is correct
41 Correct 7 ms 1956 KB Output is correct
42 Correct 12 ms 1372 KB Output is correct
43 Correct 11 ms 2140 KB Output is correct
44 Correct 33 ms 4700 KB Output is correct
45 Correct 44 ms 4796 KB Output is correct
46 Correct 58 ms 7976 KB Output is correct
47 Correct 98 ms 7920 KB Output is correct
48 Correct 83 ms 7768 KB Output is correct
49 Correct 46 ms 13472 KB Output is correct
50 Correct 54 ms 13724 KB Output is correct
51 Correct 88 ms 8376 KB Output is correct
52 Correct 87 ms 8024 KB Output is correct
53 Correct 79 ms 7772 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 344 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 1 ms 344 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 0 ms 408 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 1 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 3 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 600 KB Output is correct
114 Correct 2 ms 604 KB Output is correct
115 Correct 3 ms 600 KB Output is correct
116 Correct 3 ms 600 KB Output is correct
117 Correct 4 ms 604 KB Output is correct
118 Correct 4 ms 604 KB Output is correct
119 Correct 5 ms 1368 KB Output is correct
120 Correct 4 ms 1116 KB Output is correct
121 Correct 6 ms 1116 KB Output is correct
122 Correct 5 ms 1112 KB Output is correct
123 Correct 5 ms 1116 KB Output is correct
124 Correct 18 ms 4444 KB Output is correct
125 Correct 58 ms 11984 KB Output is correct
126 Correct 39 ms 8020 KB Output is correct
127 Correct 41 ms 8016 KB Output is correct
128 Correct 45 ms 7896 KB Output is correct
129 Correct 44 ms 7772 KB Output is correct
130 Correct 70 ms 15592 KB Output is correct
131 Correct 70 ms 15840 KB Output is correct
132 Correct 3 ms 604 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 604 KB Output is correct
136 Correct 3 ms 1112 KB Output is correct
137 Correct 2 ms 860 KB Output is correct
138 Correct 2 ms 604 KB Output is correct
139 Correct 3 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 2 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 2 ms 604 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 856 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 2 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 604 KB Output is correct
151 Correct 4 ms 600 KB Output is correct
152 Correct 4 ms 604 KB Output is correct
153 Correct 3 ms 600 KB Output is correct
154 Correct 9 ms 1116 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 5 ms 1368 KB Output is correct
157 Incorrect 7 ms 1116 KB Output isn't correct
158 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 3 ms 604 KB Output is correct
20 Correct 2 ms 856 KB Output is correct
21 Correct 2 ms 604 KB Output is correct
22 Correct 4 ms 600 KB Output is correct
23 Correct 4 ms 600 KB Output is correct
24 Correct 2 ms 856 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 604 KB Output is correct
27 Correct 4 ms 604 KB Output is correct
28 Correct 3 ms 780 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 860 KB Output is correct
31 Correct 4 ms 1116 KB Output is correct
32 Correct 8 ms 1256 KB Output is correct
33 Correct 7 ms 1116 KB Output is correct
34 Correct 5 ms 1736 KB Output is correct
35 Correct 6 ms 1736 KB Output is correct
36 Correct 8 ms 1116 KB Output is correct
37 Correct 8 ms 1112 KB Output is correct
38 Correct 8 ms 1116 KB Output is correct
39 Correct 76 ms 7912 KB Output is correct
40 Correct 9 ms 1116 KB Output is correct
41 Correct 7 ms 1956 KB Output is correct
42 Correct 12 ms 1372 KB Output is correct
43 Correct 11 ms 2140 KB Output is correct
44 Correct 33 ms 4700 KB Output is correct
45 Correct 44 ms 4796 KB Output is correct
46 Correct 58 ms 7976 KB Output is correct
47 Correct 98 ms 7920 KB Output is correct
48 Correct 83 ms 7768 KB Output is correct
49 Correct 46 ms 13472 KB Output is correct
50 Correct 54 ms 13724 KB Output is correct
51 Correct 88 ms 8376 KB Output is correct
52 Correct 87 ms 8024 KB Output is correct
53 Correct 79 ms 7772 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 1 ms 344 KB Output is correct
58 Correct 1 ms 344 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 1 ms 344 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 1 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 1 ms 348 KB Output is correct
91 Correct 0 ms 408 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 1 ms 344 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 1 ms 348 KB Output is correct
101 Correct 1 ms 348 KB Output is correct
102 Correct 1 ms 348 KB Output is correct
103 Correct 1 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 1 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 3 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 600 KB Output is correct
114 Correct 2 ms 604 KB Output is correct
115 Correct 3 ms 600 KB Output is correct
116 Correct 3 ms 600 KB Output is correct
117 Correct 4 ms 604 KB Output is correct
118 Correct 4 ms 604 KB Output is correct
119 Correct 5 ms 1368 KB Output is correct
120 Correct 4 ms 1116 KB Output is correct
121 Correct 6 ms 1116 KB Output is correct
122 Correct 5 ms 1112 KB Output is correct
123 Correct 5 ms 1116 KB Output is correct
124 Correct 18 ms 4444 KB Output is correct
125 Correct 58 ms 11984 KB Output is correct
126 Correct 39 ms 8020 KB Output is correct
127 Correct 41 ms 8016 KB Output is correct
128 Correct 45 ms 7896 KB Output is correct
129 Correct 44 ms 7772 KB Output is correct
130 Correct 70 ms 15592 KB Output is correct
131 Correct 70 ms 15840 KB Output is correct
132 Correct 3 ms 604 KB Output is correct
133 Correct 1 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 604 KB Output is correct
136 Correct 3 ms 1112 KB Output is correct
137 Correct 2 ms 860 KB Output is correct
138 Correct 2 ms 604 KB Output is correct
139 Correct 3 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 2 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 2 ms 604 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 856 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 2 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 604 KB Output is correct
151 Correct 4 ms 600 KB Output is correct
152 Correct 4 ms 604 KB Output is correct
153 Correct 3 ms 600 KB Output is correct
154 Correct 9 ms 1116 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 5 ms 1368 KB Output is correct
157 Incorrect 7 ms 1116 KB Output isn't correct
158 Halted 0 ms 0 KB -