#include <bits/stdc++.h>
using namespace std;
int R, C, N;
bool isBest(int d1, int d2, pair<int, int> p){
int mn1 = min(d1, d2);
int mx1 = max(d1, d2);
int mn2 = min(p.first, p.second);
int mx2 = max(p.first, p.second);
if(!((mx1 <= N && mn1 < N) || (mx2 <= N && mn2 < N))) return false;
if(mx1 == mx2) return mn1 < mn2;
else return mx1 < mx2;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> R >> C >> N;
int Sr, Sc, Gr, Gc; cin >> Sr >> Sc >> Gr >> Gc; Sr--; Sc--; Gr--; Gc--;
vector<string> v(R);
for(auto &i : v) cin >> i;
vector<vector<int>> dist(R, vector<int>(C, 1e9));
vector<vector<bool>> vis(R, vector<bool>(C, false));
dist[Sr][Sc] = 0;
priority_queue<tuple<int, int, int>> q; q.push({0, Sr, Sc});
while(!q.empty()){
int i = get<1>(q.top()); int j = get<2>(q.top()); q.pop();
if(vis[i][j]) continue;
vis[i][j] = true;
// cout << "i " << i+1 << " j " << j+1 << " dist " << dist[i][j] << "\n";
for(int ai = -1; ai <= 1; ai++){
for(int aj = -1; aj <= 1; aj++){
if(ai * aj != 0 || i + ai < 0 || i + ai >= R || j + aj < 0 || j + aj >= C) continue;
int ni = i + ai; int nj = j + aj;
if(v[ni][nj] == '.' && dist[ni][nj] > dist[i][j]){
dist[ni][nj] = dist[i][j];
q.push({-dist[ni][nj], ni, nj});
}
}
}
for(int ai = -N; ai <= N; ai++){
for(int aj = -N; aj <= N; aj++){
if(min(abs(ai), abs(aj)) == N) continue;
if(i + ai < 0 || i + ai >= R || j + aj < 0 || j + aj >= C) continue;
int ni = i + ai; int nj = j + aj;
// cout << "ni " << ni+1 << " nj " << nj+1 << "\n";
if(dist[ni][nj] > dist[i][j]+1){
dist[ni][nj] = dist[i][j]+1;
q.push({-dist[ni][nj], ni, nj});
}
}
}
}
cout << dist[Gr][Gc] << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
344 KB |
Output is correct |
19 |
Correct |
9 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
800 KB |
Output is correct |
22 |
Correct |
13 ms |
604 KB |
Output is correct |
23 |
Correct |
7 ms |
792 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
12 ms |
944 KB |
Output is correct |
27 |
Correct |
12 ms |
860 KB |
Output is correct |
28 |
Correct |
8 ms |
604 KB |
Output is correct |
29 |
Correct |
20 ms |
1288 KB |
Output is correct |
30 |
Correct |
7 ms |
928 KB |
Output is correct |
31 |
Correct |
20 ms |
1112 KB |
Output is correct |
32 |
Correct |
28 ms |
1368 KB |
Output is correct |
33 |
Correct |
20 ms |
1116 KB |
Output is correct |
34 |
Correct |
7 ms |
1768 KB |
Output is correct |
35 |
Correct |
6 ms |
1768 KB |
Output is correct |
36 |
Correct |
33 ms |
1624 KB |
Output is correct |
37 |
Correct |
30 ms |
1372 KB |
Output is correct |
38 |
Correct |
21 ms |
1116 KB |
Output is correct |
39 |
Correct |
239 ms |
8264 KB |
Output is correct |
40 |
Correct |
33 ms |
1624 KB |
Output is correct |
41 |
Correct |
10 ms |
2024 KB |
Output is correct |
42 |
Correct |
33 ms |
1368 KB |
Output is correct |
43 |
Correct |
19 ms |
2140 KB |
Output is correct |
44 |
Correct |
117 ms |
4696 KB |
Output is correct |
45 |
Correct |
75 ms |
5268 KB |
Output is correct |
46 |
Correct |
226 ms |
8480 KB |
Output is correct |
47 |
Correct |
286 ms |
8380 KB |
Output is correct |
48 |
Correct |
229 ms |
8500 KB |
Output is correct |
49 |
Correct |
67 ms |
13568 KB |
Output is correct |
50 |
Correct |
57 ms |
13564 KB |
Output is correct |
51 |
Correct |
358 ms |
8724 KB |
Output is correct |
52 |
Correct |
312 ms |
8536 KB |
Output is correct |
53 |
Correct |
228 ms |
8388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
548 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
7 ms |
348 KB |
Output is correct |
13 |
Correct |
7 ms |
484 KB |
Output is correct |
14 |
Correct |
7 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 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 |
344 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 |
1 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 |
600 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
7 ms |
600 KB |
Output is correct |
10 |
Correct |
7 ms |
488 KB |
Output is correct |
11 |
Correct |
8 ms |
348 KB |
Output is correct |
12 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
7 ms |
348 KB |
Output is correct |
25 |
Correct |
13 ms |
604 KB |
Output is correct |
26 |
Correct |
27 ms |
1624 KB |
Output is correct |
27 |
Correct |
8 ms |
604 KB |
Output is correct |
28 |
Execution timed out |
2082 ms |
1636 KB |
Time limit exceeded |
29 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
548 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
7 ms |
348 KB |
Output is correct |
13 |
Correct |
7 ms |
484 KB |
Output is correct |
14 |
Correct |
7 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 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 |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
8 ms |
604 KB |
Output is correct |
34 |
Correct |
7 ms |
516 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
11 ms |
604 KB |
Output is correct |
37 |
Correct |
2 ms |
860 KB |
Output is correct |
38 |
Correct |
28 ms |
1420 KB |
Output is correct |
39 |
Correct |
8 ms |
600 KB |
Output is correct |
40 |
Correct |
11 ms |
604 KB |
Output is correct |
41 |
Correct |
7 ms |
600 KB |
Output is correct |
42 |
Execution timed out |
2091 ms |
1872 KB |
Time limit exceeded |
43 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
548 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
7 ms |
348 KB |
Output is correct |
13 |
Correct |
7 ms |
484 KB |
Output is correct |
14 |
Correct |
7 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
348 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 |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
8 ms |
604 KB |
Output is correct |
34 |
Correct |
7 ms |
516 KB |
Output is correct |
35 |
Correct |
1 ms |
344 KB |
Output is correct |
36 |
Correct |
11 ms |
604 KB |
Output is correct |
37 |
Correct |
2 ms |
860 KB |
Output is correct |
38 |
Correct |
28 ms |
1420 KB |
Output is correct |
39 |
Correct |
8 ms |
600 KB |
Output is correct |
40 |
Correct |
11 ms |
604 KB |
Output is correct |
41 |
Correct |
7 ms |
600 KB |
Output is correct |
42 |
Execution timed out |
2091 ms |
1872 KB |
Time limit exceeded |
43 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
344 KB |
Output is correct |
19 |
Correct |
9 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
800 KB |
Output is correct |
22 |
Correct |
13 ms |
604 KB |
Output is correct |
23 |
Correct |
7 ms |
792 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
12 ms |
944 KB |
Output is correct |
27 |
Correct |
12 ms |
860 KB |
Output is correct |
28 |
Correct |
8 ms |
604 KB |
Output is correct |
29 |
Correct |
20 ms |
1288 KB |
Output is correct |
30 |
Correct |
7 ms |
928 KB |
Output is correct |
31 |
Correct |
20 ms |
1112 KB |
Output is correct |
32 |
Correct |
28 ms |
1368 KB |
Output is correct |
33 |
Correct |
20 ms |
1116 KB |
Output is correct |
34 |
Correct |
7 ms |
1768 KB |
Output is correct |
35 |
Correct |
6 ms |
1768 KB |
Output is correct |
36 |
Correct |
33 ms |
1624 KB |
Output is correct |
37 |
Correct |
30 ms |
1372 KB |
Output is correct |
38 |
Correct |
21 ms |
1116 KB |
Output is correct |
39 |
Correct |
239 ms |
8264 KB |
Output is correct |
40 |
Correct |
33 ms |
1624 KB |
Output is correct |
41 |
Correct |
10 ms |
2024 KB |
Output is correct |
42 |
Correct |
33 ms |
1368 KB |
Output is correct |
43 |
Correct |
19 ms |
2140 KB |
Output is correct |
44 |
Correct |
117 ms |
4696 KB |
Output is correct |
45 |
Correct |
75 ms |
5268 KB |
Output is correct |
46 |
Correct |
226 ms |
8480 KB |
Output is correct |
47 |
Correct |
286 ms |
8380 KB |
Output is correct |
48 |
Correct |
229 ms |
8500 KB |
Output is correct |
49 |
Correct |
67 ms |
13568 KB |
Output is correct |
50 |
Correct |
57 ms |
13564 KB |
Output is correct |
51 |
Correct |
358 ms |
8724 KB |
Output is correct |
52 |
Correct |
312 ms |
8536 KB |
Output is correct |
53 |
Correct |
228 ms |
8388 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
344 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
344 KB |
Output is correct |
62 |
Correct |
1 ms |
548 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
7 ms |
348 KB |
Output is correct |
66 |
Correct |
7 ms |
484 KB |
Output is correct |
67 |
Correct |
7 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
344 KB |
Output is correct |
70 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
1 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
348 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 |
344 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 |
1 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 |
600 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
600 KB |
Output is correct |
95 |
Correct |
7 ms |
488 KB |
Output is correct |
96 |
Correct |
8 ms |
348 KB |
Output is correct |
97 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
1 ms |
348 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
7 ms |
348 KB |
Output is correct |
110 |
Correct |
13 ms |
604 KB |
Output is correct |
111 |
Correct |
27 ms |
1624 KB |
Output is correct |
112 |
Correct |
8 ms |
604 KB |
Output is correct |
113 |
Execution timed out |
2082 ms |
1636 KB |
Time limit exceeded |
114 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
344 KB |
Output is correct |
19 |
Correct |
9 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
800 KB |
Output is correct |
22 |
Correct |
13 ms |
604 KB |
Output is correct |
23 |
Correct |
7 ms |
792 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
12 ms |
944 KB |
Output is correct |
27 |
Correct |
12 ms |
860 KB |
Output is correct |
28 |
Correct |
8 ms |
604 KB |
Output is correct |
29 |
Correct |
20 ms |
1288 KB |
Output is correct |
30 |
Correct |
7 ms |
928 KB |
Output is correct |
31 |
Correct |
20 ms |
1112 KB |
Output is correct |
32 |
Correct |
28 ms |
1368 KB |
Output is correct |
33 |
Correct |
20 ms |
1116 KB |
Output is correct |
34 |
Correct |
7 ms |
1768 KB |
Output is correct |
35 |
Correct |
6 ms |
1768 KB |
Output is correct |
36 |
Correct |
33 ms |
1624 KB |
Output is correct |
37 |
Correct |
30 ms |
1372 KB |
Output is correct |
38 |
Correct |
21 ms |
1116 KB |
Output is correct |
39 |
Correct |
239 ms |
8264 KB |
Output is correct |
40 |
Correct |
33 ms |
1624 KB |
Output is correct |
41 |
Correct |
10 ms |
2024 KB |
Output is correct |
42 |
Correct |
33 ms |
1368 KB |
Output is correct |
43 |
Correct |
19 ms |
2140 KB |
Output is correct |
44 |
Correct |
117 ms |
4696 KB |
Output is correct |
45 |
Correct |
75 ms |
5268 KB |
Output is correct |
46 |
Correct |
226 ms |
8480 KB |
Output is correct |
47 |
Correct |
286 ms |
8380 KB |
Output is correct |
48 |
Correct |
229 ms |
8500 KB |
Output is correct |
49 |
Correct |
67 ms |
13568 KB |
Output is correct |
50 |
Correct |
57 ms |
13564 KB |
Output is correct |
51 |
Correct |
358 ms |
8724 KB |
Output is correct |
52 |
Correct |
312 ms |
8536 KB |
Output is correct |
53 |
Correct |
228 ms |
8388 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
344 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
344 KB |
Output is correct |
62 |
Correct |
1 ms |
548 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
7 ms |
348 KB |
Output is correct |
66 |
Correct |
7 ms |
484 KB |
Output is correct |
67 |
Correct |
7 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
344 KB |
Output is correct |
70 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
1 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
348 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 |
344 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 |
1 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 |
600 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
600 KB |
Output is correct |
95 |
Correct |
7 ms |
488 KB |
Output is correct |
96 |
Correct |
8 ms |
348 KB |
Output is correct |
97 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
1 ms |
348 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
7 ms |
348 KB |
Output is correct |
110 |
Correct |
13 ms |
604 KB |
Output is correct |
111 |
Correct |
27 ms |
1624 KB |
Output is correct |
112 |
Correct |
8 ms |
604 KB |
Output is correct |
113 |
Execution timed out |
2082 ms |
1636 KB |
Time limit exceeded |
114 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
344 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
344 KB |
Output is correct |
19 |
Correct |
9 ms |
604 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
800 KB |
Output is correct |
22 |
Correct |
13 ms |
604 KB |
Output is correct |
23 |
Correct |
7 ms |
792 KB |
Output is correct |
24 |
Correct |
3 ms |
860 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
12 ms |
944 KB |
Output is correct |
27 |
Correct |
12 ms |
860 KB |
Output is correct |
28 |
Correct |
8 ms |
604 KB |
Output is correct |
29 |
Correct |
20 ms |
1288 KB |
Output is correct |
30 |
Correct |
7 ms |
928 KB |
Output is correct |
31 |
Correct |
20 ms |
1112 KB |
Output is correct |
32 |
Correct |
28 ms |
1368 KB |
Output is correct |
33 |
Correct |
20 ms |
1116 KB |
Output is correct |
34 |
Correct |
7 ms |
1768 KB |
Output is correct |
35 |
Correct |
6 ms |
1768 KB |
Output is correct |
36 |
Correct |
33 ms |
1624 KB |
Output is correct |
37 |
Correct |
30 ms |
1372 KB |
Output is correct |
38 |
Correct |
21 ms |
1116 KB |
Output is correct |
39 |
Correct |
239 ms |
8264 KB |
Output is correct |
40 |
Correct |
33 ms |
1624 KB |
Output is correct |
41 |
Correct |
10 ms |
2024 KB |
Output is correct |
42 |
Correct |
33 ms |
1368 KB |
Output is correct |
43 |
Correct |
19 ms |
2140 KB |
Output is correct |
44 |
Correct |
117 ms |
4696 KB |
Output is correct |
45 |
Correct |
75 ms |
5268 KB |
Output is correct |
46 |
Correct |
226 ms |
8480 KB |
Output is correct |
47 |
Correct |
286 ms |
8380 KB |
Output is correct |
48 |
Correct |
229 ms |
8500 KB |
Output is correct |
49 |
Correct |
67 ms |
13568 KB |
Output is correct |
50 |
Correct |
57 ms |
13564 KB |
Output is correct |
51 |
Correct |
358 ms |
8724 KB |
Output is correct |
52 |
Correct |
312 ms |
8536 KB |
Output is correct |
53 |
Correct |
228 ms |
8388 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
344 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
0 ms |
348 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
348 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
344 KB |
Output is correct |
62 |
Correct |
1 ms |
548 KB |
Output is correct |
63 |
Correct |
1 ms |
344 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
7 ms |
348 KB |
Output is correct |
66 |
Correct |
7 ms |
484 KB |
Output is correct |
67 |
Correct |
7 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
344 KB |
Output is correct |
70 |
Correct |
0 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 |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
1 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
348 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 |
344 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 |
1 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 |
600 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
600 KB |
Output is correct |
95 |
Correct |
7 ms |
488 KB |
Output is correct |
96 |
Correct |
8 ms |
348 KB |
Output is correct |
97 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
1 ms |
348 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
7 ms |
348 KB |
Output is correct |
110 |
Correct |
13 ms |
604 KB |
Output is correct |
111 |
Correct |
27 ms |
1624 KB |
Output is correct |
112 |
Correct |
8 ms |
604 KB |
Output is correct |
113 |
Execution timed out |
2082 ms |
1636 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |