Submission #941659

# Submission time Handle Problem Language Result Execution time Memory
941659 2024-03-09T09:04:07 Z peterandvoi Maze (JOI23_ho_t3) C++17
100 / 100
440 ms 68464 KB
#include <bits/stdc++.h>

using namespace std;

#ifdef ngu
#include "debug.h"
#else
#define debug(...) 42
#endif

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

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    #ifdef ngu
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
    #endif
    int r, c, n;
    cin >> r >> c >> n;
    vector<vector<char>> a(r, vector<char>(c));
    vector<vector<int>> d(r, vector<int>(c, -1));
    int sr, sc, gr, gc;
    cin >> sr >> sc >> gr >> gc;
    sr--; sc--; gr--; gc--;
    for (int i = 0; i < r; ++i) {
        for (int j = 0; j < c; ++j) {
            cin >> a[i][j];
        }
    }
    auto inside = [&](int i, int j) {
        return 0 <= i && i < r && 0 <= j && j < c;
    };
    queue<pair<int, int>> W;
    queue<tuple<int, int, int, int>> B;
    W.emplace(sr, sc);
    d[sr][sc] = 0;
    while (W.size() || B.size()) {
        while (W.size()) {
            auto [x, y] = W.front();
            W.pop();
            for (int dr = 0; dr < 4; ++dr) {
                int i = x + dx[dr], j = y + dy[dr];
                if (inside(i, j) && d[i][j] == -1) {
                    if (a[i][j] == '.') {
                        d[i][j] = d[x][y];
                        W.emplace(i, j);
                    } else {
                        d[i][j] = d[x][y] + 1;
                        B.emplace(i, j, n - 1, n - 1);
                    }
                }
            }
        }
        while (B.size()) {
            auto [x, y, cx, cy] = B.front();
            B.pop();
            if (cx == 0 || cy == 0) {
                W.emplace(x, y);
            }
            for (int dr = 0; dr < 4; ++dr) {
                int i = x + dx[dr], j = y + dy[dr];
                int ci = cx - abs(dx[dr]), cj = cy - abs(dy[dr]);
                if (inside(i, j) && d[i][j] == -1 && ci >= 0 && cj >= 0) {
                    d[i][j] = d[x][y];
                    B.emplace(i, j, ci, cj);
                }
            }
        }
    }
    cout << d[gr][gc];
}
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 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 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 456 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 4 ms 604 KB Output is correct
20 Correct 2 ms 860 KB Output is correct
21 Correct 2 ms 836 KB Output is correct
22 Correct 4 ms 848 KB Output is correct
23 Correct 3 ms 600 KB Output is correct
24 Correct 2 ms 880 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 3 ms 848 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 856 KB Output is correct
31 Correct 6 ms 1372 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 8 ms 1372 KB Output is correct
34 Correct 4 ms 1736 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 9 ms 1372 KB Output is correct
37 Correct 9 ms 1372 KB Output is correct
38 Correct 8 ms 1372 KB Output is correct
39 Correct 81 ms 9160 KB Output is correct
40 Correct 9 ms 1368 KB Output is correct
41 Correct 6 ms 1956 KB Output is correct
42 Correct 12 ms 1636 KB Output is correct
43 Correct 12 ms 2140 KB Output is correct
44 Correct 33 ms 4728 KB Output is correct
45 Correct 45 ms 5192 KB Output is correct
46 Correct 41 ms 9516 KB Output is correct
47 Correct 87 ms 9308 KB Output is correct
48 Correct 80 ms 9616 KB Output is correct
49 Correct 35 ms 13472 KB Output is correct
50 Correct 61 ms 13468 KB Output is correct
51 Correct 86 ms 9752 KB Output is correct
52 Correct 90 ms 9556 KB Output is correct
53 Correct 89 ms 9564 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 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 0 ms 464 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 344 KB Output is correct
20 Correct 0 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 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 460 KB Output is correct
31 Correct 1 ms 344 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 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 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 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 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 0 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 2 ms 604 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 2 ms 604 KB Output is correct
28 Correct 2 ms 604 KB Output is correct
29 Correct 2 ms 720 KB Output is correct
30 Correct 2 ms 604 KB Output is correct
31 Correct 2 ms 720 KB Output is correct
32 Correct 4 ms 860 KB Output is correct
33 Correct 4 ms 860 KB Output is correct
34 Correct 5 ms 1628 KB Output is correct
35 Correct 4 ms 1372 KB Output is correct
36 Correct 4 ms 1368 KB Output is correct
37 Correct 5 ms 1372 KB Output is correct
38 Correct 5 ms 1372 KB Output is correct
39 Correct 19 ms 4892 KB Output is correct
40 Correct 55 ms 13392 KB Output is correct
41 Correct 42 ms 9552 KB Output is correct
42 Correct 40 ms 9412 KB Output is correct
43 Correct 48 ms 9308 KB Output is correct
44 Correct 54 ms 9300 KB Output is correct
45 Correct 68 ms 17464 KB Output is correct
46 Correct 87 ms 17152 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 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 0 ms 464 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 344 KB Output is correct
20 Correct 0 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 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 460 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 4 ms 604 KB Output is correct
34 Correct 0 ms 456 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 2 ms 456 KB Output is correct
37 Correct 3 ms 860 KB Output is correct
38 Correct 2 ms 816 KB Output is correct
39 Correct 2 ms 600 KB Output is correct
40 Correct 4 ms 604 KB Output is correct
41 Correct 3 ms 600 KB Output is correct
42 Correct 3 ms 604 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 3 ms 856 KB Output is correct
45 Correct 2 ms 860 KB Output is correct
46 Correct 3 ms 860 KB Output is correct
47 Correct 3 ms 860 KB Output is correct
48 Correct 3 ms 604 KB Output is correct
49 Correct 3 ms 604 KB Output is correct
50 Correct 2 ms 604 KB Output is correct
51 Correct 2 ms 600 KB Output is correct
52 Correct 4 ms 860 KB Output is correct
53 Correct 4 ms 860 KB Output is correct
54 Correct 4 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 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 0 ms 464 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 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 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 344 KB Output is correct
20 Correct 0 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 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 348 KB Output is correct
28 Correct 1 ms 600 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 460 KB Output is correct
31 Correct 1 ms 344 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 4 ms 604 KB Output is correct
34 Correct 0 ms 456 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 2 ms 456 KB Output is correct
37 Correct 3 ms 860 KB Output is correct
38 Correct 2 ms 816 KB Output is correct
39 Correct 2 ms 600 KB Output is correct
40 Correct 4 ms 604 KB Output is correct
41 Correct 3 ms 600 KB Output is correct
42 Correct 3 ms 604 KB Output is correct
43 Correct 2 ms 604 KB Output is correct
44 Correct 3 ms 856 KB Output is correct
45 Correct 2 ms 860 KB Output is correct
46 Correct 3 ms 860 KB Output is correct
47 Correct 3 ms 860 KB Output is correct
48 Correct 3 ms 604 KB Output is correct
49 Correct 3 ms 604 KB Output is correct
50 Correct 2 ms 604 KB Output is correct
51 Correct 2 ms 600 KB Output is correct
52 Correct 4 ms 860 KB Output is correct
53 Correct 4 ms 860 KB Output is correct
54 Correct 4 ms 604 KB Output is correct
55 Correct 8 ms 1372 KB Output is correct
56 Correct 4 ms 860 KB Output is correct
57 Correct 6 ms 1908 KB Output is correct
58 Correct 7 ms 1116 KB Output is correct
59 Correct 4 ms 1372 KB Output is correct
60 Correct 9 ms 1368 KB Output is correct
61 Correct 8 ms 1380 KB Output is correct
62 Correct 4 ms 1268 KB Output is correct
63 Correct 5 ms 1372 KB Output is correct
64 Correct 5 ms 1368 KB Output is correct
65 Correct 4 ms 1736 KB Output is correct
66 Correct 7 ms 1596 KB Output is correct
67 Correct 6 ms 1372 KB Output is correct
68 Correct 6 ms 1116 KB Output is correct
69 Correct 6 ms 1116 KB Output is correct
70 Correct 5 ms 1116 KB Output is correct
71 Correct 6 ms 1112 KB Output is correct
72 Correct 8 ms 1368 KB Output is correct
73 Correct 9 ms 1368 KB Output is correct
74 Correct 8 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 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 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 456 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 4 ms 604 KB Output is correct
20 Correct 2 ms 860 KB Output is correct
21 Correct 2 ms 836 KB Output is correct
22 Correct 4 ms 848 KB Output is correct
23 Correct 3 ms 600 KB Output is correct
24 Correct 2 ms 880 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 3 ms 848 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 856 KB Output is correct
31 Correct 6 ms 1372 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 8 ms 1372 KB Output is correct
34 Correct 4 ms 1736 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 9 ms 1372 KB Output is correct
37 Correct 9 ms 1372 KB Output is correct
38 Correct 8 ms 1372 KB Output is correct
39 Correct 81 ms 9160 KB Output is correct
40 Correct 9 ms 1368 KB Output is correct
41 Correct 6 ms 1956 KB Output is correct
42 Correct 12 ms 1636 KB Output is correct
43 Correct 12 ms 2140 KB Output is correct
44 Correct 33 ms 4728 KB Output is correct
45 Correct 45 ms 5192 KB Output is correct
46 Correct 41 ms 9516 KB Output is correct
47 Correct 87 ms 9308 KB Output is correct
48 Correct 80 ms 9616 KB Output is correct
49 Correct 35 ms 13472 KB Output is correct
50 Correct 61 ms 13468 KB Output is correct
51 Correct 86 ms 9752 KB Output is correct
52 Correct 90 ms 9556 KB Output is correct
53 Correct 89 ms 9564 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 344 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 456 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 0 ms 464 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 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 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 0 ms 344 KB Output is correct
73 Correct 0 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 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 460 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 2 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 604 KB Output is correct
114 Correct 2 ms 720 KB Output is correct
115 Correct 2 ms 604 KB Output is correct
116 Correct 2 ms 720 KB Output is correct
117 Correct 4 ms 860 KB Output is correct
118 Correct 4 ms 860 KB Output is correct
119 Correct 5 ms 1628 KB Output is correct
120 Correct 4 ms 1372 KB Output is correct
121 Correct 4 ms 1368 KB Output is correct
122 Correct 5 ms 1372 KB Output is correct
123 Correct 5 ms 1372 KB Output is correct
124 Correct 19 ms 4892 KB Output is correct
125 Correct 55 ms 13392 KB Output is correct
126 Correct 42 ms 9552 KB Output is correct
127 Correct 40 ms 9412 KB Output is correct
128 Correct 48 ms 9308 KB Output is correct
129 Correct 54 ms 9300 KB Output is correct
130 Correct 68 ms 17464 KB Output is correct
131 Correct 87 ms 17152 KB Output is correct
132 Correct 4 ms 604 KB Output is correct
133 Correct 0 ms 456 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 456 KB Output is correct
136 Correct 3 ms 860 KB Output is correct
137 Correct 2 ms 816 KB Output is correct
138 Correct 2 ms 600 KB Output is correct
139 Correct 4 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 3 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 3 ms 856 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 860 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 3 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 600 KB Output is correct
151 Correct 4 ms 860 KB Output is correct
152 Correct 4 ms 860 KB Output is correct
153 Correct 4 ms 604 KB Output is correct
154 Correct 8 ms 1372 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 6 ms 1908 KB Output is correct
157 Correct 7 ms 1116 KB Output is correct
158 Correct 4 ms 1372 KB Output is correct
159 Correct 9 ms 1368 KB Output is correct
160 Correct 8 ms 1380 KB Output is correct
161 Correct 4 ms 1268 KB Output is correct
162 Correct 5 ms 1372 KB Output is correct
163 Correct 5 ms 1368 KB Output is correct
164 Correct 4 ms 1736 KB Output is correct
165 Correct 7 ms 1596 KB Output is correct
166 Correct 6 ms 1372 KB Output is correct
167 Correct 6 ms 1116 KB Output is correct
168 Correct 6 ms 1116 KB Output is correct
169 Correct 5 ms 1116 KB Output is correct
170 Correct 6 ms 1112 KB Output is correct
171 Correct 8 ms 1368 KB Output is correct
172 Correct 9 ms 1368 KB Output is correct
173 Correct 8 ms 1372 KB Output is correct
174 Correct 10 ms 1628 KB Output is correct
175 Correct 12 ms 2400 KB Output is correct
176 Correct 38 ms 5216 KB Output is correct
177 Correct 47 ms 6312 KB Output is correct
178 Correct 59 ms 8144 KB Output is correct
179 Correct 53 ms 9364 KB Output is correct
180 Correct 51 ms 9308 KB Output is correct
181 Correct 52 ms 9308 KB Output is correct
182 Correct 53 ms 9304 KB Output is correct
183 Correct 63 ms 10456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 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 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 456 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 4 ms 604 KB Output is correct
20 Correct 2 ms 860 KB Output is correct
21 Correct 2 ms 836 KB Output is correct
22 Correct 4 ms 848 KB Output is correct
23 Correct 3 ms 600 KB Output is correct
24 Correct 2 ms 880 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 3 ms 848 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 856 KB Output is correct
31 Correct 6 ms 1372 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 8 ms 1372 KB Output is correct
34 Correct 4 ms 1736 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 9 ms 1372 KB Output is correct
37 Correct 9 ms 1372 KB Output is correct
38 Correct 8 ms 1372 KB Output is correct
39 Correct 81 ms 9160 KB Output is correct
40 Correct 9 ms 1368 KB Output is correct
41 Correct 6 ms 1956 KB Output is correct
42 Correct 12 ms 1636 KB Output is correct
43 Correct 12 ms 2140 KB Output is correct
44 Correct 33 ms 4728 KB Output is correct
45 Correct 45 ms 5192 KB Output is correct
46 Correct 41 ms 9516 KB Output is correct
47 Correct 87 ms 9308 KB Output is correct
48 Correct 80 ms 9616 KB Output is correct
49 Correct 35 ms 13472 KB Output is correct
50 Correct 61 ms 13468 KB Output is correct
51 Correct 86 ms 9752 KB Output is correct
52 Correct 90 ms 9556 KB Output is correct
53 Correct 89 ms 9564 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 344 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 456 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 0 ms 464 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 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 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 0 ms 344 KB Output is correct
73 Correct 0 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 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 460 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 2 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 604 KB Output is correct
114 Correct 2 ms 720 KB Output is correct
115 Correct 2 ms 604 KB Output is correct
116 Correct 2 ms 720 KB Output is correct
117 Correct 4 ms 860 KB Output is correct
118 Correct 4 ms 860 KB Output is correct
119 Correct 5 ms 1628 KB Output is correct
120 Correct 4 ms 1372 KB Output is correct
121 Correct 4 ms 1368 KB Output is correct
122 Correct 5 ms 1372 KB Output is correct
123 Correct 5 ms 1372 KB Output is correct
124 Correct 19 ms 4892 KB Output is correct
125 Correct 55 ms 13392 KB Output is correct
126 Correct 42 ms 9552 KB Output is correct
127 Correct 40 ms 9412 KB Output is correct
128 Correct 48 ms 9308 KB Output is correct
129 Correct 54 ms 9300 KB Output is correct
130 Correct 68 ms 17464 KB Output is correct
131 Correct 87 ms 17152 KB Output is correct
132 Correct 4 ms 604 KB Output is correct
133 Correct 0 ms 456 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 456 KB Output is correct
136 Correct 3 ms 860 KB Output is correct
137 Correct 2 ms 816 KB Output is correct
138 Correct 2 ms 600 KB Output is correct
139 Correct 4 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 3 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 3 ms 856 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 860 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 3 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 600 KB Output is correct
151 Correct 4 ms 860 KB Output is correct
152 Correct 4 ms 860 KB Output is correct
153 Correct 4 ms 604 KB Output is correct
154 Correct 8 ms 1372 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 6 ms 1908 KB Output is correct
157 Correct 7 ms 1116 KB Output is correct
158 Correct 4 ms 1372 KB Output is correct
159 Correct 9 ms 1368 KB Output is correct
160 Correct 8 ms 1380 KB Output is correct
161 Correct 4 ms 1268 KB Output is correct
162 Correct 5 ms 1372 KB Output is correct
163 Correct 5 ms 1368 KB Output is correct
164 Correct 4 ms 1736 KB Output is correct
165 Correct 7 ms 1596 KB Output is correct
166 Correct 6 ms 1372 KB Output is correct
167 Correct 6 ms 1116 KB Output is correct
168 Correct 6 ms 1116 KB Output is correct
169 Correct 5 ms 1116 KB Output is correct
170 Correct 6 ms 1112 KB Output is correct
171 Correct 8 ms 1368 KB Output is correct
172 Correct 9 ms 1368 KB Output is correct
173 Correct 8 ms 1372 KB Output is correct
174 Correct 10 ms 1628 KB Output is correct
175 Correct 12 ms 2400 KB Output is correct
176 Correct 38 ms 5216 KB Output is correct
177 Correct 47 ms 6312 KB Output is correct
178 Correct 59 ms 8144 KB Output is correct
179 Correct 53 ms 9364 KB Output is correct
180 Correct 51 ms 9308 KB Output is correct
181 Correct 52 ms 9308 KB Output is correct
182 Correct 53 ms 9304 KB Output is correct
183 Correct 63 ms 10456 KB Output is correct
184 Correct 177 ms 18196 KB Output is correct
185 Correct 64 ms 10140 KB Output is correct
186 Correct 70 ms 17752 KB Output is correct
187 Correct 88 ms 12888 KB Output is correct
188 Correct 101 ms 18768 KB Output is correct
189 Correct 186 ms 18260 KB Output is correct
190 Correct 185 ms 18004 KB Output is correct
191 Correct 93 ms 18528 KB Output is correct
192 Correct 102 ms 18008 KB Output is correct
193 Correct 96 ms 18012 KB Output is correct
194 Correct 75 ms 26852 KB Output is correct
195 Correct 128 ms 26856 KB Output is correct
196 Correct 106 ms 18052 KB Output is correct
197 Correct 103 ms 18124 KB Output is correct
198 Correct 103 ms 17904 KB Output is correct
199 Correct 108 ms 18120 KB Output is correct
200 Correct 189 ms 18856 KB Output is correct
201 Correct 194 ms 18700 KB Output is correct
202 Correct 186 ms 18260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 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 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 456 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 4 ms 604 KB Output is correct
20 Correct 2 ms 860 KB Output is correct
21 Correct 2 ms 836 KB Output is correct
22 Correct 4 ms 848 KB Output is correct
23 Correct 3 ms 600 KB Output is correct
24 Correct 2 ms 880 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 4 ms 860 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 3 ms 848 KB Output is correct
29 Correct 8 ms 1368 KB Output is correct
30 Correct 4 ms 856 KB Output is correct
31 Correct 6 ms 1372 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 8 ms 1372 KB Output is correct
34 Correct 4 ms 1736 KB Output is correct
35 Correct 7 ms 1736 KB Output is correct
36 Correct 9 ms 1372 KB Output is correct
37 Correct 9 ms 1372 KB Output is correct
38 Correct 8 ms 1372 KB Output is correct
39 Correct 81 ms 9160 KB Output is correct
40 Correct 9 ms 1368 KB Output is correct
41 Correct 6 ms 1956 KB Output is correct
42 Correct 12 ms 1636 KB Output is correct
43 Correct 12 ms 2140 KB Output is correct
44 Correct 33 ms 4728 KB Output is correct
45 Correct 45 ms 5192 KB Output is correct
46 Correct 41 ms 9516 KB Output is correct
47 Correct 87 ms 9308 KB Output is correct
48 Correct 80 ms 9616 KB Output is correct
49 Correct 35 ms 13472 KB Output is correct
50 Correct 61 ms 13468 KB Output is correct
51 Correct 86 ms 9752 KB Output is correct
52 Correct 90 ms 9556 KB Output is correct
53 Correct 89 ms 9564 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 1 ms 344 KB Output is correct
56 Correct 0 ms 344 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 456 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 0 ms 464 KB Output is correct
65 Correct 0 ms 344 KB Output is correct
66 Correct 0 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 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 0 ms 344 KB Output is correct
73 Correct 0 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 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 348 KB Output is correct
81 Correct 1 ms 600 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 460 KB Output is correct
84 Correct 1 ms 344 KB Output is correct
85 Correct 1 ms 344 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 1 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 1 ms 348 KB Output is correct
109 Correct 1 ms 348 KB Output is correct
110 Correct 2 ms 604 KB Output is correct
111 Correct 2 ms 860 KB Output is correct
112 Correct 2 ms 604 KB Output is correct
113 Correct 2 ms 604 KB Output is correct
114 Correct 2 ms 720 KB Output is correct
115 Correct 2 ms 604 KB Output is correct
116 Correct 2 ms 720 KB Output is correct
117 Correct 4 ms 860 KB Output is correct
118 Correct 4 ms 860 KB Output is correct
119 Correct 5 ms 1628 KB Output is correct
120 Correct 4 ms 1372 KB Output is correct
121 Correct 4 ms 1368 KB Output is correct
122 Correct 5 ms 1372 KB Output is correct
123 Correct 5 ms 1372 KB Output is correct
124 Correct 19 ms 4892 KB Output is correct
125 Correct 55 ms 13392 KB Output is correct
126 Correct 42 ms 9552 KB Output is correct
127 Correct 40 ms 9412 KB Output is correct
128 Correct 48 ms 9308 KB Output is correct
129 Correct 54 ms 9300 KB Output is correct
130 Correct 68 ms 17464 KB Output is correct
131 Correct 87 ms 17152 KB Output is correct
132 Correct 4 ms 604 KB Output is correct
133 Correct 0 ms 456 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 2 ms 456 KB Output is correct
136 Correct 3 ms 860 KB Output is correct
137 Correct 2 ms 816 KB Output is correct
138 Correct 2 ms 600 KB Output is correct
139 Correct 4 ms 604 KB Output is correct
140 Correct 3 ms 600 KB Output is correct
141 Correct 3 ms 604 KB Output is correct
142 Correct 2 ms 604 KB Output is correct
143 Correct 3 ms 856 KB Output is correct
144 Correct 2 ms 860 KB Output is correct
145 Correct 3 ms 860 KB Output is correct
146 Correct 3 ms 860 KB Output is correct
147 Correct 3 ms 604 KB Output is correct
148 Correct 3 ms 604 KB Output is correct
149 Correct 2 ms 604 KB Output is correct
150 Correct 2 ms 600 KB Output is correct
151 Correct 4 ms 860 KB Output is correct
152 Correct 4 ms 860 KB Output is correct
153 Correct 4 ms 604 KB Output is correct
154 Correct 8 ms 1372 KB Output is correct
155 Correct 4 ms 860 KB Output is correct
156 Correct 6 ms 1908 KB Output is correct
157 Correct 7 ms 1116 KB Output is correct
158 Correct 4 ms 1372 KB Output is correct
159 Correct 9 ms 1368 KB Output is correct
160 Correct 8 ms 1380 KB Output is correct
161 Correct 4 ms 1268 KB Output is correct
162 Correct 5 ms 1372 KB Output is correct
163 Correct 5 ms 1368 KB Output is correct
164 Correct 4 ms 1736 KB Output is correct
165 Correct 7 ms 1596 KB Output is correct
166 Correct 6 ms 1372 KB Output is correct
167 Correct 6 ms 1116 KB Output is correct
168 Correct 6 ms 1116 KB Output is correct
169 Correct 5 ms 1116 KB Output is correct
170 Correct 6 ms 1112 KB Output is correct
171 Correct 8 ms 1368 KB Output is correct
172 Correct 9 ms 1368 KB Output is correct
173 Correct 8 ms 1372 KB Output is correct
174 Correct 10 ms 1628 KB Output is correct
175 Correct 12 ms 2400 KB Output is correct
176 Correct 38 ms 5216 KB Output is correct
177 Correct 47 ms 6312 KB Output is correct
178 Correct 59 ms 8144 KB Output is correct
179 Correct 53 ms 9364 KB Output is correct
180 Correct 51 ms 9308 KB Output is correct
181 Correct 52 ms 9308 KB Output is correct
182 Correct 53 ms 9304 KB Output is correct
183 Correct 63 ms 10456 KB Output is correct
184 Correct 177 ms 18196 KB Output is correct
185 Correct 64 ms 10140 KB Output is correct
186 Correct 70 ms 17752 KB Output is correct
187 Correct 88 ms 12888 KB Output is correct
188 Correct 101 ms 18768 KB Output is correct
189 Correct 186 ms 18260 KB Output is correct
190 Correct 185 ms 18004 KB Output is correct
191 Correct 93 ms 18528 KB Output is correct
192 Correct 102 ms 18008 KB Output is correct
193 Correct 96 ms 18012 KB Output is correct
194 Correct 75 ms 26852 KB Output is correct
195 Correct 128 ms 26856 KB Output is correct
196 Correct 106 ms 18052 KB Output is correct
197 Correct 103 ms 18124 KB Output is correct
198 Correct 103 ms 17904 KB Output is correct
199 Correct 108 ms 18120 KB Output is correct
200 Correct 189 ms 18856 KB Output is correct
201 Correct 194 ms 18700 KB Output is correct
202 Correct 186 ms 18260 KB Output is correct
203 Correct 372 ms 35732 KB Output is correct
204 Correct 106 ms 18632 KB Output is correct
205 Correct 180 ms 22100 KB Output is correct
206 Correct 318 ms 35544 KB Output is correct
207 Correct 209 ms 36628 KB Output is correct
208 Correct 409 ms 36064 KB Output is correct
209 Correct 368 ms 35664 KB Output is correct
210 Correct 223 ms 36688 KB Output is correct
211 Correct 206 ms 35836 KB Output is correct
212 Correct 250 ms 35668 KB Output is correct
213 Correct 140 ms 53108 KB Output is correct
214 Correct 235 ms 53108 KB Output is correct
215 Correct 224 ms 35680 KB Output is correct
216 Correct 235 ms 35992 KB Output is correct
217 Correct 249 ms 35928 KB Output is correct
218 Correct 222 ms 35924 KB Output is correct
219 Correct 270 ms 46064 KB Output is correct
220 Correct 290 ms 56072 KB Output is correct
221 Correct 298 ms 68176 KB Output is correct
222 Correct 316 ms 68464 KB Output is correct
223 Correct 428 ms 36740 KB Output is correct
224 Correct 432 ms 36180 KB Output is correct
225 Correct 440 ms 35924 KB Output is correct