#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pll;
#define fastio ios::sync_with_stdio(false), cin.tie(0)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define pb push_back
#define eb emplace_back
#define f first
#define s second
const int INF = 1e9;
struct pt{
int x, y;
pt(){}
pt(int _x, int _y) : x(_x), y(_y){}
bool operator < (const pt& other) const{
return x < other.x;
}
};
istream &operator>> (istream &s, pt &p){
s >> p.x >> p.y;
return s;
}
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int main(void){
// fastio;
int r, c, n;
cin>>r>>c>>n;
pt st, ed;
cin>>st>>ed;
st.x--, st.y--, ed.x--, ed.y--;
vector<string> s(r);
REP(i, r) cin>>s[i];
vector<vector<int>> dist(r, vector<int>(c, INF));
dist[st.x][st.y] = 0;
typedef pair<int, pt> pipt;
priority_queue<pipt, vector<pipt>, greater<pipt>> q;
q.push({0, st});
auto inbound = [&](int x, int y) -> bool{
return x >= 0 && y >= 0 && x < r && y < c;
};
while(!q.empty()){
auto [dis, pos] = q.top(); q.pop();
auto [x, y] = pos;
if(dist[x][y] != dis) continue;
for(int d = 0; d < 4; d++){
int xx = x + dx[d], yy = y + dy[d];
if(!inbound(xx, yy) || s[xx][yy] == '#') continue;
if(dist[xx][yy] > dist[x][y]){
dist[xx][yy] = dist[x][y];
q.push({dist[x][y], pt(xx, yy)});
}
}
for(int xx = x - n; xx <= x + n; xx++){
for(int yy = y - n; yy <= y + n; yy++){
if(!inbound(xx, yy)) continue;
int tk = (xx == x - n) + (xx == x + n) + (yy == y - n) + (yy == y + n);
if(tk == 2) continue;
if(dist[xx][yy] > dist[x][y] + 1){
dist[xx][yy] = dist[x][y] + 1;
q.push({dist[xx][yy], pt(xx, yy)});
}
}
}
}
cout<<dist[ed.x][ed.y]<<"\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 |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
8 ms |
860 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
876 KB |
Output is correct |
22 |
Correct |
10 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
704 KB |
Output is correct |
24 |
Correct |
4 ms |
1112 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
11 ms |
856 KB |
Output is correct |
27 |
Correct |
11 ms |
860 KB |
Output is correct |
28 |
Correct |
7 ms |
884 KB |
Output is correct |
29 |
Correct |
18 ms |
1396 KB |
Output is correct |
30 |
Correct |
6 ms |
860 KB |
Output is correct |
31 |
Correct |
22 ms |
1428 KB |
Output is correct |
32 |
Correct |
25 ms |
1416 KB |
Output is correct |
33 |
Correct |
17 ms |
1368 KB |
Output is correct |
34 |
Correct |
9 ms |
2028 KB |
Output is correct |
35 |
Correct |
8 ms |
2028 KB |
Output is correct |
36 |
Correct |
28 ms |
1560 KB |
Output is correct |
37 |
Correct |
26 ms |
1372 KB |
Output is correct |
38 |
Correct |
19 ms |
1432 KB |
Output is correct |
39 |
Correct |
198 ms |
10196 KB |
Output is correct |
40 |
Correct |
26 ms |
1372 KB |
Output is correct |
41 |
Correct |
10 ms |
2284 KB |
Output is correct |
42 |
Correct |
31 ms |
1864 KB |
Output is correct |
43 |
Correct |
19 ms |
2396 KB |
Output is correct |
44 |
Correct |
104 ms |
5332 KB |
Output is correct |
45 |
Correct |
75 ms |
5696 KB |
Output is correct |
46 |
Correct |
206 ms |
10320 KB |
Output is correct |
47 |
Correct |
256 ms |
10064 KB |
Output is correct |
48 |
Correct |
209 ms |
9996 KB |
Output is correct |
49 |
Correct |
80 ms |
15184 KB |
Output is correct |
50 |
Correct |
83 ms |
15184 KB |
Output is correct |
51 |
Correct |
296 ms |
10580 KB |
Output is correct |
52 |
Correct |
278 ms |
10320 KB |
Output is correct |
53 |
Correct |
209 ms |
10320 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 |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
432 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
428 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
8 ms |
480 KB |
Output is correct |
13 |
Correct |
8 ms |
408 KB |
Output is correct |
14 |
Correct |
6 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 |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
7 ms |
480 KB |
Output is correct |
10 |
Correct |
7 ms |
348 KB |
Output is correct |
11 |
Correct |
7 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
452 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
604 KB |
Output is correct |
24 |
Correct |
8 ms |
348 KB |
Output is correct |
25 |
Correct |
11 ms |
724 KB |
Output is correct |
26 |
Correct |
31 ms |
1540 KB |
Output is correct |
27 |
Correct |
8 ms |
860 KB |
Output is correct |
28 |
Execution timed out |
2072 ms |
1628 KB |
Time limit exceeded |
29 |
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 |
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 |
1 ms |
432 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
428 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
8 ms |
480 KB |
Output is correct |
13 |
Correct |
8 ms |
408 KB |
Output is correct |
14 |
Correct |
6 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 |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
10 ms |
856 KB |
Output is correct |
34 |
Correct |
9 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
11 ms |
724 KB |
Output is correct |
37 |
Correct |
3 ms |
860 KB |
Output is correct |
38 |
Correct |
31 ms |
1516 KB |
Output is correct |
39 |
Correct |
8 ms |
860 KB |
Output is correct |
40 |
Correct |
10 ms |
860 KB |
Output is correct |
41 |
Correct |
7 ms |
856 KB |
Output is correct |
42 |
Execution timed out |
2032 ms |
1628 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 |
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 |
1 ms |
432 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
428 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
8 ms |
480 KB |
Output is correct |
13 |
Correct |
8 ms |
408 KB |
Output is correct |
14 |
Correct |
6 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 |
344 KB |
Output is correct |
18 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
348 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
10 ms |
856 KB |
Output is correct |
34 |
Correct |
9 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
11 ms |
724 KB |
Output is correct |
37 |
Correct |
3 ms |
860 KB |
Output is correct |
38 |
Correct |
31 ms |
1516 KB |
Output is correct |
39 |
Correct |
8 ms |
860 KB |
Output is correct |
40 |
Correct |
10 ms |
860 KB |
Output is correct |
41 |
Correct |
7 ms |
856 KB |
Output is correct |
42 |
Execution timed out |
2032 ms |
1628 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 |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
8 ms |
860 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
876 KB |
Output is correct |
22 |
Correct |
10 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
704 KB |
Output is correct |
24 |
Correct |
4 ms |
1112 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
11 ms |
856 KB |
Output is correct |
27 |
Correct |
11 ms |
860 KB |
Output is correct |
28 |
Correct |
7 ms |
884 KB |
Output is correct |
29 |
Correct |
18 ms |
1396 KB |
Output is correct |
30 |
Correct |
6 ms |
860 KB |
Output is correct |
31 |
Correct |
22 ms |
1428 KB |
Output is correct |
32 |
Correct |
25 ms |
1416 KB |
Output is correct |
33 |
Correct |
17 ms |
1368 KB |
Output is correct |
34 |
Correct |
9 ms |
2028 KB |
Output is correct |
35 |
Correct |
8 ms |
2028 KB |
Output is correct |
36 |
Correct |
28 ms |
1560 KB |
Output is correct |
37 |
Correct |
26 ms |
1372 KB |
Output is correct |
38 |
Correct |
19 ms |
1432 KB |
Output is correct |
39 |
Correct |
198 ms |
10196 KB |
Output is correct |
40 |
Correct |
26 ms |
1372 KB |
Output is correct |
41 |
Correct |
10 ms |
2284 KB |
Output is correct |
42 |
Correct |
31 ms |
1864 KB |
Output is correct |
43 |
Correct |
19 ms |
2396 KB |
Output is correct |
44 |
Correct |
104 ms |
5332 KB |
Output is correct |
45 |
Correct |
75 ms |
5696 KB |
Output is correct |
46 |
Correct |
206 ms |
10320 KB |
Output is correct |
47 |
Correct |
256 ms |
10064 KB |
Output is correct |
48 |
Correct |
209 ms |
9996 KB |
Output is correct |
49 |
Correct |
80 ms |
15184 KB |
Output is correct |
50 |
Correct |
83 ms |
15184 KB |
Output is correct |
51 |
Correct |
296 ms |
10580 KB |
Output is correct |
52 |
Correct |
278 ms |
10320 KB |
Output is correct |
53 |
Correct |
209 ms |
10320 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 |
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 |
1 ms |
432 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
428 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
8 ms |
480 KB |
Output is correct |
66 |
Correct |
8 ms |
408 KB |
Output is correct |
67 |
Correct |
6 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 |
344 KB |
Output is correct |
71 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
1 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 |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
480 KB |
Output is correct |
95 |
Correct |
7 ms |
348 KB |
Output is correct |
96 |
Correct |
7 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
1 ms |
452 KB |
Output is correct |
100 |
Correct |
0 ms |
348 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
344 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
0 ms |
604 KB |
Output is correct |
109 |
Correct |
8 ms |
348 KB |
Output is correct |
110 |
Correct |
11 ms |
724 KB |
Output is correct |
111 |
Correct |
31 ms |
1540 KB |
Output is correct |
112 |
Correct |
8 ms |
860 KB |
Output is correct |
113 |
Execution timed out |
2072 ms |
1628 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 |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
8 ms |
860 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
876 KB |
Output is correct |
22 |
Correct |
10 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
704 KB |
Output is correct |
24 |
Correct |
4 ms |
1112 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
11 ms |
856 KB |
Output is correct |
27 |
Correct |
11 ms |
860 KB |
Output is correct |
28 |
Correct |
7 ms |
884 KB |
Output is correct |
29 |
Correct |
18 ms |
1396 KB |
Output is correct |
30 |
Correct |
6 ms |
860 KB |
Output is correct |
31 |
Correct |
22 ms |
1428 KB |
Output is correct |
32 |
Correct |
25 ms |
1416 KB |
Output is correct |
33 |
Correct |
17 ms |
1368 KB |
Output is correct |
34 |
Correct |
9 ms |
2028 KB |
Output is correct |
35 |
Correct |
8 ms |
2028 KB |
Output is correct |
36 |
Correct |
28 ms |
1560 KB |
Output is correct |
37 |
Correct |
26 ms |
1372 KB |
Output is correct |
38 |
Correct |
19 ms |
1432 KB |
Output is correct |
39 |
Correct |
198 ms |
10196 KB |
Output is correct |
40 |
Correct |
26 ms |
1372 KB |
Output is correct |
41 |
Correct |
10 ms |
2284 KB |
Output is correct |
42 |
Correct |
31 ms |
1864 KB |
Output is correct |
43 |
Correct |
19 ms |
2396 KB |
Output is correct |
44 |
Correct |
104 ms |
5332 KB |
Output is correct |
45 |
Correct |
75 ms |
5696 KB |
Output is correct |
46 |
Correct |
206 ms |
10320 KB |
Output is correct |
47 |
Correct |
256 ms |
10064 KB |
Output is correct |
48 |
Correct |
209 ms |
9996 KB |
Output is correct |
49 |
Correct |
80 ms |
15184 KB |
Output is correct |
50 |
Correct |
83 ms |
15184 KB |
Output is correct |
51 |
Correct |
296 ms |
10580 KB |
Output is correct |
52 |
Correct |
278 ms |
10320 KB |
Output is correct |
53 |
Correct |
209 ms |
10320 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 |
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 |
1 ms |
432 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
428 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
8 ms |
480 KB |
Output is correct |
66 |
Correct |
8 ms |
408 KB |
Output is correct |
67 |
Correct |
6 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 |
344 KB |
Output is correct |
71 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
1 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 |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
480 KB |
Output is correct |
95 |
Correct |
7 ms |
348 KB |
Output is correct |
96 |
Correct |
7 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
1 ms |
452 KB |
Output is correct |
100 |
Correct |
0 ms |
348 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
344 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
0 ms |
604 KB |
Output is correct |
109 |
Correct |
8 ms |
348 KB |
Output is correct |
110 |
Correct |
11 ms |
724 KB |
Output is correct |
111 |
Correct |
31 ms |
1540 KB |
Output is correct |
112 |
Correct |
8 ms |
860 KB |
Output is correct |
113 |
Execution timed out |
2072 ms |
1628 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 |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
436 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
600 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 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 |
8 ms |
860 KB |
Output is correct |
20 |
Correct |
3 ms |
860 KB |
Output is correct |
21 |
Correct |
8 ms |
876 KB |
Output is correct |
22 |
Correct |
10 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
704 KB |
Output is correct |
24 |
Correct |
4 ms |
1112 KB |
Output is correct |
25 |
Correct |
3 ms |
860 KB |
Output is correct |
26 |
Correct |
11 ms |
856 KB |
Output is correct |
27 |
Correct |
11 ms |
860 KB |
Output is correct |
28 |
Correct |
7 ms |
884 KB |
Output is correct |
29 |
Correct |
18 ms |
1396 KB |
Output is correct |
30 |
Correct |
6 ms |
860 KB |
Output is correct |
31 |
Correct |
22 ms |
1428 KB |
Output is correct |
32 |
Correct |
25 ms |
1416 KB |
Output is correct |
33 |
Correct |
17 ms |
1368 KB |
Output is correct |
34 |
Correct |
9 ms |
2028 KB |
Output is correct |
35 |
Correct |
8 ms |
2028 KB |
Output is correct |
36 |
Correct |
28 ms |
1560 KB |
Output is correct |
37 |
Correct |
26 ms |
1372 KB |
Output is correct |
38 |
Correct |
19 ms |
1432 KB |
Output is correct |
39 |
Correct |
198 ms |
10196 KB |
Output is correct |
40 |
Correct |
26 ms |
1372 KB |
Output is correct |
41 |
Correct |
10 ms |
2284 KB |
Output is correct |
42 |
Correct |
31 ms |
1864 KB |
Output is correct |
43 |
Correct |
19 ms |
2396 KB |
Output is correct |
44 |
Correct |
104 ms |
5332 KB |
Output is correct |
45 |
Correct |
75 ms |
5696 KB |
Output is correct |
46 |
Correct |
206 ms |
10320 KB |
Output is correct |
47 |
Correct |
256 ms |
10064 KB |
Output is correct |
48 |
Correct |
209 ms |
9996 KB |
Output is correct |
49 |
Correct |
80 ms |
15184 KB |
Output is correct |
50 |
Correct |
83 ms |
15184 KB |
Output is correct |
51 |
Correct |
296 ms |
10580 KB |
Output is correct |
52 |
Correct |
278 ms |
10320 KB |
Output is correct |
53 |
Correct |
209 ms |
10320 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 |
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 |
1 ms |
432 KB |
Output is correct |
60 |
Correct |
0 ms |
348 KB |
Output is correct |
61 |
Correct |
0 ms |
348 KB |
Output is correct |
62 |
Correct |
1 ms |
428 KB |
Output is correct |
63 |
Correct |
0 ms |
348 KB |
Output is correct |
64 |
Correct |
1 ms |
348 KB |
Output is correct |
65 |
Correct |
8 ms |
480 KB |
Output is correct |
66 |
Correct |
8 ms |
408 KB |
Output is correct |
67 |
Correct |
6 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 |
344 KB |
Output is correct |
71 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
348 KB |
Output is correct |
78 |
Correct |
0 ms |
348 KB |
Output is correct |
79 |
Correct |
0 ms |
348 KB |
Output is correct |
80 |
Correct |
0 ms |
344 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 |
0 ms |
348 KB |
Output is correct |
86 |
Correct |
0 ms |
348 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
348 KB |
Output is correct |
89 |
Correct |
1 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 |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
7 ms |
480 KB |
Output is correct |
95 |
Correct |
7 ms |
348 KB |
Output is correct |
96 |
Correct |
7 ms |
348 KB |
Output is correct |
97 |
Correct |
0 ms |
348 KB |
Output is correct |
98 |
Correct |
0 ms |
348 KB |
Output is correct |
99 |
Correct |
1 ms |
452 KB |
Output is correct |
100 |
Correct |
0 ms |
348 KB |
Output is correct |
101 |
Correct |
0 ms |
348 KB |
Output is correct |
102 |
Correct |
0 ms |
348 KB |
Output is correct |
103 |
Correct |
0 ms |
344 KB |
Output is correct |
104 |
Correct |
0 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
344 KB |
Output is correct |
106 |
Correct |
1 ms |
348 KB |
Output is correct |
107 |
Correct |
0 ms |
348 KB |
Output is correct |
108 |
Correct |
0 ms |
604 KB |
Output is correct |
109 |
Correct |
8 ms |
348 KB |
Output is correct |
110 |
Correct |
11 ms |
724 KB |
Output is correct |
111 |
Correct |
31 ms |
1540 KB |
Output is correct |
112 |
Correct |
8 ms |
860 KB |
Output is correct |
113 |
Execution timed out |
2072 ms |
1628 KB |
Time limit exceeded |
114 |
Halted |
0 ms |
0 KB |
- |