#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, int to) {
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;
if (id == to) return;
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), cvt(to));
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, 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 |
432 ms |
1128528 KB |
Output is correct |
2 |
Correct |
435 ms |
1128528 KB |
Output is correct |
3 |
Correct |
427 ms |
1128808 KB |
Output is correct |
4 |
Correct |
537 ms |
1128924 KB |
Output is correct |
5 |
Correct |
436 ms |
1129084 KB |
Output is correct |
6 |
Correct |
429 ms |
1128784 KB |
Output is correct |
7 |
Correct |
431 ms |
1129036 KB |
Output is correct |
8 |
Correct |
430 ms |
1128788 KB |
Output is correct |
9 |
Correct |
432 ms |
1128448 KB |
Output is correct |
10 |
Correct |
441 ms |
1128616 KB |
Output is correct |
11 |
Correct |
431 ms |
1128620 KB |
Output is correct |
12 |
Correct |
431 ms |
1128528 KB |
Output is correct |
13 |
Correct |
426 ms |
1128528 KB |
Output is correct |
14 |
Correct |
437 ms |
1128788 KB |
Output is correct |
15 |
Correct |
427 ms |
1128532 KB |
Output is correct |
16 |
Correct |
434 ms |
1128900 KB |
Output is correct |
17 |
Correct |
432 ms |
1128892 KB |
Output is correct |
18 |
Correct |
440 ms |
1128676 KB |
Output is correct |
19 |
Correct |
478 ms |
1145424 KB |
Output is correct |
20 |
Correct |
449 ms |
1141560 KB |
Output is correct |
21 |
Correct |
471 ms |
1147752 KB |
Output is correct |
22 |
Correct |
480 ms |
1145940 KB |
Output is correct |
23 |
Correct |
492 ms |
1145684 KB |
Output is correct |
24 |
Correct |
461 ms |
1145508 KB |
Output is correct |
25 |
Correct |
458 ms |
1145640 KB |
Output is correct |
26 |
Correct |
469 ms |
1146376 KB |
Output is correct |
27 |
Correct |
464 ms |
1145988 KB |
Output is correct |
28 |
Correct |
482 ms |
1145556 KB |
Output is correct |
29 |
Correct |
582 ms |
1171280 KB |
Output is correct |
30 |
Correct |
470 ms |
1146092 KB |
Output is correct |
31 |
Correct |
527 ms |
1179272 KB |
Output is correct |
32 |
Correct |
569 ms |
1171896 KB |
Output is correct |
33 |
Correct |
555 ms |
1171028 KB |
Output is correct |
34 |
Correct |
523 ms |
1171024 KB |
Output is correct |
35 |
Correct |
500 ms |
1171272 KB |
Output is correct |
36 |
Correct |
537 ms |
1172752 KB |
Output is correct |
37 |
Correct |
558 ms |
1172056 KB |
Output is correct |
38 |
Correct |
510 ms |
1171332 KB |
Output is correct |
39 |
Execution timed out |
2132 ms |
1555824 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
425 ms |
1128604 KB |
Output is correct |
2 |
Correct |
431 ms |
1128616 KB |
Output is correct |
3 |
Correct |
446 ms |
1128612 KB |
Output is correct |
4 |
Correct |
430 ms |
1128604 KB |
Output is correct |
5 |
Correct |
435 ms |
1128988 KB |
Output is correct |
6 |
Correct |
429 ms |
1128600 KB |
Output is correct |
7 |
Correct |
432 ms |
1128632 KB |
Output is correct |
8 |
Correct |
442 ms |
1128548 KB |
Output is correct |
9 |
Correct |
427 ms |
1128784 KB |
Output is correct |
10 |
Correct |
432 ms |
1129008 KB |
Output is correct |
11 |
Correct |
539 ms |
1128788 KB |
Output is correct |
12 |
Correct |
429 ms |
1128784 KB |
Output is correct |
13 |
Correct |
434 ms |
1129044 KB |
Output is correct |
14 |
Correct |
436 ms |
1128792 KB |
Output is correct |
15 |
Correct |
445 ms |
1128884 KB |
Output is correct |
16 |
Correct |
573 ms |
1128892 KB |
Output is correct |
17 |
Correct |
440 ms |
1128732 KB |
Output is correct |
18 |
Correct |
433 ms |
1128484 KB |
Output is correct |
19 |
Correct |
433 ms |
1128836 KB |
Output is correct |
20 |
Correct |
428 ms |
1128496 KB |
Output is correct |
21 |
Correct |
429 ms |
1128784 KB |
Output is correct |
22 |
Correct |
434 ms |
1128772 KB |
Output is correct |
23 |
Correct |
431 ms |
1128840 KB |
Output is correct |
24 |
Correct |
431 ms |
1128724 KB |
Output is correct |
25 |
Correct |
438 ms |
1128516 KB |
Output is correct |
26 |
Correct |
442 ms |
1128644 KB |
Output is correct |
27 |
Correct |
430 ms |
1128596 KB |
Output is correct |
28 |
Correct |
430 ms |
1128788 KB |
Output is correct |
29 |
Correct |
437 ms |
1128548 KB |
Output is correct |
30 |
Correct |
431 ms |
1128888 KB |
Output is correct |
31 |
Correct |
432 ms |
1128788 KB |
Output is correct |
32 |
Correct |
432 ms |
1128788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
436 ms |
1128604 KB |
Output is correct |
2 |
Correct |
427 ms |
1128388 KB |
Output is correct |
3 |
Correct |
431 ms |
1128528 KB |
Output is correct |
4 |
Correct |
428 ms |
1128604 KB |
Output is correct |
5 |
Correct |
426 ms |
1128532 KB |
Output is correct |
6 |
Correct |
435 ms |
1128844 KB |
Output is correct |
7 |
Correct |
427 ms |
1128784 KB |
Output is correct |
8 |
Correct |
432 ms |
1128788 KB |
Output is correct |
9 |
Correct |
437 ms |
1128836 KB |
Output is correct |
10 |
Correct |
440 ms |
1128908 KB |
Output is correct |
11 |
Correct |
428 ms |
1128988 KB |
Output is correct |
12 |
Correct |
439 ms |
1128788 KB |
Output is correct |
13 |
Correct |
441 ms |
1128440 KB |
Output is correct |
14 |
Correct |
449 ms |
1128836 KB |
Output is correct |
15 |
Correct |
445 ms |
1128616 KB |
Output is correct |
16 |
Correct |
445 ms |
1128780 KB |
Output is correct |
17 |
Correct |
441 ms |
1128536 KB |
Output is correct |
18 |
Correct |
436 ms |
1128788 KB |
Output is correct |
19 |
Correct |
440 ms |
1128512 KB |
Output is correct |
20 |
Correct |
437 ms |
1128432 KB |
Output is correct |
21 |
Correct |
428 ms |
1128828 KB |
Output is correct |
22 |
Correct |
442 ms |
1128808 KB |
Output is correct |
23 |
Correct |
446 ms |
1128740 KB |
Output is correct |
24 |
Correct |
446 ms |
1129128 KB |
Output is correct |
25 |
Correct |
489 ms |
1140396 KB |
Output is correct |
26 |
Correct |
483 ms |
1145164 KB |
Output is correct |
27 |
Correct |
489 ms |
1147752 KB |
Output is correct |
28 |
Correct |
488 ms |
1149544 KB |
Output is correct |
29 |
Correct |
519 ms |
1147096 KB |
Output is correct |
30 |
Correct |
482 ms |
1146704 KB |
Output is correct |
31 |
Correct |
498 ms |
1146028 KB |
Output is correct |
32 |
Correct |
471 ms |
1146232 KB |
Output is correct |
33 |
Correct |
466 ms |
1145888 KB |
Output is correct |
34 |
Correct |
519 ms |
1167264 KB |
Output is correct |
35 |
Correct |
535 ms |
1179312 KB |
Output is correct |
36 |
Correct |
551 ms |
1180616 KB |
Output is correct |
37 |
Correct |
540 ms |
1172568 KB |
Output is correct |
38 |
Correct |
562 ms |
1174612 KB |
Output is correct |
39 |
Correct |
840 ms |
1267160 KB |
Output is correct |
40 |
Correct |
1527 ms |
1515824 KB |
Output is correct |
41 |
Correct |
1645 ms |
1617532 KB |
Output is correct |
42 |
Correct |
1931 ms |
1615588 KB |
Output is correct |
43 |
Correct |
1829 ms |
1594516 KB |
Output is correct |
44 |
Correct |
1493 ms |
1572664 KB |
Output is correct |
45 |
Correct |
1752 ms |
1597120 KB |
Output is correct |
46 |
Correct |
1877 ms |
1589972 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
425 ms |
1128604 KB |
Output is correct |
2 |
Correct |
431 ms |
1128616 KB |
Output is correct |
3 |
Correct |
446 ms |
1128612 KB |
Output is correct |
4 |
Correct |
430 ms |
1128604 KB |
Output is correct |
5 |
Correct |
435 ms |
1128988 KB |
Output is correct |
6 |
Correct |
429 ms |
1128600 KB |
Output is correct |
7 |
Correct |
432 ms |
1128632 KB |
Output is correct |
8 |
Correct |
442 ms |
1128548 KB |
Output is correct |
9 |
Correct |
427 ms |
1128784 KB |
Output is correct |
10 |
Correct |
432 ms |
1129008 KB |
Output is correct |
11 |
Correct |
539 ms |
1128788 KB |
Output is correct |
12 |
Correct |
429 ms |
1128784 KB |
Output is correct |
13 |
Correct |
434 ms |
1129044 KB |
Output is correct |
14 |
Correct |
436 ms |
1128792 KB |
Output is correct |
15 |
Correct |
445 ms |
1128884 KB |
Output is correct |
16 |
Correct |
573 ms |
1128892 KB |
Output is correct |
17 |
Correct |
440 ms |
1128732 KB |
Output is correct |
18 |
Correct |
433 ms |
1128484 KB |
Output is correct |
19 |
Correct |
433 ms |
1128836 KB |
Output is correct |
20 |
Correct |
428 ms |
1128496 KB |
Output is correct |
21 |
Correct |
429 ms |
1128784 KB |
Output is correct |
22 |
Correct |
434 ms |
1128772 KB |
Output is correct |
23 |
Correct |
431 ms |
1128840 KB |
Output is correct |
24 |
Correct |
431 ms |
1128724 KB |
Output is correct |
25 |
Correct |
438 ms |
1128516 KB |
Output is correct |
26 |
Correct |
442 ms |
1128644 KB |
Output is correct |
27 |
Correct |
430 ms |
1128596 KB |
Output is correct |
28 |
Correct |
430 ms |
1128788 KB |
Output is correct |
29 |
Correct |
437 ms |
1128548 KB |
Output is correct |
30 |
Correct |
431 ms |
1128888 KB |
Output is correct |
31 |
Correct |
432 ms |
1128788 KB |
Output is correct |
32 |
Correct |
432 ms |
1128788 KB |
Output is correct |
33 |
Correct |
478 ms |
1145532 KB |
Output is correct |
34 |
Correct |
434 ms |
1129252 KB |
Output is correct |
35 |
Correct |
433 ms |
1129780 KB |
Output is correct |
36 |
Correct |
459 ms |
1139572 KB |
Output is correct |
37 |
Correct |
455 ms |
1141680 KB |
Output is correct |
38 |
Correct |
470 ms |
1145172 KB |
Output is correct |
39 |
Correct |
473 ms |
1147728 KB |
Output is correct |
40 |
Correct |
482 ms |
1145980 KB |
Output is correct |
41 |
Correct |
493 ms |
1145404 KB |
Output is correct |
42 |
Correct |
479 ms |
1149552 KB |
Output is correct |
43 |
Correct |
483 ms |
1147232 KB |
Output is correct |
44 |
Correct |
472 ms |
1146744 KB |
Output is correct |
45 |
Correct |
471 ms |
1145524 KB |
Output is correct |
46 |
Correct |
460 ms |
1145588 KB |
Output is correct |
47 |
Correct |
471 ms |
1145680 KB |
Output is correct |
48 |
Correct |
479 ms |
1145988 KB |
Output is correct |
49 |
Correct |
481 ms |
1146104 KB |
Output is correct |
50 |
Correct |
477 ms |
1146084 KB |
Output is correct |
51 |
Correct |
474 ms |
1146484 KB |
Output is correct |
52 |
Correct |
470 ms |
1146196 KB |
Output is correct |
53 |
Correct |
469 ms |
1145984 KB |
Output is correct |
54 |
Correct |
471 ms |
1145424 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
425 ms |
1128604 KB |
Output is correct |
2 |
Correct |
431 ms |
1128616 KB |
Output is correct |
3 |
Correct |
446 ms |
1128612 KB |
Output is correct |
4 |
Correct |
430 ms |
1128604 KB |
Output is correct |
5 |
Correct |
435 ms |
1128988 KB |
Output is correct |
6 |
Correct |
429 ms |
1128600 KB |
Output is correct |
7 |
Correct |
432 ms |
1128632 KB |
Output is correct |
8 |
Correct |
442 ms |
1128548 KB |
Output is correct |
9 |
Correct |
427 ms |
1128784 KB |
Output is correct |
10 |
Correct |
432 ms |
1129008 KB |
Output is correct |
11 |
Correct |
539 ms |
1128788 KB |
Output is correct |
12 |
Correct |
429 ms |
1128784 KB |
Output is correct |
13 |
Correct |
434 ms |
1129044 KB |
Output is correct |
14 |
Correct |
436 ms |
1128792 KB |
Output is correct |
15 |
Correct |
445 ms |
1128884 KB |
Output is correct |
16 |
Correct |
573 ms |
1128892 KB |
Output is correct |
17 |
Correct |
440 ms |
1128732 KB |
Output is correct |
18 |
Correct |
433 ms |
1128484 KB |
Output is correct |
19 |
Correct |
433 ms |
1128836 KB |
Output is correct |
20 |
Correct |
428 ms |
1128496 KB |
Output is correct |
21 |
Correct |
429 ms |
1128784 KB |
Output is correct |
22 |
Correct |
434 ms |
1128772 KB |
Output is correct |
23 |
Correct |
431 ms |
1128840 KB |
Output is correct |
24 |
Correct |
431 ms |
1128724 KB |
Output is correct |
25 |
Correct |
438 ms |
1128516 KB |
Output is correct |
26 |
Correct |
442 ms |
1128644 KB |
Output is correct |
27 |
Correct |
430 ms |
1128596 KB |
Output is correct |
28 |
Correct |
430 ms |
1128788 KB |
Output is correct |
29 |
Correct |
437 ms |
1128548 KB |
Output is correct |
30 |
Correct |
431 ms |
1128888 KB |
Output is correct |
31 |
Correct |
432 ms |
1128788 KB |
Output is correct |
32 |
Correct |
432 ms |
1128788 KB |
Output is correct |
33 |
Correct |
478 ms |
1145532 KB |
Output is correct |
34 |
Correct |
434 ms |
1129252 KB |
Output is correct |
35 |
Correct |
433 ms |
1129780 KB |
Output is correct |
36 |
Correct |
459 ms |
1139572 KB |
Output is correct |
37 |
Correct |
455 ms |
1141680 KB |
Output is correct |
38 |
Correct |
470 ms |
1145172 KB |
Output is correct |
39 |
Correct |
473 ms |
1147728 KB |
Output is correct |
40 |
Correct |
482 ms |
1145980 KB |
Output is correct |
41 |
Correct |
493 ms |
1145404 KB |
Output is correct |
42 |
Correct |
479 ms |
1149552 KB |
Output is correct |
43 |
Correct |
483 ms |
1147232 KB |
Output is correct |
44 |
Correct |
472 ms |
1146744 KB |
Output is correct |
45 |
Correct |
471 ms |
1145524 KB |
Output is correct |
46 |
Correct |
460 ms |
1145588 KB |
Output is correct |
47 |
Correct |
471 ms |
1145680 KB |
Output is correct |
48 |
Correct |
479 ms |
1145988 KB |
Output is correct |
49 |
Correct |
481 ms |
1146104 KB |
Output is correct |
50 |
Correct |
477 ms |
1146084 KB |
Output is correct |
51 |
Correct |
474 ms |
1146484 KB |
Output is correct |
52 |
Correct |
470 ms |
1146196 KB |
Output is correct |
53 |
Correct |
469 ms |
1145984 KB |
Output is correct |
54 |
Correct |
471 ms |
1145424 KB |
Output is correct |
55 |
Correct |
561 ms |
1171280 KB |
Output is correct |
56 |
Correct |
468 ms |
1145936 KB |
Output is correct |
57 |
Correct |
519 ms |
1167312 KB |
Output is correct |
58 |
Correct |
558 ms |
1167744 KB |
Output is correct |
59 |
Correct |
523 ms |
1179316 KB |
Output is correct |
60 |
Correct |
578 ms |
1172092 KB |
Output is correct |
61 |
Correct |
555 ms |
1171084 KB |
Output is correct |
62 |
Correct |
535 ms |
1180688 KB |
Output is correct |
63 |
Correct |
528 ms |
1172748 KB |
Output is correct |
64 |
Correct |
521 ms |
1173092 KB |
Output is correct |
65 |
Correct |
518 ms |
1171104 KB |
Output is correct |
66 |
Correct |
514 ms |
1171016 KB |
Output is correct |
67 |
Correct |
553 ms |
1171360 KB |
Output is correct |
68 |
Correct |
566 ms |
1172076 KB |
Output is correct |
69 |
Correct |
558 ms |
1172304 KB |
Output is correct |
70 |
Correct |
595 ms |
1172388 KB |
Output is correct |
71 |
Correct |
554 ms |
1172816 KB |
Output is correct |
72 |
Correct |
539 ms |
1172564 KB |
Output is correct |
73 |
Correct |
560 ms |
1172560 KB |
Output is correct |
74 |
Correct |
503 ms |
1171028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
432 ms |
1128528 KB |
Output is correct |
2 |
Correct |
435 ms |
1128528 KB |
Output is correct |
3 |
Correct |
427 ms |
1128808 KB |
Output is correct |
4 |
Correct |
537 ms |
1128924 KB |
Output is correct |
5 |
Correct |
436 ms |
1129084 KB |
Output is correct |
6 |
Correct |
429 ms |
1128784 KB |
Output is correct |
7 |
Correct |
431 ms |
1129036 KB |
Output is correct |
8 |
Correct |
430 ms |
1128788 KB |
Output is correct |
9 |
Correct |
432 ms |
1128448 KB |
Output is correct |
10 |
Correct |
441 ms |
1128616 KB |
Output is correct |
11 |
Correct |
431 ms |
1128620 KB |
Output is correct |
12 |
Correct |
431 ms |
1128528 KB |
Output is correct |
13 |
Correct |
426 ms |
1128528 KB |
Output is correct |
14 |
Correct |
437 ms |
1128788 KB |
Output is correct |
15 |
Correct |
427 ms |
1128532 KB |
Output is correct |
16 |
Correct |
434 ms |
1128900 KB |
Output is correct |
17 |
Correct |
432 ms |
1128892 KB |
Output is correct |
18 |
Correct |
440 ms |
1128676 KB |
Output is correct |
19 |
Correct |
478 ms |
1145424 KB |
Output is correct |
20 |
Correct |
449 ms |
1141560 KB |
Output is correct |
21 |
Correct |
471 ms |
1147752 KB |
Output is correct |
22 |
Correct |
480 ms |
1145940 KB |
Output is correct |
23 |
Correct |
492 ms |
1145684 KB |
Output is correct |
24 |
Correct |
461 ms |
1145508 KB |
Output is correct |
25 |
Correct |
458 ms |
1145640 KB |
Output is correct |
26 |
Correct |
469 ms |
1146376 KB |
Output is correct |
27 |
Correct |
464 ms |
1145988 KB |
Output is correct |
28 |
Correct |
482 ms |
1145556 KB |
Output is correct |
29 |
Correct |
582 ms |
1171280 KB |
Output is correct |
30 |
Correct |
470 ms |
1146092 KB |
Output is correct |
31 |
Correct |
527 ms |
1179272 KB |
Output is correct |
32 |
Correct |
569 ms |
1171896 KB |
Output is correct |
33 |
Correct |
555 ms |
1171028 KB |
Output is correct |
34 |
Correct |
523 ms |
1171024 KB |
Output is correct |
35 |
Correct |
500 ms |
1171272 KB |
Output is correct |
36 |
Correct |
537 ms |
1172752 KB |
Output is correct |
37 |
Correct |
558 ms |
1172056 KB |
Output is correct |
38 |
Correct |
510 ms |
1171332 KB |
Output is correct |
39 |
Execution timed out |
2132 ms |
1555824 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
432 ms |
1128528 KB |
Output is correct |
2 |
Correct |
435 ms |
1128528 KB |
Output is correct |
3 |
Correct |
427 ms |
1128808 KB |
Output is correct |
4 |
Correct |
537 ms |
1128924 KB |
Output is correct |
5 |
Correct |
436 ms |
1129084 KB |
Output is correct |
6 |
Correct |
429 ms |
1128784 KB |
Output is correct |
7 |
Correct |
431 ms |
1129036 KB |
Output is correct |
8 |
Correct |
430 ms |
1128788 KB |
Output is correct |
9 |
Correct |
432 ms |
1128448 KB |
Output is correct |
10 |
Correct |
441 ms |
1128616 KB |
Output is correct |
11 |
Correct |
431 ms |
1128620 KB |
Output is correct |
12 |
Correct |
431 ms |
1128528 KB |
Output is correct |
13 |
Correct |
426 ms |
1128528 KB |
Output is correct |
14 |
Correct |
437 ms |
1128788 KB |
Output is correct |
15 |
Correct |
427 ms |
1128532 KB |
Output is correct |
16 |
Correct |
434 ms |
1128900 KB |
Output is correct |
17 |
Correct |
432 ms |
1128892 KB |
Output is correct |
18 |
Correct |
440 ms |
1128676 KB |
Output is correct |
19 |
Correct |
478 ms |
1145424 KB |
Output is correct |
20 |
Correct |
449 ms |
1141560 KB |
Output is correct |
21 |
Correct |
471 ms |
1147752 KB |
Output is correct |
22 |
Correct |
480 ms |
1145940 KB |
Output is correct |
23 |
Correct |
492 ms |
1145684 KB |
Output is correct |
24 |
Correct |
461 ms |
1145508 KB |
Output is correct |
25 |
Correct |
458 ms |
1145640 KB |
Output is correct |
26 |
Correct |
469 ms |
1146376 KB |
Output is correct |
27 |
Correct |
464 ms |
1145988 KB |
Output is correct |
28 |
Correct |
482 ms |
1145556 KB |
Output is correct |
29 |
Correct |
582 ms |
1171280 KB |
Output is correct |
30 |
Correct |
470 ms |
1146092 KB |
Output is correct |
31 |
Correct |
527 ms |
1179272 KB |
Output is correct |
32 |
Correct |
569 ms |
1171896 KB |
Output is correct |
33 |
Correct |
555 ms |
1171028 KB |
Output is correct |
34 |
Correct |
523 ms |
1171024 KB |
Output is correct |
35 |
Correct |
500 ms |
1171272 KB |
Output is correct |
36 |
Correct |
537 ms |
1172752 KB |
Output is correct |
37 |
Correct |
558 ms |
1172056 KB |
Output is correct |
38 |
Correct |
510 ms |
1171332 KB |
Output is correct |
39 |
Execution timed out |
2132 ms |
1555824 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
432 ms |
1128528 KB |
Output is correct |
2 |
Correct |
435 ms |
1128528 KB |
Output is correct |
3 |
Correct |
427 ms |
1128808 KB |
Output is correct |
4 |
Correct |
537 ms |
1128924 KB |
Output is correct |
5 |
Correct |
436 ms |
1129084 KB |
Output is correct |
6 |
Correct |
429 ms |
1128784 KB |
Output is correct |
7 |
Correct |
431 ms |
1129036 KB |
Output is correct |
8 |
Correct |
430 ms |
1128788 KB |
Output is correct |
9 |
Correct |
432 ms |
1128448 KB |
Output is correct |
10 |
Correct |
441 ms |
1128616 KB |
Output is correct |
11 |
Correct |
431 ms |
1128620 KB |
Output is correct |
12 |
Correct |
431 ms |
1128528 KB |
Output is correct |
13 |
Correct |
426 ms |
1128528 KB |
Output is correct |
14 |
Correct |
437 ms |
1128788 KB |
Output is correct |
15 |
Correct |
427 ms |
1128532 KB |
Output is correct |
16 |
Correct |
434 ms |
1128900 KB |
Output is correct |
17 |
Correct |
432 ms |
1128892 KB |
Output is correct |
18 |
Correct |
440 ms |
1128676 KB |
Output is correct |
19 |
Correct |
478 ms |
1145424 KB |
Output is correct |
20 |
Correct |
449 ms |
1141560 KB |
Output is correct |
21 |
Correct |
471 ms |
1147752 KB |
Output is correct |
22 |
Correct |
480 ms |
1145940 KB |
Output is correct |
23 |
Correct |
492 ms |
1145684 KB |
Output is correct |
24 |
Correct |
461 ms |
1145508 KB |
Output is correct |
25 |
Correct |
458 ms |
1145640 KB |
Output is correct |
26 |
Correct |
469 ms |
1146376 KB |
Output is correct |
27 |
Correct |
464 ms |
1145988 KB |
Output is correct |
28 |
Correct |
482 ms |
1145556 KB |
Output is correct |
29 |
Correct |
582 ms |
1171280 KB |
Output is correct |
30 |
Correct |
470 ms |
1146092 KB |
Output is correct |
31 |
Correct |
527 ms |
1179272 KB |
Output is correct |
32 |
Correct |
569 ms |
1171896 KB |
Output is correct |
33 |
Correct |
555 ms |
1171028 KB |
Output is correct |
34 |
Correct |
523 ms |
1171024 KB |
Output is correct |
35 |
Correct |
500 ms |
1171272 KB |
Output is correct |
36 |
Correct |
537 ms |
1172752 KB |
Output is correct |
37 |
Correct |
558 ms |
1172056 KB |
Output is correct |
38 |
Correct |
510 ms |
1171332 KB |
Output is correct |
39 |
Execution timed out |
2132 ms |
1555824 KB |
Time limit exceeded |
40 |
Halted |
0 ms |
0 KB |
- |