#include <bits/stdc++.h>
using namespace std;
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 1.5e3+10, MOD = 1e9+7;
const int INF = 2e9+10;
vector<vector<int>> can_square(vector<vector<int>> g, int a, int b) {
int n = sz(g), m = sz(g[0]);
auto can = g;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (!g[i][j]) continue;
int k = j;
while (k < m && g[i][k]) k++;
k--;
for (int me = j; me <= k; me++) {
can[i][me] &= (k - j + 1) >= a;
}
j = k;
}
}
for (int j = 0; j < m; j++) {
for (int i = 0; i < n; i++) {
if (!g[i][j]) continue;
int k = i;
while (k < n && g[k][j]) k++;
k--;
for (int me = i; me <= k; me++) {
can[me][j] &= (k - i + 1) >= b;
}
i = k;
}
}
/*
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (!g[i][j]) continue;
int ra = 1;
for (int k = j-1; k >= 0; k--) {
if (!g[i][k]) break;
ra++;
}
for (int k = j+1; k < m; k++) {
if (!g[i][k]) break;
ra++;
}
int rb = 1;
for (int k = i-1; k >= 0; k--) {
if (!g[k][j]) break;
rb++;
}
for (int k = i+1; k < n; k++) {
if (!g[k][j]) break;
rb++;
}
if (ra >= a && rb >= b) {
can[i][j] = 1;
}
}
}
*/
return can;
}
int n, m, a, b;
bool vis[N][N];
void dfs(int i, int j, const auto& one, const auto& two, const auto& can) {
vis[i][j] = 1;
if (i < n-1 && !vis[i+1][j] && can[i+1][j] && one[i][j]) {
dfs(i+1, j, one, two, can);
}
if (j < m-1 && !vis[i][j+1] && can[i][j+1] && two[i][j]) {
dfs(i, j+1, one, two, can);
}
if (i > 0 && !vis[i-1][j] && can[i-1][j] && one[i-1][j]) {
dfs(i-1, j, one, two, can);
}
if (j > 0 && !vis[i][j-1] && can[i][j-1] && two[i][j-1]) {
dfs(i, j-1, one, two, can);
}
}
void solve() {
cin >> m >> n >> a >> b;
int trash, si, sj; cin >> trash >> si >> sj >> trash;
vector<vector<int>> g(n, vector<int>(m));
int ei = -1, ej = -1;
for (int i = 0; i < n; i++) {
string s; cin >> s;
for (int j = 0; j < m; j++) {
if (s[j] == 'X') g[i][j] = 0;
else {
g[i][j] = 1;
if (s[j] == '*')
ei = i, ej = j;
}
}
}
vector<vector<int>> g1(n-1, vector<int>(m));
vector<vector<int>> g2(n, vector<int>(m-1));
for (int i = 0; i < n-1; i++) {
for (int j = 0; j < m; j++) {
g1[i][j] = g[i][j] & g[i+1][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m-1; j++) {
g2[i][j] = g[i][j] & g[i][j+1];
}
}
auto one = can_square(g1, a, b-1), two = can_square(g2, a-1, b);
auto can = can_square(g, a, b);
if (!can[si][sj] || !can[ei][ej]) {
cout << "NO\n";
return;
}
dfs(si, sj, one, two, can);
cout << (vis[ei][ej] ? "YES\n" : "NO\n");
}
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int T = 1;
// cin >> T;
while (T--) solve();
}
Compilation message
Main.cpp:83:30: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
83 | void dfs(int i, int j, const auto& one, const auto& two, const auto& can) {
| ^~~~
Main.cpp:83:47: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
83 | void dfs(int i, int j, const auto& one, const auto& two, const auto& can) {
| ^~~~
Main.cpp:83:64: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
83 | void dfs(int i, int j, const auto& one, const auto& two, const auto& can) {
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
856 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 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 |
348 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 |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
860 KB |
Output is correct |
18 |
Correct |
0 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
860 KB |
Output is correct |
20 |
Correct |
0 ms |
860 KB |
Output is correct |
21 |
Correct |
0 ms |
860 KB |
Output is correct |
22 |
Correct |
0 ms |
860 KB |
Output is correct |
23 |
Correct |
0 ms |
860 KB |
Output is correct |
24 |
Correct |
1 ms |
860 KB |
Output is correct |
25 |
Correct |
0 ms |
860 KB |
Output is correct |
26 |
Correct |
0 ms |
860 KB |
Output is correct |
27 |
Correct |
0 ms |
860 KB |
Output is correct |
28 |
Correct |
1 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
860 KB |
Output is correct |
30 |
Correct |
0 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
860 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
860 KB |
Output is correct |
35 |
Correct |
1 ms |
860 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
860 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
0 ms |
860 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
856 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 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 |
348 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 |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
860 KB |
Output is correct |
18 |
Correct |
0 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
860 KB |
Output is correct |
20 |
Correct |
0 ms |
860 KB |
Output is correct |
21 |
Correct |
0 ms |
860 KB |
Output is correct |
22 |
Correct |
0 ms |
860 KB |
Output is correct |
23 |
Correct |
0 ms |
860 KB |
Output is correct |
24 |
Correct |
1 ms |
860 KB |
Output is correct |
25 |
Correct |
0 ms |
860 KB |
Output is correct |
26 |
Correct |
0 ms |
860 KB |
Output is correct |
27 |
Correct |
0 ms |
860 KB |
Output is correct |
28 |
Correct |
1 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
860 KB |
Output is correct |
30 |
Correct |
0 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
860 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
860 KB |
Output is correct |
35 |
Correct |
1 ms |
860 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
860 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
0 ms |
860 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
860 KB |
Output is correct |
50 |
Correct |
0 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
0 ms |
604 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
0 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
1628 KB |
Output is correct |
60 |
Correct |
1 ms |
1676 KB |
Output is correct |
61 |
Correct |
1 ms |
1624 KB |
Output is correct |
62 |
Correct |
1 ms |
1884 KB |
Output is correct |
63 |
Correct |
1 ms |
1884 KB |
Output is correct |
64 |
Correct |
1 ms |
1884 KB |
Output is correct |
65 |
Correct |
1 ms |
1884 KB |
Output is correct |
66 |
Correct |
1 ms |
1884 KB |
Output is correct |
67 |
Correct |
1 ms |
1884 KB |
Output is correct |
68 |
Correct |
1 ms |
1884 KB |
Output is correct |
69 |
Correct |
1 ms |
1884 KB |
Output is correct |
70 |
Correct |
1 ms |
1628 KB |
Output is correct |
71 |
Correct |
1 ms |
1628 KB |
Output is correct |
72 |
Correct |
1 ms |
1628 KB |
Output is correct |
73 |
Correct |
1 ms |
1628 KB |
Output is correct |
74 |
Correct |
1 ms |
1624 KB |
Output is correct |
75 |
Correct |
0 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
1884 KB |
Output is correct |
77 |
Correct |
0 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
1684 KB |
Output is correct |
79 |
Correct |
1 ms |
1628 KB |
Output is correct |
80 |
Correct |
0 ms |
604 KB |
Output is correct |
81 |
Correct |
0 ms |
860 KB |
Output is correct |
82 |
Correct |
1 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
860 KB |
Output is correct |
84 |
Correct |
1 ms |
860 KB |
Output is correct |
85 |
Correct |
1 ms |
860 KB |
Output is correct |
86 |
Correct |
1 ms |
1884 KB |
Output is correct |
87 |
Correct |
1 ms |
1880 KB |
Output is correct |
88 |
Correct |
1 ms |
1884 KB |
Output is correct |
89 |
Correct |
1 ms |
1884 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
1108 KB |
Output is correct |
4 |
Correct |
9 ms |
17244 KB |
Output is correct |
5 |
Correct |
8 ms |
16988 KB |
Output is correct |
6 |
Correct |
1 ms |
2140 KB |
Output is correct |
7 |
Correct |
7 ms |
14144 KB |
Output is correct |
8 |
Correct |
7 ms |
13916 KB |
Output is correct |
9 |
Correct |
1 ms |
1116 KB |
Output is correct |
10 |
Correct |
3 ms |
2908 KB |
Output is correct |
11 |
Correct |
3 ms |
2908 KB |
Output is correct |
12 |
Correct |
1 ms |
1116 KB |
Output is correct |
13 |
Correct |
3 ms |
2908 KB |
Output is correct |
14 |
Correct |
4 ms |
3016 KB |
Output is correct |
15 |
Correct |
9 ms |
16940 KB |
Output is correct |
16 |
Correct |
10 ms |
14424 KB |
Output is correct |
17 |
Correct |
8 ms |
16220 KB |
Output is correct |
18 |
Correct |
9 ms |
16076 KB |
Output is correct |
19 |
Correct |
9 ms |
15964 KB |
Output is correct |
20 |
Correct |
10 ms |
15932 KB |
Output is correct |
21 |
Correct |
10 ms |
15964 KB |
Output is correct |
22 |
Correct |
10 ms |
15964 KB |
Output is correct |
23 |
Correct |
10 ms |
15964 KB |
Output is correct |
24 |
Correct |
10 ms |
15964 KB |
Output is correct |
25 |
Correct |
11 ms |
15964 KB |
Output is correct |
26 |
Correct |
8 ms |
11612 KB |
Output is correct |
27 |
Correct |
6 ms |
11612 KB |
Output is correct |
28 |
Correct |
6 ms |
11612 KB |
Output is correct |
29 |
Correct |
7 ms |
11652 KB |
Output is correct |
30 |
Correct |
8 ms |
15452 KB |
Output is correct |
31 |
Correct |
2 ms |
2652 KB |
Output is correct |
32 |
Correct |
10 ms |
15752 KB |
Output is correct |
33 |
Correct |
2 ms |
2652 KB |
Output is correct |
34 |
Correct |
8 ms |
14428 KB |
Output is correct |
35 |
Correct |
9 ms |
14440 KB |
Output is correct |
36 |
Correct |
2 ms |
4700 KB |
Output is correct |
37 |
Correct |
4 ms |
7112 KB |
Output is correct |
38 |
Correct |
4 ms |
6760 KB |
Output is correct |
39 |
Correct |
4 ms |
6748 KB |
Output is correct |
40 |
Correct |
4 ms |
7200 KB |
Output is correct |
41 |
Correct |
4 ms |
6748 KB |
Output is correct |
42 |
Correct |
9 ms |
15904 KB |
Output is correct |
43 |
Correct |
10 ms |
17756 KB |
Output is correct |
44 |
Correct |
9 ms |
15856 KB |
Output is correct |
45 |
Correct |
11 ms |
15964 KB |
Output is correct |
46 |
Correct |
1 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
856 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 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 |
348 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 |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
860 KB |
Output is correct |
18 |
Correct |
0 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
860 KB |
Output is correct |
20 |
Correct |
0 ms |
860 KB |
Output is correct |
21 |
Correct |
0 ms |
860 KB |
Output is correct |
22 |
Correct |
0 ms |
860 KB |
Output is correct |
23 |
Correct |
0 ms |
860 KB |
Output is correct |
24 |
Correct |
1 ms |
860 KB |
Output is correct |
25 |
Correct |
0 ms |
860 KB |
Output is correct |
26 |
Correct |
0 ms |
860 KB |
Output is correct |
27 |
Correct |
0 ms |
860 KB |
Output is correct |
28 |
Correct |
1 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
860 KB |
Output is correct |
30 |
Correct |
0 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
860 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
860 KB |
Output is correct |
35 |
Correct |
1 ms |
860 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
860 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
0 ms |
860 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
860 KB |
Output is correct |
50 |
Correct |
0 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
0 ms |
604 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
0 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
1628 KB |
Output is correct |
60 |
Correct |
1 ms |
1676 KB |
Output is correct |
61 |
Correct |
1 ms |
1624 KB |
Output is correct |
62 |
Correct |
1 ms |
1884 KB |
Output is correct |
63 |
Correct |
1 ms |
1884 KB |
Output is correct |
64 |
Correct |
1 ms |
1884 KB |
Output is correct |
65 |
Correct |
1 ms |
1884 KB |
Output is correct |
66 |
Correct |
1 ms |
1884 KB |
Output is correct |
67 |
Correct |
1 ms |
1884 KB |
Output is correct |
68 |
Correct |
1 ms |
1884 KB |
Output is correct |
69 |
Correct |
1 ms |
1884 KB |
Output is correct |
70 |
Correct |
1 ms |
1628 KB |
Output is correct |
71 |
Correct |
1 ms |
1628 KB |
Output is correct |
72 |
Correct |
1 ms |
1628 KB |
Output is correct |
73 |
Correct |
1 ms |
1628 KB |
Output is correct |
74 |
Correct |
1 ms |
1624 KB |
Output is correct |
75 |
Correct |
0 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
1884 KB |
Output is correct |
77 |
Correct |
0 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
1684 KB |
Output is correct |
79 |
Correct |
1 ms |
1628 KB |
Output is correct |
80 |
Correct |
0 ms |
604 KB |
Output is correct |
81 |
Correct |
0 ms |
860 KB |
Output is correct |
82 |
Correct |
1 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
860 KB |
Output is correct |
84 |
Correct |
1 ms |
860 KB |
Output is correct |
85 |
Correct |
1 ms |
860 KB |
Output is correct |
86 |
Correct |
1 ms |
1884 KB |
Output is correct |
87 |
Correct |
1 ms |
1880 KB |
Output is correct |
88 |
Correct |
1 ms |
1884 KB |
Output is correct |
89 |
Correct |
1 ms |
1884 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
91 |
Correct |
1 ms |
1108 KB |
Output is correct |
92 |
Correct |
9 ms |
17244 KB |
Output is correct |
93 |
Correct |
8 ms |
16988 KB |
Output is correct |
94 |
Correct |
1 ms |
2140 KB |
Output is correct |
95 |
Correct |
7 ms |
14144 KB |
Output is correct |
96 |
Correct |
7 ms |
13916 KB |
Output is correct |
97 |
Correct |
1 ms |
1116 KB |
Output is correct |
98 |
Correct |
3 ms |
2908 KB |
Output is correct |
99 |
Correct |
3 ms |
2908 KB |
Output is correct |
100 |
Correct |
1 ms |
1116 KB |
Output is correct |
101 |
Correct |
3 ms |
2908 KB |
Output is correct |
102 |
Correct |
4 ms |
3016 KB |
Output is correct |
103 |
Correct |
9 ms |
16940 KB |
Output is correct |
104 |
Correct |
10 ms |
14424 KB |
Output is correct |
105 |
Correct |
8 ms |
16220 KB |
Output is correct |
106 |
Correct |
9 ms |
16076 KB |
Output is correct |
107 |
Correct |
9 ms |
15964 KB |
Output is correct |
108 |
Correct |
10 ms |
15932 KB |
Output is correct |
109 |
Correct |
10 ms |
15964 KB |
Output is correct |
110 |
Correct |
10 ms |
15964 KB |
Output is correct |
111 |
Correct |
10 ms |
15964 KB |
Output is correct |
112 |
Correct |
10 ms |
15964 KB |
Output is correct |
113 |
Correct |
11 ms |
15964 KB |
Output is correct |
114 |
Correct |
8 ms |
11612 KB |
Output is correct |
115 |
Correct |
6 ms |
11612 KB |
Output is correct |
116 |
Correct |
6 ms |
11612 KB |
Output is correct |
117 |
Correct |
7 ms |
11652 KB |
Output is correct |
118 |
Correct |
8 ms |
15452 KB |
Output is correct |
119 |
Correct |
2 ms |
2652 KB |
Output is correct |
120 |
Correct |
10 ms |
15752 KB |
Output is correct |
121 |
Correct |
2 ms |
2652 KB |
Output is correct |
122 |
Correct |
8 ms |
14428 KB |
Output is correct |
123 |
Correct |
9 ms |
14440 KB |
Output is correct |
124 |
Correct |
2 ms |
4700 KB |
Output is correct |
125 |
Correct |
4 ms |
7112 KB |
Output is correct |
126 |
Correct |
4 ms |
6760 KB |
Output is correct |
127 |
Correct |
4 ms |
6748 KB |
Output is correct |
128 |
Correct |
4 ms |
7200 KB |
Output is correct |
129 |
Correct |
4 ms |
6748 KB |
Output is correct |
130 |
Correct |
9 ms |
15904 KB |
Output is correct |
131 |
Correct |
10 ms |
17756 KB |
Output is correct |
132 |
Correct |
9 ms |
15856 KB |
Output is correct |
133 |
Correct |
11 ms |
15964 KB |
Output is correct |
134 |
Correct |
1 ms |
2652 KB |
Output is correct |
135 |
Correct |
1 ms |
1624 KB |
Output is correct |
136 |
Correct |
3 ms |
5980 KB |
Output is correct |
137 |
Correct |
3 ms |
3932 KB |
Output is correct |
138 |
Correct |
1 ms |
1628 KB |
Output is correct |
139 |
Correct |
3 ms |
5980 KB |
Output is correct |
140 |
Correct |
3 ms |
3932 KB |
Output is correct |
141 |
Correct |
1 ms |
1884 KB |
Output is correct |
142 |
Correct |
3 ms |
3932 KB |
Output is correct |
143 |
Correct |
4 ms |
4104 KB |
Output is correct |
144 |
Correct |
0 ms |
604 KB |
Output is correct |
145 |
Correct |
5 ms |
4100 KB |
Output is correct |
146 |
Correct |
5 ms |
3928 KB |
Output is correct |
147 |
Correct |
12 ms |
21436 KB |
Output is correct |
148 |
Correct |
13 ms |
22816 KB |
Output is correct |
149 |
Correct |
13 ms |
21340 KB |
Output is correct |
150 |
Correct |
13 ms |
22596 KB |
Output is correct |
151 |
Correct |
14 ms |
22828 KB |
Output is correct |
152 |
Correct |
12 ms |
22620 KB |
Output is correct |
153 |
Correct |
12 ms |
22620 KB |
Output is correct |
154 |
Correct |
15 ms |
22616 KB |
Output is correct |
155 |
Correct |
13 ms |
22872 KB |
Output is correct |
156 |
Correct |
13 ms |
22620 KB |
Output is correct |
157 |
Correct |
12 ms |
22620 KB |
Output is correct |
158 |
Correct |
11 ms |
19404 KB |
Output is correct |
159 |
Correct |
12 ms |
19388 KB |
Output is correct |
160 |
Correct |
12 ms |
19356 KB |
Output is correct |
161 |
Correct |
11 ms |
19292 KB |
Output is correct |
162 |
Correct |
11 ms |
20828 KB |
Output is correct |
163 |
Correct |
3 ms |
3676 KB |
Output is correct |
164 |
Correct |
13 ms |
21852 KB |
Output is correct |
165 |
Correct |
2 ms |
3420 KB |
Output is correct |
166 |
Correct |
13 ms |
21664 KB |
Output is correct |
167 |
Correct |
12 ms |
20568 KB |
Output is correct |
168 |
Correct |
2 ms |
5724 KB |
Output is correct |
169 |
Correct |
6 ms |
9564 KB |
Output is correct |
170 |
Correct |
5 ms |
9716 KB |
Output is correct |
171 |
Correct |
5 ms |
9308 KB |
Output is correct |
172 |
Correct |
5 ms |
9052 KB |
Output is correct |
173 |
Correct |
5 ms |
9564 KB |
Output is correct |
174 |
Correct |
13 ms |
22620 KB |
Output is correct |
175 |
Correct |
12 ms |
22620 KB |
Output is correct |
176 |
Correct |
12 ms |
22712 KB |
Output is correct |
177 |
Correct |
13 ms |
24412 KB |
Output is correct |
178 |
Correct |
3 ms |
3676 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
856 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 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 |
348 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 |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
860 KB |
Output is correct |
16 |
Correct |
1 ms |
604 KB |
Output is correct |
17 |
Correct |
0 ms |
860 KB |
Output is correct |
18 |
Correct |
0 ms |
860 KB |
Output is correct |
19 |
Correct |
0 ms |
860 KB |
Output is correct |
20 |
Correct |
0 ms |
860 KB |
Output is correct |
21 |
Correct |
0 ms |
860 KB |
Output is correct |
22 |
Correct |
0 ms |
860 KB |
Output is correct |
23 |
Correct |
0 ms |
860 KB |
Output is correct |
24 |
Correct |
1 ms |
860 KB |
Output is correct |
25 |
Correct |
0 ms |
860 KB |
Output is correct |
26 |
Correct |
0 ms |
860 KB |
Output is correct |
27 |
Correct |
0 ms |
860 KB |
Output is correct |
28 |
Correct |
1 ms |
860 KB |
Output is correct |
29 |
Correct |
1 ms |
860 KB |
Output is correct |
30 |
Correct |
0 ms |
860 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
860 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
860 KB |
Output is correct |
35 |
Correct |
1 ms |
860 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
604 KB |
Output is correct |
38 |
Correct |
1 ms |
604 KB |
Output is correct |
39 |
Correct |
0 ms |
604 KB |
Output is correct |
40 |
Correct |
0 ms |
604 KB |
Output is correct |
41 |
Correct |
0 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
860 KB |
Output is correct |
43 |
Correct |
1 ms |
860 KB |
Output is correct |
44 |
Correct |
0 ms |
860 KB |
Output is correct |
45 |
Correct |
0 ms |
860 KB |
Output is correct |
46 |
Correct |
0 ms |
348 KB |
Output is correct |
47 |
Correct |
1 ms |
604 KB |
Output is correct |
48 |
Correct |
1 ms |
604 KB |
Output is correct |
49 |
Correct |
1 ms |
860 KB |
Output is correct |
50 |
Correct |
0 ms |
604 KB |
Output is correct |
51 |
Correct |
0 ms |
604 KB |
Output is correct |
52 |
Correct |
0 ms |
604 KB |
Output is correct |
53 |
Correct |
0 ms |
604 KB |
Output is correct |
54 |
Correct |
1 ms |
604 KB |
Output is correct |
55 |
Correct |
0 ms |
604 KB |
Output is correct |
56 |
Correct |
0 ms |
348 KB |
Output is correct |
57 |
Correct |
1 ms |
604 KB |
Output is correct |
58 |
Correct |
0 ms |
604 KB |
Output is correct |
59 |
Correct |
1 ms |
1628 KB |
Output is correct |
60 |
Correct |
1 ms |
1676 KB |
Output is correct |
61 |
Correct |
1 ms |
1624 KB |
Output is correct |
62 |
Correct |
1 ms |
1884 KB |
Output is correct |
63 |
Correct |
1 ms |
1884 KB |
Output is correct |
64 |
Correct |
1 ms |
1884 KB |
Output is correct |
65 |
Correct |
1 ms |
1884 KB |
Output is correct |
66 |
Correct |
1 ms |
1884 KB |
Output is correct |
67 |
Correct |
1 ms |
1884 KB |
Output is correct |
68 |
Correct |
1 ms |
1884 KB |
Output is correct |
69 |
Correct |
1 ms |
1884 KB |
Output is correct |
70 |
Correct |
1 ms |
1628 KB |
Output is correct |
71 |
Correct |
1 ms |
1628 KB |
Output is correct |
72 |
Correct |
1 ms |
1628 KB |
Output is correct |
73 |
Correct |
1 ms |
1628 KB |
Output is correct |
74 |
Correct |
1 ms |
1624 KB |
Output is correct |
75 |
Correct |
0 ms |
604 KB |
Output is correct |
76 |
Correct |
1 ms |
1884 KB |
Output is correct |
77 |
Correct |
0 ms |
604 KB |
Output is correct |
78 |
Correct |
1 ms |
1684 KB |
Output is correct |
79 |
Correct |
1 ms |
1628 KB |
Output is correct |
80 |
Correct |
0 ms |
604 KB |
Output is correct |
81 |
Correct |
0 ms |
860 KB |
Output is correct |
82 |
Correct |
1 ms |
860 KB |
Output is correct |
83 |
Correct |
1 ms |
860 KB |
Output is correct |
84 |
Correct |
1 ms |
860 KB |
Output is correct |
85 |
Correct |
1 ms |
860 KB |
Output is correct |
86 |
Correct |
1 ms |
1884 KB |
Output is correct |
87 |
Correct |
1 ms |
1880 KB |
Output is correct |
88 |
Correct |
1 ms |
1884 KB |
Output is correct |
89 |
Correct |
1 ms |
1884 KB |
Output is correct |
90 |
Correct |
0 ms |
604 KB |
Output is correct |
91 |
Correct |
1 ms |
1108 KB |
Output is correct |
92 |
Correct |
9 ms |
17244 KB |
Output is correct |
93 |
Correct |
8 ms |
16988 KB |
Output is correct |
94 |
Correct |
1 ms |
2140 KB |
Output is correct |
95 |
Correct |
7 ms |
14144 KB |
Output is correct |
96 |
Correct |
7 ms |
13916 KB |
Output is correct |
97 |
Correct |
1 ms |
1116 KB |
Output is correct |
98 |
Correct |
3 ms |
2908 KB |
Output is correct |
99 |
Correct |
3 ms |
2908 KB |
Output is correct |
100 |
Correct |
1 ms |
1116 KB |
Output is correct |
101 |
Correct |
3 ms |
2908 KB |
Output is correct |
102 |
Correct |
4 ms |
3016 KB |
Output is correct |
103 |
Correct |
9 ms |
16940 KB |
Output is correct |
104 |
Correct |
10 ms |
14424 KB |
Output is correct |
105 |
Correct |
8 ms |
16220 KB |
Output is correct |
106 |
Correct |
9 ms |
16076 KB |
Output is correct |
107 |
Correct |
9 ms |
15964 KB |
Output is correct |
108 |
Correct |
10 ms |
15932 KB |
Output is correct |
109 |
Correct |
10 ms |
15964 KB |
Output is correct |
110 |
Correct |
10 ms |
15964 KB |
Output is correct |
111 |
Correct |
10 ms |
15964 KB |
Output is correct |
112 |
Correct |
10 ms |
15964 KB |
Output is correct |
113 |
Correct |
11 ms |
15964 KB |
Output is correct |
114 |
Correct |
8 ms |
11612 KB |
Output is correct |
115 |
Correct |
6 ms |
11612 KB |
Output is correct |
116 |
Correct |
6 ms |
11612 KB |
Output is correct |
117 |
Correct |
7 ms |
11652 KB |
Output is correct |
118 |
Correct |
8 ms |
15452 KB |
Output is correct |
119 |
Correct |
2 ms |
2652 KB |
Output is correct |
120 |
Correct |
10 ms |
15752 KB |
Output is correct |
121 |
Correct |
2 ms |
2652 KB |
Output is correct |
122 |
Correct |
8 ms |
14428 KB |
Output is correct |
123 |
Correct |
9 ms |
14440 KB |
Output is correct |
124 |
Correct |
2 ms |
4700 KB |
Output is correct |
125 |
Correct |
4 ms |
7112 KB |
Output is correct |
126 |
Correct |
4 ms |
6760 KB |
Output is correct |
127 |
Correct |
4 ms |
6748 KB |
Output is correct |
128 |
Correct |
4 ms |
7200 KB |
Output is correct |
129 |
Correct |
4 ms |
6748 KB |
Output is correct |
130 |
Correct |
9 ms |
15904 KB |
Output is correct |
131 |
Correct |
10 ms |
17756 KB |
Output is correct |
132 |
Correct |
9 ms |
15856 KB |
Output is correct |
133 |
Correct |
11 ms |
15964 KB |
Output is correct |
134 |
Correct |
1 ms |
2652 KB |
Output is correct |
135 |
Correct |
1 ms |
1624 KB |
Output is correct |
136 |
Correct |
3 ms |
5980 KB |
Output is correct |
137 |
Correct |
3 ms |
3932 KB |
Output is correct |
138 |
Correct |
1 ms |
1628 KB |
Output is correct |
139 |
Correct |
3 ms |
5980 KB |
Output is correct |
140 |
Correct |
3 ms |
3932 KB |
Output is correct |
141 |
Correct |
1 ms |
1884 KB |
Output is correct |
142 |
Correct |
3 ms |
3932 KB |
Output is correct |
143 |
Correct |
4 ms |
4104 KB |
Output is correct |
144 |
Correct |
0 ms |
604 KB |
Output is correct |
145 |
Correct |
5 ms |
4100 KB |
Output is correct |
146 |
Correct |
5 ms |
3928 KB |
Output is correct |
147 |
Correct |
12 ms |
21436 KB |
Output is correct |
148 |
Correct |
13 ms |
22816 KB |
Output is correct |
149 |
Correct |
13 ms |
21340 KB |
Output is correct |
150 |
Correct |
13 ms |
22596 KB |
Output is correct |
151 |
Correct |
14 ms |
22828 KB |
Output is correct |
152 |
Correct |
12 ms |
22620 KB |
Output is correct |
153 |
Correct |
12 ms |
22620 KB |
Output is correct |
154 |
Correct |
15 ms |
22616 KB |
Output is correct |
155 |
Correct |
13 ms |
22872 KB |
Output is correct |
156 |
Correct |
13 ms |
22620 KB |
Output is correct |
157 |
Correct |
12 ms |
22620 KB |
Output is correct |
158 |
Correct |
11 ms |
19404 KB |
Output is correct |
159 |
Correct |
12 ms |
19388 KB |
Output is correct |
160 |
Correct |
12 ms |
19356 KB |
Output is correct |
161 |
Correct |
11 ms |
19292 KB |
Output is correct |
162 |
Correct |
11 ms |
20828 KB |
Output is correct |
163 |
Correct |
3 ms |
3676 KB |
Output is correct |
164 |
Correct |
13 ms |
21852 KB |
Output is correct |
165 |
Correct |
2 ms |
3420 KB |
Output is correct |
166 |
Correct |
13 ms |
21664 KB |
Output is correct |
167 |
Correct |
12 ms |
20568 KB |
Output is correct |
168 |
Correct |
2 ms |
5724 KB |
Output is correct |
169 |
Correct |
6 ms |
9564 KB |
Output is correct |
170 |
Correct |
5 ms |
9716 KB |
Output is correct |
171 |
Correct |
5 ms |
9308 KB |
Output is correct |
172 |
Correct |
5 ms |
9052 KB |
Output is correct |
173 |
Correct |
5 ms |
9564 KB |
Output is correct |
174 |
Correct |
13 ms |
22620 KB |
Output is correct |
175 |
Correct |
12 ms |
22620 KB |
Output is correct |
176 |
Correct |
12 ms |
22712 KB |
Output is correct |
177 |
Correct |
13 ms |
24412 KB |
Output is correct |
178 |
Correct |
3 ms |
3676 KB |
Output is correct |
179 |
Correct |
11 ms |
19288 KB |
Output is correct |
180 |
Correct |
63 ms |
62524 KB |
Output is correct |
181 |
Correct |
69 ms |
64500 KB |
Output is correct |
182 |
Correct |
11 ms |
17236 KB |
Output is correct |
183 |
Correct |
64 ms |
64560 KB |
Output is correct |
184 |
Correct |
64 ms |
64496 KB |
Output is correct |
185 |
Correct |
50 ms |
47504 KB |
Output is correct |
186 |
Correct |
73 ms |
64692 KB |
Output is correct |
187 |
Correct |
76 ms |
64560 KB |
Output is correct |
188 |
Correct |
47 ms |
33876 KB |
Output is correct |
189 |
Correct |
89 ms |
64596 KB |
Output is correct |
190 |
Correct |
95 ms |
64724 KB |
Output is correct |
191 |
Correct |
223 ms |
321876 KB |
Output is correct |
192 |
Correct |
254 ms |
345764 KB |
Output is correct |
193 |
Correct |
231 ms |
332880 KB |
Output is correct |
194 |
Correct |
259 ms |
383552 KB |
Output is correct |
195 |
Correct |
270 ms |
383568 KB |
Output is correct |
196 |
Correct |
308 ms |
383668 KB |
Output is correct |
197 |
Correct |
293 ms |
383568 KB |
Output is correct |
198 |
Correct |
302 ms |
383572 KB |
Output is correct |
199 |
Correct |
269 ms |
383572 KB |
Output is correct |
200 |
Correct |
271 ms |
383312 KB |
Output is correct |
201 |
Correct |
256 ms |
383312 KB |
Output is correct |
202 |
Correct |
242 ms |
324648 KB |
Output is correct |
203 |
Correct |
244 ms |
324248 KB |
Output is correct |
204 |
Correct |
242 ms |
324432 KB |
Output is correct |
205 |
Correct |
250 ms |
323928 KB |
Output is correct |
206 |
Correct |
235 ms |
335444 KB |
Output is correct |
207 |
Correct |
56 ms |
56800 KB |
Output is correct |
208 |
Correct |
230 ms |
321124 KB |
Output is correct |
209 |
Correct |
57 ms |
57628 KB |
Output is correct |
210 |
Correct |
229 ms |
342096 KB |
Output is correct |
211 |
Correct |
247 ms |
362780 KB |
Output is correct |
212 |
Correct |
47 ms |
57908 KB |
Output is correct |
213 |
Correct |
115 ms |
154704 KB |
Output is correct |
214 |
Correct |
106 ms |
146404 KB |
Output is correct |
215 |
Correct |
119 ms |
157372 KB |
Output is correct |
216 |
Correct |
106 ms |
143956 KB |
Output is correct |
217 |
Correct |
105 ms |
146000 KB |
Output is correct |
218 |
Correct |
269 ms |
383508 KB |
Output is correct |
219 |
Correct |
267 ms |
383708 KB |
Output is correct |
220 |
Correct |
259 ms |
383560 KB |
Output is correct |
221 |
Correct |
280 ms |
383568 KB |
Output is correct |
222 |
Correct |
32 ms |
54300 KB |
Output is correct |