#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int w, h, k, l;
cin >> w >> h >> k >> l;
int xh, yh, xv, yv;
cin >> yh >> xh >> yv >> xv;
vector<string> s(h);
for (int i = 0; i < h; i++) {
cin >> s[i];
}
int fx, fy;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (s[i][j] == '*') {
fx = i;
fy = j;
}
}
}
vector<vector<int>> cnt(h, vector<int>(w));
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
cnt[i][j] = (s[i][j] == 'X' ? 1 : 0);
if (i > 0) {
cnt[i][j] += cnt[i - 1][j];
}
if (j > 0) {
cnt[i][j] += cnt[i][j - 1];
}
if (i > 0 && j > 0) {
cnt[i][j] -= cnt[i - 1][j - 1];
}
}
}
auto GetSum = [&](int x1, int y1, int x2, int y2) {
int s = cnt[x2][y2];
if (x1 > 0) {
s -= cnt[x1 - 1][y2];
}
if (y1 > 0) {
s -= cnt[x2][y1 - 1];
}
if (x1 > 0 && y1 > 0) {
s += cnt[x1 - 1][y1 - 1];
}
return s;
};
vector<vector<bool>> ch(h, vector<bool>(w));
vector<vector<bool>> cv(h, vector<bool>(w));
auto Valid = [&](int x, int y) {
return 0 <= x && x < h && 0 <= y && y < w && s[x][y] != 'X';
};
vector<vector<int>> U(h, vector<int>(w));
vector<vector<int>> D(h, vector<int>(w));
vector<vector<int>> L(h, vector<int>(w));
vector<vector<int>> R(h, vector<int>(w));
for (int x = 0; x < h; x++) {
for (int y = 0; y < w; y++) {
if (s[x][y] == 'X') {
U[x][y] = D[x][y] = L[x][y] = R[x][y] = -1;
continue;
}
{
U[x][y] = (int) 1e9;
int low = max(0, x - l + 1), high = min(x, h - l);
while (low <= high) {
int mid = (low + high) >> 1;
if (GetSum(mid, y, x, y) == 0) {
U[x][y] = mid;
high = mid - 1;
} else {
low = mid + 1;
}
}
}
{
D[x][y] = -1;
int low = U[x][y], high = min(x, h - l);
while (low <= high) {
int mid = (low + high) >> 1;
if (GetSum(mid, y, mid + l - 1, y) == 0) {
D[x][y] = mid;
low = mid + 1;
} else {
high = mid - 1;
}
}
}
{
L[x][y] = (int) 1e9;
int low = max(0, y - k + 1), high = min(y, w - k);
while (low <= high) {
int mid = (low + high) >> 1;
if (GetSum(x, mid, x, y) == 0) {
L[x][y] = mid;
high = mid - 1;
} else {
low = mid + 1;
}
}
}
{
R[x][y] = -1;
int low = L[x][y], high = min(y, w - k);
while (low <= high) {
int mid = (low + high) >> 1;
if (GetSum(x, mid, x, mid + k - 1) == 0) {
R[x][y] = mid;
low = mid + 1;
} else {
high = mid - 1;
}
}
}
if (U[x][y] > D[x][y] || L[x][y] > R[x][y]) {
U[x][y] = D[x][y] = L[x][y] = R[x][y] = -1;
continue;
}
if (!Valid(U[x][y], y) || !Valid(U[x][y] + l - 1, y) || GetSum(U[x][y], y, U[x][y] + l - 1, y) > 0) {
U[x][y] = D[x][y] = L[x][y] = R[x][y] = -1;
}
if (!Valid(x, L[x][y]) || !Valid(x, L[x][y] + k - 1) || GetSum(x, L[x][y], x, L[x][y] + k - 1) > 0) {
U[x][y] = D[x][y] = L[x][y] = R[x][y] = -1;
}
}
}
auto Inter = [&](int l1, int r1, int l2, int r2) {
return max(l1, l2) <= min(r1, r2);
};
int sx = xh, sy = yv;
vector<vector<bool>> f(h, vector<bool>(w));
f[sx][sy] = true;
vector<pair<int, int>> que;
que.emplace_back(sx, sy);
for (int b = 0; b < (int) que.size(); b++) {
int x = que[b].first;
int y = que[b].second;
for (int d = 0; d < 4; d++) {
int nx = x + dx[d];
int ny = y + dy[d];
if (!Valid(nx, ny)) {
continue;
}
if (d == 0) {
if (D[x][y] == x - l + 1 || !Inter(L[x][y], R[x][y], L[nx][ny], R[nx][ny])) {
continue;
}
}
if (d == 1) {
if (R[x][y] == y - k + 1 || !Inter(U[x][y], D[x][y], U[nx][ny], D[nx][ny])) {
continue;
}
}
if (d == 2) {
if (U[x][y] == x || !Inter(L[x][y], R[x][y], L[nx][ny], R[nx][ny])) {
continue;
}
}
if (d == 3) {
if (L[x][y] == y || !Inter(U[x][y], D[x][y], U[nx][ny], D[nx][ny])) {
continue;
}
}
if (Valid(nx, ny) && !f[nx][ny]) {
f[nx][ny] = true;
que.emplace_back(nx, ny);
}
}
}
cout << (f[fx][fy] ? "YES" : "NO") << '\n';
return 0;
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:178:16: warning: 'fx' may be used uninitialized in this function [-Wmaybe-uninitialized]
178 | cout << (f[fx][fy] ? "YES" : "NO") << '\n';
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
424 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
576 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
456 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
360 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
424 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
576 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
456 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
360 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
604 KB |
Output is correct |
64 |
Correct |
1 ms |
600 KB |
Output is correct |
65 |
Correct |
1 ms |
604 KB |
Output is correct |
66 |
Correct |
2 ms |
600 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
600 KB |
Output is correct |
70 |
Correct |
2 ms |
600 KB |
Output is correct |
71 |
Correct |
1 ms |
856 KB |
Output is correct |
72 |
Correct |
1 ms |
604 KB |
Output is correct |
73 |
Correct |
1 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
600 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
1 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
600 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
1 ms |
604 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
856 KB |
Output is correct |
87 |
Correct |
1 ms |
604 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
7 ms |
3796 KB |
Output is correct |
5 |
Correct |
9 ms |
3544 KB |
Output is correct |
6 |
Correct |
1 ms |
860 KB |
Output is correct |
7 |
Correct |
8 ms |
3660 KB |
Output is correct |
8 |
Correct |
10 ms |
3540 KB |
Output is correct |
9 |
Correct |
3 ms |
992 KB |
Output is correct |
10 |
Correct |
7 ms |
2396 KB |
Output is correct |
11 |
Correct |
8 ms |
2392 KB |
Output is correct |
12 |
Correct |
2 ms |
1116 KB |
Output is correct |
13 |
Correct |
4 ms |
2348 KB |
Output is correct |
14 |
Correct |
4 ms |
2396 KB |
Output is correct |
15 |
Correct |
9 ms |
3472 KB |
Output is correct |
16 |
Correct |
7 ms |
3284 KB |
Output is correct |
17 |
Correct |
6 ms |
3284 KB |
Output is correct |
18 |
Correct |
10 ms |
3544 KB |
Output is correct |
19 |
Correct |
9 ms |
3544 KB |
Output is correct |
20 |
Correct |
10 ms |
3544 KB |
Output is correct |
21 |
Correct |
12 ms |
3540 KB |
Output is correct |
22 |
Correct |
7 ms |
3544 KB |
Output is correct |
23 |
Correct |
7 ms |
3544 KB |
Output is correct |
24 |
Correct |
7 ms |
3544 KB |
Output is correct |
25 |
Correct |
8 ms |
3540 KB |
Output is correct |
26 |
Correct |
8 ms |
3544 KB |
Output is correct |
27 |
Correct |
9 ms |
3544 KB |
Output is correct |
28 |
Correct |
7 ms |
3544 KB |
Output is correct |
29 |
Correct |
9 ms |
3544 KB |
Output is correct |
30 |
Correct |
8 ms |
3536 KB |
Output is correct |
31 |
Correct |
9 ms |
3292 KB |
Output is correct |
32 |
Correct |
7 ms |
3392 KB |
Output is correct |
33 |
Correct |
7 ms |
3280 KB |
Output is correct |
34 |
Correct |
7 ms |
3396 KB |
Output is correct |
35 |
Correct |
6 ms |
3292 KB |
Output is correct |
36 |
Correct |
3 ms |
2140 KB |
Output is correct |
37 |
Correct |
5 ms |
2764 KB |
Output is correct |
38 |
Correct |
5 ms |
2652 KB |
Output is correct |
39 |
Correct |
5 ms |
2652 KB |
Output is correct |
40 |
Correct |
6 ms |
2648 KB |
Output is correct |
41 |
Correct |
5 ms |
2652 KB |
Output is correct |
42 |
Correct |
7 ms |
3612 KB |
Output is correct |
43 |
Correct |
11 ms |
3452 KB |
Output is correct |
44 |
Correct |
7 ms |
3540 KB |
Output is correct |
45 |
Correct |
9 ms |
3544 KB |
Output is correct |
46 |
Correct |
3 ms |
2140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
424 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
576 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
456 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
360 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
604 KB |
Output is correct |
64 |
Correct |
1 ms |
600 KB |
Output is correct |
65 |
Correct |
1 ms |
604 KB |
Output is correct |
66 |
Correct |
2 ms |
600 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
600 KB |
Output is correct |
70 |
Correct |
2 ms |
600 KB |
Output is correct |
71 |
Correct |
1 ms |
856 KB |
Output is correct |
72 |
Correct |
1 ms |
604 KB |
Output is correct |
73 |
Correct |
1 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
600 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
1 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
600 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
1 ms |
604 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
856 KB |
Output is correct |
87 |
Correct |
1 ms |
604 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
91 |
Correct |
1 ms |
348 KB |
Output is correct |
92 |
Correct |
7 ms |
3796 KB |
Output is correct |
93 |
Correct |
9 ms |
3544 KB |
Output is correct |
94 |
Correct |
1 ms |
860 KB |
Output is correct |
95 |
Correct |
8 ms |
3660 KB |
Output is correct |
96 |
Correct |
10 ms |
3540 KB |
Output is correct |
97 |
Correct |
3 ms |
992 KB |
Output is correct |
98 |
Correct |
7 ms |
2396 KB |
Output is correct |
99 |
Correct |
8 ms |
2392 KB |
Output is correct |
100 |
Correct |
2 ms |
1116 KB |
Output is correct |
101 |
Correct |
4 ms |
2348 KB |
Output is correct |
102 |
Correct |
4 ms |
2396 KB |
Output is correct |
103 |
Correct |
9 ms |
3472 KB |
Output is correct |
104 |
Correct |
7 ms |
3284 KB |
Output is correct |
105 |
Correct |
6 ms |
3284 KB |
Output is correct |
106 |
Correct |
10 ms |
3544 KB |
Output is correct |
107 |
Correct |
9 ms |
3544 KB |
Output is correct |
108 |
Correct |
10 ms |
3544 KB |
Output is correct |
109 |
Correct |
12 ms |
3540 KB |
Output is correct |
110 |
Correct |
7 ms |
3544 KB |
Output is correct |
111 |
Correct |
7 ms |
3544 KB |
Output is correct |
112 |
Correct |
7 ms |
3544 KB |
Output is correct |
113 |
Correct |
8 ms |
3540 KB |
Output is correct |
114 |
Correct |
8 ms |
3544 KB |
Output is correct |
115 |
Correct |
9 ms |
3544 KB |
Output is correct |
116 |
Correct |
7 ms |
3544 KB |
Output is correct |
117 |
Correct |
9 ms |
3544 KB |
Output is correct |
118 |
Correct |
8 ms |
3536 KB |
Output is correct |
119 |
Correct |
9 ms |
3292 KB |
Output is correct |
120 |
Correct |
7 ms |
3392 KB |
Output is correct |
121 |
Correct |
7 ms |
3280 KB |
Output is correct |
122 |
Correct |
7 ms |
3396 KB |
Output is correct |
123 |
Correct |
6 ms |
3292 KB |
Output is correct |
124 |
Correct |
3 ms |
2140 KB |
Output is correct |
125 |
Correct |
5 ms |
2764 KB |
Output is correct |
126 |
Correct |
5 ms |
2652 KB |
Output is correct |
127 |
Correct |
5 ms |
2652 KB |
Output is correct |
128 |
Correct |
6 ms |
2648 KB |
Output is correct |
129 |
Correct |
5 ms |
2652 KB |
Output is correct |
130 |
Correct |
7 ms |
3612 KB |
Output is correct |
131 |
Correct |
11 ms |
3452 KB |
Output is correct |
132 |
Correct |
7 ms |
3540 KB |
Output is correct |
133 |
Correct |
9 ms |
3544 KB |
Output is correct |
134 |
Correct |
3 ms |
2140 KB |
Output is correct |
135 |
Correct |
3 ms |
1372 KB |
Output is correct |
136 |
Correct |
9 ms |
3288 KB |
Output is correct |
137 |
Correct |
4 ms |
3164 KB |
Output is correct |
138 |
Correct |
2 ms |
1372 KB |
Output is correct |
139 |
Correct |
15 ms |
3328 KB |
Output is correct |
140 |
Correct |
3 ms |
3160 KB |
Output is correct |
141 |
Correct |
3 ms |
1556 KB |
Output is correct |
142 |
Correct |
8 ms |
3164 KB |
Output is correct |
143 |
Correct |
4 ms |
3164 KB |
Output is correct |
144 |
Correct |
1 ms |
348 KB |
Output is correct |
145 |
Correct |
7 ms |
3164 KB |
Output is correct |
146 |
Correct |
3 ms |
3164 KB |
Output is correct |
147 |
Correct |
12 ms |
4248 KB |
Output is correct |
148 |
Correct |
15 ms |
4320 KB |
Output is correct |
149 |
Correct |
13 ms |
4056 KB |
Output is correct |
150 |
Correct |
13 ms |
4308 KB |
Output is correct |
151 |
Correct |
12 ms |
4304 KB |
Output is correct |
152 |
Correct |
17 ms |
4308 KB |
Output is correct |
153 |
Correct |
13 ms |
4308 KB |
Output is correct |
154 |
Correct |
12 ms |
4504 KB |
Output is correct |
155 |
Correct |
13 ms |
4564 KB |
Output is correct |
156 |
Correct |
13 ms |
4560 KB |
Output is correct |
157 |
Correct |
18 ms |
4448 KB |
Output is correct |
158 |
Correct |
13 ms |
4436 KB |
Output is correct |
159 |
Correct |
16 ms |
4304 KB |
Output is correct |
160 |
Correct |
13 ms |
4560 KB |
Output is correct |
161 |
Correct |
13 ms |
4372 KB |
Output is correct |
162 |
Correct |
12 ms |
4056 KB |
Output is correct |
163 |
Correct |
8 ms |
4052 KB |
Output is correct |
164 |
Correct |
9 ms |
4388 KB |
Output is correct |
165 |
Correct |
9 ms |
4060 KB |
Output is correct |
166 |
Correct |
13 ms |
4304 KB |
Output is correct |
167 |
Correct |
10 ms |
4052 KB |
Output is correct |
168 |
Correct |
6 ms |
3032 KB |
Output is correct |
169 |
Correct |
9 ms |
3800 KB |
Output is correct |
170 |
Correct |
14 ms |
3800 KB |
Output is correct |
171 |
Correct |
9 ms |
3540 KB |
Output is correct |
172 |
Correct |
9 ms |
3544 KB |
Output is correct |
173 |
Correct |
10 ms |
3712 KB |
Output is correct |
174 |
Correct |
11 ms |
4296 KB |
Output is correct |
175 |
Correct |
8 ms |
4308 KB |
Output is correct |
176 |
Correct |
8 ms |
4408 KB |
Output is correct |
177 |
Correct |
14 ms |
4304 KB |
Output is correct |
178 |
Correct |
2 ms |
2908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
604 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
348 KB |
Output is correct |
23 |
Correct |
1 ms |
348 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
1 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
1 ms |
424 KB |
Output is correct |
33 |
Correct |
1 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
0 ms |
576 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
456 KB |
Output is correct |
38 |
Correct |
1 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
360 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
1 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
1 ms |
344 KB |
Output is correct |
45 |
Correct |
1 ms |
344 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
0 ms |
348 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
604 KB |
Output is correct |
50 |
Correct |
1 ms |
604 KB |
Output is correct |
51 |
Correct |
1 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
1 ms |
348 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
1 ms |
604 KB |
Output is correct |
56 |
Correct |
1 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
1 ms |
600 KB |
Output is correct |
59 |
Correct |
1 ms |
604 KB |
Output is correct |
60 |
Correct |
1 ms |
604 KB |
Output is correct |
61 |
Correct |
1 ms |
604 KB |
Output is correct |
62 |
Correct |
1 ms |
600 KB |
Output is correct |
63 |
Correct |
1 ms |
604 KB |
Output is correct |
64 |
Correct |
1 ms |
600 KB |
Output is correct |
65 |
Correct |
1 ms |
604 KB |
Output is correct |
66 |
Correct |
2 ms |
600 KB |
Output is correct |
67 |
Correct |
1 ms |
604 KB |
Output is correct |
68 |
Correct |
1 ms |
604 KB |
Output is correct |
69 |
Correct |
1 ms |
600 KB |
Output is correct |
70 |
Correct |
2 ms |
600 KB |
Output is correct |
71 |
Correct |
1 ms |
856 KB |
Output is correct |
72 |
Correct |
1 ms |
604 KB |
Output is correct |
73 |
Correct |
1 ms |
604 KB |
Output is correct |
74 |
Correct |
1 ms |
604 KB |
Output is correct |
75 |
Correct |
1 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
600 KB |
Output is correct |
77 |
Correct |
1 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
604 KB |
Output is correct |
79 |
Correct |
1 ms |
604 KB |
Output is correct |
80 |
Correct |
1 ms |
604 KB |
Output is correct |
81 |
Correct |
1 ms |
604 KB |
Output is correct |
82 |
Correct |
1 ms |
600 KB |
Output is correct |
83 |
Correct |
1 ms |
604 KB |
Output is correct |
84 |
Correct |
1 ms |
604 KB |
Output is correct |
85 |
Correct |
1 ms |
604 KB |
Output is correct |
86 |
Correct |
1 ms |
856 KB |
Output is correct |
87 |
Correct |
1 ms |
604 KB |
Output is correct |
88 |
Correct |
1 ms |
604 KB |
Output is correct |
89 |
Correct |
1 ms |
604 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
91 |
Correct |
1 ms |
348 KB |
Output is correct |
92 |
Correct |
7 ms |
3796 KB |
Output is correct |
93 |
Correct |
9 ms |
3544 KB |
Output is correct |
94 |
Correct |
1 ms |
860 KB |
Output is correct |
95 |
Correct |
8 ms |
3660 KB |
Output is correct |
96 |
Correct |
10 ms |
3540 KB |
Output is correct |
97 |
Correct |
3 ms |
992 KB |
Output is correct |
98 |
Correct |
7 ms |
2396 KB |
Output is correct |
99 |
Correct |
8 ms |
2392 KB |
Output is correct |
100 |
Correct |
2 ms |
1116 KB |
Output is correct |
101 |
Correct |
4 ms |
2348 KB |
Output is correct |
102 |
Correct |
4 ms |
2396 KB |
Output is correct |
103 |
Correct |
9 ms |
3472 KB |
Output is correct |
104 |
Correct |
7 ms |
3284 KB |
Output is correct |
105 |
Correct |
6 ms |
3284 KB |
Output is correct |
106 |
Correct |
10 ms |
3544 KB |
Output is correct |
107 |
Correct |
9 ms |
3544 KB |
Output is correct |
108 |
Correct |
10 ms |
3544 KB |
Output is correct |
109 |
Correct |
12 ms |
3540 KB |
Output is correct |
110 |
Correct |
7 ms |
3544 KB |
Output is correct |
111 |
Correct |
7 ms |
3544 KB |
Output is correct |
112 |
Correct |
7 ms |
3544 KB |
Output is correct |
113 |
Correct |
8 ms |
3540 KB |
Output is correct |
114 |
Correct |
8 ms |
3544 KB |
Output is correct |
115 |
Correct |
9 ms |
3544 KB |
Output is correct |
116 |
Correct |
7 ms |
3544 KB |
Output is correct |
117 |
Correct |
9 ms |
3544 KB |
Output is correct |
118 |
Correct |
8 ms |
3536 KB |
Output is correct |
119 |
Correct |
9 ms |
3292 KB |
Output is correct |
120 |
Correct |
7 ms |
3392 KB |
Output is correct |
121 |
Correct |
7 ms |
3280 KB |
Output is correct |
122 |
Correct |
7 ms |
3396 KB |
Output is correct |
123 |
Correct |
6 ms |
3292 KB |
Output is correct |
124 |
Correct |
3 ms |
2140 KB |
Output is correct |
125 |
Correct |
5 ms |
2764 KB |
Output is correct |
126 |
Correct |
5 ms |
2652 KB |
Output is correct |
127 |
Correct |
5 ms |
2652 KB |
Output is correct |
128 |
Correct |
6 ms |
2648 KB |
Output is correct |
129 |
Correct |
5 ms |
2652 KB |
Output is correct |
130 |
Correct |
7 ms |
3612 KB |
Output is correct |
131 |
Correct |
11 ms |
3452 KB |
Output is correct |
132 |
Correct |
7 ms |
3540 KB |
Output is correct |
133 |
Correct |
9 ms |
3544 KB |
Output is correct |
134 |
Correct |
3 ms |
2140 KB |
Output is correct |
135 |
Correct |
3 ms |
1372 KB |
Output is correct |
136 |
Correct |
9 ms |
3288 KB |
Output is correct |
137 |
Correct |
4 ms |
3164 KB |
Output is correct |
138 |
Correct |
2 ms |
1372 KB |
Output is correct |
139 |
Correct |
15 ms |
3328 KB |
Output is correct |
140 |
Correct |
3 ms |
3160 KB |
Output is correct |
141 |
Correct |
3 ms |
1556 KB |
Output is correct |
142 |
Correct |
8 ms |
3164 KB |
Output is correct |
143 |
Correct |
4 ms |
3164 KB |
Output is correct |
144 |
Correct |
1 ms |
348 KB |
Output is correct |
145 |
Correct |
7 ms |
3164 KB |
Output is correct |
146 |
Correct |
3 ms |
3164 KB |
Output is correct |
147 |
Correct |
12 ms |
4248 KB |
Output is correct |
148 |
Correct |
15 ms |
4320 KB |
Output is correct |
149 |
Correct |
13 ms |
4056 KB |
Output is correct |
150 |
Correct |
13 ms |
4308 KB |
Output is correct |
151 |
Correct |
12 ms |
4304 KB |
Output is correct |
152 |
Correct |
17 ms |
4308 KB |
Output is correct |
153 |
Correct |
13 ms |
4308 KB |
Output is correct |
154 |
Correct |
12 ms |
4504 KB |
Output is correct |
155 |
Correct |
13 ms |
4564 KB |
Output is correct |
156 |
Correct |
13 ms |
4560 KB |
Output is correct |
157 |
Correct |
18 ms |
4448 KB |
Output is correct |
158 |
Correct |
13 ms |
4436 KB |
Output is correct |
159 |
Correct |
16 ms |
4304 KB |
Output is correct |
160 |
Correct |
13 ms |
4560 KB |
Output is correct |
161 |
Correct |
13 ms |
4372 KB |
Output is correct |
162 |
Correct |
12 ms |
4056 KB |
Output is correct |
163 |
Correct |
8 ms |
4052 KB |
Output is correct |
164 |
Correct |
9 ms |
4388 KB |
Output is correct |
165 |
Correct |
9 ms |
4060 KB |
Output is correct |
166 |
Correct |
13 ms |
4304 KB |
Output is correct |
167 |
Correct |
10 ms |
4052 KB |
Output is correct |
168 |
Correct |
6 ms |
3032 KB |
Output is correct |
169 |
Correct |
9 ms |
3800 KB |
Output is correct |
170 |
Correct |
14 ms |
3800 KB |
Output is correct |
171 |
Correct |
9 ms |
3540 KB |
Output is correct |
172 |
Correct |
9 ms |
3544 KB |
Output is correct |
173 |
Correct |
10 ms |
3712 KB |
Output is correct |
174 |
Correct |
11 ms |
4296 KB |
Output is correct |
175 |
Correct |
8 ms |
4308 KB |
Output is correct |
176 |
Correct |
8 ms |
4408 KB |
Output is correct |
177 |
Correct |
14 ms |
4304 KB |
Output is correct |
178 |
Correct |
2 ms |
2908 KB |
Output is correct |
179 |
Correct |
39 ms |
13136 KB |
Output is correct |
180 |
Correct |
322 ms |
48856 KB |
Output is correct |
181 |
Correct |
57 ms |
48980 KB |
Output is correct |
182 |
Correct |
27 ms |
13140 KB |
Output is correct |
183 |
Correct |
279 ms |
48676 KB |
Output is correct |
184 |
Correct |
48 ms |
48960 KB |
Output is correct |
185 |
Correct |
113 ms |
35872 KB |
Output is correct |
186 |
Correct |
130 ms |
48936 KB |
Output is correct |
187 |
Correct |
46 ms |
48724 KB |
Output is correct |
188 |
Correct |
51 ms |
25788 KB |
Output is correct |
189 |
Correct |
96 ms |
48728 KB |
Output is correct |
190 |
Correct |
44 ms |
48512 KB |
Output is correct |
191 |
Correct |
209 ms |
58808 KB |
Output is correct |
192 |
Correct |
240 ms |
61364 KB |
Output is correct |
193 |
Correct |
213 ms |
61376 KB |
Output is correct |
194 |
Correct |
268 ms |
82600 KB |
Output is correct |
195 |
Correct |
271 ms |
83368 KB |
Output is correct |
196 |
Correct |
249 ms |
81832 KB |
Output is correct |
197 |
Correct |
259 ms |
83116 KB |
Output is correct |
198 |
Correct |
260 ms |
83348 KB |
Output is correct |
199 |
Correct |
265 ms |
82404 KB |
Output is correct |
200 |
Correct |
272 ms |
83672 KB |
Output is correct |
201 |
Correct |
276 ms |
82116 KB |
Output is correct |
202 |
Correct |
261 ms |
81832 KB |
Output is correct |
203 |
Correct |
262 ms |
83728 KB |
Output is correct |
204 |
Correct |
262 ms |
82804 KB |
Output is correct |
205 |
Correct |
277 ms |
82928 KB |
Output is correct |
206 |
Correct |
175 ms |
61620 KB |
Output is correct |
207 |
Correct |
169 ms |
60596 KB |
Output is correct |
208 |
Correct |
169 ms |
59628 KB |
Output is correct |
209 |
Correct |
166 ms |
61828 KB |
Output is correct |
210 |
Correct |
184 ms |
61220 KB |
Output is correct |
211 |
Correct |
177 ms |
80972 KB |
Output is correct |
212 |
Correct |
93 ms |
42324 KB |
Output is correct |
213 |
Correct |
182 ms |
54980 KB |
Output is correct |
214 |
Correct |
185 ms |
52164 KB |
Output is correct |
215 |
Correct |
203 ms |
54148 KB |
Output is correct |
216 |
Correct |
168 ms |
50624 KB |
Output is correct |
217 |
Correct |
179 ms |
52156 KB |
Output is correct |
218 |
Correct |
183 ms |
83988 KB |
Output is correct |
219 |
Correct |
191 ms |
82600 KB |
Output is correct |
220 |
Correct |
177 ms |
83876 KB |
Output is correct |
221 |
Correct |
176 ms |
82852 KB |
Output is correct |
222 |
Correct |
29 ms |
41220 KB |
Output is correct |