#include "bits/stdc++.h"
using namespace std;
//#define int long long
const int MAXN = 1e7 + 10;
const int MOD = 1e9 + 7;
mt19937_64 rng((int)std::chrono::steady_clock::now().time_since_epoch().count());
int rnd(int x, int y) {
int u = uniform_int_distribution<int>(x, y)(rng); return u;
}
int bm(int b, int p) {
if(p==0) return 1 % MOD;
int r = bm(b, p >> 1);
if(p&1) return (((r*r) % MOD) * b) % MOD;
return (r*r) % MOD;
}
int inv(int b) {
return bm(b, MOD-2);
}
int fastlog(int x) {
return (x == 0 ? -1 : 64 - __builtin_clzll(x) - 1);
}
void printcase(int i) { cout << "Case #" << i << ": "; }
int r,c,n,sr,sc,gr,gc;
vector<vector<char>>a;
vector<int>adj[MAXN];
int dist[MAXN];
bool vis[MAXN];
int nxt;
int f(int i, int j) {
return i*c+j;
}
void solve(int tc) {
for(int i=0; i<MAXN; i++) dist[i] = 1e9;
cin>>r>>c>>n;
cin>>sr>>sc;
cin>>gr>>gc;
sr--,sc--,gr--,gc--;
a.resize(r);
for(int i=0;i<r;i++){
a[i].resize(c);
for(int j=0;j<c;j++){
cin>>a[i][j];
}
}
for(int i=0;i<r;i++){
for(int j=0;j+1<c;j++){
if(a[i][j]=='.'&&a[i][j+1]=='.'){
adj[f(i,j)].push_back(f(i,j+1));
adj[f(i,j+1)].push_back(f(i,j));
}
}
}
for(int i=0;i+1<r;i++){
for(int j=0;j<c;j++){
if(a[i][j]=='.'&&a[i+1][j]=='.'){
adj[f(i,j)].push_back(f(i+1,j));
adj[f(i+1,j)].push_back(f(i,j));
}
}
}
//pt3
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
if(i%n != n-1 && i+1 < r) {
adj[f(2*r+i, j)].push_back(f(2*r+i+1, j));
adj[f(6*r+i, j)].push_back(f(6*r+i+1, j));
}
if(j%n != n-1 && j+1 < c) {
adj[f(2*r+i, j)].push_back(f(2*r+i, j+1));
adj[f(6*r+i, j)].push_back(f(6*r+i, j+1));
}
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
if(i%n != n-1 && i+1 < r) {
adj[f(3*r+i, j)].push_back(f(3*r+i+1, j));
adj[f(7*r+i, j)].push_back(f(7*r+i+1, j));
}
if(j%n != 0 && j-1 >= 0) {
adj[f(3*r+i, j)].push_back(f(3*r+i, j-1));
adj[f(7*r+i, j)].push_back(f(7*r+i, j-1));
}
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
if(i%n != 0 && i-1 >= 0) {
adj[f(4*r+i, j)].push_back(f(4*r+i-1, j));
adj[f(8*r+i, j)].push_back(f(8*r+i-1, j));
}
if(j%n != 0 && j-1 >= 0) {
adj[f(4*r+i, j)].push_back(f(4*r+i, j-1));
adj[f(8*r+i, j)].push_back(f(8*r+i, j-1));
}
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
if(i%n != 0 && i-1 >= 0) {
adj[f(5*r+i, j)].push_back(f(5*r+i-1, j));
adj[f(9*r+i, j)].push_back(f(9*r+i-1, j));
}
if(j%n != n-1 && j+1 < c) {
adj[f(5*r+i, j)].push_back(f(5*r+i, j+1));
adj[f(9*r+i, j)].push_back(f(9*r+i, j+1));
}
}
}
for(int i=2;i<6;i++){
for(int j=0;j<r*c;j++){
adj[j].push_back(i*r*c+j);
}
}
for(int i=6;i<10;i++){
for(int j=0;j<r*c;j++){
adj[i*r*c+j].push_back(j);
}
}
for(int i=0;i+n-1<r;i++){
for(int j=0;j+n-1<c;j++){
adj[f(r+i,j)].push_back(f(6*r+i,j));
adj[f(4*r+i,j)].push_back(f(r+i,j));
if(j%n!=0) {
adj[f(r+i,j)].push_back(f(7*r+i,j+n-1));
adj[f(5*r+i,j+n-1)].push_back(f(r+i,j));
}
if(i%n!=0) {
adj[f(r+i,j)].push_back(f(9*r+i+n-1,j));
adj[f(3*r+i+n-1,j)].push_back(f(r+i,j));
}
if(i%n!=0 && j%n!=0) {
adj[f(r+i,j)].push_back(f(8*r+i+n-1,j+n-1));
adj[f(2*r+i+n-1,j+n-1)].push_back(f(r+i,j));
}
}
}
//pt2
for(int i=0;i+n-1<r;i++){
for(int j=0;j+n-1<c;j++){
for(int k=-n+1;k<n;k+=n-1){
if(i+k>=0 && i+k<r && j>=n) adj[f(r+i,j)].push_back(f(r+i+k,j-n));
if(i+k>=0 && i+k<r && j+n<c) adj[f(r+i,j)].push_back(f(r+i+k,j+n));
if(j+k>=0 && i>=n && j+k<c) adj[f(r+i,j)].push_back(f(r+i-n,j+k));
if(j+k>=0 && i+n<r && j+k<c) adj[f(r+i,j)].push_back(f(r+i+n,j+k));
if(k==n-1)break;
}
}
}
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
if(j%n!=n-1 && j+1<c) {
adj[f(10*r+i,j)].push_back(f(10*r+i,j+1));
adj[f(11*r+i,j+1)].push_back(f(11*r+i,j));
adj[f(14*r+i,j)].push_back(f(14*r+i,j+1));
adj[f(15*r+i,j+1)].push_back(f(15*r+i,j));
}
if(i%n!=n-1 && i+1<r){
adj[f(12*r+i,j)].push_back(f(12*r+i+1,j));
adj[f(13*r+i+1,j)].push_back(f(13*r+i,j));
adj[f(16*r+i,j)].push_back(f(16*r+i+1,j));
adj[f(17*r+i+1,j)].push_back(f(17*r+i,j));
}
if(a[i][j]=='.') {
adj[f(14*r+i,j)].push_back(f(i,j));
adj[f(15*r+i,j)].push_back(f(i,j));
adj[f(16*r+i,j)].push_back(f(i,j));
adj[f(17*r+i,j)].push_back(f(i,j));
adj[f(i,j)].push_back(f(10*r+i,j));
adj[f(i,j)].push_back(f(11*r+i,j));
adj[f(i,j)].push_back(f(12*r+i,j));
adj[f(i,j)].push_back(f(13*r+i,j));
}
}
}
for(int i=0;i+n-1<r;i++){
for(int j=0;j+n-1<c;j++){
if(j>0) {
adj[f(r+i,j)].push_back(f(16*r+i,j-1));
adj[f(r+i,j)].push_back(f(17*r+i+n-1,j-1));
adj[f(12*r+i+n-1,j-1)].push_back(f(r+i,j));
adj[f(13*r+i,j-1)].push_back(f(r+i,j));
}
if(j+n<c) {
adj[f(r+i,j)].push_back(f(16*r+i,j+n));
adj[f(r+i,j)].push_back(f(17*r+i+n-1,j+n));
adj[f(12*r+i+n-1,j+n)].push_back(f(r+i,j));
adj[f(13*r+i,j+n)].push_back(f(r+i,j));
}
if(i>0) {
adj[f(r+i,j)].push_back(f(14*r+i-1,j));
adj[f(r+i,j)].push_back(f(15*r+i-1,j+n-1));
adj[f(10*r+i-1,j+n-1)].push_back(f(r+i,j));
adj[f(11*r+i-1,j)].push_back(f(r+i,j));
}
if(i+n<r) {
adj[f(r+i,j)].push_back(f(14*r+i+n,j));
adj[f(r+i,j)].push_back(f(15*r+i+n,j+n-1));
adj[f(10*r+i+n,j+n-1)].push_back(f(r+i,j));
adj[f(11*r+i+n,j)].push_back(f(r+i,j));
}
}
}
queue<int> q[2];
q[0].push(f(sr, sc));
int tar = f(gr, gc);
dist[f(sr, sc)]=0;
//unordered_map<int, int> prv;
while(q[0].size() || q[1].size()) {
for(int i=0; i<2; i++) {
if(q[i].size()) {
int f = q[i].front(); q[i].pop();
if(f == tar) {
/*
int bruh = f;
stack<int>stk;
while(bruh != sr*c+sc) {
stk.push(bruh);
bruh=prv[bruh];
}
stk.push(sr*c+sc);
while(stk.size()){
int x=stk.top();
cout<<x/(r*c)<<' '<<(x%(r*c))/c<<' '<<(x%(r*c))%c<<'\n';
stk.pop();
}
cout<<'\n';
*/
cout << dist[f] << '\n'; return;
}
if(!vis[f]) {
vis[f] = 1;
for(int x: adj[f]) {
if(!vis[x] && dist[x] > dist[f] + (x >= r*c && x < 2*r*c)) {
dist[x] = dist[f] + (x >= r*c && x < 2*r*c);
// prv[x] = f;
if(x >= r*c && x < 2*r*c) q[1].push(x);
else q[0].push(x);
}
}
}
break;
}
}
}
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
int t = 1; //cin >> t;
for(int i=1; i<=t; i++) solve(i);
}
// 勿忘初衷
/*
8 9 5
3 1
2 9
.#..###.#
##..#.##.
.###..#.#
#.....##.
..###....
#......##
.##.#.###
#.##.###.
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
127 ms |
274252 KB |
Output is correct |
2 |
Correct |
116 ms |
274200 KB |
Output is correct |
3 |
Correct |
117 ms |
274716 KB |
Output is correct |
4 |
Correct |
121 ms |
274992 KB |
Output is correct |
5 |
Correct |
119 ms |
274756 KB |
Output is correct |
6 |
Correct |
117 ms |
274652 KB |
Output is correct |
7 |
Correct |
118 ms |
274744 KB |
Output is correct |
8 |
Correct |
117 ms |
274536 KB |
Output is correct |
9 |
Correct |
118 ms |
274292 KB |
Output is correct |
10 |
Correct |
130 ms |
274300 KB |
Output is correct |
11 |
Correct |
115 ms |
274252 KB |
Output is correct |
12 |
Correct |
115 ms |
274280 KB |
Output is correct |
13 |
Correct |
122 ms |
274404 KB |
Output is correct |
14 |
Correct |
117 ms |
274324 KB |
Output is correct |
15 |
Correct |
118 ms |
274220 KB |
Output is correct |
16 |
Correct |
118 ms |
274764 KB |
Output is correct |
17 |
Correct |
122 ms |
274756 KB |
Output is correct |
18 |
Correct |
120 ms |
274928 KB |
Output is correct |
19 |
Correct |
197 ms |
299152 KB |
Output is correct |
20 |
Correct |
149 ms |
288728 KB |
Output is correct |
21 |
Correct |
234 ms |
308716 KB |
Output is correct |
22 |
Correct |
209 ms |
302668 KB |
Output is correct |
23 |
Correct |
226 ms |
298788 KB |
Output is correct |
24 |
Correct |
184 ms |
303196 KB |
Output is correct |
25 |
Correct |
157 ms |
292936 KB |
Output is correct |
26 |
Correct |
207 ms |
303536 KB |
Output is correct |
27 |
Correct |
182 ms |
302556 KB |
Output is correct |
28 |
Correct |
188 ms |
298896 KB |
Output is correct |
29 |
Correct |
413 ms |
336944 KB |
Output is correct |
30 |
Correct |
203 ms |
303140 KB |
Output is correct |
31 |
Correct |
488 ms |
360708 KB |
Output is correct |
32 |
Correct |
460 ms |
345592 KB |
Output is correct |
33 |
Correct |
361 ms |
335520 KB |
Output is correct |
34 |
Correct |
323 ms |
346660 KB |
Output is correct |
35 |
Correct |
237 ms |
321084 KB |
Output is correct |
36 |
Correct |
478 ms |
348400 KB |
Output is correct |
37 |
Correct |
423 ms |
345776 KB |
Output is correct |
38 |
Correct |
302 ms |
335880 KB |
Output is correct |
39 |
Runtime error |
684 ms |
722156 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
132 ms |
274288 KB |
Output is correct |
2 |
Correct |
120 ms |
274184 KB |
Output is correct |
3 |
Correct |
120 ms |
274300 KB |
Output is correct |
4 |
Correct |
121 ms |
274180 KB |
Output is correct |
5 |
Correct |
121 ms |
274716 KB |
Output is correct |
6 |
Correct |
123 ms |
274304 KB |
Output is correct |
7 |
Correct |
123 ms |
274252 KB |
Output is correct |
8 |
Correct |
122 ms |
274300 KB |
Output is correct |
9 |
Correct |
122 ms |
274792 KB |
Output is correct |
10 |
Correct |
131 ms |
274784 KB |
Output is correct |
11 |
Correct |
121 ms |
274708 KB |
Output is correct |
12 |
Correct |
121 ms |
274888 KB |
Output is correct |
13 |
Correct |
141 ms |
274764 KB |
Output is correct |
14 |
Correct |
123 ms |
274828 KB |
Output is correct |
15 |
Correct |
128 ms |
274904 KB |
Output is correct |
16 |
Correct |
121 ms |
274508 KB |
Output is correct |
17 |
Correct |
123 ms |
274796 KB |
Output is correct |
18 |
Correct |
124 ms |
274232 KB |
Output is correct |
19 |
Correct |
131 ms |
274892 KB |
Output is correct |
20 |
Correct |
131 ms |
274432 KB |
Output is correct |
21 |
Correct |
121 ms |
274276 KB |
Output is correct |
22 |
Correct |
122 ms |
274600 KB |
Output is correct |
23 |
Correct |
123 ms |
274352 KB |
Output is correct |
24 |
Correct |
126 ms |
274276 KB |
Output is correct |
25 |
Correct |
140 ms |
274252 KB |
Output is correct |
26 |
Correct |
129 ms |
274308 KB |
Output is correct |
27 |
Correct |
134 ms |
274340 KB |
Output is correct |
28 |
Correct |
138 ms |
274736 KB |
Output is correct |
29 |
Correct |
122 ms |
274292 KB |
Output is correct |
30 |
Correct |
123 ms |
274788 KB |
Output is correct |
31 |
Correct |
123 ms |
274728 KB |
Output is correct |
32 |
Correct |
127 ms |
274660 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
274196 KB |
Output is correct |
2 |
Correct |
123 ms |
274248 KB |
Output is correct |
3 |
Correct |
140 ms |
274196 KB |
Output is correct |
4 |
Correct |
123 ms |
274292 KB |
Output is correct |
5 |
Correct |
127 ms |
274252 KB |
Output is correct |
6 |
Correct |
131 ms |
274228 KB |
Output is correct |
7 |
Correct |
127 ms |
274776 KB |
Output is correct |
8 |
Correct |
131 ms |
274740 KB |
Output is correct |
9 |
Correct |
132 ms |
274900 KB |
Output is correct |
10 |
Correct |
127 ms |
274840 KB |
Output is correct |
11 |
Correct |
133 ms |
274792 KB |
Output is correct |
12 |
Correct |
125 ms |
274728 KB |
Output is correct |
13 |
Correct |
125 ms |
274252 KB |
Output is correct |
14 |
Correct |
123 ms |
274780 KB |
Output is correct |
15 |
Correct |
122 ms |
274180 KB |
Output is correct |
16 |
Correct |
122 ms |
274664 KB |
Output is correct |
17 |
Correct |
121 ms |
274416 KB |
Output is correct |
18 |
Correct |
127 ms |
274192 KB |
Output is correct |
19 |
Correct |
121 ms |
274372 KB |
Output is correct |
20 |
Correct |
122 ms |
274244 KB |
Output is correct |
21 |
Correct |
133 ms |
274776 KB |
Output is correct |
22 |
Correct |
124 ms |
274780 KB |
Output is correct |
23 |
Correct |
127 ms |
274760 KB |
Output is correct |
24 |
Correct |
132 ms |
275476 KB |
Output is correct |
25 |
Correct |
204 ms |
299324 KB |
Output is correct |
26 |
Correct |
285 ms |
312060 KB |
Output is correct |
27 |
Correct |
225 ms |
308696 KB |
Output is correct |
28 |
Correct |
263 ms |
309488 KB |
Output is correct |
29 |
Correct |
232 ms |
307736 KB |
Output is correct |
30 |
Correct |
216 ms |
306916 KB |
Output is correct |
31 |
Correct |
242 ms |
308076 KB |
Output is correct |
32 |
Correct |
201 ms |
303656 KB |
Output is correct |
33 |
Correct |
197 ms |
302548 KB |
Output is correct |
34 |
Correct |
570 ms |
354880 KB |
Output is correct |
35 |
Correct |
459 ms |
360628 KB |
Output is correct |
36 |
Correct |
530 ms |
362640 KB |
Output is correct |
37 |
Correct |
535 ms |
358268 KB |
Output is correct |
38 |
Correct |
439 ms |
355732 KB |
Output is correct |
39 |
Correct |
1834 ms |
582264 KB |
Output is correct |
40 |
Runtime error |
902 ms |
879444 KB |
Execution killed with signal 11 |
41 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
132 ms |
274288 KB |
Output is correct |
2 |
Correct |
120 ms |
274184 KB |
Output is correct |
3 |
Correct |
120 ms |
274300 KB |
Output is correct |
4 |
Correct |
121 ms |
274180 KB |
Output is correct |
5 |
Correct |
121 ms |
274716 KB |
Output is correct |
6 |
Correct |
123 ms |
274304 KB |
Output is correct |
7 |
Correct |
123 ms |
274252 KB |
Output is correct |
8 |
Correct |
122 ms |
274300 KB |
Output is correct |
9 |
Correct |
122 ms |
274792 KB |
Output is correct |
10 |
Correct |
131 ms |
274784 KB |
Output is correct |
11 |
Correct |
121 ms |
274708 KB |
Output is correct |
12 |
Correct |
121 ms |
274888 KB |
Output is correct |
13 |
Correct |
141 ms |
274764 KB |
Output is correct |
14 |
Correct |
123 ms |
274828 KB |
Output is correct |
15 |
Correct |
128 ms |
274904 KB |
Output is correct |
16 |
Correct |
121 ms |
274508 KB |
Output is correct |
17 |
Correct |
123 ms |
274796 KB |
Output is correct |
18 |
Correct |
124 ms |
274232 KB |
Output is correct |
19 |
Correct |
131 ms |
274892 KB |
Output is correct |
20 |
Correct |
131 ms |
274432 KB |
Output is correct |
21 |
Correct |
121 ms |
274276 KB |
Output is correct |
22 |
Correct |
122 ms |
274600 KB |
Output is correct |
23 |
Correct |
123 ms |
274352 KB |
Output is correct |
24 |
Correct |
126 ms |
274276 KB |
Output is correct |
25 |
Correct |
140 ms |
274252 KB |
Output is correct |
26 |
Correct |
129 ms |
274308 KB |
Output is correct |
27 |
Correct |
134 ms |
274340 KB |
Output is correct |
28 |
Correct |
138 ms |
274736 KB |
Output is correct |
29 |
Correct |
122 ms |
274292 KB |
Output is correct |
30 |
Correct |
123 ms |
274788 KB |
Output is correct |
31 |
Correct |
123 ms |
274728 KB |
Output is correct |
32 |
Correct |
127 ms |
274660 KB |
Output is correct |
33 |
Correct |
236 ms |
299196 KB |
Output is correct |
34 |
Correct |
143 ms |
275504 KB |
Output is correct |
35 |
Correct |
149 ms |
276432 KB |
Output is correct |
36 |
Correct |
250 ms |
299312 KB |
Output is correct |
37 |
Correct |
166 ms |
288736 KB |
Output is correct |
38 |
Correct |
296 ms |
311996 KB |
Output is correct |
39 |
Correct |
256 ms |
308760 KB |
Output is correct |
40 |
Correct |
268 ms |
302760 KB |
Output is correct |
41 |
Correct |
246 ms |
298792 KB |
Output is correct |
42 |
Correct |
271 ms |
309540 KB |
Output is correct |
43 |
Correct |
266 ms |
307760 KB |
Output is correct |
44 |
Correct |
226 ms |
306896 KB |
Output is correct |
45 |
Correct |
226 ms |
303316 KB |
Output is correct |
46 |
Correct |
214 ms |
292916 KB |
Output is correct |
47 |
Correct |
265 ms |
304904 KB |
Output is correct |
48 |
Correct |
268 ms |
307924 KB |
Output is correct |
49 |
Correct |
271 ms |
308000 KB |
Output is correct |
50 |
Correct |
309 ms |
308068 KB |
Output is correct |
51 |
Correct |
245 ms |
308044 KB |
Output is correct |
52 |
Correct |
204 ms |
303448 KB |
Output is correct |
53 |
Correct |
207 ms |
302560 KB |
Output is correct |
54 |
Correct |
205 ms |
298968 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
132 ms |
274288 KB |
Output is correct |
2 |
Correct |
120 ms |
274184 KB |
Output is correct |
3 |
Correct |
120 ms |
274300 KB |
Output is correct |
4 |
Correct |
121 ms |
274180 KB |
Output is correct |
5 |
Correct |
121 ms |
274716 KB |
Output is correct |
6 |
Correct |
123 ms |
274304 KB |
Output is correct |
7 |
Correct |
123 ms |
274252 KB |
Output is correct |
8 |
Correct |
122 ms |
274300 KB |
Output is correct |
9 |
Correct |
122 ms |
274792 KB |
Output is correct |
10 |
Correct |
131 ms |
274784 KB |
Output is correct |
11 |
Correct |
121 ms |
274708 KB |
Output is correct |
12 |
Correct |
121 ms |
274888 KB |
Output is correct |
13 |
Correct |
141 ms |
274764 KB |
Output is correct |
14 |
Correct |
123 ms |
274828 KB |
Output is correct |
15 |
Correct |
128 ms |
274904 KB |
Output is correct |
16 |
Correct |
121 ms |
274508 KB |
Output is correct |
17 |
Correct |
123 ms |
274796 KB |
Output is correct |
18 |
Correct |
124 ms |
274232 KB |
Output is correct |
19 |
Correct |
131 ms |
274892 KB |
Output is correct |
20 |
Correct |
131 ms |
274432 KB |
Output is correct |
21 |
Correct |
121 ms |
274276 KB |
Output is correct |
22 |
Correct |
122 ms |
274600 KB |
Output is correct |
23 |
Correct |
123 ms |
274352 KB |
Output is correct |
24 |
Correct |
126 ms |
274276 KB |
Output is correct |
25 |
Correct |
140 ms |
274252 KB |
Output is correct |
26 |
Correct |
129 ms |
274308 KB |
Output is correct |
27 |
Correct |
134 ms |
274340 KB |
Output is correct |
28 |
Correct |
138 ms |
274736 KB |
Output is correct |
29 |
Correct |
122 ms |
274292 KB |
Output is correct |
30 |
Correct |
123 ms |
274788 KB |
Output is correct |
31 |
Correct |
123 ms |
274728 KB |
Output is correct |
32 |
Correct |
127 ms |
274660 KB |
Output is correct |
33 |
Correct |
236 ms |
299196 KB |
Output is correct |
34 |
Correct |
143 ms |
275504 KB |
Output is correct |
35 |
Correct |
149 ms |
276432 KB |
Output is correct |
36 |
Correct |
250 ms |
299312 KB |
Output is correct |
37 |
Correct |
166 ms |
288736 KB |
Output is correct |
38 |
Correct |
296 ms |
311996 KB |
Output is correct |
39 |
Correct |
256 ms |
308760 KB |
Output is correct |
40 |
Correct |
268 ms |
302760 KB |
Output is correct |
41 |
Correct |
246 ms |
298792 KB |
Output is correct |
42 |
Correct |
271 ms |
309540 KB |
Output is correct |
43 |
Correct |
266 ms |
307760 KB |
Output is correct |
44 |
Correct |
226 ms |
306896 KB |
Output is correct |
45 |
Correct |
226 ms |
303316 KB |
Output is correct |
46 |
Correct |
214 ms |
292916 KB |
Output is correct |
47 |
Correct |
265 ms |
304904 KB |
Output is correct |
48 |
Correct |
268 ms |
307924 KB |
Output is correct |
49 |
Correct |
271 ms |
308000 KB |
Output is correct |
50 |
Correct |
309 ms |
308068 KB |
Output is correct |
51 |
Correct |
245 ms |
308044 KB |
Output is correct |
52 |
Correct |
204 ms |
303448 KB |
Output is correct |
53 |
Correct |
207 ms |
302560 KB |
Output is correct |
54 |
Correct |
205 ms |
298968 KB |
Output is correct |
55 |
Correct |
378 ms |
336948 KB |
Output is correct |
56 |
Correct |
223 ms |
303048 KB |
Output is correct |
57 |
Correct |
604 ms |
354788 KB |
Output is correct |
58 |
Correct |
614 ms |
360932 KB |
Output is correct |
59 |
Correct |
474 ms |
360656 KB |
Output is correct |
60 |
Correct |
451 ms |
345600 KB |
Output is correct |
61 |
Correct |
418 ms |
335652 KB |
Output is correct |
62 |
Correct |
529 ms |
362624 KB |
Output is correct |
63 |
Correct |
547 ms |
358384 KB |
Output is correct |
64 |
Correct |
459 ms |
355728 KB |
Output is correct |
65 |
Correct |
315 ms |
346672 KB |
Output is correct |
66 |
Correct |
246 ms |
321108 KB |
Output is correct |
67 |
Correct |
482 ms |
350968 KB |
Output is correct |
68 |
Correct |
567 ms |
358588 KB |
Output is correct |
69 |
Correct |
586 ms |
358696 KB |
Output is correct |
70 |
Correct |
664 ms |
358864 KB |
Output is correct |
71 |
Correct |
608 ms |
358864 KB |
Output is correct |
72 |
Correct |
424 ms |
348460 KB |
Output is correct |
73 |
Correct |
460 ms |
345776 KB |
Output is correct |
74 |
Correct |
329 ms |
335920 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
127 ms |
274252 KB |
Output is correct |
2 |
Correct |
116 ms |
274200 KB |
Output is correct |
3 |
Correct |
117 ms |
274716 KB |
Output is correct |
4 |
Correct |
121 ms |
274992 KB |
Output is correct |
5 |
Correct |
119 ms |
274756 KB |
Output is correct |
6 |
Correct |
117 ms |
274652 KB |
Output is correct |
7 |
Correct |
118 ms |
274744 KB |
Output is correct |
8 |
Correct |
117 ms |
274536 KB |
Output is correct |
9 |
Correct |
118 ms |
274292 KB |
Output is correct |
10 |
Correct |
130 ms |
274300 KB |
Output is correct |
11 |
Correct |
115 ms |
274252 KB |
Output is correct |
12 |
Correct |
115 ms |
274280 KB |
Output is correct |
13 |
Correct |
122 ms |
274404 KB |
Output is correct |
14 |
Correct |
117 ms |
274324 KB |
Output is correct |
15 |
Correct |
118 ms |
274220 KB |
Output is correct |
16 |
Correct |
118 ms |
274764 KB |
Output is correct |
17 |
Correct |
122 ms |
274756 KB |
Output is correct |
18 |
Correct |
120 ms |
274928 KB |
Output is correct |
19 |
Correct |
197 ms |
299152 KB |
Output is correct |
20 |
Correct |
149 ms |
288728 KB |
Output is correct |
21 |
Correct |
234 ms |
308716 KB |
Output is correct |
22 |
Correct |
209 ms |
302668 KB |
Output is correct |
23 |
Correct |
226 ms |
298788 KB |
Output is correct |
24 |
Correct |
184 ms |
303196 KB |
Output is correct |
25 |
Correct |
157 ms |
292936 KB |
Output is correct |
26 |
Correct |
207 ms |
303536 KB |
Output is correct |
27 |
Correct |
182 ms |
302556 KB |
Output is correct |
28 |
Correct |
188 ms |
298896 KB |
Output is correct |
29 |
Correct |
413 ms |
336944 KB |
Output is correct |
30 |
Correct |
203 ms |
303140 KB |
Output is correct |
31 |
Correct |
488 ms |
360708 KB |
Output is correct |
32 |
Correct |
460 ms |
345592 KB |
Output is correct |
33 |
Correct |
361 ms |
335520 KB |
Output is correct |
34 |
Correct |
323 ms |
346660 KB |
Output is correct |
35 |
Correct |
237 ms |
321084 KB |
Output is correct |
36 |
Correct |
478 ms |
348400 KB |
Output is correct |
37 |
Correct |
423 ms |
345776 KB |
Output is correct |
38 |
Correct |
302 ms |
335880 KB |
Output is correct |
39 |
Runtime error |
684 ms |
722156 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
127 ms |
274252 KB |
Output is correct |
2 |
Correct |
116 ms |
274200 KB |
Output is correct |
3 |
Correct |
117 ms |
274716 KB |
Output is correct |
4 |
Correct |
121 ms |
274992 KB |
Output is correct |
5 |
Correct |
119 ms |
274756 KB |
Output is correct |
6 |
Correct |
117 ms |
274652 KB |
Output is correct |
7 |
Correct |
118 ms |
274744 KB |
Output is correct |
8 |
Correct |
117 ms |
274536 KB |
Output is correct |
9 |
Correct |
118 ms |
274292 KB |
Output is correct |
10 |
Correct |
130 ms |
274300 KB |
Output is correct |
11 |
Correct |
115 ms |
274252 KB |
Output is correct |
12 |
Correct |
115 ms |
274280 KB |
Output is correct |
13 |
Correct |
122 ms |
274404 KB |
Output is correct |
14 |
Correct |
117 ms |
274324 KB |
Output is correct |
15 |
Correct |
118 ms |
274220 KB |
Output is correct |
16 |
Correct |
118 ms |
274764 KB |
Output is correct |
17 |
Correct |
122 ms |
274756 KB |
Output is correct |
18 |
Correct |
120 ms |
274928 KB |
Output is correct |
19 |
Correct |
197 ms |
299152 KB |
Output is correct |
20 |
Correct |
149 ms |
288728 KB |
Output is correct |
21 |
Correct |
234 ms |
308716 KB |
Output is correct |
22 |
Correct |
209 ms |
302668 KB |
Output is correct |
23 |
Correct |
226 ms |
298788 KB |
Output is correct |
24 |
Correct |
184 ms |
303196 KB |
Output is correct |
25 |
Correct |
157 ms |
292936 KB |
Output is correct |
26 |
Correct |
207 ms |
303536 KB |
Output is correct |
27 |
Correct |
182 ms |
302556 KB |
Output is correct |
28 |
Correct |
188 ms |
298896 KB |
Output is correct |
29 |
Correct |
413 ms |
336944 KB |
Output is correct |
30 |
Correct |
203 ms |
303140 KB |
Output is correct |
31 |
Correct |
488 ms |
360708 KB |
Output is correct |
32 |
Correct |
460 ms |
345592 KB |
Output is correct |
33 |
Correct |
361 ms |
335520 KB |
Output is correct |
34 |
Correct |
323 ms |
346660 KB |
Output is correct |
35 |
Correct |
237 ms |
321084 KB |
Output is correct |
36 |
Correct |
478 ms |
348400 KB |
Output is correct |
37 |
Correct |
423 ms |
345776 KB |
Output is correct |
38 |
Correct |
302 ms |
335880 KB |
Output is correct |
39 |
Runtime error |
684 ms |
722156 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
127 ms |
274252 KB |
Output is correct |
2 |
Correct |
116 ms |
274200 KB |
Output is correct |
3 |
Correct |
117 ms |
274716 KB |
Output is correct |
4 |
Correct |
121 ms |
274992 KB |
Output is correct |
5 |
Correct |
119 ms |
274756 KB |
Output is correct |
6 |
Correct |
117 ms |
274652 KB |
Output is correct |
7 |
Correct |
118 ms |
274744 KB |
Output is correct |
8 |
Correct |
117 ms |
274536 KB |
Output is correct |
9 |
Correct |
118 ms |
274292 KB |
Output is correct |
10 |
Correct |
130 ms |
274300 KB |
Output is correct |
11 |
Correct |
115 ms |
274252 KB |
Output is correct |
12 |
Correct |
115 ms |
274280 KB |
Output is correct |
13 |
Correct |
122 ms |
274404 KB |
Output is correct |
14 |
Correct |
117 ms |
274324 KB |
Output is correct |
15 |
Correct |
118 ms |
274220 KB |
Output is correct |
16 |
Correct |
118 ms |
274764 KB |
Output is correct |
17 |
Correct |
122 ms |
274756 KB |
Output is correct |
18 |
Correct |
120 ms |
274928 KB |
Output is correct |
19 |
Correct |
197 ms |
299152 KB |
Output is correct |
20 |
Correct |
149 ms |
288728 KB |
Output is correct |
21 |
Correct |
234 ms |
308716 KB |
Output is correct |
22 |
Correct |
209 ms |
302668 KB |
Output is correct |
23 |
Correct |
226 ms |
298788 KB |
Output is correct |
24 |
Correct |
184 ms |
303196 KB |
Output is correct |
25 |
Correct |
157 ms |
292936 KB |
Output is correct |
26 |
Correct |
207 ms |
303536 KB |
Output is correct |
27 |
Correct |
182 ms |
302556 KB |
Output is correct |
28 |
Correct |
188 ms |
298896 KB |
Output is correct |
29 |
Correct |
413 ms |
336944 KB |
Output is correct |
30 |
Correct |
203 ms |
303140 KB |
Output is correct |
31 |
Correct |
488 ms |
360708 KB |
Output is correct |
32 |
Correct |
460 ms |
345592 KB |
Output is correct |
33 |
Correct |
361 ms |
335520 KB |
Output is correct |
34 |
Correct |
323 ms |
346660 KB |
Output is correct |
35 |
Correct |
237 ms |
321084 KB |
Output is correct |
36 |
Correct |
478 ms |
348400 KB |
Output is correct |
37 |
Correct |
423 ms |
345776 KB |
Output is correct |
38 |
Correct |
302 ms |
335880 KB |
Output is correct |
39 |
Runtime error |
684 ms |
722156 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |