#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
const int maxn = 6e6 + 10, block = sqrt(maxn) + 10;
struct cell
{
int x, y;
cell(int _x = 0, int _y = 0)
{
x = _x;
y = _y;
}
cell add(const cell &r) const
{
cell d;
d.x = x + r.x;
d.y = y + r.y;
return d;
}
};
cell neib[4] = {{0, 1}, {1, 0}, {-1, 0}, {0, -1}};
int n, m, h;
vector < int > a[block], tr[block], tl[block];
vector < int > tu[block], td[block];
vector < int > ver_idx[block];
vector < pair < int, bool > > adj[maxn];
int stx, sty, enx, eny;
int nxt;
int visit[maxn], dist[maxn];
void add_edges_row(int row, int i, int j, int ver)
{
if (j - i + 1 == 2 * h - 1)
{
adj[ver].push_back({tr[row][i], 1});
adj[ver].push_back({tl[row][j], 1});
}
else
{
if (i == 1)
adj[ver].push_back({tl[row][j], 1});
else
adj[ver].push_back({tr[row][i], 1});
}
}
void add_edges_col(int col, int i, int j, int ver)
{
if (j - i + 1 == 2 * h - 1)
{
adj[ver].push_back({td[i][col], 1});
adj[ver].push_back({tl[j][col], 1});
}
else
{
if (i == 1)
adj[ver].push_back({td[i][col], 1});
else
adj[ver].push_back({tl[j][col], 1});
}
}
void solve()
{
cin >> n >> m >> h;
cin >> stx >> sty;
cin >> enx >> eny;
for (int i = 1; i <= n; i ++)
{
a[i].resize(m + 2);
tl[i].resize(m + 2);
tr[i].resize(m + 2);
td[i].resize(m + 2);
tu[i].resize(m + 2);
ver_idx[i].resize(m + 2);
for (int j = 1; j <= m; j ++)
{
char c;
cin >> c;
if (c == '.')
a[i][j] = 0;
else
a[i][j] = 1;
}
}
int cnt = 0;
nxt = n * m;
for (int i = 1; i <= n; i ++)
{
for (int j = 1; j <= m; j ++)
{
ver_idx[i][j] = ++ cnt;
}
}
for (int i = 1; i <= n; i ++)
{
for (int j = 1; j <= m; j ++)
{
tr[i][j] = ++ nxt;
tl[i][j] = ++ nxt;
}
for (int j = 1; j <= m; j ++)
{
if (j % (2 * h - 1) != 0 && j != m)
adj[tr[i][j]].push_back({tr[i][j + 1], 0});
adj[tr[i][j]].push_back({ver_idx[i][j], 0});
if ((j - 1) % (2 * h - 1) != 0)
adj[tl[i][j]].push_back({tl[i][j - 1], 0});
adj[tl[i][j]].push_back({ver_idx[i][j], 0});
}
}
for (int j = 1; j <= m; j ++)
{
for (int i = 1; i <= n; i ++)
{
tu[i][j] = ++ nxt;
td[i][j] = ++ nxt;
}
for (int i = 1; i <= n; i ++)
{
if (i % (2 * h - 1) != 0 && i != n)
adj[td[i][j]].push_back({td[i + 1][j], 0});
adj[td[i][j]].push_back({ver_idx[i][j], 0});
if ((i - 1) % (2 * h - 1) != 0)
adj[tu[i][j]].push_back({tu[i - 1][j], 0});
adj[tu[i][j]].push_back({ver_idx[i][j], 0});
}
}
///exit(0);
for (int i = 1; i <= n; i ++)
for (int j = 1; j <= m; j ++)
{
cell cur(i, j);
for (int d = 0; d < 4; d ++)
{
cell nb = cur.add(neib[d]);
if (nb.x > 0 && nb.x <= n && nb.y > 0 && nb.y <= m)
if (a[nb.x][nb.y] == 0)
{
adj[ver_idx[cur.x][cur.y]].push_back({ver_idx[nb.x][nb.y], 0});
}
}
int st_row = max(1, i - h), en_row = min(n, i + h);
int st_col = max(1, j - h), en_col = min(m, j + h);
int fs_row = st_row, ds_row = en_row;
if (fs_row == i - h)
fs_row ++;
if (ds_row == i + h)
ds_row --;
///cout << i << " " << j << " range " << st_row << " " << en_row << endl;
///add_edges(col_root[j], 1, n, fs_row, ds_row, ver_idx[i][j], 1);
/// up row
bool f1 = false, f2 = false;
if (st_row == i - h)
{
if (st_col == j - h)
st_col ++, f1 = true;
if (en_col == j + h)
en_col --, f2 = true;
}
///add_edges(row_root[st_row], 1, m, st_col, en_col, ver_idx[i][j], 1);
add_edges_row(st_row, st_col, en_col, ver_idx[i][j]);
if (st_row == i - h)
{
if (f1)
st_col --;
if (f2)
en_col ++;
}
/// down row
f1 = f2 = false;
if (en_row == i + h)
{
if (st_col == j - h)
st_col ++, f1 = true;
if (en_col == j + h)
en_col --, f2 = true;
}
////cout << i << " " << j << " range " << st_col << " " << en_col << endl;
///add_edges(row_root[en_row], 1, m, st_col, en_col, ver_idx[i][j], 1);
add_edges_row(en_row, st_col, en_col, ver_idx[i][j]);
if (en_row == i + h)
{
if (f1)
st_col --;
if (f2)
en_col ++;
}
/// left col
f1 = f2 = false;
if (st_col == j - h)
{
if (st_row == i - h)
st_row ++, f1 = true;
if (en_row == i + h)
en_row --, f2 = true;
}
///add_edges(col_root[st_col], 1, n, st_row, en_row, ver_idx[i][j], 1);
add_edges_col(st_col, st_row, en_row, ver_idx[i][j]);
if (st_col == j - h)
{
if (f1)
st_row --;
if (f2)
en_row ++;
}
/// right col
f1 = f2 = false;
if (en_col == j + h)
{
if (st_row == i - h)
st_row ++, f1 = true;
if (en_row == i + h)
en_row --, f2 = true;
}
///cout << i << " " << j << " " << "range " << st_row << " " << en_row << " col " << en_col << endl;
///add_edges(col_root[en_col], 1, n, st_row, en_row, ver_idx[i][j], 1);
add_edges_col(en_col, st_row, en_row, ver_idx[i][j]);
if (en_col == j + h)
{
if (f1)
st_row --;
if (f2)
en_row ++;
}
/**for (int row = st_row; row <= en_row; row ++)
{
if (row == i - h || row == i + h)
{
st_col ++, en_col --;
add_edges(row_root[row], 1, m, st_col, en_col, ver_idx[i][j], 1);
st_col --, en_col ++;
}
else
{
adj[ver_idx[cur.x][cur.y]].push_back({fict[row][cur.y], 1});
}
}*/
}
for (int i = 1; i <= nxt; i ++)
dist[i] = 1e9;
deque < int > dq;
dq.push_back(ver_idx[stx][sty]);
dist[ver_idx[stx][sty]] = 0;
while(!dq.empty())
{
int cur = dq.front();
dq.pop_front();
if (cur == ver_idx[enx][eny])
{
cout << dist[cur] << endl;
return;
}
for (pair < int, int > nb : adj[cur])
{
int u = nb.first;
int w = nb.second;
if (dist[u] > dist[cur] + w)
{
dist[u] = dist[cur] + w;
if (w == 0)
dq.push_front(u);
else
dq.push_back(u);
}
}
}
/**for (int i = 1; i <= n; i ++, cout << endl)
for (int j = 1; j <= m; j ++)
cout << dist[ver_idx[i][j]] << " ";*/
int ans = dist[ver_idx[enx][eny]];
for (int i = 1; i <= n; i ++)
for (int j = 1; j <= m; j ++)
{
if (abs(i - enx) <= h && abs(j - eny) <= h)
{
if (abs(i - enx) + abs(j - eny) != 2 * h)
{
ans = min(ans, dist[ver_idx[i][j]] + 1);
}
}
}
cout << ans << endl;
}
int main()
{
speed();
solve();
return 0;
}
/**
3 3 2
1 1
3 3
.#.
##.
...
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
141564 KB |
Output is correct |
2 |
Correct |
58 ms |
141448 KB |
Output is correct |
3 |
Correct |
59 ms |
141716 KB |
Output is correct |
4 |
Correct |
69 ms |
141864 KB |
Output is correct |
5 |
Correct |
61 ms |
141856 KB |
Output is correct |
6 |
Correct |
59 ms |
141680 KB |
Output is correct |
7 |
Correct |
59 ms |
141768 KB |
Output is correct |
8 |
Correct |
59 ms |
141712 KB |
Output is correct |
9 |
Correct |
59 ms |
141536 KB |
Output is correct |
10 |
Correct |
60 ms |
141508 KB |
Output is correct |
11 |
Correct |
59 ms |
141508 KB |
Output is correct |
12 |
Correct |
59 ms |
141552 KB |
Output is correct |
13 |
Correct |
58 ms |
141504 KB |
Output is correct |
14 |
Correct |
63 ms |
141504 KB |
Output is correct |
15 |
Correct |
68 ms |
141488 KB |
Output is correct |
16 |
Correct |
58 ms |
141768 KB |
Output is correct |
17 |
Correct |
64 ms |
141804 KB |
Output is correct |
18 |
Correct |
60 ms |
141732 KB |
Output is correct |
19 |
Correct |
92 ms |
157096 KB |
Output is correct |
20 |
Correct |
78 ms |
152948 KB |
Output is correct |
21 |
Correct |
89 ms |
160104 KB |
Output is correct |
22 |
Correct |
97 ms |
159476 KB |
Output is correct |
23 |
Correct |
95 ms |
156468 KB |
Output is correct |
24 |
Correct |
96 ms |
156256 KB |
Output is correct |
25 |
Correct |
81 ms |
156264 KB |
Output is correct |
26 |
Correct |
89 ms |
159988 KB |
Output is correct |
27 |
Correct |
88 ms |
159596 KB |
Output is correct |
28 |
Correct |
86 ms |
156564 KB |
Output is correct |
29 |
Correct |
160 ms |
180548 KB |
Output is correct |
30 |
Correct |
90 ms |
158032 KB |
Output is correct |
31 |
Correct |
133 ms |
188224 KB |
Output is correct |
32 |
Correct |
177 ms |
186668 KB |
Output is correct |
33 |
Correct |
152 ms |
178800 KB |
Output is correct |
34 |
Correct |
115 ms |
178468 KB |
Output is correct |
35 |
Correct |
111 ms |
178504 KB |
Output is correct |
36 |
Correct |
147 ms |
187428 KB |
Output is correct |
37 |
Correct |
151 ms |
186712 KB |
Output is correct |
38 |
Correct |
124 ms |
179024 KB |
Output is correct |
39 |
Runtime error |
564 ms |
644392 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
60 ms |
141544 KB |
Output is correct |
2 |
Correct |
59 ms |
141476 KB |
Output is correct |
3 |
Correct |
60 ms |
141500 KB |
Output is correct |
4 |
Correct |
58 ms |
141544 KB |
Output is correct |
5 |
Correct |
62 ms |
141772 KB |
Output is correct |
6 |
Correct |
61 ms |
141504 KB |
Output is correct |
7 |
Correct |
60 ms |
141508 KB |
Output is correct |
8 |
Correct |
67 ms |
141560 KB |
Output is correct |
9 |
Correct |
59 ms |
141828 KB |
Output is correct |
10 |
Correct |
60 ms |
141852 KB |
Output is correct |
11 |
Correct |
66 ms |
141836 KB |
Output is correct |
12 |
Correct |
60 ms |
141732 KB |
Output is correct |
13 |
Correct |
60 ms |
141772 KB |
Output is correct |
14 |
Correct |
59 ms |
141692 KB |
Output is correct |
15 |
Correct |
60 ms |
141724 KB |
Output is correct |
16 |
Correct |
61 ms |
141748 KB |
Output is correct |
17 |
Correct |
70 ms |
141748 KB |
Output is correct |
18 |
Correct |
60 ms |
141468 KB |
Output is correct |
19 |
Correct |
60 ms |
141628 KB |
Output is correct |
20 |
Correct |
59 ms |
141500 KB |
Output is correct |
21 |
Correct |
59 ms |
141556 KB |
Output is correct |
22 |
Correct |
59 ms |
141692 KB |
Output is correct |
23 |
Correct |
60 ms |
141484 KB |
Output is correct |
24 |
Correct |
64 ms |
141676 KB |
Output is correct |
25 |
Correct |
59 ms |
141472 KB |
Output is correct |
26 |
Correct |
60 ms |
141568 KB |
Output is correct |
27 |
Correct |
59 ms |
141524 KB |
Output is correct |
28 |
Correct |
59 ms |
141644 KB |
Output is correct |
29 |
Correct |
59 ms |
141564 KB |
Output is correct |
30 |
Correct |
59 ms |
141852 KB |
Output is correct |
31 |
Correct |
60 ms |
141776 KB |
Output is correct |
32 |
Correct |
66 ms |
141772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
141540 KB |
Output is correct |
2 |
Correct |
59 ms |
141480 KB |
Output is correct |
3 |
Correct |
58 ms |
141516 KB |
Output is correct |
4 |
Correct |
58 ms |
141492 KB |
Output is correct |
5 |
Correct |
60 ms |
141520 KB |
Output is correct |
6 |
Correct |
64 ms |
141536 KB |
Output is correct |
7 |
Correct |
61 ms |
141868 KB |
Output is correct |
8 |
Correct |
60 ms |
141812 KB |
Output is correct |
9 |
Correct |
59 ms |
141792 KB |
Output is correct |
10 |
Correct |
61 ms |
141684 KB |
Output is correct |
11 |
Correct |
60 ms |
141780 KB |
Output is correct |
12 |
Correct |
60 ms |
141772 KB |
Output is correct |
13 |
Correct |
65 ms |
141552 KB |
Output is correct |
14 |
Correct |
65 ms |
141728 KB |
Output is correct |
15 |
Correct |
60 ms |
141544 KB |
Output is correct |
16 |
Correct |
60 ms |
141648 KB |
Output is correct |
17 |
Correct |
61 ms |
141524 KB |
Output is correct |
18 |
Correct |
59 ms |
141500 KB |
Output is correct |
19 |
Correct |
63 ms |
141552 KB |
Output is correct |
20 |
Correct |
60 ms |
141516 KB |
Output is correct |
21 |
Correct |
61 ms |
141644 KB |
Output is correct |
22 |
Correct |
60 ms |
141776 KB |
Output is correct |
23 |
Correct |
59 ms |
141772 KB |
Output is correct |
24 |
Correct |
60 ms |
141984 KB |
Output is correct |
25 |
Correct |
83 ms |
152584 KB |
Output is correct |
26 |
Correct |
95 ms |
158340 KB |
Output is correct |
27 |
Correct |
86 ms |
160076 KB |
Output is correct |
28 |
Correct |
90 ms |
156356 KB |
Output is correct |
29 |
Correct |
91 ms |
156096 KB |
Output is correct |
30 |
Correct |
88 ms |
154448 KB |
Output is correct |
31 |
Correct |
96 ms |
156132 KB |
Output is correct |
32 |
Correct |
89 ms |
160028 KB |
Output is correct |
33 |
Correct |
91 ms |
159560 KB |
Output is correct |
34 |
Correct |
138 ms |
176060 KB |
Output is correct |
35 |
Correct |
128 ms |
188152 KB |
Output is correct |
36 |
Correct |
142 ms |
178660 KB |
Output is correct |
37 |
Correct |
139 ms |
177912 KB |
Output is correct |
38 |
Correct |
126 ms |
173976 KB |
Output is correct |
39 |
Correct |
315 ms |
274420 KB |
Output is correct |
40 |
Runtime error |
611 ms |
647668 KB |
Execution killed with signal 11 |
41 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
60 ms |
141544 KB |
Output is correct |
2 |
Correct |
59 ms |
141476 KB |
Output is correct |
3 |
Correct |
60 ms |
141500 KB |
Output is correct |
4 |
Correct |
58 ms |
141544 KB |
Output is correct |
5 |
Correct |
62 ms |
141772 KB |
Output is correct |
6 |
Correct |
61 ms |
141504 KB |
Output is correct |
7 |
Correct |
60 ms |
141508 KB |
Output is correct |
8 |
Correct |
67 ms |
141560 KB |
Output is correct |
9 |
Correct |
59 ms |
141828 KB |
Output is correct |
10 |
Correct |
60 ms |
141852 KB |
Output is correct |
11 |
Correct |
66 ms |
141836 KB |
Output is correct |
12 |
Correct |
60 ms |
141732 KB |
Output is correct |
13 |
Correct |
60 ms |
141772 KB |
Output is correct |
14 |
Correct |
59 ms |
141692 KB |
Output is correct |
15 |
Correct |
60 ms |
141724 KB |
Output is correct |
16 |
Correct |
61 ms |
141748 KB |
Output is correct |
17 |
Correct |
70 ms |
141748 KB |
Output is correct |
18 |
Correct |
60 ms |
141468 KB |
Output is correct |
19 |
Correct |
60 ms |
141628 KB |
Output is correct |
20 |
Correct |
59 ms |
141500 KB |
Output is correct |
21 |
Correct |
59 ms |
141556 KB |
Output is correct |
22 |
Correct |
59 ms |
141692 KB |
Output is correct |
23 |
Correct |
60 ms |
141484 KB |
Output is correct |
24 |
Correct |
64 ms |
141676 KB |
Output is correct |
25 |
Correct |
59 ms |
141472 KB |
Output is correct |
26 |
Correct |
60 ms |
141568 KB |
Output is correct |
27 |
Correct |
59 ms |
141524 KB |
Output is correct |
28 |
Correct |
59 ms |
141644 KB |
Output is correct |
29 |
Correct |
59 ms |
141564 KB |
Output is correct |
30 |
Correct |
59 ms |
141852 KB |
Output is correct |
31 |
Correct |
60 ms |
141776 KB |
Output is correct |
32 |
Correct |
66 ms |
141772 KB |
Output is correct |
33 |
Correct |
93 ms |
157076 KB |
Output is correct |
34 |
Correct |
59 ms |
141996 KB |
Output is correct |
35 |
Correct |
61 ms |
142540 KB |
Output is correct |
36 |
Correct |
81 ms |
152652 KB |
Output is correct |
37 |
Correct |
75 ms |
152896 KB |
Output is correct |
38 |
Correct |
92 ms |
158260 KB |
Output is correct |
39 |
Correct |
87 ms |
160036 KB |
Output is correct |
40 |
Correct |
94 ms |
159496 KB |
Output is correct |
41 |
Correct |
106 ms |
156456 KB |
Output is correct |
42 |
Correct |
102 ms |
156396 KB |
Output is correct |
43 |
Correct |
95 ms |
156000 KB |
Output is correct |
44 |
Correct |
90 ms |
154540 KB |
Output is correct |
45 |
Correct |
81 ms |
156360 KB |
Output is correct |
46 |
Correct |
92 ms |
156380 KB |
Output is correct |
47 |
Correct |
101 ms |
155876 KB |
Output is correct |
48 |
Correct |
94 ms |
156052 KB |
Output is correct |
49 |
Correct |
101 ms |
156112 KB |
Output is correct |
50 |
Correct |
96 ms |
155988 KB |
Output is correct |
51 |
Correct |
95 ms |
156084 KB |
Output is correct |
52 |
Correct |
89 ms |
159908 KB |
Output is correct |
53 |
Correct |
89 ms |
159620 KB |
Output is correct |
54 |
Correct |
89 ms |
156596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
60 ms |
141544 KB |
Output is correct |
2 |
Correct |
59 ms |
141476 KB |
Output is correct |
3 |
Correct |
60 ms |
141500 KB |
Output is correct |
4 |
Correct |
58 ms |
141544 KB |
Output is correct |
5 |
Correct |
62 ms |
141772 KB |
Output is correct |
6 |
Correct |
61 ms |
141504 KB |
Output is correct |
7 |
Correct |
60 ms |
141508 KB |
Output is correct |
8 |
Correct |
67 ms |
141560 KB |
Output is correct |
9 |
Correct |
59 ms |
141828 KB |
Output is correct |
10 |
Correct |
60 ms |
141852 KB |
Output is correct |
11 |
Correct |
66 ms |
141836 KB |
Output is correct |
12 |
Correct |
60 ms |
141732 KB |
Output is correct |
13 |
Correct |
60 ms |
141772 KB |
Output is correct |
14 |
Correct |
59 ms |
141692 KB |
Output is correct |
15 |
Correct |
60 ms |
141724 KB |
Output is correct |
16 |
Correct |
61 ms |
141748 KB |
Output is correct |
17 |
Correct |
70 ms |
141748 KB |
Output is correct |
18 |
Correct |
60 ms |
141468 KB |
Output is correct |
19 |
Correct |
60 ms |
141628 KB |
Output is correct |
20 |
Correct |
59 ms |
141500 KB |
Output is correct |
21 |
Correct |
59 ms |
141556 KB |
Output is correct |
22 |
Correct |
59 ms |
141692 KB |
Output is correct |
23 |
Correct |
60 ms |
141484 KB |
Output is correct |
24 |
Correct |
64 ms |
141676 KB |
Output is correct |
25 |
Correct |
59 ms |
141472 KB |
Output is correct |
26 |
Correct |
60 ms |
141568 KB |
Output is correct |
27 |
Correct |
59 ms |
141524 KB |
Output is correct |
28 |
Correct |
59 ms |
141644 KB |
Output is correct |
29 |
Correct |
59 ms |
141564 KB |
Output is correct |
30 |
Correct |
59 ms |
141852 KB |
Output is correct |
31 |
Correct |
60 ms |
141776 KB |
Output is correct |
32 |
Correct |
66 ms |
141772 KB |
Output is correct |
33 |
Correct |
93 ms |
157076 KB |
Output is correct |
34 |
Correct |
59 ms |
141996 KB |
Output is correct |
35 |
Correct |
61 ms |
142540 KB |
Output is correct |
36 |
Correct |
81 ms |
152652 KB |
Output is correct |
37 |
Correct |
75 ms |
152896 KB |
Output is correct |
38 |
Correct |
92 ms |
158260 KB |
Output is correct |
39 |
Correct |
87 ms |
160036 KB |
Output is correct |
40 |
Correct |
94 ms |
159496 KB |
Output is correct |
41 |
Correct |
106 ms |
156456 KB |
Output is correct |
42 |
Correct |
102 ms |
156396 KB |
Output is correct |
43 |
Correct |
95 ms |
156000 KB |
Output is correct |
44 |
Correct |
90 ms |
154540 KB |
Output is correct |
45 |
Correct |
81 ms |
156360 KB |
Output is correct |
46 |
Correct |
92 ms |
156380 KB |
Output is correct |
47 |
Correct |
101 ms |
155876 KB |
Output is correct |
48 |
Correct |
94 ms |
156052 KB |
Output is correct |
49 |
Correct |
101 ms |
156112 KB |
Output is correct |
50 |
Correct |
96 ms |
155988 KB |
Output is correct |
51 |
Correct |
95 ms |
156084 KB |
Output is correct |
52 |
Correct |
89 ms |
159908 KB |
Output is correct |
53 |
Correct |
89 ms |
159620 KB |
Output is correct |
54 |
Correct |
89 ms |
156596 KB |
Output is correct |
55 |
Correct |
152 ms |
180556 KB |
Output is correct |
56 |
Correct |
98 ms |
158032 KB |
Output is correct |
57 |
Correct |
132 ms |
175948 KB |
Output is correct |
58 |
Incorrect |
151 ms |
179336 KB |
Output isn't correct |
59 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
141564 KB |
Output is correct |
2 |
Correct |
58 ms |
141448 KB |
Output is correct |
3 |
Correct |
59 ms |
141716 KB |
Output is correct |
4 |
Correct |
69 ms |
141864 KB |
Output is correct |
5 |
Correct |
61 ms |
141856 KB |
Output is correct |
6 |
Correct |
59 ms |
141680 KB |
Output is correct |
7 |
Correct |
59 ms |
141768 KB |
Output is correct |
8 |
Correct |
59 ms |
141712 KB |
Output is correct |
9 |
Correct |
59 ms |
141536 KB |
Output is correct |
10 |
Correct |
60 ms |
141508 KB |
Output is correct |
11 |
Correct |
59 ms |
141508 KB |
Output is correct |
12 |
Correct |
59 ms |
141552 KB |
Output is correct |
13 |
Correct |
58 ms |
141504 KB |
Output is correct |
14 |
Correct |
63 ms |
141504 KB |
Output is correct |
15 |
Correct |
68 ms |
141488 KB |
Output is correct |
16 |
Correct |
58 ms |
141768 KB |
Output is correct |
17 |
Correct |
64 ms |
141804 KB |
Output is correct |
18 |
Correct |
60 ms |
141732 KB |
Output is correct |
19 |
Correct |
92 ms |
157096 KB |
Output is correct |
20 |
Correct |
78 ms |
152948 KB |
Output is correct |
21 |
Correct |
89 ms |
160104 KB |
Output is correct |
22 |
Correct |
97 ms |
159476 KB |
Output is correct |
23 |
Correct |
95 ms |
156468 KB |
Output is correct |
24 |
Correct |
96 ms |
156256 KB |
Output is correct |
25 |
Correct |
81 ms |
156264 KB |
Output is correct |
26 |
Correct |
89 ms |
159988 KB |
Output is correct |
27 |
Correct |
88 ms |
159596 KB |
Output is correct |
28 |
Correct |
86 ms |
156564 KB |
Output is correct |
29 |
Correct |
160 ms |
180548 KB |
Output is correct |
30 |
Correct |
90 ms |
158032 KB |
Output is correct |
31 |
Correct |
133 ms |
188224 KB |
Output is correct |
32 |
Correct |
177 ms |
186668 KB |
Output is correct |
33 |
Correct |
152 ms |
178800 KB |
Output is correct |
34 |
Correct |
115 ms |
178468 KB |
Output is correct |
35 |
Correct |
111 ms |
178504 KB |
Output is correct |
36 |
Correct |
147 ms |
187428 KB |
Output is correct |
37 |
Correct |
151 ms |
186712 KB |
Output is correct |
38 |
Correct |
124 ms |
179024 KB |
Output is correct |
39 |
Runtime error |
564 ms |
644392 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
141564 KB |
Output is correct |
2 |
Correct |
58 ms |
141448 KB |
Output is correct |
3 |
Correct |
59 ms |
141716 KB |
Output is correct |
4 |
Correct |
69 ms |
141864 KB |
Output is correct |
5 |
Correct |
61 ms |
141856 KB |
Output is correct |
6 |
Correct |
59 ms |
141680 KB |
Output is correct |
7 |
Correct |
59 ms |
141768 KB |
Output is correct |
8 |
Correct |
59 ms |
141712 KB |
Output is correct |
9 |
Correct |
59 ms |
141536 KB |
Output is correct |
10 |
Correct |
60 ms |
141508 KB |
Output is correct |
11 |
Correct |
59 ms |
141508 KB |
Output is correct |
12 |
Correct |
59 ms |
141552 KB |
Output is correct |
13 |
Correct |
58 ms |
141504 KB |
Output is correct |
14 |
Correct |
63 ms |
141504 KB |
Output is correct |
15 |
Correct |
68 ms |
141488 KB |
Output is correct |
16 |
Correct |
58 ms |
141768 KB |
Output is correct |
17 |
Correct |
64 ms |
141804 KB |
Output is correct |
18 |
Correct |
60 ms |
141732 KB |
Output is correct |
19 |
Correct |
92 ms |
157096 KB |
Output is correct |
20 |
Correct |
78 ms |
152948 KB |
Output is correct |
21 |
Correct |
89 ms |
160104 KB |
Output is correct |
22 |
Correct |
97 ms |
159476 KB |
Output is correct |
23 |
Correct |
95 ms |
156468 KB |
Output is correct |
24 |
Correct |
96 ms |
156256 KB |
Output is correct |
25 |
Correct |
81 ms |
156264 KB |
Output is correct |
26 |
Correct |
89 ms |
159988 KB |
Output is correct |
27 |
Correct |
88 ms |
159596 KB |
Output is correct |
28 |
Correct |
86 ms |
156564 KB |
Output is correct |
29 |
Correct |
160 ms |
180548 KB |
Output is correct |
30 |
Correct |
90 ms |
158032 KB |
Output is correct |
31 |
Correct |
133 ms |
188224 KB |
Output is correct |
32 |
Correct |
177 ms |
186668 KB |
Output is correct |
33 |
Correct |
152 ms |
178800 KB |
Output is correct |
34 |
Correct |
115 ms |
178468 KB |
Output is correct |
35 |
Correct |
111 ms |
178504 KB |
Output is correct |
36 |
Correct |
147 ms |
187428 KB |
Output is correct |
37 |
Correct |
151 ms |
186712 KB |
Output is correct |
38 |
Correct |
124 ms |
179024 KB |
Output is correct |
39 |
Runtime error |
564 ms |
644392 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
141564 KB |
Output is correct |
2 |
Correct |
58 ms |
141448 KB |
Output is correct |
3 |
Correct |
59 ms |
141716 KB |
Output is correct |
4 |
Correct |
69 ms |
141864 KB |
Output is correct |
5 |
Correct |
61 ms |
141856 KB |
Output is correct |
6 |
Correct |
59 ms |
141680 KB |
Output is correct |
7 |
Correct |
59 ms |
141768 KB |
Output is correct |
8 |
Correct |
59 ms |
141712 KB |
Output is correct |
9 |
Correct |
59 ms |
141536 KB |
Output is correct |
10 |
Correct |
60 ms |
141508 KB |
Output is correct |
11 |
Correct |
59 ms |
141508 KB |
Output is correct |
12 |
Correct |
59 ms |
141552 KB |
Output is correct |
13 |
Correct |
58 ms |
141504 KB |
Output is correct |
14 |
Correct |
63 ms |
141504 KB |
Output is correct |
15 |
Correct |
68 ms |
141488 KB |
Output is correct |
16 |
Correct |
58 ms |
141768 KB |
Output is correct |
17 |
Correct |
64 ms |
141804 KB |
Output is correct |
18 |
Correct |
60 ms |
141732 KB |
Output is correct |
19 |
Correct |
92 ms |
157096 KB |
Output is correct |
20 |
Correct |
78 ms |
152948 KB |
Output is correct |
21 |
Correct |
89 ms |
160104 KB |
Output is correct |
22 |
Correct |
97 ms |
159476 KB |
Output is correct |
23 |
Correct |
95 ms |
156468 KB |
Output is correct |
24 |
Correct |
96 ms |
156256 KB |
Output is correct |
25 |
Correct |
81 ms |
156264 KB |
Output is correct |
26 |
Correct |
89 ms |
159988 KB |
Output is correct |
27 |
Correct |
88 ms |
159596 KB |
Output is correct |
28 |
Correct |
86 ms |
156564 KB |
Output is correct |
29 |
Correct |
160 ms |
180548 KB |
Output is correct |
30 |
Correct |
90 ms |
158032 KB |
Output is correct |
31 |
Correct |
133 ms |
188224 KB |
Output is correct |
32 |
Correct |
177 ms |
186668 KB |
Output is correct |
33 |
Correct |
152 ms |
178800 KB |
Output is correct |
34 |
Correct |
115 ms |
178468 KB |
Output is correct |
35 |
Correct |
111 ms |
178504 KB |
Output is correct |
36 |
Correct |
147 ms |
187428 KB |
Output is correct |
37 |
Correct |
151 ms |
186712 KB |
Output is correct |
38 |
Correct |
124 ms |
179024 KB |
Output is correct |
39 |
Runtime error |
564 ms |
644392 KB |
Execution killed with signal 11 |
40 |
Halted |
0 ms |
0 KB |
- |