#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0},
dy[] = {0, 1, 0, -1};
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
int r, c, n; cin >> r >> c >> n;
int Sr, Sc; cin >> Sr >> Sc;
int Gr, Gc; cin >> Gr >> Gc;
vector<vector<char>> a(r + 10, vector<char>(c + 10));
for (int i = 1; i <= r; ++i) {
for (int j = 1; j <= c; ++j) cin >> a[i][j];
}
auto in = [&](int x, int y) { return 1 <= x && x <= r && 1 <= y && y <= c; };
vector<vector<int>> f(r + 10, vector<int>(c + 10, 1'000'000'000));
auto getSquare = [&](int x, int y, int way, int type) {
vector<pair<int, int>> ret = {{x, y}};
for (int t = 0; t < 4; ++t) {
for (int i = 1; i < n; ++i) {
x += dx[way]; y += dy[way];
ret.push_back({x, y});
}
way = (way + type + 4) % 4;
}
return ret;
};
deque<pair<int, int>> q;
q.push_back({Sr, Sc});
f[Sr][Sc] = 0;
while (q.size()) {
auto [x, y] = q.front(); q.pop_front();
if (abs(Gr - x) <= n && abs(Gc - y) <= n) { f[Gr][Gc] = min(f[Gr][Gc], f[x][y] + 1); }
for (int t = 0; t < 4; ++t) {
int nX = x + dx[t], nY = y + dy[t];
if (!in(nX, nY) || a[nX][nY] == '#') continue;
if (f[nX][nY] > f[x][y]) {
f[nX][nY] = f[x][y];
q.push_front({nX, nY});
}
}
for (int t = 0; t < 4; ++t) {
int stX = x + dx[t], stY = y + dy[t];
for (int type = -1; type <= 1; type += 2) {
for (const auto& [nX, nY] : getSquare(stX, stY, t, type)) {
if (!in(nX, nY)) continue;
if (f[nX][nY] > f[x][y] + 1) {
f[nX][nY] = f[x][y] + 1;
q.push_back({nX, nY});
}
}
}
}
}
cout << f[Gr][Gc] << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
504 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
11 ms |
592 KB |
Output is correct |
20 |
Correct |
9 ms |
2984 KB |
Output is correct |
21 |
Correct |
11 ms |
848 KB |
Output is correct |
22 |
Correct |
12 ms |
592 KB |
Output is correct |
23 |
Correct |
11 ms |
592 KB |
Output is correct |
24 |
Correct |
12 ms |
3920 KB |
Output is correct |
25 |
Correct |
13 ms |
3920 KB |
Output is correct |
26 |
Correct |
15 ms |
848 KB |
Output is correct |
27 |
Correct |
15 ms |
992 KB |
Output is correct |
28 |
Correct |
10 ms |
784 KB |
Output is correct |
29 |
Correct |
29 ms |
1272 KB |
Output is correct |
30 |
Correct |
14 ms |
2384 KB |
Output is correct |
31 |
Correct |
27 ms |
1864 KB |
Output is correct |
32 |
Correct |
33 ms |
1104 KB |
Output is correct |
33 |
Correct |
26 ms |
1104 KB |
Output is correct |
34 |
Correct |
33 ms |
9148 KB |
Output is correct |
35 |
Correct |
29 ms |
9148 KB |
Output is correct |
36 |
Correct |
30 ms |
1104 KB |
Output is correct |
37 |
Correct |
32 ms |
1104 KB |
Output is correct |
38 |
Correct |
27 ms |
1104 KB |
Output is correct |
39 |
Correct |
299 ms |
8008 KB |
Output is correct |
40 |
Correct |
49 ms |
1616 KB |
Output is correct |
41 |
Correct |
36 ms |
11168 KB |
Output is correct |
42 |
Correct |
39 ms |
1360 KB |
Output is correct |
43 |
Correct |
46 ms |
8016 KB |
Output is correct |
44 |
Correct |
150 ms |
10576 KB |
Output is correct |
45 |
Correct |
147 ms |
12720 KB |
Output is correct |
46 |
Correct |
261 ms |
14152 KB |
Output is correct |
47 |
Correct |
293 ms |
8016 KB |
Output is correct |
48 |
Correct |
247 ms |
8016 KB |
Output is correct |
49 |
Correct |
252 ms |
86924 KB |
Output is correct |
50 |
Correct |
241 ms |
87032 KB |
Output is correct |
51 |
Correct |
298 ms |
8016 KB |
Output is correct |
52 |
Correct |
291 ms |
8108 KB |
Output is correct |
53 |
Correct |
246 ms |
8016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
592 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
504 KB |
Output is correct |
9 |
Correct |
1 ms |
552 KB |
Output is correct |
10 |
Correct |
1 ms |
508 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
17 ms |
336 KB |
Output is correct |
13 |
Correct |
10 ms |
336 KB |
Output is correct |
14 |
Correct |
9 ms |
336 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
2 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
3 ms |
508 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
336 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
508 KB |
Output is correct |
27 |
Correct |
1 ms |
336 KB |
Output is correct |
28 |
Correct |
1 ms |
336 KB |
Output is correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Correct |
1 ms |
336 KB |
Output is correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
512 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
17 ms |
480 KB |
Output is correct |
10 |
Correct |
10 ms |
476 KB |
Output is correct |
11 |
Correct |
9 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
336 KB |
Output is correct |
13 |
Correct |
1 ms |
592 KB |
Output is correct |
14 |
Correct |
4 ms |
336 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
2 ms |
508 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
1 ms |
336 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
336 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
18 ms |
336 KB |
Output is correct |
25 |
Correct |
43 ms |
592 KB |
Output is correct |
26 |
Correct |
162 ms |
1104 KB |
Output is correct |
27 |
Correct |
11 ms |
848 KB |
Output is correct |
28 |
Execution timed out |
2099 ms |
1420 KB |
Time limit exceeded |
29 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
592 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
504 KB |
Output is correct |
9 |
Correct |
1 ms |
552 KB |
Output is correct |
10 |
Correct |
1 ms |
508 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
17 ms |
336 KB |
Output is correct |
13 |
Correct |
10 ms |
336 KB |
Output is correct |
14 |
Correct |
9 ms |
336 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
2 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
3 ms |
508 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
336 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
508 KB |
Output is correct |
27 |
Correct |
1 ms |
336 KB |
Output is correct |
28 |
Correct |
1 ms |
336 KB |
Output is correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Correct |
1 ms |
336 KB |
Output is correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
33 |
Correct |
11 ms |
592 KB |
Output is correct |
34 |
Correct |
18 ms |
336 KB |
Output is correct |
35 |
Correct |
3 ms |
592 KB |
Output is correct |
36 |
Correct |
43 ms |
592 KB |
Output is correct |
37 |
Correct |
9 ms |
3152 KB |
Output is correct |
38 |
Correct |
157 ms |
1104 KB |
Output is correct |
39 |
Correct |
12 ms |
848 KB |
Output is correct |
40 |
Correct |
13 ms |
812 KB |
Output is correct |
41 |
Correct |
12 ms |
592 KB |
Output is correct |
42 |
Execution timed out |
2096 ms |
1344 KB |
Time limit exceeded |
43 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
592 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
504 KB |
Output is correct |
9 |
Correct |
1 ms |
552 KB |
Output is correct |
10 |
Correct |
1 ms |
508 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
17 ms |
336 KB |
Output is correct |
13 |
Correct |
10 ms |
336 KB |
Output is correct |
14 |
Correct |
9 ms |
336 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
2 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
3 ms |
508 KB |
Output is correct |
20 |
Correct |
1 ms |
336 KB |
Output is correct |
21 |
Correct |
1 ms |
336 KB |
Output is correct |
22 |
Correct |
1 ms |
336 KB |
Output is correct |
23 |
Correct |
1 ms |
336 KB |
Output is correct |
24 |
Correct |
1 ms |
336 KB |
Output is correct |
25 |
Correct |
1 ms |
336 KB |
Output is correct |
26 |
Correct |
1 ms |
508 KB |
Output is correct |
27 |
Correct |
1 ms |
336 KB |
Output is correct |
28 |
Correct |
1 ms |
336 KB |
Output is correct |
29 |
Correct |
1 ms |
336 KB |
Output is correct |
30 |
Correct |
1 ms |
336 KB |
Output is correct |
31 |
Correct |
1 ms |
336 KB |
Output is correct |
32 |
Correct |
1 ms |
336 KB |
Output is correct |
33 |
Correct |
11 ms |
592 KB |
Output is correct |
34 |
Correct |
18 ms |
336 KB |
Output is correct |
35 |
Correct |
3 ms |
592 KB |
Output is correct |
36 |
Correct |
43 ms |
592 KB |
Output is correct |
37 |
Correct |
9 ms |
3152 KB |
Output is correct |
38 |
Correct |
157 ms |
1104 KB |
Output is correct |
39 |
Correct |
12 ms |
848 KB |
Output is correct |
40 |
Correct |
13 ms |
812 KB |
Output is correct |
41 |
Correct |
12 ms |
592 KB |
Output is correct |
42 |
Execution timed out |
2096 ms |
1344 KB |
Time limit exceeded |
43 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
504 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
11 ms |
592 KB |
Output is correct |
20 |
Correct |
9 ms |
2984 KB |
Output is correct |
21 |
Correct |
11 ms |
848 KB |
Output is correct |
22 |
Correct |
12 ms |
592 KB |
Output is correct |
23 |
Correct |
11 ms |
592 KB |
Output is correct |
24 |
Correct |
12 ms |
3920 KB |
Output is correct |
25 |
Correct |
13 ms |
3920 KB |
Output is correct |
26 |
Correct |
15 ms |
848 KB |
Output is correct |
27 |
Correct |
15 ms |
992 KB |
Output is correct |
28 |
Correct |
10 ms |
784 KB |
Output is correct |
29 |
Correct |
29 ms |
1272 KB |
Output is correct |
30 |
Correct |
14 ms |
2384 KB |
Output is correct |
31 |
Correct |
27 ms |
1864 KB |
Output is correct |
32 |
Correct |
33 ms |
1104 KB |
Output is correct |
33 |
Correct |
26 ms |
1104 KB |
Output is correct |
34 |
Correct |
33 ms |
9148 KB |
Output is correct |
35 |
Correct |
29 ms |
9148 KB |
Output is correct |
36 |
Correct |
30 ms |
1104 KB |
Output is correct |
37 |
Correct |
32 ms |
1104 KB |
Output is correct |
38 |
Correct |
27 ms |
1104 KB |
Output is correct |
39 |
Correct |
299 ms |
8008 KB |
Output is correct |
40 |
Correct |
49 ms |
1616 KB |
Output is correct |
41 |
Correct |
36 ms |
11168 KB |
Output is correct |
42 |
Correct |
39 ms |
1360 KB |
Output is correct |
43 |
Correct |
46 ms |
8016 KB |
Output is correct |
44 |
Correct |
150 ms |
10576 KB |
Output is correct |
45 |
Correct |
147 ms |
12720 KB |
Output is correct |
46 |
Correct |
261 ms |
14152 KB |
Output is correct |
47 |
Correct |
293 ms |
8016 KB |
Output is correct |
48 |
Correct |
247 ms |
8016 KB |
Output is correct |
49 |
Correct |
252 ms |
86924 KB |
Output is correct |
50 |
Correct |
241 ms |
87032 KB |
Output is correct |
51 |
Correct |
298 ms |
8016 KB |
Output is correct |
52 |
Correct |
291 ms |
8108 KB |
Output is correct |
53 |
Correct |
246 ms |
8016 KB |
Output is correct |
54 |
Correct |
1 ms |
504 KB |
Output is correct |
55 |
Correct |
1 ms |
336 KB |
Output is correct |
56 |
Correct |
1 ms |
336 KB |
Output is correct |
57 |
Correct |
1 ms |
336 KB |
Output is correct |
58 |
Correct |
1 ms |
336 KB |
Output is correct |
59 |
Correct |
1 ms |
592 KB |
Output is correct |
60 |
Correct |
1 ms |
336 KB |
Output is correct |
61 |
Correct |
1 ms |
504 KB |
Output is correct |
62 |
Correct |
1 ms |
552 KB |
Output is correct |
63 |
Correct |
1 ms |
508 KB |
Output is correct |
64 |
Correct |
1 ms |
336 KB |
Output is correct |
65 |
Correct |
17 ms |
336 KB |
Output is correct |
66 |
Correct |
10 ms |
336 KB |
Output is correct |
67 |
Correct |
9 ms |
336 KB |
Output is correct |
68 |
Correct |
1 ms |
336 KB |
Output is correct |
69 |
Correct |
1 ms |
336 KB |
Output is correct |
70 |
Correct |
2 ms |
336 KB |
Output is correct |
71 |
Correct |
1 ms |
336 KB |
Output is correct |
72 |
Correct |
3 ms |
508 KB |
Output is correct |
73 |
Correct |
1 ms |
336 KB |
Output is correct |
74 |
Correct |
1 ms |
336 KB |
Output is correct |
75 |
Correct |
1 ms |
336 KB |
Output is correct |
76 |
Correct |
1 ms |
336 KB |
Output is correct |
77 |
Correct |
1 ms |
336 KB |
Output is correct |
78 |
Correct |
1 ms |
336 KB |
Output is correct |
79 |
Correct |
1 ms |
508 KB |
Output is correct |
80 |
Correct |
1 ms |
336 KB |
Output is correct |
81 |
Correct |
1 ms |
336 KB |
Output is correct |
82 |
Correct |
1 ms |
336 KB |
Output is correct |
83 |
Correct |
1 ms |
336 KB |
Output is correct |
84 |
Correct |
1 ms |
336 KB |
Output is correct |
85 |
Correct |
1 ms |
336 KB |
Output is correct |
86 |
Correct |
1 ms |
336 KB |
Output is correct |
87 |
Correct |
1 ms |
336 KB |
Output is correct |
88 |
Correct |
1 ms |
336 KB |
Output is correct |
89 |
Correct |
1 ms |
512 KB |
Output is correct |
90 |
Correct |
1 ms |
336 KB |
Output is correct |
91 |
Correct |
1 ms |
336 KB |
Output is correct |
92 |
Correct |
1 ms |
336 KB |
Output is correct |
93 |
Correct |
1 ms |
336 KB |
Output is correct |
94 |
Correct |
17 ms |
480 KB |
Output is correct |
95 |
Correct |
10 ms |
476 KB |
Output is correct |
96 |
Correct |
9 ms |
336 KB |
Output is correct |
97 |
Correct |
1 ms |
336 KB |
Output is correct |
98 |
Correct |
1 ms |
592 KB |
Output is correct |
99 |
Correct |
4 ms |
336 KB |
Output is correct |
100 |
Correct |
1 ms |
336 KB |
Output is correct |
101 |
Correct |
2 ms |
508 KB |
Output is correct |
102 |
Correct |
1 ms |
336 KB |
Output is correct |
103 |
Correct |
1 ms |
336 KB |
Output is correct |
104 |
Correct |
1 ms |
336 KB |
Output is correct |
105 |
Correct |
1 ms |
336 KB |
Output is correct |
106 |
Correct |
1 ms |
336 KB |
Output is correct |
107 |
Correct |
1 ms |
336 KB |
Output is correct |
108 |
Correct |
1 ms |
336 KB |
Output is correct |
109 |
Correct |
18 ms |
336 KB |
Output is correct |
110 |
Correct |
43 ms |
592 KB |
Output is correct |
111 |
Correct |
162 ms |
1104 KB |
Output is correct |
112 |
Correct |
11 ms |
848 KB |
Output is correct |
113 |
Execution timed out |
2099 ms |
1420 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
504 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
11 ms |
592 KB |
Output is correct |
20 |
Correct |
9 ms |
2984 KB |
Output is correct |
21 |
Correct |
11 ms |
848 KB |
Output is correct |
22 |
Correct |
12 ms |
592 KB |
Output is correct |
23 |
Correct |
11 ms |
592 KB |
Output is correct |
24 |
Correct |
12 ms |
3920 KB |
Output is correct |
25 |
Correct |
13 ms |
3920 KB |
Output is correct |
26 |
Correct |
15 ms |
848 KB |
Output is correct |
27 |
Correct |
15 ms |
992 KB |
Output is correct |
28 |
Correct |
10 ms |
784 KB |
Output is correct |
29 |
Correct |
29 ms |
1272 KB |
Output is correct |
30 |
Correct |
14 ms |
2384 KB |
Output is correct |
31 |
Correct |
27 ms |
1864 KB |
Output is correct |
32 |
Correct |
33 ms |
1104 KB |
Output is correct |
33 |
Correct |
26 ms |
1104 KB |
Output is correct |
34 |
Correct |
33 ms |
9148 KB |
Output is correct |
35 |
Correct |
29 ms |
9148 KB |
Output is correct |
36 |
Correct |
30 ms |
1104 KB |
Output is correct |
37 |
Correct |
32 ms |
1104 KB |
Output is correct |
38 |
Correct |
27 ms |
1104 KB |
Output is correct |
39 |
Correct |
299 ms |
8008 KB |
Output is correct |
40 |
Correct |
49 ms |
1616 KB |
Output is correct |
41 |
Correct |
36 ms |
11168 KB |
Output is correct |
42 |
Correct |
39 ms |
1360 KB |
Output is correct |
43 |
Correct |
46 ms |
8016 KB |
Output is correct |
44 |
Correct |
150 ms |
10576 KB |
Output is correct |
45 |
Correct |
147 ms |
12720 KB |
Output is correct |
46 |
Correct |
261 ms |
14152 KB |
Output is correct |
47 |
Correct |
293 ms |
8016 KB |
Output is correct |
48 |
Correct |
247 ms |
8016 KB |
Output is correct |
49 |
Correct |
252 ms |
86924 KB |
Output is correct |
50 |
Correct |
241 ms |
87032 KB |
Output is correct |
51 |
Correct |
298 ms |
8016 KB |
Output is correct |
52 |
Correct |
291 ms |
8108 KB |
Output is correct |
53 |
Correct |
246 ms |
8016 KB |
Output is correct |
54 |
Correct |
1 ms |
504 KB |
Output is correct |
55 |
Correct |
1 ms |
336 KB |
Output is correct |
56 |
Correct |
1 ms |
336 KB |
Output is correct |
57 |
Correct |
1 ms |
336 KB |
Output is correct |
58 |
Correct |
1 ms |
336 KB |
Output is correct |
59 |
Correct |
1 ms |
592 KB |
Output is correct |
60 |
Correct |
1 ms |
336 KB |
Output is correct |
61 |
Correct |
1 ms |
504 KB |
Output is correct |
62 |
Correct |
1 ms |
552 KB |
Output is correct |
63 |
Correct |
1 ms |
508 KB |
Output is correct |
64 |
Correct |
1 ms |
336 KB |
Output is correct |
65 |
Correct |
17 ms |
336 KB |
Output is correct |
66 |
Correct |
10 ms |
336 KB |
Output is correct |
67 |
Correct |
9 ms |
336 KB |
Output is correct |
68 |
Correct |
1 ms |
336 KB |
Output is correct |
69 |
Correct |
1 ms |
336 KB |
Output is correct |
70 |
Correct |
2 ms |
336 KB |
Output is correct |
71 |
Correct |
1 ms |
336 KB |
Output is correct |
72 |
Correct |
3 ms |
508 KB |
Output is correct |
73 |
Correct |
1 ms |
336 KB |
Output is correct |
74 |
Correct |
1 ms |
336 KB |
Output is correct |
75 |
Correct |
1 ms |
336 KB |
Output is correct |
76 |
Correct |
1 ms |
336 KB |
Output is correct |
77 |
Correct |
1 ms |
336 KB |
Output is correct |
78 |
Correct |
1 ms |
336 KB |
Output is correct |
79 |
Correct |
1 ms |
508 KB |
Output is correct |
80 |
Correct |
1 ms |
336 KB |
Output is correct |
81 |
Correct |
1 ms |
336 KB |
Output is correct |
82 |
Correct |
1 ms |
336 KB |
Output is correct |
83 |
Correct |
1 ms |
336 KB |
Output is correct |
84 |
Correct |
1 ms |
336 KB |
Output is correct |
85 |
Correct |
1 ms |
336 KB |
Output is correct |
86 |
Correct |
1 ms |
336 KB |
Output is correct |
87 |
Correct |
1 ms |
336 KB |
Output is correct |
88 |
Correct |
1 ms |
336 KB |
Output is correct |
89 |
Correct |
1 ms |
512 KB |
Output is correct |
90 |
Correct |
1 ms |
336 KB |
Output is correct |
91 |
Correct |
1 ms |
336 KB |
Output is correct |
92 |
Correct |
1 ms |
336 KB |
Output is correct |
93 |
Correct |
1 ms |
336 KB |
Output is correct |
94 |
Correct |
17 ms |
480 KB |
Output is correct |
95 |
Correct |
10 ms |
476 KB |
Output is correct |
96 |
Correct |
9 ms |
336 KB |
Output is correct |
97 |
Correct |
1 ms |
336 KB |
Output is correct |
98 |
Correct |
1 ms |
592 KB |
Output is correct |
99 |
Correct |
4 ms |
336 KB |
Output is correct |
100 |
Correct |
1 ms |
336 KB |
Output is correct |
101 |
Correct |
2 ms |
508 KB |
Output is correct |
102 |
Correct |
1 ms |
336 KB |
Output is correct |
103 |
Correct |
1 ms |
336 KB |
Output is correct |
104 |
Correct |
1 ms |
336 KB |
Output is correct |
105 |
Correct |
1 ms |
336 KB |
Output is correct |
106 |
Correct |
1 ms |
336 KB |
Output is correct |
107 |
Correct |
1 ms |
336 KB |
Output is correct |
108 |
Correct |
1 ms |
336 KB |
Output is correct |
109 |
Correct |
18 ms |
336 KB |
Output is correct |
110 |
Correct |
43 ms |
592 KB |
Output is correct |
111 |
Correct |
162 ms |
1104 KB |
Output is correct |
112 |
Correct |
11 ms |
848 KB |
Output is correct |
113 |
Execution timed out |
2099 ms |
1420 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
5 |
Correct |
1 ms |
336 KB |
Output is correct |
6 |
Correct |
1 ms |
336 KB |
Output is correct |
7 |
Correct |
1 ms |
336 KB |
Output is correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
336 KB |
Output is correct |
10 |
Correct |
1 ms |
336 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
504 KB |
Output is correct |
13 |
Correct |
1 ms |
336 KB |
Output is correct |
14 |
Correct |
1 ms |
504 KB |
Output is correct |
15 |
Correct |
1 ms |
336 KB |
Output is correct |
16 |
Correct |
1 ms |
336 KB |
Output is correct |
17 |
Correct |
1 ms |
336 KB |
Output is correct |
18 |
Correct |
1 ms |
336 KB |
Output is correct |
19 |
Correct |
11 ms |
592 KB |
Output is correct |
20 |
Correct |
9 ms |
2984 KB |
Output is correct |
21 |
Correct |
11 ms |
848 KB |
Output is correct |
22 |
Correct |
12 ms |
592 KB |
Output is correct |
23 |
Correct |
11 ms |
592 KB |
Output is correct |
24 |
Correct |
12 ms |
3920 KB |
Output is correct |
25 |
Correct |
13 ms |
3920 KB |
Output is correct |
26 |
Correct |
15 ms |
848 KB |
Output is correct |
27 |
Correct |
15 ms |
992 KB |
Output is correct |
28 |
Correct |
10 ms |
784 KB |
Output is correct |
29 |
Correct |
29 ms |
1272 KB |
Output is correct |
30 |
Correct |
14 ms |
2384 KB |
Output is correct |
31 |
Correct |
27 ms |
1864 KB |
Output is correct |
32 |
Correct |
33 ms |
1104 KB |
Output is correct |
33 |
Correct |
26 ms |
1104 KB |
Output is correct |
34 |
Correct |
33 ms |
9148 KB |
Output is correct |
35 |
Correct |
29 ms |
9148 KB |
Output is correct |
36 |
Correct |
30 ms |
1104 KB |
Output is correct |
37 |
Correct |
32 ms |
1104 KB |
Output is correct |
38 |
Correct |
27 ms |
1104 KB |
Output is correct |
39 |
Correct |
299 ms |
8008 KB |
Output is correct |
40 |
Correct |
49 ms |
1616 KB |
Output is correct |
41 |
Correct |
36 ms |
11168 KB |
Output is correct |
42 |
Correct |
39 ms |
1360 KB |
Output is correct |
43 |
Correct |
46 ms |
8016 KB |
Output is correct |
44 |
Correct |
150 ms |
10576 KB |
Output is correct |
45 |
Correct |
147 ms |
12720 KB |
Output is correct |
46 |
Correct |
261 ms |
14152 KB |
Output is correct |
47 |
Correct |
293 ms |
8016 KB |
Output is correct |
48 |
Correct |
247 ms |
8016 KB |
Output is correct |
49 |
Correct |
252 ms |
86924 KB |
Output is correct |
50 |
Correct |
241 ms |
87032 KB |
Output is correct |
51 |
Correct |
298 ms |
8016 KB |
Output is correct |
52 |
Correct |
291 ms |
8108 KB |
Output is correct |
53 |
Correct |
246 ms |
8016 KB |
Output is correct |
54 |
Correct |
1 ms |
504 KB |
Output is correct |
55 |
Correct |
1 ms |
336 KB |
Output is correct |
56 |
Correct |
1 ms |
336 KB |
Output is correct |
57 |
Correct |
1 ms |
336 KB |
Output is correct |
58 |
Correct |
1 ms |
336 KB |
Output is correct |
59 |
Correct |
1 ms |
592 KB |
Output is correct |
60 |
Correct |
1 ms |
336 KB |
Output is correct |
61 |
Correct |
1 ms |
504 KB |
Output is correct |
62 |
Correct |
1 ms |
552 KB |
Output is correct |
63 |
Correct |
1 ms |
508 KB |
Output is correct |
64 |
Correct |
1 ms |
336 KB |
Output is correct |
65 |
Correct |
17 ms |
336 KB |
Output is correct |
66 |
Correct |
10 ms |
336 KB |
Output is correct |
67 |
Correct |
9 ms |
336 KB |
Output is correct |
68 |
Correct |
1 ms |
336 KB |
Output is correct |
69 |
Correct |
1 ms |
336 KB |
Output is correct |
70 |
Correct |
2 ms |
336 KB |
Output is correct |
71 |
Correct |
1 ms |
336 KB |
Output is correct |
72 |
Correct |
3 ms |
508 KB |
Output is correct |
73 |
Correct |
1 ms |
336 KB |
Output is correct |
74 |
Correct |
1 ms |
336 KB |
Output is correct |
75 |
Correct |
1 ms |
336 KB |
Output is correct |
76 |
Correct |
1 ms |
336 KB |
Output is correct |
77 |
Correct |
1 ms |
336 KB |
Output is correct |
78 |
Correct |
1 ms |
336 KB |
Output is correct |
79 |
Correct |
1 ms |
508 KB |
Output is correct |
80 |
Correct |
1 ms |
336 KB |
Output is correct |
81 |
Correct |
1 ms |
336 KB |
Output is correct |
82 |
Correct |
1 ms |
336 KB |
Output is correct |
83 |
Correct |
1 ms |
336 KB |
Output is correct |
84 |
Correct |
1 ms |
336 KB |
Output is correct |
85 |
Correct |
1 ms |
336 KB |
Output is correct |
86 |
Correct |
1 ms |
336 KB |
Output is correct |
87 |
Correct |
1 ms |
336 KB |
Output is correct |
88 |
Correct |
1 ms |
336 KB |
Output is correct |
89 |
Correct |
1 ms |
512 KB |
Output is correct |
90 |
Correct |
1 ms |
336 KB |
Output is correct |
91 |
Correct |
1 ms |
336 KB |
Output is correct |
92 |
Correct |
1 ms |
336 KB |
Output is correct |
93 |
Correct |
1 ms |
336 KB |
Output is correct |
94 |
Correct |
17 ms |
480 KB |
Output is correct |
95 |
Correct |
10 ms |
476 KB |
Output is correct |
96 |
Correct |
9 ms |
336 KB |
Output is correct |
97 |
Correct |
1 ms |
336 KB |
Output is correct |
98 |
Correct |
1 ms |
592 KB |
Output is correct |
99 |
Correct |
4 ms |
336 KB |
Output is correct |
100 |
Correct |
1 ms |
336 KB |
Output is correct |
101 |
Correct |
2 ms |
508 KB |
Output is correct |
102 |
Correct |
1 ms |
336 KB |
Output is correct |
103 |
Correct |
1 ms |
336 KB |
Output is correct |
104 |
Correct |
1 ms |
336 KB |
Output is correct |
105 |
Correct |
1 ms |
336 KB |
Output is correct |
106 |
Correct |
1 ms |
336 KB |
Output is correct |
107 |
Correct |
1 ms |
336 KB |
Output is correct |
108 |
Correct |
1 ms |
336 KB |
Output is correct |
109 |
Correct |
18 ms |
336 KB |
Output is correct |
110 |
Correct |
43 ms |
592 KB |
Output is correct |
111 |
Correct |
162 ms |
1104 KB |
Output is correct |
112 |
Correct |
11 ms |
848 KB |
Output is correct |
113 |
Execution timed out |
2099 ms |
1420 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |