#include <bits/stdc++.h>
using namespace std;
#ifdef MIKU
#define debug(x...) cout << "[" << #x << "] : ", dout(x)
void dout() { cout << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
// #define int long long
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;
const int MXN = 6000005, LAYER = 8;
const pii D[4] = {mp(1, 0), mp(-1, 0), mp(0, 1), mp(0, -1)};
int R, C, N;
pii sr, to;
vector<string> s;
int K;
vector<int> edge[MXN * LAYER];
int dis[MXN * LAYER];
inline int cvt(pii p) {
return p.fs * C + p.sc;
}
inline pii cvt(int x) {
return mp(x / C, x % C);
}
inline pii operator+(pii a, pii b) {
return mp(a.fs + b.fs, a.sc + b.sc);
}
inline bool OUT(pii p) {
if (!(0 <= p.fs && p.fs < R)) return true;
if (!(0 <= p.sc && p.sc < C)) return true;
return false;
}
namespace EDGE {
inline int cvt3(int l, int x, int y) {
return l * R * C + x * C + y;
}
inline void PUSH_EDGE(int sr, int to, int val) {
// debug(sr, to, val);
edge[sr].push_back(val ? ~to : to);
}
void E0() {
FOR(i, 0, R * C) {
pii p = cvt(i);
if (s[p.fs][p.sc] == '#') continue;
FOR(d, 0, 4) {
pii nxt = p + D[d];
if (OUT(nxt)) continue;
if (s[nxt.fs][nxt.sc] == '#') continue;
PUSH_EDGE(cvt3(0, p.fs, p.sc), cvt3(0, nxt.fs, nxt.sc), 0);
}
}
}
void E0_1() {
FOR(i, 0, R * C) {
pii p = cvt(i);
FOR(d, 0, 4) {
pii nxt = p + D[d];
if (OUT(nxt)) continue;
PUSH_EDGE(cvt3(0, p.fs, p.sc), cvt3(1, nxt.fs, nxt.sc), 1);
}
}
}
void E23_4() {
FOR(j, 0, C) {
for (int l_bnd = 0, r_bnd; l_bnd < R; l_bnd += K) {
r_bnd = min(R, l_bnd + K);
FOR(i, l_bnd, r_bnd) {
PUSH_EDGE(cvt3(2, i, j), cvt3(4, i, j), 0);
PUSH_EDGE(cvt3(3, i, j), cvt3(4, i, j), 0);
}
FOR(i, l_bnd, r_bnd - 1) PUSH_EDGE(cvt3(2, i, j), cvt3(2, i + 1, j), 0);
FOR(i, l_bnd + 1, r_bnd) PUSH_EDGE(cvt3(3, i, j), cvt3(3, i - 1, j), 0);
}
}
}
void E1_23() {
auto ADD_EDGE = [&](int y, int l, int r, int sr) -> void {
if (r - l == K) {
PUSH_EDGE(sr, cvt3(2, l, y), 0);
PUSH_EDGE(sr, cvt3(3, r - 1, y), 0);
return;
}
if (r == R) {
PUSH_EDGE(sr, cvt3(2, l, y), 0);
int m = (l ? (l - 1) / K * K + K : 0);
if (m < R) PUSH_EDGE(sr, cvt3(2, m, y), 0);
return;
}
PUSH_EDGE(sr, cvt3(3, r - 1, y), 0);
};
FOR(j, 0, C) {
FOR(i, 0, R) {
int l_bnd = max(0, i - (N - 1)), r_bnd = min(R, i + N);
ADD_EDGE(j, l_bnd, r_bnd, cvt3(1, i, j));
}
}
}
void E56_7() {
FOR(i, 0, R) {
for (int l_bnd = 0, r_bnd; l_bnd < C; l_bnd += K) {
r_bnd = min(C, l_bnd + K);
FOR(j, l_bnd, r_bnd) {
PUSH_EDGE(cvt3(5, i, j), cvt3(7, i, j), 0);
PUSH_EDGE(cvt3(6, i, j), cvt3(7, i, j), 0);
}
FOR(j, l_bnd, r_bnd - 1) PUSH_EDGE(cvt3(5, i, j), cvt3(5, i, j + 1), 0);
FOR(j, l_bnd + 1, r_bnd) PUSH_EDGE(cvt3(6, i, j), cvt3(6, i, j - 1), 0);
}
}
}
void E4_56() {
auto ADD_EDGE = [&](int x, int l, int r, int sr) -> void {
if (r - l == K) {
PUSH_EDGE(sr, cvt3(5, x, l), 0);
PUSH_EDGE(sr, cvt3(6, x, r - 1), 0);
return;
}
if (r == C) {
PUSH_EDGE(sr, cvt3(5, x, l), 0);
int m = (l ? (l - 1) / K * K + K : 0);
if (m < C) PUSH_EDGE(sr, cvt3(5, x, m), 0);
return;
}
PUSH_EDGE(sr, cvt3(6, x, r - 1), 0);
};
FOR(i, 0, R) {
FOR(j, 0, C) {
int l_bnd = max(0, j - (N - 1)), r_bnd = min(C, j + N);
ADD_EDGE(i, l_bnd, r_bnd, cvt3(4, i, j));
}
}
}
void E7_0() {
FOR(i, 0, R * C) {
pii p = cvt(i);
PUSH_EDGE(cvt3(7, p.fs, p.sc), cvt3(0, p.fs, p.sc), 0);
FOR(d, 0, 4) {
pii nxt = p + D[d];
if (OUT(nxt) || s[nxt.fs][nxt.sc] == '#') continue;
PUSH_EDGE(cvt3(7, p.fs, p.sc), cvt3(0, nxt.fs, nxt.sc), 0);
}
}
}
void BUILD() {
E0();
E0_1();
E23_4();
E1_23();
E56_7();
E4_56();
E7_0();
}
}
namespace BFS {
deque<pii> dq;
void GO(int sr) {
fill(dis, dis + R * C * LAYER, -1);
dq.push_back(mp(0, sr));
while (dq.size()) {
pii now = dq.front();
dq.pop_front();
debug(now.fs, now.sc);
if (dis[now.sc] != -1) continue;
int len = now.fs, id = now.sc;
dis[id] = len;
for (auto &i : edge[id]) {
int tg = (i < 0 ? ~i : i);
if (dis[tg] != -1) continue;
if (i < 0) dq.push_back(mp(len + 1, tg));
else dq.push_front(mp(len, tg));
}
}
}
}
void miku() {
cin >> R >> C >> N >> sr.fs >> sr.sc >> to.fs >> to.sc;
sr.fs--, sr.sc--, to.fs--, to.sc--;
K = N * 2 - 1;
s.resize(R);
FOR(i, 0, R) cin >> s[i];
EDGE::BUILD();
BFS::GO(cvt(sr));
cout << dis[cvt(to)] << '\n';
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(iostream::failbit);
miku();
return 0;
}
Compilation message
Main.cpp: In function 'void BFS::GO(int)':
Main.cpp:10:20: warning: statement has no effect [-Wunused-value]
10 | #define debug(...) 39
| ^~
Main.cpp:186:13: note: in expansion of macro 'debug'
186 | debug(now.fs, now.sc);
| ^~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
460 ms |
1128664 KB |
Output is correct |
2 |
Correct |
424 ms |
1128608 KB |
Output is correct |
3 |
Correct |
457 ms |
1129280 KB |
Output is correct |
4 |
Correct |
446 ms |
1128792 KB |
Output is correct |
5 |
Correct |
423 ms |
1128772 KB |
Output is correct |
6 |
Correct |
525 ms |
1129044 KB |
Output is correct |
7 |
Correct |
449 ms |
1128788 KB |
Output is correct |
8 |
Correct |
447 ms |
1129220 KB |
Output is correct |
9 |
Correct |
421 ms |
1128528 KB |
Output is correct |
10 |
Correct |
454 ms |
1128560 KB |
Output is correct |
11 |
Correct |
467 ms |
1128532 KB |
Output is correct |
12 |
Correct |
441 ms |
1128600 KB |
Output is correct |
13 |
Correct |
488 ms |
1128652 KB |
Output is correct |
14 |
Correct |
446 ms |
1128548 KB |
Output is correct |
15 |
Correct |
479 ms |
1128616 KB |
Output is correct |
16 |
Correct |
454 ms |
1128664 KB |
Output is correct |
17 |
Correct |
442 ms |
1128900 KB |
Output is correct |
18 |
Correct |
453 ms |
1129044 KB |
Output is correct |
19 |
Correct |
541 ms |
1145428 KB |
Output is correct |
20 |
Correct |
494 ms |
1141544 KB |
Output is correct |
21 |
Correct |
542 ms |
1149528 KB |
Output is correct |
22 |
Correct |
561 ms |
1145688 KB |
Output is correct |
23 |
Correct |
561 ms |
1145564 KB |
Output is correct |
24 |
Correct |
457 ms |
1145840 KB |
Output is correct |
25 |
Correct |
451 ms |
1145428 KB |
Output is correct |
26 |
Correct |
493 ms |
1146432 KB |
Output is correct |
27 |
Correct |
492 ms |
1146192 KB |
Output is correct |
28 |
Correct |
480 ms |
1145568 KB |
Output is correct |
29 |
Correct |
568 ms |
1171052 KB |
Output is correct |
30 |
Correct |
469 ms |
1145872 KB |
Output is correct |
31 |
Correct |
556 ms |
1180772 KB |
Output is correct |
32 |
Correct |
571 ms |
1172044 KB |
Output is correct |
33 |
Correct |
564 ms |
1170772 KB |
Output is correct |
34 |
Correct |
504 ms |
1170912 KB |
Output is correct |
35 |
Correct |
528 ms |
1171216 KB |
Output is correct |
36 |
Correct |
599 ms |
1172596 KB |
Output is correct |
37 |
Correct |
588 ms |
1172000 KB |
Output is correct |
38 |
Correct |
576 ms |
1171044 KB |
Output is correct |
39 |
Execution timed out |
2159 ms |
1554376 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
474 ms |
1128552 KB |
Output is correct |
2 |
Correct |
434 ms |
1128616 KB |
Output is correct |
3 |
Correct |
429 ms |
1128616 KB |
Output is correct |
4 |
Correct |
463 ms |
1128556 KB |
Output is correct |
5 |
Correct |
441 ms |
1128788 KB |
Output is correct |
6 |
Correct |
442 ms |
1128552 KB |
Output is correct |
7 |
Correct |
433 ms |
1128532 KB |
Output is correct |
8 |
Correct |
432 ms |
1128632 KB |
Output is correct |
9 |
Correct |
430 ms |
1128948 KB |
Output is correct |
10 |
Correct |
438 ms |
1128792 KB |
Output is correct |
11 |
Correct |
442 ms |
1128772 KB |
Output is correct |
12 |
Correct |
431 ms |
1128896 KB |
Output is correct |
13 |
Correct |
453 ms |
1128704 KB |
Output is correct |
14 |
Correct |
443 ms |
1128784 KB |
Output is correct |
15 |
Correct |
438 ms |
1128840 KB |
Output is correct |
16 |
Correct |
442 ms |
1129056 KB |
Output is correct |
17 |
Correct |
428 ms |
1128832 KB |
Output is correct |
18 |
Correct |
442 ms |
1128608 KB |
Output is correct |
19 |
Correct |
521 ms |
1128844 KB |
Output is correct |
20 |
Correct |
443 ms |
1128532 KB |
Output is correct |
21 |
Correct |
435 ms |
1128508 KB |
Output is correct |
22 |
Correct |
447 ms |
1128788 KB |
Output is correct |
23 |
Correct |
437 ms |
1128768 KB |
Output is correct |
24 |
Correct |
431 ms |
1128528 KB |
Output is correct |
25 |
Correct |
434 ms |
1128528 KB |
Output is correct |
26 |
Correct |
439 ms |
1128528 KB |
Output is correct |
27 |
Correct |
432 ms |
1128528 KB |
Output is correct |
28 |
Correct |
433 ms |
1128896 KB |
Output is correct |
29 |
Correct |
445 ms |
1128576 KB |
Output is correct |
30 |
Correct |
433 ms |
1129112 KB |
Output is correct |
31 |
Correct |
447 ms |
1128836 KB |
Output is correct |
32 |
Correct |
437 ms |
1128892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
457 ms |
1128612 KB |
Output is correct |
2 |
Correct |
428 ms |
1128404 KB |
Output is correct |
3 |
Correct |
429 ms |
1128640 KB |
Output is correct |
4 |
Correct |
455 ms |
1128612 KB |
Output is correct |
5 |
Correct |
432 ms |
1128752 KB |
Output is correct |
6 |
Correct |
428 ms |
1128632 KB |
Output is correct |
7 |
Correct |
427 ms |
1128948 KB |
Output is correct |
8 |
Correct |
436 ms |
1128848 KB |
Output is correct |
9 |
Correct |
433 ms |
1128920 KB |
Output is correct |
10 |
Correct |
436 ms |
1129128 KB |
Output is correct |
11 |
Correct |
430 ms |
1128788 KB |
Output is correct |
12 |
Correct |
440 ms |
1128684 KB |
Output is correct |
13 |
Correct |
428 ms |
1128508 KB |
Output is correct |
14 |
Correct |
426 ms |
1128784 KB |
Output is correct |
15 |
Correct |
458 ms |
1128620 KB |
Output is correct |
16 |
Correct |
447 ms |
1128788 KB |
Output is correct |
17 |
Correct |
446 ms |
1128872 KB |
Output is correct |
18 |
Correct |
442 ms |
1128608 KB |
Output is correct |
19 |
Correct |
445 ms |
1128600 KB |
Output is correct |
20 |
Correct |
463 ms |
1128812 KB |
Output is correct |
21 |
Correct |
457 ms |
1128724 KB |
Output is correct |
22 |
Correct |
452 ms |
1128908 KB |
Output is correct |
23 |
Correct |
448 ms |
1128892 KB |
Output is correct |
24 |
Correct |
487 ms |
1129176 KB |
Output is correct |
25 |
Correct |
469 ms |
1139672 KB |
Output is correct |
26 |
Correct |
495 ms |
1146196 KB |
Output is correct |
27 |
Correct |
504 ms |
1149312 KB |
Output is correct |
28 |
Correct |
487 ms |
1149364 KB |
Output is correct |
29 |
Correct |
495 ms |
1147728 KB |
Output is correct |
30 |
Correct |
488 ms |
1147548 KB |
Output is correct |
31 |
Correct |
540 ms |
1146228 KB |
Output is correct |
32 |
Correct |
486 ms |
1146344 KB |
Output is correct |
33 |
Correct |
493 ms |
1146188 KB |
Output is correct |
34 |
Correct |
568 ms |
1168136 KB |
Output is correct |
35 |
Correct |
559 ms |
1180852 KB |
Output is correct |
36 |
Correct |
565 ms |
1181112 KB |
Output is correct |
37 |
Correct |
570 ms |
1176880 KB |
Output is correct |
38 |
Correct |
541 ms |
1175960 KB |
Output is correct |
39 |
Correct |
902 ms |
1269224 KB |
Output is correct |
40 |
Execution timed out |
2120 ms |
1544004 KB |
Time limit exceeded |
41 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
474 ms |
1128552 KB |
Output is correct |
2 |
Correct |
434 ms |
1128616 KB |
Output is correct |
3 |
Correct |
429 ms |
1128616 KB |
Output is correct |
4 |
Correct |
463 ms |
1128556 KB |
Output is correct |
5 |
Correct |
441 ms |
1128788 KB |
Output is correct |
6 |
Correct |
442 ms |
1128552 KB |
Output is correct |
7 |
Correct |
433 ms |
1128532 KB |
Output is correct |
8 |
Correct |
432 ms |
1128632 KB |
Output is correct |
9 |
Correct |
430 ms |
1128948 KB |
Output is correct |
10 |
Correct |
438 ms |
1128792 KB |
Output is correct |
11 |
Correct |
442 ms |
1128772 KB |
Output is correct |
12 |
Correct |
431 ms |
1128896 KB |
Output is correct |
13 |
Correct |
453 ms |
1128704 KB |
Output is correct |
14 |
Correct |
443 ms |
1128784 KB |
Output is correct |
15 |
Correct |
438 ms |
1128840 KB |
Output is correct |
16 |
Correct |
442 ms |
1129056 KB |
Output is correct |
17 |
Correct |
428 ms |
1128832 KB |
Output is correct |
18 |
Correct |
442 ms |
1128608 KB |
Output is correct |
19 |
Correct |
521 ms |
1128844 KB |
Output is correct |
20 |
Correct |
443 ms |
1128532 KB |
Output is correct |
21 |
Correct |
435 ms |
1128508 KB |
Output is correct |
22 |
Correct |
447 ms |
1128788 KB |
Output is correct |
23 |
Correct |
437 ms |
1128768 KB |
Output is correct |
24 |
Correct |
431 ms |
1128528 KB |
Output is correct |
25 |
Correct |
434 ms |
1128528 KB |
Output is correct |
26 |
Correct |
439 ms |
1128528 KB |
Output is correct |
27 |
Correct |
432 ms |
1128528 KB |
Output is correct |
28 |
Correct |
433 ms |
1128896 KB |
Output is correct |
29 |
Correct |
445 ms |
1128576 KB |
Output is correct |
30 |
Correct |
433 ms |
1129112 KB |
Output is correct |
31 |
Correct |
447 ms |
1128836 KB |
Output is correct |
32 |
Correct |
437 ms |
1128892 KB |
Output is correct |
33 |
Correct |
490 ms |
1145648 KB |
Output is correct |
34 |
Correct |
434 ms |
1129292 KB |
Output is correct |
35 |
Correct |
429 ms |
1129780 KB |
Output is correct |
36 |
Correct |
460 ms |
1139580 KB |
Output is correct |
37 |
Correct |
453 ms |
1141736 KB |
Output is correct |
38 |
Correct |
483 ms |
1146284 KB |
Output is correct |
39 |
Correct |
485 ms |
1149388 KB |
Output is correct |
40 |
Correct |
499 ms |
1146152 KB |
Output is correct |
41 |
Correct |
493 ms |
1145388 KB |
Output is correct |
42 |
Correct |
489 ms |
1149580 KB |
Output is correct |
43 |
Correct |
482 ms |
1147816 KB |
Output is correct |
44 |
Correct |
478 ms |
1147544 KB |
Output is correct |
45 |
Correct |
459 ms |
1145684 KB |
Output is correct |
46 |
Correct |
456 ms |
1145488 KB |
Output is correct |
47 |
Correct |
477 ms |
1145848 KB |
Output is correct |
48 |
Correct |
502 ms |
1145940 KB |
Output is correct |
49 |
Correct |
482 ms |
1145940 KB |
Output is correct |
50 |
Correct |
480 ms |
1145948 KB |
Output is correct |
51 |
Correct |
483 ms |
1146196 KB |
Output is correct |
52 |
Correct |
498 ms |
1146280 KB |
Output is correct |
53 |
Correct |
486 ms |
1145936 KB |
Output is correct |
54 |
Correct |
483 ms |
1145592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
474 ms |
1128552 KB |
Output is correct |
2 |
Correct |
434 ms |
1128616 KB |
Output is correct |
3 |
Correct |
429 ms |
1128616 KB |
Output is correct |
4 |
Correct |
463 ms |
1128556 KB |
Output is correct |
5 |
Correct |
441 ms |
1128788 KB |
Output is correct |
6 |
Correct |
442 ms |
1128552 KB |
Output is correct |
7 |
Correct |
433 ms |
1128532 KB |
Output is correct |
8 |
Correct |
432 ms |
1128632 KB |
Output is correct |
9 |
Correct |
430 ms |
1128948 KB |
Output is correct |
10 |
Correct |
438 ms |
1128792 KB |
Output is correct |
11 |
Correct |
442 ms |
1128772 KB |
Output is correct |
12 |
Correct |
431 ms |
1128896 KB |
Output is correct |
13 |
Correct |
453 ms |
1128704 KB |
Output is correct |
14 |
Correct |
443 ms |
1128784 KB |
Output is correct |
15 |
Correct |
438 ms |
1128840 KB |
Output is correct |
16 |
Correct |
442 ms |
1129056 KB |
Output is correct |
17 |
Correct |
428 ms |
1128832 KB |
Output is correct |
18 |
Correct |
442 ms |
1128608 KB |
Output is correct |
19 |
Correct |
521 ms |
1128844 KB |
Output is correct |
20 |
Correct |
443 ms |
1128532 KB |
Output is correct |
21 |
Correct |
435 ms |
1128508 KB |
Output is correct |
22 |
Correct |
447 ms |
1128788 KB |
Output is correct |
23 |
Correct |
437 ms |
1128768 KB |
Output is correct |
24 |
Correct |
431 ms |
1128528 KB |
Output is correct |
25 |
Correct |
434 ms |
1128528 KB |
Output is correct |
26 |
Correct |
439 ms |
1128528 KB |
Output is correct |
27 |
Correct |
432 ms |
1128528 KB |
Output is correct |
28 |
Correct |
433 ms |
1128896 KB |
Output is correct |
29 |
Correct |
445 ms |
1128576 KB |
Output is correct |
30 |
Correct |
433 ms |
1129112 KB |
Output is correct |
31 |
Correct |
447 ms |
1128836 KB |
Output is correct |
32 |
Correct |
437 ms |
1128892 KB |
Output is correct |
33 |
Correct |
490 ms |
1145648 KB |
Output is correct |
34 |
Correct |
434 ms |
1129292 KB |
Output is correct |
35 |
Correct |
429 ms |
1129780 KB |
Output is correct |
36 |
Correct |
460 ms |
1139580 KB |
Output is correct |
37 |
Correct |
453 ms |
1141736 KB |
Output is correct |
38 |
Correct |
483 ms |
1146284 KB |
Output is correct |
39 |
Correct |
485 ms |
1149388 KB |
Output is correct |
40 |
Correct |
499 ms |
1146152 KB |
Output is correct |
41 |
Correct |
493 ms |
1145388 KB |
Output is correct |
42 |
Correct |
489 ms |
1149580 KB |
Output is correct |
43 |
Correct |
482 ms |
1147816 KB |
Output is correct |
44 |
Correct |
478 ms |
1147544 KB |
Output is correct |
45 |
Correct |
459 ms |
1145684 KB |
Output is correct |
46 |
Correct |
456 ms |
1145488 KB |
Output is correct |
47 |
Correct |
477 ms |
1145848 KB |
Output is correct |
48 |
Correct |
502 ms |
1145940 KB |
Output is correct |
49 |
Correct |
482 ms |
1145940 KB |
Output is correct |
50 |
Correct |
480 ms |
1145948 KB |
Output is correct |
51 |
Correct |
483 ms |
1146196 KB |
Output is correct |
52 |
Correct |
498 ms |
1146280 KB |
Output is correct |
53 |
Correct |
486 ms |
1145936 KB |
Output is correct |
54 |
Correct |
483 ms |
1145592 KB |
Output is correct |
55 |
Correct |
569 ms |
1171120 KB |
Output is correct |
56 |
Correct |
485 ms |
1146164 KB |
Output is correct |
57 |
Correct |
566 ms |
1167956 KB |
Output is correct |
58 |
Correct |
572 ms |
1167896 KB |
Output is correct |
59 |
Correct |
562 ms |
1181228 KB |
Output is correct |
60 |
Correct |
576 ms |
1172048 KB |
Output is correct |
61 |
Correct |
574 ms |
1171024 KB |
Output is correct |
62 |
Correct |
677 ms |
1180992 KB |
Output is correct |
63 |
Correct |
662 ms |
1176900 KB |
Output is correct |
64 |
Correct |
538 ms |
1176036 KB |
Output is correct |
65 |
Correct |
516 ms |
1171168 KB |
Output is correct |
66 |
Correct |
513 ms |
1171048 KB |
Output is correct |
67 |
Correct |
569 ms |
1171256 KB |
Output is correct |
68 |
Correct |
569 ms |
1172052 KB |
Output is correct |
69 |
Correct |
560 ms |
1172120 KB |
Output is correct |
70 |
Correct |
601 ms |
1172568 KB |
Output is correct |
71 |
Correct |
570 ms |
1172792 KB |
Output is correct |
72 |
Correct |
586 ms |
1172832 KB |
Output is correct |
73 |
Correct |
608 ms |
1172516 KB |
Output is correct |
74 |
Correct |
579 ms |
1171192 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
460 ms |
1128664 KB |
Output is correct |
2 |
Correct |
424 ms |
1128608 KB |
Output is correct |
3 |
Correct |
457 ms |
1129280 KB |
Output is correct |
4 |
Correct |
446 ms |
1128792 KB |
Output is correct |
5 |
Correct |
423 ms |
1128772 KB |
Output is correct |
6 |
Correct |
525 ms |
1129044 KB |
Output is correct |
7 |
Correct |
449 ms |
1128788 KB |
Output is correct |
8 |
Correct |
447 ms |
1129220 KB |
Output is correct |
9 |
Correct |
421 ms |
1128528 KB |
Output is correct |
10 |
Correct |
454 ms |
1128560 KB |
Output is correct |
11 |
Correct |
467 ms |
1128532 KB |
Output is correct |
12 |
Correct |
441 ms |
1128600 KB |
Output is correct |
13 |
Correct |
488 ms |
1128652 KB |
Output is correct |
14 |
Correct |
446 ms |
1128548 KB |
Output is correct |
15 |
Correct |
479 ms |
1128616 KB |
Output is correct |
16 |
Correct |
454 ms |
1128664 KB |
Output is correct |
17 |
Correct |
442 ms |
1128900 KB |
Output is correct |
18 |
Correct |
453 ms |
1129044 KB |
Output is correct |
19 |
Correct |
541 ms |
1145428 KB |
Output is correct |
20 |
Correct |
494 ms |
1141544 KB |
Output is correct |
21 |
Correct |
542 ms |
1149528 KB |
Output is correct |
22 |
Correct |
561 ms |
1145688 KB |
Output is correct |
23 |
Correct |
561 ms |
1145564 KB |
Output is correct |
24 |
Correct |
457 ms |
1145840 KB |
Output is correct |
25 |
Correct |
451 ms |
1145428 KB |
Output is correct |
26 |
Correct |
493 ms |
1146432 KB |
Output is correct |
27 |
Correct |
492 ms |
1146192 KB |
Output is correct |
28 |
Correct |
480 ms |
1145568 KB |
Output is correct |
29 |
Correct |
568 ms |
1171052 KB |
Output is correct |
30 |
Correct |
469 ms |
1145872 KB |
Output is correct |
31 |
Correct |
556 ms |
1180772 KB |
Output is correct |
32 |
Correct |
571 ms |
1172044 KB |
Output is correct |
33 |
Correct |
564 ms |
1170772 KB |
Output is correct |
34 |
Correct |
504 ms |
1170912 KB |
Output is correct |
35 |
Correct |
528 ms |
1171216 KB |
Output is correct |
36 |
Correct |
599 ms |
1172596 KB |
Output is correct |
37 |
Correct |
588 ms |
1172000 KB |
Output is correct |
38 |
Correct |
576 ms |
1171044 KB |
Output is correct |
39 |
Execution timed out |
2159 ms |
1554376 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
460 ms |
1128664 KB |
Output is correct |
2 |
Correct |
424 ms |
1128608 KB |
Output is correct |
3 |
Correct |
457 ms |
1129280 KB |
Output is correct |
4 |
Correct |
446 ms |
1128792 KB |
Output is correct |
5 |
Correct |
423 ms |
1128772 KB |
Output is correct |
6 |
Correct |
525 ms |
1129044 KB |
Output is correct |
7 |
Correct |
449 ms |
1128788 KB |
Output is correct |
8 |
Correct |
447 ms |
1129220 KB |
Output is correct |
9 |
Correct |
421 ms |
1128528 KB |
Output is correct |
10 |
Correct |
454 ms |
1128560 KB |
Output is correct |
11 |
Correct |
467 ms |
1128532 KB |
Output is correct |
12 |
Correct |
441 ms |
1128600 KB |
Output is correct |
13 |
Correct |
488 ms |
1128652 KB |
Output is correct |
14 |
Correct |
446 ms |
1128548 KB |
Output is correct |
15 |
Correct |
479 ms |
1128616 KB |
Output is correct |
16 |
Correct |
454 ms |
1128664 KB |
Output is correct |
17 |
Correct |
442 ms |
1128900 KB |
Output is correct |
18 |
Correct |
453 ms |
1129044 KB |
Output is correct |
19 |
Correct |
541 ms |
1145428 KB |
Output is correct |
20 |
Correct |
494 ms |
1141544 KB |
Output is correct |
21 |
Correct |
542 ms |
1149528 KB |
Output is correct |
22 |
Correct |
561 ms |
1145688 KB |
Output is correct |
23 |
Correct |
561 ms |
1145564 KB |
Output is correct |
24 |
Correct |
457 ms |
1145840 KB |
Output is correct |
25 |
Correct |
451 ms |
1145428 KB |
Output is correct |
26 |
Correct |
493 ms |
1146432 KB |
Output is correct |
27 |
Correct |
492 ms |
1146192 KB |
Output is correct |
28 |
Correct |
480 ms |
1145568 KB |
Output is correct |
29 |
Correct |
568 ms |
1171052 KB |
Output is correct |
30 |
Correct |
469 ms |
1145872 KB |
Output is correct |
31 |
Correct |
556 ms |
1180772 KB |
Output is correct |
32 |
Correct |
571 ms |
1172044 KB |
Output is correct |
33 |
Correct |
564 ms |
1170772 KB |
Output is correct |
34 |
Correct |
504 ms |
1170912 KB |
Output is correct |
35 |
Correct |
528 ms |
1171216 KB |
Output is correct |
36 |
Correct |
599 ms |
1172596 KB |
Output is correct |
37 |
Correct |
588 ms |
1172000 KB |
Output is correct |
38 |
Correct |
576 ms |
1171044 KB |
Output is correct |
39 |
Execution timed out |
2159 ms |
1554376 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
460 ms |
1128664 KB |
Output is correct |
2 |
Correct |
424 ms |
1128608 KB |
Output is correct |
3 |
Correct |
457 ms |
1129280 KB |
Output is correct |
4 |
Correct |
446 ms |
1128792 KB |
Output is correct |
5 |
Correct |
423 ms |
1128772 KB |
Output is correct |
6 |
Correct |
525 ms |
1129044 KB |
Output is correct |
7 |
Correct |
449 ms |
1128788 KB |
Output is correct |
8 |
Correct |
447 ms |
1129220 KB |
Output is correct |
9 |
Correct |
421 ms |
1128528 KB |
Output is correct |
10 |
Correct |
454 ms |
1128560 KB |
Output is correct |
11 |
Correct |
467 ms |
1128532 KB |
Output is correct |
12 |
Correct |
441 ms |
1128600 KB |
Output is correct |
13 |
Correct |
488 ms |
1128652 KB |
Output is correct |
14 |
Correct |
446 ms |
1128548 KB |
Output is correct |
15 |
Correct |
479 ms |
1128616 KB |
Output is correct |
16 |
Correct |
454 ms |
1128664 KB |
Output is correct |
17 |
Correct |
442 ms |
1128900 KB |
Output is correct |
18 |
Correct |
453 ms |
1129044 KB |
Output is correct |
19 |
Correct |
541 ms |
1145428 KB |
Output is correct |
20 |
Correct |
494 ms |
1141544 KB |
Output is correct |
21 |
Correct |
542 ms |
1149528 KB |
Output is correct |
22 |
Correct |
561 ms |
1145688 KB |
Output is correct |
23 |
Correct |
561 ms |
1145564 KB |
Output is correct |
24 |
Correct |
457 ms |
1145840 KB |
Output is correct |
25 |
Correct |
451 ms |
1145428 KB |
Output is correct |
26 |
Correct |
493 ms |
1146432 KB |
Output is correct |
27 |
Correct |
492 ms |
1146192 KB |
Output is correct |
28 |
Correct |
480 ms |
1145568 KB |
Output is correct |
29 |
Correct |
568 ms |
1171052 KB |
Output is correct |
30 |
Correct |
469 ms |
1145872 KB |
Output is correct |
31 |
Correct |
556 ms |
1180772 KB |
Output is correct |
32 |
Correct |
571 ms |
1172044 KB |
Output is correct |
33 |
Correct |
564 ms |
1170772 KB |
Output is correct |
34 |
Correct |
504 ms |
1170912 KB |
Output is correct |
35 |
Correct |
528 ms |
1171216 KB |
Output is correct |
36 |
Correct |
599 ms |
1172596 KB |
Output is correct |
37 |
Correct |
588 ms |
1172000 KB |
Output is correct |
38 |
Correct |
576 ms |
1171044 KB |
Output is correct |
39 |
Execution timed out |
2159 ms |
1554376 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |