#include <bits/stdc++.h>
using namespace std;
#define dbg(x) x
#define prt(x) dbg(cerr << x)
#define pv(x) dbg(cerr << #x << " = " << x << '\n')
#define pv2(x) dbg(cerr << #x << " = " << x.first << ',' << x.second << '\n')
#define parr(x) dbg(prt(#x << " = { "); for (auto y : x) prt(y << ' '); prt("}\n");)
#define parr2(x) dbg(prt(#x << " = { "); for (auto [y, z] : x) prt(y << ',' << z << " "); prt("}\n");)
#define parr2d(x) dbg(prt(#x << ":\n"); for (auto arr : x) {parr(arr);} prt('\n'));
#define parr2d2(x) dbg(prt(#x << ":\n"); for (auto arr : x) {parr2(arr);} prt('\n'));
/*
*/
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
const int inf = 2e9 + 5;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, m, k;
cin >> n >> m >> k;
int i0, j0, i1, j1;
cin >> i0 >> j0 >> i1 >> j1;
i0--; j0--; i1--; j1--;
vector<string> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
function<bool(int, int)> ok = [&] (int i, int j) {
return i >= 0 && i < n && j >= 0 && j < m;
};
if (k == 1) {
vector<vector<int>> dist(n, vector<int>(m, inf));
deque<array<int, 3>> q;
q.push_back({i0, j0, 0});
dist[i0][j0] = 0;
while (q.size()) {
int i = q[0][0], j = q[0][1], _d = q[0][2];
q.pop_front();
if (dist[i][j] != _d) continue;
for (int d = 0; d < 4; d++) {
int ni = i + dx[d], nj = j + dy[d];
if (!ok(ni, nj)) continue;
if (a[ni][nj] == '.') {
if (dist[i][j] < dist[ni][nj]) {
dist[ni][nj] = dist[i][j];
q.push_front({ni, nj, dist[i][j]});
}
} else {
if (dist[i][j] + 1 < dist[ni][nj]) {
dist[ni][nj] = dist[i][j] + 1;
q.push_back({ni, nj, dist[i][j] + 1});
}
}
}
}
cout << dist[i1][j1] << '\n';
} else if (n * m <= 1000) {
vector<vector<int>> dist(n, vector<int>(m, inf));
dist[i0][j0] = 0;
vector<vector<bool>> vis(n, vector<bool>(m, false));
priority_queue<array<int, 3>> q;
q.push({0, i0, j0});
vis[i0][j0] = true;
while (q.size()) {
int ed = -q.top()[0], i = q.top()[1], j = q.top()[2];
q.pop();
if (ed != dist[i][j]) continue;
for (int ni = max(i - k, 0); ni <= min(i + k, n - 1); ni++) {
for (int nj = max(j - k, 0); nj <= min(j + k, m - 1); nj++) {
if (ni == i && nj == j) continue;
if (abs(i - ni) + abs(j - nj) == 1 && a[ni][nj] == '.') {
if (dist[i][j] < dist[ni][nj]) {
dist[ni][nj] = dist[i][j];
q.push({-dist[ni][nj], ni, nj});
}
} else {
if (dist[i][j] + 1 < dist[ni][nj]) {
dist[ni][nj] = dist[i][j] + 1;
q.push({-dist[ni][nj], ni, nj});
}
}
}
}
}
cout << dist[i1][j1] << '\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 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 |
0 ms |
348 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 |
0 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 |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
860 KB |
Output is correct |
22 |
Correct |
4 ms |
844 KB |
Output is correct |
23 |
Correct |
3 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
1116 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
4 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
720 KB |
Output is correct |
28 |
Correct |
2 ms |
604 KB |
Output is correct |
29 |
Correct |
6 ms |
1236 KB |
Output is correct |
30 |
Correct |
4 ms |
868 KB |
Output is correct |
31 |
Correct |
6 ms |
2140 KB |
Output is correct |
32 |
Correct |
10 ms |
1372 KB |
Output is correct |
33 |
Correct |
6 ms |
1372 KB |
Output is correct |
34 |
Correct |
4 ms |
2024 KB |
Output is correct |
35 |
Correct |
5 ms |
2024 KB |
Output is correct |
36 |
Correct |
10 ms |
1468 KB |
Output is correct |
37 |
Correct |
10 ms |
1884 KB |
Output is correct |
38 |
Correct |
6 ms |
1184 KB |
Output is correct |
39 |
Correct |
62 ms |
9308 KB |
Output is correct |
40 |
Correct |
11 ms |
1372 KB |
Output is correct |
41 |
Correct |
8 ms |
2280 KB |
Output is correct |
42 |
Correct |
11 ms |
1880 KB |
Output is correct |
43 |
Correct |
10 ms |
2396 KB |
Output is correct |
44 |
Correct |
40 ms |
5468 KB |
Output is correct |
45 |
Correct |
36 ms |
5876 KB |
Output is correct |
46 |
Correct |
52 ms |
15188 KB |
Output is correct |
47 |
Correct |
91 ms |
9496 KB |
Output is correct |
48 |
Correct |
54 ms |
9452 KB |
Output is correct |
49 |
Correct |
40 ms |
15408 KB |
Output is correct |
50 |
Correct |
43 ms |
15096 KB |
Output is correct |
51 |
Correct |
92 ms |
9812 KB |
Output is correct |
52 |
Correct |
94 ms |
9592 KB |
Output is correct |
53 |
Correct |
57 ms |
9504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
460 KB |
Output is correct |
5 |
Correct |
0 ms |
456 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
460 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
348 KB |
Output is correct |
13 |
Correct |
3 ms |
348 KB |
Output is correct |
14 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
3 ms |
348 KB |
Output is correct |
10 |
Correct |
3 ms |
348 KB |
Output is correct |
11 |
Correct |
2 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
460 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
0 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 |
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 |
452 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
25 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
460 KB |
Output is correct |
5 |
Correct |
0 ms |
456 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
460 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
348 KB |
Output is correct |
13 |
Correct |
3 ms |
348 KB |
Output is correct |
14 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
35 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
460 KB |
Output is correct |
5 |
Correct |
0 ms |
456 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
460 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
3 ms |
348 KB |
Output is correct |
13 |
Correct |
3 ms |
348 KB |
Output is correct |
14 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
3 ms |
604 KB |
Output is correct |
34 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
35 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 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 |
0 ms |
348 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 |
0 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 |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
860 KB |
Output is correct |
22 |
Correct |
4 ms |
844 KB |
Output is correct |
23 |
Correct |
3 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
1116 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
4 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
720 KB |
Output is correct |
28 |
Correct |
2 ms |
604 KB |
Output is correct |
29 |
Correct |
6 ms |
1236 KB |
Output is correct |
30 |
Correct |
4 ms |
868 KB |
Output is correct |
31 |
Correct |
6 ms |
2140 KB |
Output is correct |
32 |
Correct |
10 ms |
1372 KB |
Output is correct |
33 |
Correct |
6 ms |
1372 KB |
Output is correct |
34 |
Correct |
4 ms |
2024 KB |
Output is correct |
35 |
Correct |
5 ms |
2024 KB |
Output is correct |
36 |
Correct |
10 ms |
1468 KB |
Output is correct |
37 |
Correct |
10 ms |
1884 KB |
Output is correct |
38 |
Correct |
6 ms |
1184 KB |
Output is correct |
39 |
Correct |
62 ms |
9308 KB |
Output is correct |
40 |
Correct |
11 ms |
1372 KB |
Output is correct |
41 |
Correct |
8 ms |
2280 KB |
Output is correct |
42 |
Correct |
11 ms |
1880 KB |
Output is correct |
43 |
Correct |
10 ms |
2396 KB |
Output is correct |
44 |
Correct |
40 ms |
5468 KB |
Output is correct |
45 |
Correct |
36 ms |
5876 KB |
Output is correct |
46 |
Correct |
52 ms |
15188 KB |
Output is correct |
47 |
Correct |
91 ms |
9496 KB |
Output is correct |
48 |
Correct |
54 ms |
9452 KB |
Output is correct |
49 |
Correct |
40 ms |
15408 KB |
Output is correct |
50 |
Correct |
43 ms |
15096 KB |
Output is correct |
51 |
Correct |
92 ms |
9812 KB |
Output is correct |
52 |
Correct |
94 ms |
9592 KB |
Output is correct |
53 |
Correct |
57 ms |
9504 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
0 ms |
460 KB |
Output is correct |
58 |
Correct |
0 ms |
456 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
3 ms |
348 KB |
Output is correct |
66 |
Correct |
3 ms |
348 KB |
Output is correct |
67 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
81 |
Correct |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
1 ms |
348 KB |
Output is correct |
84 |
Correct |
1 ms |
348 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
1 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 |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
0 ms |
600 KB |
Output is correct |
93 |
Correct |
0 ms |
348 KB |
Output is correct |
94 |
Correct |
3 ms |
348 KB |
Output is correct |
95 |
Correct |
3 ms |
348 KB |
Output is correct |
96 |
Correct |
2 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
460 KB |
Output is correct |
99 |
Correct |
1 ms |
344 KB |
Output is correct |
100 |
Correct |
0 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 |
0 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 |
452 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
110 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 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 |
0 ms |
348 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 |
0 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 |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
860 KB |
Output is correct |
22 |
Correct |
4 ms |
844 KB |
Output is correct |
23 |
Correct |
3 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
1116 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
4 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
720 KB |
Output is correct |
28 |
Correct |
2 ms |
604 KB |
Output is correct |
29 |
Correct |
6 ms |
1236 KB |
Output is correct |
30 |
Correct |
4 ms |
868 KB |
Output is correct |
31 |
Correct |
6 ms |
2140 KB |
Output is correct |
32 |
Correct |
10 ms |
1372 KB |
Output is correct |
33 |
Correct |
6 ms |
1372 KB |
Output is correct |
34 |
Correct |
4 ms |
2024 KB |
Output is correct |
35 |
Correct |
5 ms |
2024 KB |
Output is correct |
36 |
Correct |
10 ms |
1468 KB |
Output is correct |
37 |
Correct |
10 ms |
1884 KB |
Output is correct |
38 |
Correct |
6 ms |
1184 KB |
Output is correct |
39 |
Correct |
62 ms |
9308 KB |
Output is correct |
40 |
Correct |
11 ms |
1372 KB |
Output is correct |
41 |
Correct |
8 ms |
2280 KB |
Output is correct |
42 |
Correct |
11 ms |
1880 KB |
Output is correct |
43 |
Correct |
10 ms |
2396 KB |
Output is correct |
44 |
Correct |
40 ms |
5468 KB |
Output is correct |
45 |
Correct |
36 ms |
5876 KB |
Output is correct |
46 |
Correct |
52 ms |
15188 KB |
Output is correct |
47 |
Correct |
91 ms |
9496 KB |
Output is correct |
48 |
Correct |
54 ms |
9452 KB |
Output is correct |
49 |
Correct |
40 ms |
15408 KB |
Output is correct |
50 |
Correct |
43 ms |
15096 KB |
Output is correct |
51 |
Correct |
92 ms |
9812 KB |
Output is correct |
52 |
Correct |
94 ms |
9592 KB |
Output is correct |
53 |
Correct |
57 ms |
9504 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
0 ms |
460 KB |
Output is correct |
58 |
Correct |
0 ms |
456 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
3 ms |
348 KB |
Output is correct |
66 |
Correct |
3 ms |
348 KB |
Output is correct |
67 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
81 |
Correct |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
1 ms |
348 KB |
Output is correct |
84 |
Correct |
1 ms |
348 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
1 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 |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
0 ms |
600 KB |
Output is correct |
93 |
Correct |
0 ms |
348 KB |
Output is correct |
94 |
Correct |
3 ms |
348 KB |
Output is correct |
95 |
Correct |
3 ms |
348 KB |
Output is correct |
96 |
Correct |
2 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
460 KB |
Output is correct |
99 |
Correct |
1 ms |
344 KB |
Output is correct |
100 |
Correct |
0 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 |
0 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 |
452 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
110 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 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 |
0 ms |
348 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 |
0 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 |
3 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
860 KB |
Output is correct |
22 |
Correct |
4 ms |
844 KB |
Output is correct |
23 |
Correct |
3 ms |
604 KB |
Output is correct |
24 |
Correct |
2 ms |
1116 KB |
Output is correct |
25 |
Correct |
2 ms |
1116 KB |
Output is correct |
26 |
Correct |
4 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
720 KB |
Output is correct |
28 |
Correct |
2 ms |
604 KB |
Output is correct |
29 |
Correct |
6 ms |
1236 KB |
Output is correct |
30 |
Correct |
4 ms |
868 KB |
Output is correct |
31 |
Correct |
6 ms |
2140 KB |
Output is correct |
32 |
Correct |
10 ms |
1372 KB |
Output is correct |
33 |
Correct |
6 ms |
1372 KB |
Output is correct |
34 |
Correct |
4 ms |
2024 KB |
Output is correct |
35 |
Correct |
5 ms |
2024 KB |
Output is correct |
36 |
Correct |
10 ms |
1468 KB |
Output is correct |
37 |
Correct |
10 ms |
1884 KB |
Output is correct |
38 |
Correct |
6 ms |
1184 KB |
Output is correct |
39 |
Correct |
62 ms |
9308 KB |
Output is correct |
40 |
Correct |
11 ms |
1372 KB |
Output is correct |
41 |
Correct |
8 ms |
2280 KB |
Output is correct |
42 |
Correct |
11 ms |
1880 KB |
Output is correct |
43 |
Correct |
10 ms |
2396 KB |
Output is correct |
44 |
Correct |
40 ms |
5468 KB |
Output is correct |
45 |
Correct |
36 ms |
5876 KB |
Output is correct |
46 |
Correct |
52 ms |
15188 KB |
Output is correct |
47 |
Correct |
91 ms |
9496 KB |
Output is correct |
48 |
Correct |
54 ms |
9452 KB |
Output is correct |
49 |
Correct |
40 ms |
15408 KB |
Output is correct |
50 |
Correct |
43 ms |
15096 KB |
Output is correct |
51 |
Correct |
92 ms |
9812 KB |
Output is correct |
52 |
Correct |
94 ms |
9592 KB |
Output is correct |
53 |
Correct |
57 ms |
9504 KB |
Output is correct |
54 |
Correct |
0 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
0 ms |
460 KB |
Output is correct |
58 |
Correct |
0 ms |
456 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
460 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
348 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
3 ms |
348 KB |
Output is correct |
66 |
Correct |
3 ms |
348 KB |
Output is correct |
67 |
Correct |
3 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 |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
1 ms |
348 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 |
1 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 |
0 ms |
600 KB |
Output is correct |
81 |
Correct |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
1 ms |
348 KB |
Output is correct |
84 |
Correct |
1 ms |
348 KB |
Output is correct |
85 |
Correct |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
1 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 |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
0 ms |
600 KB |
Output is correct |
93 |
Correct |
0 ms |
348 KB |
Output is correct |
94 |
Correct |
3 ms |
348 KB |
Output is correct |
95 |
Correct |
3 ms |
348 KB |
Output is correct |
96 |
Correct |
2 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
460 KB |
Output is correct |
99 |
Correct |
1 ms |
344 KB |
Output is correct |
100 |
Correct |
0 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 |
0 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 |
452 KB |
Output is correct |
108 |
Correct |
0 ms |
348 KB |
Output is correct |
109 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
110 |
Halted |
0 ms |
0 KB |
- |