#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
int R, C;
int N;
pii debut;
pii fin;
vector<vector<char>> maze;
vector<vector<int>> vis;
pii delta[4] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
bool is_valid(pii pos){
if(pos.first>=R || pos.first< 0){
return false;
}
if(pos.second>=C || pos.second<0){
return false;
}
return true;
}
vector<pii> get_free(pii pos){
vector<pii> res;
for(auto d: delta){
pii c= {pos.first+d.first, pos.second+d.second};
if(is_valid(c) && maze[c.first][c.second] != '#'){
res.push_back(c);
}
}
return res;
}
vector<pii> get_paid(pii pos){
vector<pii> res;
for(int i = pos.first-N; i<=pos.first+N; i++){
for(int j = pos.second-N; j<=pos.second+N; j++){
pii c= {i, j};
if(is_valid(c)){
if(abs(c.first-pos.first)<=N && abs(c.second-pos.second)<=N){
if(abs(c.first-pos.first)<N || abs(c.second-pos.second)<N){
res.push_back(c);
}
}
}
}
}
/*for(int i= -N; i<=N; i+=2*N){
for(int j = -(N-1); j<=N-1; j++){
pii c = {pos.first+i, pos.second+j};
if(is_valid(c)){
res.push_back(c);
}
}
}
for(int i= -N; i<=N; i+=2*N){
for(int j = -(N-1); j<=N-1; j++){
pii c = {pos.first+j, pos.second+i};
if(is_valid(c)){
res.push_back(c);
}
}
}*/
return res;
}
void display(){
for(int i = 0; i<R; i++){
for(int j = 0; j<C; j++){
if(maze[i][j]=='.'){
if(vis[i][j]){
cout<<'o';
}
else{
cout<<'.';
}
}
else{
if(vis[i][j]){
cout<<'O';
}
else{
cout<<'#';
}
}
}
cout<<endl;
}
cout<<endl;
}
int BFS(){
deque<pair<pii, int>> dq;
dq.push_back({debut, 0});
vis[debut.first][debut.second] = 0;
while(dq.size()>0){
//display();
auto cur= dq.front();
dq.pop_front();
pii cur_pos =cur.first;
int dist = cur.second;
if(dist!= vis[cur_pos.first][cur_pos.second]){
continue;
}
//cout<<cur_pos.first<<" "<<cur_pos.second<<" "<<dist<<endl;
//cout<<dist<<endl;
if(cur_pos == fin){
return dist;
}
for(auto e: get_free(cur_pos)){
if(vis[e.first][e.second] > dist){
vis[e.first][e.second] = dist;
dq.push_front({e, dist});
}
}
for(auto e: get_paid(cur_pos)){
if(vis[e.first][e.second]>dist+1){
vis[e.first][e.second] = dist+1;
dq.push_back({e, dist+1});
}
}
}
return 1e9;
}
signed main(){
cin>>R>>C;
cin>>N;
maze.resize(R, vector<char> (C));
vis.resize(R, vector<int>(C, 1e9));
cin>>debut.first>>debut.second;
debut.first--;
debut.second--;
cin>>fin.first>>fin.second;
fin.first--;
fin.second--;
for(int i = 0; i<R; i++){
for(int j = 0; j<C; j++){
cin>>maze[i][j];
}
}
cout<<BFS()<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
676 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
432 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 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 |
444 KB |
Output is correct |
14 |
Correct |
0 ms |
440 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
9 ms |
860 KB |
Output is correct |
20 |
Correct |
6 ms |
1116 KB |
Output is correct |
21 |
Correct |
4 ms |
1296 KB |
Output is correct |
22 |
Correct |
11 ms |
1208 KB |
Output is correct |
23 |
Correct |
10 ms |
992 KB |
Output is correct |
24 |
Correct |
9 ms |
1368 KB |
Output is correct |
25 |
Correct |
7 ms |
1368 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
956 KB |
Output is correct |
28 |
Correct |
6 ms |
856 KB |
Output is correct |
29 |
Correct |
25 ms |
1900 KB |
Output is correct |
30 |
Correct |
11 ms |
1116 KB |
Output is correct |
31 |
Correct |
17 ms |
3160 KB |
Output is correct |
32 |
Correct |
30 ms |
1884 KB |
Output is correct |
33 |
Correct |
23 ms |
1932 KB |
Output is correct |
34 |
Correct |
24 ms |
2760 KB |
Output is correct |
35 |
Correct |
19 ms |
2760 KB |
Output is correct |
36 |
Correct |
19 ms |
2136 KB |
Output is correct |
37 |
Correct |
25 ms |
1980 KB |
Output is correct |
38 |
Correct |
7 ms |
1720 KB |
Output is correct |
39 |
Correct |
254 ms |
15120 KB |
Output is correct |
40 |
Correct |
14 ms |
2136 KB |
Output is correct |
41 |
Correct |
17 ms |
3492 KB |
Output is correct |
42 |
Correct |
39 ms |
2396 KB |
Output is correct |
43 |
Correct |
37 ms |
3420 KB |
Output is correct |
44 |
Correct |
69 ms |
8028 KB |
Output is correct |
45 |
Correct |
65 ms |
8636 KB |
Output is correct |
46 |
Correct |
93 ms |
21272 KB |
Output is correct |
47 |
Correct |
284 ms |
15184 KB |
Output is correct |
48 |
Correct |
193 ms |
15188 KB |
Output is correct |
49 |
Correct |
170 ms |
25244 KB |
Output is correct |
50 |
Correct |
158 ms |
25248 KB |
Output is correct |
51 |
Correct |
233 ms |
15952 KB |
Output is correct |
52 |
Correct |
184 ms |
15484 KB |
Output is correct |
53 |
Correct |
211 ms |
15188 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 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 |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
432 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
6 ms |
348 KB |
Output is correct |
13 |
Correct |
11 ms |
344 KB |
Output is correct |
14 |
Correct |
13 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 |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
436 KB |
Output is correct |
19 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
6 ms |
508 KB |
Output is correct |
10 |
Correct |
10 ms |
504 KB |
Output is correct |
11 |
Correct |
13 ms |
344 KB |
Output is correct |
12 |
Correct |
1 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 |
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 |
344 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
424 KB |
Output is correct |
22 |
Correct |
1 ms |
600 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
9 ms |
348 KB |
Output is correct |
25 |
Correct |
4 ms |
604 KB |
Output is correct |
26 |
Correct |
52 ms |
2388 KB |
Output is correct |
27 |
Correct |
5 ms |
1364 KB |
Output is correct |
28 |
Execution timed out |
2101 ms |
4884 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 |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
432 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
6 ms |
348 KB |
Output is correct |
13 |
Correct |
11 ms |
344 KB |
Output is correct |
14 |
Correct |
13 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 |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
436 KB |
Output is correct |
19 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
8 ms |
860 KB |
Output is correct |
34 |
Correct |
9 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
5 ms |
604 KB |
Output is correct |
37 |
Correct |
6 ms |
1212 KB |
Output is correct |
38 |
Correct |
51 ms |
2396 KB |
Output is correct |
39 |
Correct |
5 ms |
1112 KB |
Output is correct |
40 |
Correct |
11 ms |
856 KB |
Output is correct |
41 |
Correct |
9 ms |
860 KB |
Output is correct |
42 |
Execution timed out |
2082 ms |
4964 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 |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
432 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
6 ms |
348 KB |
Output is correct |
13 |
Correct |
11 ms |
344 KB |
Output is correct |
14 |
Correct |
13 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 |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
436 KB |
Output is correct |
19 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
8 ms |
860 KB |
Output is correct |
34 |
Correct |
9 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
5 ms |
604 KB |
Output is correct |
37 |
Correct |
6 ms |
1212 KB |
Output is correct |
38 |
Correct |
51 ms |
2396 KB |
Output is correct |
39 |
Correct |
5 ms |
1112 KB |
Output is correct |
40 |
Correct |
11 ms |
856 KB |
Output is correct |
41 |
Correct |
9 ms |
860 KB |
Output is correct |
42 |
Execution timed out |
2082 ms |
4964 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 |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
676 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
432 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 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 |
444 KB |
Output is correct |
14 |
Correct |
0 ms |
440 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
9 ms |
860 KB |
Output is correct |
20 |
Correct |
6 ms |
1116 KB |
Output is correct |
21 |
Correct |
4 ms |
1296 KB |
Output is correct |
22 |
Correct |
11 ms |
1208 KB |
Output is correct |
23 |
Correct |
10 ms |
992 KB |
Output is correct |
24 |
Correct |
9 ms |
1368 KB |
Output is correct |
25 |
Correct |
7 ms |
1368 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
956 KB |
Output is correct |
28 |
Correct |
6 ms |
856 KB |
Output is correct |
29 |
Correct |
25 ms |
1900 KB |
Output is correct |
30 |
Correct |
11 ms |
1116 KB |
Output is correct |
31 |
Correct |
17 ms |
3160 KB |
Output is correct |
32 |
Correct |
30 ms |
1884 KB |
Output is correct |
33 |
Correct |
23 ms |
1932 KB |
Output is correct |
34 |
Correct |
24 ms |
2760 KB |
Output is correct |
35 |
Correct |
19 ms |
2760 KB |
Output is correct |
36 |
Correct |
19 ms |
2136 KB |
Output is correct |
37 |
Correct |
25 ms |
1980 KB |
Output is correct |
38 |
Correct |
7 ms |
1720 KB |
Output is correct |
39 |
Correct |
254 ms |
15120 KB |
Output is correct |
40 |
Correct |
14 ms |
2136 KB |
Output is correct |
41 |
Correct |
17 ms |
3492 KB |
Output is correct |
42 |
Correct |
39 ms |
2396 KB |
Output is correct |
43 |
Correct |
37 ms |
3420 KB |
Output is correct |
44 |
Correct |
69 ms |
8028 KB |
Output is correct |
45 |
Correct |
65 ms |
8636 KB |
Output is correct |
46 |
Correct |
93 ms |
21272 KB |
Output is correct |
47 |
Correct |
284 ms |
15184 KB |
Output is correct |
48 |
Correct |
193 ms |
15188 KB |
Output is correct |
49 |
Correct |
170 ms |
25244 KB |
Output is correct |
50 |
Correct |
158 ms |
25248 KB |
Output is correct |
51 |
Correct |
233 ms |
15952 KB |
Output is correct |
52 |
Correct |
184 ms |
15484 KB |
Output is correct |
53 |
Correct |
211 ms |
15188 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
432 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
6 ms |
348 KB |
Output is correct |
66 |
Correct |
11 ms |
344 KB |
Output is correct |
67 |
Correct |
13 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
348 KB |
Output is correct |
71 |
Correct |
0 ms |
436 KB |
Output is correct |
72 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
76 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
1 ms |
348 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 |
436 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
344 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
6 ms |
508 KB |
Output is correct |
95 |
Correct |
10 ms |
504 KB |
Output is correct |
96 |
Correct |
13 ms |
344 KB |
Output is correct |
97 |
Correct |
1 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 |
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 |
344 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
424 KB |
Output is correct |
107 |
Correct |
1 ms |
600 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
9 ms |
348 KB |
Output is correct |
110 |
Correct |
4 ms |
604 KB |
Output is correct |
111 |
Correct |
52 ms |
2388 KB |
Output is correct |
112 |
Correct |
5 ms |
1364 KB |
Output is correct |
113 |
Execution timed out |
2101 ms |
4884 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
676 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
432 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 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 |
444 KB |
Output is correct |
14 |
Correct |
0 ms |
440 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
9 ms |
860 KB |
Output is correct |
20 |
Correct |
6 ms |
1116 KB |
Output is correct |
21 |
Correct |
4 ms |
1296 KB |
Output is correct |
22 |
Correct |
11 ms |
1208 KB |
Output is correct |
23 |
Correct |
10 ms |
992 KB |
Output is correct |
24 |
Correct |
9 ms |
1368 KB |
Output is correct |
25 |
Correct |
7 ms |
1368 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
956 KB |
Output is correct |
28 |
Correct |
6 ms |
856 KB |
Output is correct |
29 |
Correct |
25 ms |
1900 KB |
Output is correct |
30 |
Correct |
11 ms |
1116 KB |
Output is correct |
31 |
Correct |
17 ms |
3160 KB |
Output is correct |
32 |
Correct |
30 ms |
1884 KB |
Output is correct |
33 |
Correct |
23 ms |
1932 KB |
Output is correct |
34 |
Correct |
24 ms |
2760 KB |
Output is correct |
35 |
Correct |
19 ms |
2760 KB |
Output is correct |
36 |
Correct |
19 ms |
2136 KB |
Output is correct |
37 |
Correct |
25 ms |
1980 KB |
Output is correct |
38 |
Correct |
7 ms |
1720 KB |
Output is correct |
39 |
Correct |
254 ms |
15120 KB |
Output is correct |
40 |
Correct |
14 ms |
2136 KB |
Output is correct |
41 |
Correct |
17 ms |
3492 KB |
Output is correct |
42 |
Correct |
39 ms |
2396 KB |
Output is correct |
43 |
Correct |
37 ms |
3420 KB |
Output is correct |
44 |
Correct |
69 ms |
8028 KB |
Output is correct |
45 |
Correct |
65 ms |
8636 KB |
Output is correct |
46 |
Correct |
93 ms |
21272 KB |
Output is correct |
47 |
Correct |
284 ms |
15184 KB |
Output is correct |
48 |
Correct |
193 ms |
15188 KB |
Output is correct |
49 |
Correct |
170 ms |
25244 KB |
Output is correct |
50 |
Correct |
158 ms |
25248 KB |
Output is correct |
51 |
Correct |
233 ms |
15952 KB |
Output is correct |
52 |
Correct |
184 ms |
15484 KB |
Output is correct |
53 |
Correct |
211 ms |
15188 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
432 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
6 ms |
348 KB |
Output is correct |
66 |
Correct |
11 ms |
344 KB |
Output is correct |
67 |
Correct |
13 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
348 KB |
Output is correct |
71 |
Correct |
0 ms |
436 KB |
Output is correct |
72 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
76 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
1 ms |
348 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 |
436 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
344 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
6 ms |
508 KB |
Output is correct |
95 |
Correct |
10 ms |
504 KB |
Output is correct |
96 |
Correct |
13 ms |
344 KB |
Output is correct |
97 |
Correct |
1 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 |
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 |
344 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
424 KB |
Output is correct |
107 |
Correct |
1 ms |
600 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
9 ms |
348 KB |
Output is correct |
110 |
Correct |
4 ms |
604 KB |
Output is correct |
111 |
Correct |
52 ms |
2388 KB |
Output is correct |
112 |
Correct |
5 ms |
1364 KB |
Output is correct |
113 |
Execution timed out |
2101 ms |
4884 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
676 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
432 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
1 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 |
444 KB |
Output is correct |
14 |
Correct |
0 ms |
440 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 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 |
9 ms |
860 KB |
Output is correct |
20 |
Correct |
6 ms |
1116 KB |
Output is correct |
21 |
Correct |
4 ms |
1296 KB |
Output is correct |
22 |
Correct |
11 ms |
1208 KB |
Output is correct |
23 |
Correct |
10 ms |
992 KB |
Output is correct |
24 |
Correct |
9 ms |
1368 KB |
Output is correct |
25 |
Correct |
7 ms |
1368 KB |
Output is correct |
26 |
Correct |
3 ms |
860 KB |
Output is correct |
27 |
Correct |
3 ms |
956 KB |
Output is correct |
28 |
Correct |
6 ms |
856 KB |
Output is correct |
29 |
Correct |
25 ms |
1900 KB |
Output is correct |
30 |
Correct |
11 ms |
1116 KB |
Output is correct |
31 |
Correct |
17 ms |
3160 KB |
Output is correct |
32 |
Correct |
30 ms |
1884 KB |
Output is correct |
33 |
Correct |
23 ms |
1932 KB |
Output is correct |
34 |
Correct |
24 ms |
2760 KB |
Output is correct |
35 |
Correct |
19 ms |
2760 KB |
Output is correct |
36 |
Correct |
19 ms |
2136 KB |
Output is correct |
37 |
Correct |
25 ms |
1980 KB |
Output is correct |
38 |
Correct |
7 ms |
1720 KB |
Output is correct |
39 |
Correct |
254 ms |
15120 KB |
Output is correct |
40 |
Correct |
14 ms |
2136 KB |
Output is correct |
41 |
Correct |
17 ms |
3492 KB |
Output is correct |
42 |
Correct |
39 ms |
2396 KB |
Output is correct |
43 |
Correct |
37 ms |
3420 KB |
Output is correct |
44 |
Correct |
69 ms |
8028 KB |
Output is correct |
45 |
Correct |
65 ms |
8636 KB |
Output is correct |
46 |
Correct |
93 ms |
21272 KB |
Output is correct |
47 |
Correct |
284 ms |
15184 KB |
Output is correct |
48 |
Correct |
193 ms |
15188 KB |
Output is correct |
49 |
Correct |
170 ms |
25244 KB |
Output is correct |
50 |
Correct |
158 ms |
25248 KB |
Output is correct |
51 |
Correct |
233 ms |
15952 KB |
Output is correct |
52 |
Correct |
184 ms |
15484 KB |
Output is correct |
53 |
Correct |
211 ms |
15188 KB |
Output is correct |
54 |
Correct |
0 ms |
344 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
0 ms |
344 KB |
Output is correct |
57 |
Correct |
1 ms |
344 KB |
Output is correct |
58 |
Correct |
0 ms |
348 KB |
Output is correct |
59 |
Correct |
0 ms |
344 KB |
Output is correct |
60 |
Correct |
0 ms |
344 KB |
Output is correct |
61 |
Correct |
1 ms |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
432 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
6 ms |
348 KB |
Output is correct |
66 |
Correct |
11 ms |
344 KB |
Output is correct |
67 |
Correct |
13 ms |
348 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
1 ms |
348 KB |
Output is correct |
71 |
Correct |
0 ms |
436 KB |
Output is correct |
72 |
Correct |
1 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 |
0 ms |
344 KB |
Output is correct |
76 |
Correct |
1 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
82 |
Correct |
0 ms |
348 KB |
Output is correct |
83 |
Correct |
0 ms |
348 KB |
Output is correct |
84 |
Correct |
0 ms |
348 KB |
Output is correct |
85 |
Correct |
1 ms |
348 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 |
436 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
344 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
6 ms |
508 KB |
Output is correct |
95 |
Correct |
10 ms |
504 KB |
Output is correct |
96 |
Correct |
13 ms |
344 KB |
Output is correct |
97 |
Correct |
1 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 |
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 |
344 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
424 KB |
Output is correct |
107 |
Correct |
1 ms |
600 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
9 ms |
348 KB |
Output is correct |
110 |
Correct |
4 ms |
604 KB |
Output is correct |
111 |
Correct |
52 ms |
2388 KB |
Output is correct |
112 |
Correct |
5 ms |
1364 KB |
Output is correct |
113 |
Execution timed out |
2101 ms |
4884 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |