#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(x) (int)x.size()
#define ALL(v) v.begin(),v.end()
#define MASK(k) (1LL << (k))
#define BIT(x, i) (((x) >> (i)) & 1)
#define oo (ll)1e18
#define INF (ll)1e9
#define MOD (ll)(998244353)
using namespace std;
template<class T1, class T2>
bool maximize(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2>
bool minimize(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2>
void add(T1 &a, T2 b){a += b; if(a >= MOD) a -= MOD;}
template<class T1, class T2>
void sub(T1 &a, T2 b){a -= b; if(a < 0) a += MOD;}
template<class T>
void cps(T &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}
const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
int N, M, L;
int sx, sy, tx, ty;
vector<vector<char>> a;
vector<vector<int>> d;
void solve(){
cin >> N >> M >> L;
cin >> sx >> sy >> tx >> ty;
a.resize(N + 3, vector<char>(M + 3, 0));
d.resize(N + 3, vector<int>(M + 3, INF));
for(int i=1; i<=N; i++){
for(int j=1; j<=M; j++){
cin >> a[i][j];
}
}
queue<pair<int, int>> q;
q.push({sx, sy});
d[sx][sy] = 0;
while(true){
vector<pair<int, int>> pos;
while(sz(q)){
int x = q.front().fi;
int y = q.front().se;
q.pop();
pos.push_back({x, y});
for(int k=0; k<4; k++){
int nx = x + dx[k], ny = y + dy[k];
if(nx < 1 || nx > N || ny < 1 || ny > M || a[nx][ny] == '#') continue;
if(minimize(d[nx][ny], d[x][y])){
q.push({nx, ny});
}
}
}
for(auto o: pos){
queue<pair<int, int>> qq;
qq.push({o.fi, o.se});
while(sz(qq)){
int x = qq.front().fi;
int y = qq.front().se;
qq.pop();
for(int k=0; k<4; k++){
int nx = x + dx[k], ny = y + dy[k];
if(nx < 1 || nx > N || ny < 1 || ny > M) continue;
int t1 = abs(nx - o.fi), t2 = abs(ny - o.se);
if(t1 > L || t2 > L || t1 + t2 == 2 * L) continue;
if(d[o.fi - 1][o.se] == d[o.fi][o.se] && nx < o.fi) continue;
if(d[o.fi + 1][o.se] == d[o.fi][o.se] && nx > o.fi) continue;
if(d[o.fi][o.se - 1] == d[o.fi][o.se] && ny < o.se) continue;
if(d[o.fi][o.se + 1] == d[o.fi][o.se] && ny > o.se) continue;
if(minimize(d[nx][ny], d[o.fi][o.se] + 1)){
qq.push({nx, ny});
q.push({nx, ny});
}
}
}
}
if(d[tx][ty] < INF) break;
}
// for(int i=1; i<=N; i++){
// for(int j=1; j<=M; j++){
// cout << d[i][j] << ' ';
// }
// cout << '\n';
// }
cout << d[tx][ty] << '\n';
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
// freopen("flowers.inp", "r", stdin);
// freopen("flowers.out", "w", stdout);
int nTest = 1;
while(nTest--)
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
372 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
456 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 |
604 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 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 |
416 KB |
Output is correct |
19 |
Correct |
6 ms |
604 KB |
Output is correct |
20 |
Correct |
5 ms |
1444 KB |
Output is correct |
21 |
Correct |
6 ms |
1240 KB |
Output is correct |
22 |
Correct |
8 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
856 KB |
Output is correct |
24 |
Correct |
5 ms |
1884 KB |
Output is correct |
25 |
Correct |
6 ms |
1760 KB |
Output is correct |
26 |
Correct |
2 ms |
832 KB |
Output is correct |
27 |
Correct |
1 ms |
860 KB |
Output is correct |
28 |
Correct |
4 ms |
860 KB |
Output is correct |
29 |
Correct |
17 ms |
1400 KB |
Output is correct |
30 |
Correct |
6 ms |
1372 KB |
Output is correct |
31 |
Correct |
15 ms |
3544 KB |
Output is correct |
32 |
Correct |
19 ms |
1400 KB |
Output is correct |
33 |
Correct |
15 ms |
1368 KB |
Output is correct |
34 |
Correct |
12 ms |
3784 KB |
Output is correct |
35 |
Correct |
15 ms |
3784 KB |
Output is correct |
36 |
Correct |
12 ms |
1632 KB |
Output is correct |
37 |
Correct |
16 ms |
1544 KB |
Output is correct |
38 |
Correct |
3 ms |
1372 KB |
Output is correct |
39 |
Correct |
178 ms |
9552 KB |
Output is correct |
40 |
Correct |
8 ms |
1664 KB |
Output is correct |
41 |
Correct |
11 ms |
4772 KB |
Output is correct |
42 |
Correct |
34 ms |
1776 KB |
Output is correct |
43 |
Correct |
21 ms |
3932 KB |
Output is correct |
44 |
Correct |
35 ms |
6772 KB |
Output is correct |
45 |
Correct |
42 ms |
7496 KB |
Output is correct |
46 |
Correct |
146 ms |
25812 KB |
Output is correct |
47 |
Correct |
191 ms |
9516 KB |
Output is correct |
48 |
Correct |
128 ms |
9304 KB |
Output is correct |
49 |
Correct |
96 ms |
35488 KB |
Output is correct |
50 |
Correct |
115 ms |
35484 KB |
Output is correct |
51 |
Correct |
151 ms |
10576 KB |
Output is correct |
52 |
Correct |
109 ms |
9888 KB |
Output is correct |
53 |
Correct |
180 ms |
9320 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 |
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 |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
460 KB |
Output is correct |
10 |
Correct |
1 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 |
1 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 |
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 |
0 ms |
460 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 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 |
1 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 |
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 |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
392 KB |
Output is correct |
25 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
26 |
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 |
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 |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
460 KB |
Output is correct |
10 |
Correct |
1 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 |
1 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 |
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 |
0 ms |
460 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
7 ms |
600 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
37 |
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 |
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 |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
460 KB |
Output is correct |
10 |
Correct |
1 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 |
1 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 |
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 |
0 ms |
460 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
23 |
Correct |
0 ms |
348 KB |
Output is correct |
24 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
32 |
Correct |
1 ms |
344 KB |
Output is correct |
33 |
Correct |
7 ms |
600 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
37 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
372 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
456 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 |
604 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 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 |
416 KB |
Output is correct |
19 |
Correct |
6 ms |
604 KB |
Output is correct |
20 |
Correct |
5 ms |
1444 KB |
Output is correct |
21 |
Correct |
6 ms |
1240 KB |
Output is correct |
22 |
Correct |
8 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
856 KB |
Output is correct |
24 |
Correct |
5 ms |
1884 KB |
Output is correct |
25 |
Correct |
6 ms |
1760 KB |
Output is correct |
26 |
Correct |
2 ms |
832 KB |
Output is correct |
27 |
Correct |
1 ms |
860 KB |
Output is correct |
28 |
Correct |
4 ms |
860 KB |
Output is correct |
29 |
Correct |
17 ms |
1400 KB |
Output is correct |
30 |
Correct |
6 ms |
1372 KB |
Output is correct |
31 |
Correct |
15 ms |
3544 KB |
Output is correct |
32 |
Correct |
19 ms |
1400 KB |
Output is correct |
33 |
Correct |
15 ms |
1368 KB |
Output is correct |
34 |
Correct |
12 ms |
3784 KB |
Output is correct |
35 |
Correct |
15 ms |
3784 KB |
Output is correct |
36 |
Correct |
12 ms |
1632 KB |
Output is correct |
37 |
Correct |
16 ms |
1544 KB |
Output is correct |
38 |
Correct |
3 ms |
1372 KB |
Output is correct |
39 |
Correct |
178 ms |
9552 KB |
Output is correct |
40 |
Correct |
8 ms |
1664 KB |
Output is correct |
41 |
Correct |
11 ms |
4772 KB |
Output is correct |
42 |
Correct |
34 ms |
1776 KB |
Output is correct |
43 |
Correct |
21 ms |
3932 KB |
Output is correct |
44 |
Correct |
35 ms |
6772 KB |
Output is correct |
45 |
Correct |
42 ms |
7496 KB |
Output is correct |
46 |
Correct |
146 ms |
25812 KB |
Output is correct |
47 |
Correct |
191 ms |
9516 KB |
Output is correct |
48 |
Correct |
128 ms |
9304 KB |
Output is correct |
49 |
Correct |
96 ms |
35488 KB |
Output is correct |
50 |
Correct |
115 ms |
35484 KB |
Output is correct |
51 |
Correct |
151 ms |
10576 KB |
Output is correct |
52 |
Correct |
109 ms |
9888 KB |
Output is correct |
53 |
Correct |
180 ms |
9320 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 |
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 |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
460 KB |
Output is correct |
73 |
Correct |
0 ms |
348 KB |
Output is correct |
74 |
Correct |
0 ms |
344 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
85 |
Correct |
1 ms |
344 KB |
Output is correct |
86 |
Correct |
1 ms |
344 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
348 KB |
Output is correct |
90 |
Correct |
1 ms |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
1 ms |
348 KB |
Output is correct |
96 |
Correct |
0 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 |
348 KB |
Output is correct |
100 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
1 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
1 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
392 KB |
Output is correct |
110 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
111 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
372 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
456 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 |
604 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 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 |
416 KB |
Output is correct |
19 |
Correct |
6 ms |
604 KB |
Output is correct |
20 |
Correct |
5 ms |
1444 KB |
Output is correct |
21 |
Correct |
6 ms |
1240 KB |
Output is correct |
22 |
Correct |
8 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
856 KB |
Output is correct |
24 |
Correct |
5 ms |
1884 KB |
Output is correct |
25 |
Correct |
6 ms |
1760 KB |
Output is correct |
26 |
Correct |
2 ms |
832 KB |
Output is correct |
27 |
Correct |
1 ms |
860 KB |
Output is correct |
28 |
Correct |
4 ms |
860 KB |
Output is correct |
29 |
Correct |
17 ms |
1400 KB |
Output is correct |
30 |
Correct |
6 ms |
1372 KB |
Output is correct |
31 |
Correct |
15 ms |
3544 KB |
Output is correct |
32 |
Correct |
19 ms |
1400 KB |
Output is correct |
33 |
Correct |
15 ms |
1368 KB |
Output is correct |
34 |
Correct |
12 ms |
3784 KB |
Output is correct |
35 |
Correct |
15 ms |
3784 KB |
Output is correct |
36 |
Correct |
12 ms |
1632 KB |
Output is correct |
37 |
Correct |
16 ms |
1544 KB |
Output is correct |
38 |
Correct |
3 ms |
1372 KB |
Output is correct |
39 |
Correct |
178 ms |
9552 KB |
Output is correct |
40 |
Correct |
8 ms |
1664 KB |
Output is correct |
41 |
Correct |
11 ms |
4772 KB |
Output is correct |
42 |
Correct |
34 ms |
1776 KB |
Output is correct |
43 |
Correct |
21 ms |
3932 KB |
Output is correct |
44 |
Correct |
35 ms |
6772 KB |
Output is correct |
45 |
Correct |
42 ms |
7496 KB |
Output is correct |
46 |
Correct |
146 ms |
25812 KB |
Output is correct |
47 |
Correct |
191 ms |
9516 KB |
Output is correct |
48 |
Correct |
128 ms |
9304 KB |
Output is correct |
49 |
Correct |
96 ms |
35488 KB |
Output is correct |
50 |
Correct |
115 ms |
35484 KB |
Output is correct |
51 |
Correct |
151 ms |
10576 KB |
Output is correct |
52 |
Correct |
109 ms |
9888 KB |
Output is correct |
53 |
Correct |
180 ms |
9320 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 |
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 |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
460 KB |
Output is correct |
73 |
Correct |
0 ms |
348 KB |
Output is correct |
74 |
Correct |
0 ms |
344 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
85 |
Correct |
1 ms |
344 KB |
Output is correct |
86 |
Correct |
1 ms |
344 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
348 KB |
Output is correct |
90 |
Correct |
1 ms |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
1 ms |
348 KB |
Output is correct |
96 |
Correct |
0 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 |
348 KB |
Output is correct |
100 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
1 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
1 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
392 KB |
Output is correct |
110 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
111 |
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 |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
372 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
456 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 |
604 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 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 |
416 KB |
Output is correct |
19 |
Correct |
6 ms |
604 KB |
Output is correct |
20 |
Correct |
5 ms |
1444 KB |
Output is correct |
21 |
Correct |
6 ms |
1240 KB |
Output is correct |
22 |
Correct |
8 ms |
860 KB |
Output is correct |
23 |
Correct |
7 ms |
856 KB |
Output is correct |
24 |
Correct |
5 ms |
1884 KB |
Output is correct |
25 |
Correct |
6 ms |
1760 KB |
Output is correct |
26 |
Correct |
2 ms |
832 KB |
Output is correct |
27 |
Correct |
1 ms |
860 KB |
Output is correct |
28 |
Correct |
4 ms |
860 KB |
Output is correct |
29 |
Correct |
17 ms |
1400 KB |
Output is correct |
30 |
Correct |
6 ms |
1372 KB |
Output is correct |
31 |
Correct |
15 ms |
3544 KB |
Output is correct |
32 |
Correct |
19 ms |
1400 KB |
Output is correct |
33 |
Correct |
15 ms |
1368 KB |
Output is correct |
34 |
Correct |
12 ms |
3784 KB |
Output is correct |
35 |
Correct |
15 ms |
3784 KB |
Output is correct |
36 |
Correct |
12 ms |
1632 KB |
Output is correct |
37 |
Correct |
16 ms |
1544 KB |
Output is correct |
38 |
Correct |
3 ms |
1372 KB |
Output is correct |
39 |
Correct |
178 ms |
9552 KB |
Output is correct |
40 |
Correct |
8 ms |
1664 KB |
Output is correct |
41 |
Correct |
11 ms |
4772 KB |
Output is correct |
42 |
Correct |
34 ms |
1776 KB |
Output is correct |
43 |
Correct |
21 ms |
3932 KB |
Output is correct |
44 |
Correct |
35 ms |
6772 KB |
Output is correct |
45 |
Correct |
42 ms |
7496 KB |
Output is correct |
46 |
Correct |
146 ms |
25812 KB |
Output is correct |
47 |
Correct |
191 ms |
9516 KB |
Output is correct |
48 |
Correct |
128 ms |
9304 KB |
Output is correct |
49 |
Correct |
96 ms |
35488 KB |
Output is correct |
50 |
Correct |
115 ms |
35484 KB |
Output is correct |
51 |
Correct |
151 ms |
10576 KB |
Output is correct |
52 |
Correct |
109 ms |
9888 KB |
Output is correct |
53 |
Correct |
180 ms |
9320 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 |
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 |
348 KB |
Output is correct |
62 |
Correct |
0 ms |
460 KB |
Output is correct |
63 |
Correct |
1 ms |
348 KB |
Output is correct |
64 |
Correct |
0 ms |
348 KB |
Output is correct |
65 |
Correct |
0 ms |
348 KB |
Output is correct |
66 |
Correct |
1 ms |
348 KB |
Output is correct |
67 |
Correct |
0 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 |
1 ms |
348 KB |
Output is correct |
72 |
Correct |
0 ms |
460 KB |
Output is correct |
73 |
Correct |
0 ms |
348 KB |
Output is correct |
74 |
Correct |
0 ms |
344 KB |
Output is correct |
75 |
Correct |
0 ms |
348 KB |
Output is correct |
76 |
Correct |
0 ms |
348 KB |
Output is correct |
77 |
Correct |
0 ms |
460 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 |
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 |
0 ms |
456 KB |
Output is correct |
85 |
Correct |
1 ms |
344 KB |
Output is correct |
86 |
Correct |
1 ms |
344 KB |
Output is correct |
87 |
Correct |
1 ms |
348 KB |
Output is correct |
88 |
Correct |
0 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
348 KB |
Output is correct |
90 |
Correct |
1 ms |
348 KB |
Output is correct |
91 |
Correct |
0 ms |
348 KB |
Output is correct |
92 |
Correct |
1 ms |
348 KB |
Output is correct |
93 |
Correct |
1 ms |
348 KB |
Output is correct |
94 |
Correct |
0 ms |
348 KB |
Output is correct |
95 |
Correct |
1 ms |
348 KB |
Output is correct |
96 |
Correct |
0 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 |
348 KB |
Output is correct |
100 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
104 |
Correct |
1 ms |
348 KB |
Output is correct |
105 |
Correct |
0 ms |
348 KB |
Output is correct |
106 |
Correct |
0 ms |
348 KB |
Output is correct |
107 |
Correct |
1 ms |
348 KB |
Output is correct |
108 |
Correct |
1 ms |
348 KB |
Output is correct |
109 |
Correct |
0 ms |
392 KB |
Output is correct |
110 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
111 |
Halted |
0 ms |
0 KB |
- |