Submission #1039757

# Submission time Handle Problem Language Result Execution time Memory
1039757 2024-07-31T08:33:09 Z 중국공산당(#11033) Toy (CEOI24_toy) C++17
100 / 100
172 ms 181076 KB
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

const int dt[4][2] = { 1, 0, -1, 0, 0, 1, 0, -1 };

int w, h, k, l;
int x, y, gx, gy;
char a[1506][1506];
int sum[1506][1506], b[1506][1506], c[1506][1506], d[1506][1506];


void f(int y, int x) {
    b[y][x] = 0;
    if (y == gy && x == gx) puts("YES"), exit(0);
    for (int t = 0; t < 4; t++) {
        int ny = y + dt[t][1], nx = x + dt[t][0];
        if (ny < 0 || ny >= h || nx < 0 || nx >= w) continue;
        if (!b[ny][nx]) continue;
        if (y == ny && !c[min(y, ny)][min(x, nx)]) continue;
        if (x == nx && !d[min(y, ny)][min(x, nx)]) continue;
        f(ny, nx);
    }
}

int main() {
    scanf("%d%d%d%d", &w, &h, &k, &l);
    scanf("%*d%d%d%*d", &y, &x);
    for (int i = 0; i < h; i++) scanf("%s", a[i]);
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) if (a[i][j] == '*') gy = i, gx = j;
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) sum[i][j] = (a[i][j] == 'X') + (i ? sum[i - 1][j] : 0) + (j ? sum[i][j - 1] : 0) - (i && j ? sum[i - 1][j - 1] : 0);
    for (int i = 0; i < h - l + 1; i++) for (int j = 0; j < w - k + 1; j++) {
        int curr = sum[i + l - 1][j + k - 1] - (i ? sum[i - 1][j + k - 1] : 0) - (j ? sum[i + l - 1][j - 1] : 0) + (i && j ? sum[i - 1][j - 1] : 0);
        if (!curr) b[i][j]++, b[i + l][j]--, b[i][j + k]--, b[i + l][j + k]++;
    }
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) b[i][j] = 1;//b[i][j] += (i ? b[i - 1][j] : 0) + (j ? b[i][j - 1] : 0) - (i && j ? b[i - 1][j - 1] : 0);
    for (int i = 0; i < h - l + 1; i++) for (int j = 0; j < w - 1; j++) {
        int curr = sum[i + l - 1][j + 1] - (i ? sum[i - 1][j + 1] : 0) - (j ? sum[i + l - 1][j - 1] : 0) + (i && j ? sum[i - 1][j - 1] : 0);
        if (!curr) c[i][j]++, c[i + l][j]--;
    }
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) c[i][j] += (i ? c[i - 1][j] : 0);
    for (int i = 0; i < h; i++) for (int j = 0; j < w - k + 1; j++) {
        int curr = sum[i + 1][j + k - 1] - (i ? sum[i - 1][j + k - 1] : 0) - (j ? sum[i + 1][j - 1] : 0) + (i && j ? sum[i - 1][j - 1] : 0);
        if (!curr) d[i][j]++, d[i][j + k]--;
    }
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) d[i][j] += (j ? d[i][j - 1] : 0);
    f(y, x);
    puts("NO");
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:28:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |     scanf("%d%d%d%d", &w, &h, &k, &l);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:29:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |     scanf("%*d%d%d%*d", &y, &x);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:30:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     for (int i = 0; i < h; i++) scanf("%s", a[i]);
      |                                 ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8796 KB Output is correct
5 Correct 1 ms 8796 KB Output is correct
6 Correct 1 ms 8604 KB Output is correct
7 Correct 1 ms 8796 KB Output is correct
8 Correct 1 ms 8796 KB Output is correct
9 Correct 1 ms 8628 KB Output is correct
10 Correct 1 ms 8800 KB Output is correct
11 Correct 1 ms 7008 KB Output is correct
12 Correct 1 ms 6496 KB Output is correct
13 Correct 1 ms 7008 KB Output is correct
14 Correct 1 ms 6844 KB Output is correct
15 Correct 1 ms 8800 KB Output is correct
16 Correct 1 ms 8800 KB Output is correct
17 Correct 1 ms 8800 KB Output is correct
18 Correct 1 ms 8800 KB Output is correct
19 Correct 1 ms 8800 KB Output is correct
20 Correct 1 ms 8800 KB Output is correct
21 Correct 1 ms 8800 KB Output is correct
22 Correct 1 ms 8800 KB Output is correct
23 Correct 1 ms 8880 KB Output is correct
24 Correct 1 ms 8800 KB Output is correct
25 Correct 1 ms 8800 KB Output is correct
26 Correct 1 ms 8800 KB Output is correct
27 Correct 1 ms 8800 KB Output is correct
28 Correct 1 ms 8800 KB Output is correct
29 Correct 1 ms 8800 KB Output is correct
30 Correct 1 ms 8800 KB Output is correct
31 Correct 1 ms 8800 KB Output is correct
32 Correct 1 ms 8880 KB Output is correct
33 Correct 1 ms 8800 KB Output is correct
34 Correct 1 ms 8800 KB Output is correct
35 Correct 1 ms 8800 KB Output is correct
36 Correct 1 ms 8800 KB Output is correct
37 Correct 1 ms 8624 KB Output is correct
38 Correct 1 ms 8800 KB Output is correct
39 Correct 1 ms 8800 KB Output is correct
40 Correct 1 ms 8800 KB Output is correct
41 Correct 1 ms 8800 KB Output is correct
42 Correct 1 ms 8880 KB Output is correct
43 Correct 1 ms 8800 KB Output is correct
44 Correct 1 ms 8800 KB Output is correct
45 Correct 1 ms 8800 KB Output is correct
46 Correct 1 ms 6752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8796 KB Output is correct
5 Correct 1 ms 8796 KB Output is correct
6 Correct 1 ms 8604 KB Output is correct
7 Correct 1 ms 8796 KB Output is correct
8 Correct 1 ms 8796 KB Output is correct
9 Correct 1 ms 8628 KB Output is correct
10 Correct 1 ms 8800 KB Output is correct
11 Correct 1 ms 7008 KB Output is correct
12 Correct 1 ms 6496 KB Output is correct
13 Correct 1 ms 7008 KB Output is correct
14 Correct 1 ms 6844 KB Output is correct
15 Correct 1 ms 8800 KB Output is correct
16 Correct 1 ms 8800 KB Output is correct
17 Correct 1 ms 8800 KB Output is correct
18 Correct 1 ms 8800 KB Output is correct
19 Correct 1 ms 8800 KB Output is correct
20 Correct 1 ms 8800 KB Output is correct
21 Correct 1 ms 8800 KB Output is correct
22 Correct 1 ms 8800 KB Output is correct
23 Correct 1 ms 8880 KB Output is correct
24 Correct 1 ms 8800 KB Output is correct
25 Correct 1 ms 8800 KB Output is correct
26 Correct 1 ms 8800 KB Output is correct
27 Correct 1 ms 8800 KB Output is correct
28 Correct 1 ms 8800 KB Output is correct
29 Correct 1 ms 8800 KB Output is correct
30 Correct 1 ms 8800 KB Output is correct
31 Correct 1 ms 8800 KB Output is correct
32 Correct 1 ms 8880 KB Output is correct
33 Correct 1 ms 8800 KB Output is correct
34 Correct 1 ms 8800 KB Output is correct
35 Correct 1 ms 8800 KB Output is correct
36 Correct 1 ms 8800 KB Output is correct
37 Correct 1 ms 8624 KB Output is correct
38 Correct 1 ms 8800 KB Output is correct
39 Correct 1 ms 8800 KB Output is correct
40 Correct 1 ms 8800 KB Output is correct
41 Correct 1 ms 8800 KB Output is correct
42 Correct 1 ms 8880 KB Output is correct
43 Correct 1 ms 8800 KB Output is correct
44 Correct 1 ms 8800 KB Output is correct
45 Correct 1 ms 8800 KB Output is correct
46 Correct 1 ms 6752 KB Output is correct
47 Correct 1 ms 8552 KB Output is correct
48 Correct 1 ms 10856 KB Output is correct
49 Correct 1 ms 11100 KB Output is correct
50 Correct 1 ms 10844 KB Output is correct
51 Correct 1 ms 11096 KB Output is correct
52 Correct 1 ms 10956 KB Output is correct
53 Correct 1 ms 7004 KB Output is correct
54 Correct 1 ms 7260 KB Output is correct
55 Correct 1 ms 7260 KB Output is correct
56 Correct 1 ms 7260 KB Output is correct
57 Correct 2 ms 7256 KB Output is correct
58 Correct 1 ms 7260 KB Output is correct
59 Correct 1 ms 11100 KB Output is correct
60 Correct 1 ms 11100 KB Output is correct
61 Correct 1 ms 11100 KB Output is correct
62 Correct 1 ms 11356 KB Output is correct
63 Correct 2 ms 11356 KB Output is correct
64 Correct 2 ms 11356 KB Output is correct
65 Correct 1 ms 11356 KB Output is correct
66 Correct 2 ms 11356 KB Output is correct
67 Correct 2 ms 11356 KB Output is correct
68 Correct 1 ms 11356 KB Output is correct
69 Correct 1 ms 11452 KB Output is correct
70 Correct 2 ms 11356 KB Output is correct
71 Correct 2 ms 11356 KB Output is correct
72 Correct 1 ms 11356 KB Output is correct
73 Correct 2 ms 11356 KB Output is correct
74 Correct 1 ms 11356 KB Output is correct
75 Correct 2 ms 11356 KB Output is correct
76 Correct 1 ms 11100 KB Output is correct
77 Correct 1 ms 11440 KB Output is correct
78 Correct 1 ms 11100 KB Output is correct
79 Correct 1 ms 11356 KB Output is correct
80 Correct 1 ms 10844 KB Output is correct
81 Correct 1 ms 11100 KB Output is correct
82 Correct 1 ms 11100 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 1 ms 11096 KB Output is correct
85 Correct 1 ms 11100 KB Output is correct
86 Correct 1 ms 11100 KB Output is correct
87 Correct 1 ms 11100 KB Output is correct
88 Correct 1 ms 11100 KB Output is correct
89 Correct 1 ms 11100 KB Output is correct
90 Correct 2 ms 7260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 8792 KB Output is correct
4 Correct 3 ms 15964 KB Output is correct
5 Correct 4 ms 17756 KB Output is correct
6 Correct 1 ms 9052 KB Output is correct
7 Correct 4 ms 16988 KB Output is correct
8 Correct 4 ms 16816 KB Output is correct
9 Correct 2 ms 11100 KB Output is correct
10 Correct 3 ms 15708 KB Output is correct
11 Correct 3 ms 15880 KB Output is correct
12 Correct 2 ms 15452 KB Output is correct
13 Correct 3 ms 15708 KB Output is correct
14 Correct 3 ms 12636 KB Output is correct
15 Correct 7 ms 20988 KB Output is correct
16 Correct 6 ms 19932 KB Output is correct
17 Correct 7 ms 20060 KB Output is correct
18 Correct 6 ms 21260 KB Output is correct
19 Correct 7 ms 21292 KB Output is correct
20 Correct 7 ms 21332 KB Output is correct
21 Correct 6 ms 21336 KB Output is correct
22 Correct 6 ms 21340 KB Output is correct
23 Correct 6 ms 21328 KB Output is correct
24 Correct 6 ms 20060 KB Output is correct
25 Correct 6 ms 20060 KB Output is correct
26 Correct 6 ms 19804 KB Output is correct
27 Correct 6 ms 19972 KB Output is correct
28 Correct 5 ms 19800 KB Output is correct
29 Correct 5 ms 19804 KB Output is correct
30 Correct 7 ms 21248 KB Output is correct
31 Correct 6 ms 20824 KB Output is correct
32 Correct 4 ms 16988 KB Output is correct
33 Correct 7 ms 20828 KB Output is correct
34 Correct 4 ms 16476 KB Output is correct
35 Correct 6 ms 20740 KB Output is correct
36 Correct 3 ms 14172 KB Output is correct
37 Correct 4 ms 17500 KB Output is correct
38 Correct 4 ms 17500 KB Output is correct
39 Correct 4 ms 17500 KB Output is correct
40 Correct 4 ms 17500 KB Output is correct
41 Correct 3 ms 17500 KB Output is correct
42 Correct 5 ms 19352 KB Output is correct
43 Correct 5 ms 19452 KB Output is correct
44 Correct 3 ms 16984 KB Output is correct
45 Correct 4 ms 18524 KB Output is correct
46 Correct 3 ms 11612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8796 KB Output is correct
5 Correct 1 ms 8796 KB Output is correct
6 Correct 1 ms 8604 KB Output is correct
7 Correct 1 ms 8796 KB Output is correct
8 Correct 1 ms 8796 KB Output is correct
9 Correct 1 ms 8628 KB Output is correct
10 Correct 1 ms 8800 KB Output is correct
11 Correct 1 ms 7008 KB Output is correct
12 Correct 1 ms 6496 KB Output is correct
13 Correct 1 ms 7008 KB Output is correct
14 Correct 1 ms 6844 KB Output is correct
15 Correct 1 ms 8800 KB Output is correct
16 Correct 1 ms 8800 KB Output is correct
17 Correct 1 ms 8800 KB Output is correct
18 Correct 1 ms 8800 KB Output is correct
19 Correct 1 ms 8800 KB Output is correct
20 Correct 1 ms 8800 KB Output is correct
21 Correct 1 ms 8800 KB Output is correct
22 Correct 1 ms 8800 KB Output is correct
23 Correct 1 ms 8880 KB Output is correct
24 Correct 1 ms 8800 KB Output is correct
25 Correct 1 ms 8800 KB Output is correct
26 Correct 1 ms 8800 KB Output is correct
27 Correct 1 ms 8800 KB Output is correct
28 Correct 1 ms 8800 KB Output is correct
29 Correct 1 ms 8800 KB Output is correct
30 Correct 1 ms 8800 KB Output is correct
31 Correct 1 ms 8800 KB Output is correct
32 Correct 1 ms 8880 KB Output is correct
33 Correct 1 ms 8800 KB Output is correct
34 Correct 1 ms 8800 KB Output is correct
35 Correct 1 ms 8800 KB Output is correct
36 Correct 1 ms 8800 KB Output is correct
37 Correct 1 ms 8624 KB Output is correct
38 Correct 1 ms 8800 KB Output is correct
39 Correct 1 ms 8800 KB Output is correct
40 Correct 1 ms 8800 KB Output is correct
41 Correct 1 ms 8800 KB Output is correct
42 Correct 1 ms 8880 KB Output is correct
43 Correct 1 ms 8800 KB Output is correct
44 Correct 1 ms 8800 KB Output is correct
45 Correct 1 ms 8800 KB Output is correct
46 Correct 1 ms 6752 KB Output is correct
47 Correct 1 ms 8552 KB Output is correct
48 Correct 1 ms 10856 KB Output is correct
49 Correct 1 ms 11100 KB Output is correct
50 Correct 1 ms 10844 KB Output is correct
51 Correct 1 ms 11096 KB Output is correct
52 Correct 1 ms 10956 KB Output is correct
53 Correct 1 ms 7004 KB Output is correct
54 Correct 1 ms 7260 KB Output is correct
55 Correct 1 ms 7260 KB Output is correct
56 Correct 1 ms 7260 KB Output is correct
57 Correct 2 ms 7256 KB Output is correct
58 Correct 1 ms 7260 KB Output is correct
59 Correct 1 ms 11100 KB Output is correct
60 Correct 1 ms 11100 KB Output is correct
61 Correct 1 ms 11100 KB Output is correct
62 Correct 1 ms 11356 KB Output is correct
63 Correct 2 ms 11356 KB Output is correct
64 Correct 2 ms 11356 KB Output is correct
65 Correct 1 ms 11356 KB Output is correct
66 Correct 2 ms 11356 KB Output is correct
67 Correct 2 ms 11356 KB Output is correct
68 Correct 1 ms 11356 KB Output is correct
69 Correct 1 ms 11452 KB Output is correct
70 Correct 2 ms 11356 KB Output is correct
71 Correct 2 ms 11356 KB Output is correct
72 Correct 1 ms 11356 KB Output is correct
73 Correct 2 ms 11356 KB Output is correct
74 Correct 1 ms 11356 KB Output is correct
75 Correct 2 ms 11356 KB Output is correct
76 Correct 1 ms 11100 KB Output is correct
77 Correct 1 ms 11440 KB Output is correct
78 Correct 1 ms 11100 KB Output is correct
79 Correct 1 ms 11356 KB Output is correct
80 Correct 1 ms 10844 KB Output is correct
81 Correct 1 ms 11100 KB Output is correct
82 Correct 1 ms 11100 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 1 ms 11096 KB Output is correct
85 Correct 1 ms 11100 KB Output is correct
86 Correct 1 ms 11100 KB Output is correct
87 Correct 1 ms 11100 KB Output is correct
88 Correct 1 ms 11100 KB Output is correct
89 Correct 1 ms 11100 KB Output is correct
90 Correct 2 ms 7260 KB Output is correct
91 Correct 1 ms 8792 KB Output is correct
92 Correct 3 ms 15964 KB Output is correct
93 Correct 4 ms 17756 KB Output is correct
94 Correct 1 ms 9052 KB Output is correct
95 Correct 4 ms 16988 KB Output is correct
96 Correct 4 ms 16816 KB Output is correct
97 Correct 2 ms 11100 KB Output is correct
98 Correct 3 ms 15708 KB Output is correct
99 Correct 3 ms 15880 KB Output is correct
100 Correct 2 ms 15452 KB Output is correct
101 Correct 3 ms 15708 KB Output is correct
102 Correct 3 ms 12636 KB Output is correct
103 Correct 7 ms 20988 KB Output is correct
104 Correct 6 ms 19932 KB Output is correct
105 Correct 7 ms 20060 KB Output is correct
106 Correct 6 ms 21260 KB Output is correct
107 Correct 7 ms 21292 KB Output is correct
108 Correct 7 ms 21332 KB Output is correct
109 Correct 6 ms 21336 KB Output is correct
110 Correct 6 ms 21340 KB Output is correct
111 Correct 6 ms 21328 KB Output is correct
112 Correct 6 ms 20060 KB Output is correct
113 Correct 6 ms 20060 KB Output is correct
114 Correct 6 ms 19804 KB Output is correct
115 Correct 6 ms 19972 KB Output is correct
116 Correct 5 ms 19800 KB Output is correct
117 Correct 5 ms 19804 KB Output is correct
118 Correct 7 ms 21248 KB Output is correct
119 Correct 6 ms 20824 KB Output is correct
120 Correct 4 ms 16988 KB Output is correct
121 Correct 7 ms 20828 KB Output is correct
122 Correct 4 ms 16476 KB Output is correct
123 Correct 6 ms 20740 KB Output is correct
124 Correct 3 ms 14172 KB Output is correct
125 Correct 4 ms 17500 KB Output is correct
126 Correct 4 ms 17500 KB Output is correct
127 Correct 4 ms 17500 KB Output is correct
128 Correct 4 ms 17500 KB Output is correct
129 Correct 3 ms 17500 KB Output is correct
130 Correct 5 ms 19352 KB Output is correct
131 Correct 5 ms 19452 KB Output is correct
132 Correct 3 ms 16984 KB Output is correct
133 Correct 4 ms 18524 KB Output is correct
134 Correct 3 ms 11612 KB Output is correct
135 Correct 2 ms 15708 KB Output is correct
136 Correct 3 ms 17976 KB Output is correct
137 Correct 3 ms 17844 KB Output is correct
138 Correct 2 ms 11608 KB Output is correct
139 Correct 3 ms 18012 KB Output is correct
140 Correct 4 ms 16732 KB Output is correct
141 Correct 3 ms 13660 KB Output is correct
142 Correct 4 ms 14684 KB Output is correct
143 Correct 4 ms 14684 KB Output is correct
144 Correct 1 ms 6748 KB Output is correct
145 Correct 4 ms 14656 KB Output is correct
146 Correct 4 ms 14628 KB Output is correct
147 Correct 7 ms 21540 KB Output is correct
148 Correct 8 ms 22364 KB Output is correct
149 Correct 7 ms 22540 KB Output is correct
150 Correct 10 ms 25948 KB Output is correct
151 Correct 10 ms 25916 KB Output is correct
152 Correct 10 ms 25948 KB Output is correct
153 Correct 8 ms 25948 KB Output is correct
154 Correct 8 ms 26048 KB Output is correct
155 Correct 7 ms 25948 KB Output is correct
156 Correct 7 ms 23900 KB Output is correct
157 Correct 7 ms 23900 KB Output is correct
158 Correct 7 ms 23896 KB Output is correct
159 Correct 8 ms 23900 KB Output is correct
160 Correct 7 ms 23984 KB Output is correct
161 Correct 8 ms 23912 KB Output is correct
162 Correct 9 ms 25400 KB Output is correct
163 Correct 8 ms 25172 KB Output is correct
164 Correct 5 ms 19736 KB Output is correct
165 Correct 8 ms 24920 KB Output is correct
166 Correct 6 ms 22712 KB Output is correct
167 Correct 7 ms 24384 KB Output is correct
168 Correct 3 ms 16728 KB Output is correct
169 Correct 5 ms 20316 KB Output is correct
170 Correct 5 ms 20316 KB Output is correct
171 Correct 4 ms 20316 KB Output is correct
172 Correct 4 ms 20248 KB Output is correct
173 Correct 4 ms 20260 KB Output is correct
174 Correct 8 ms 24388 KB Output is correct
175 Correct 5 ms 22360 KB Output is correct
176 Correct 5 ms 22060 KB Output is correct
177 Correct 4 ms 19800 KB Output is correct
178 Correct 4 ms 14428 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 8536 KB Output is correct
2 Correct 1 ms 6492 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8796 KB Output is correct
5 Correct 1 ms 8796 KB Output is correct
6 Correct 1 ms 8604 KB Output is correct
7 Correct 1 ms 8796 KB Output is correct
8 Correct 1 ms 8796 KB Output is correct
9 Correct 1 ms 8628 KB Output is correct
10 Correct 1 ms 8800 KB Output is correct
11 Correct 1 ms 7008 KB Output is correct
12 Correct 1 ms 6496 KB Output is correct
13 Correct 1 ms 7008 KB Output is correct
14 Correct 1 ms 6844 KB Output is correct
15 Correct 1 ms 8800 KB Output is correct
16 Correct 1 ms 8800 KB Output is correct
17 Correct 1 ms 8800 KB Output is correct
18 Correct 1 ms 8800 KB Output is correct
19 Correct 1 ms 8800 KB Output is correct
20 Correct 1 ms 8800 KB Output is correct
21 Correct 1 ms 8800 KB Output is correct
22 Correct 1 ms 8800 KB Output is correct
23 Correct 1 ms 8880 KB Output is correct
24 Correct 1 ms 8800 KB Output is correct
25 Correct 1 ms 8800 KB Output is correct
26 Correct 1 ms 8800 KB Output is correct
27 Correct 1 ms 8800 KB Output is correct
28 Correct 1 ms 8800 KB Output is correct
29 Correct 1 ms 8800 KB Output is correct
30 Correct 1 ms 8800 KB Output is correct
31 Correct 1 ms 8800 KB Output is correct
32 Correct 1 ms 8880 KB Output is correct
33 Correct 1 ms 8800 KB Output is correct
34 Correct 1 ms 8800 KB Output is correct
35 Correct 1 ms 8800 KB Output is correct
36 Correct 1 ms 8800 KB Output is correct
37 Correct 1 ms 8624 KB Output is correct
38 Correct 1 ms 8800 KB Output is correct
39 Correct 1 ms 8800 KB Output is correct
40 Correct 1 ms 8800 KB Output is correct
41 Correct 1 ms 8800 KB Output is correct
42 Correct 1 ms 8880 KB Output is correct
43 Correct 1 ms 8800 KB Output is correct
44 Correct 1 ms 8800 KB Output is correct
45 Correct 1 ms 8800 KB Output is correct
46 Correct 1 ms 6752 KB Output is correct
47 Correct 1 ms 8552 KB Output is correct
48 Correct 1 ms 10856 KB Output is correct
49 Correct 1 ms 11100 KB Output is correct
50 Correct 1 ms 10844 KB Output is correct
51 Correct 1 ms 11096 KB Output is correct
52 Correct 1 ms 10956 KB Output is correct
53 Correct 1 ms 7004 KB Output is correct
54 Correct 1 ms 7260 KB Output is correct
55 Correct 1 ms 7260 KB Output is correct
56 Correct 1 ms 7260 KB Output is correct
57 Correct 2 ms 7256 KB Output is correct
58 Correct 1 ms 7260 KB Output is correct
59 Correct 1 ms 11100 KB Output is correct
60 Correct 1 ms 11100 KB Output is correct
61 Correct 1 ms 11100 KB Output is correct
62 Correct 1 ms 11356 KB Output is correct
63 Correct 2 ms 11356 KB Output is correct
64 Correct 2 ms 11356 KB Output is correct
65 Correct 1 ms 11356 KB Output is correct
66 Correct 2 ms 11356 KB Output is correct
67 Correct 2 ms 11356 KB Output is correct
68 Correct 1 ms 11356 KB Output is correct
69 Correct 1 ms 11452 KB Output is correct
70 Correct 2 ms 11356 KB Output is correct
71 Correct 2 ms 11356 KB Output is correct
72 Correct 1 ms 11356 KB Output is correct
73 Correct 2 ms 11356 KB Output is correct
74 Correct 1 ms 11356 KB Output is correct
75 Correct 2 ms 11356 KB Output is correct
76 Correct 1 ms 11100 KB Output is correct
77 Correct 1 ms 11440 KB Output is correct
78 Correct 1 ms 11100 KB Output is correct
79 Correct 1 ms 11356 KB Output is correct
80 Correct 1 ms 10844 KB Output is correct
81 Correct 1 ms 11100 KB Output is correct
82 Correct 1 ms 11100 KB Output is correct
83 Correct 1 ms 11100 KB Output is correct
84 Correct 1 ms 11096 KB Output is correct
85 Correct 1 ms 11100 KB Output is correct
86 Correct 1 ms 11100 KB Output is correct
87 Correct 1 ms 11100 KB Output is correct
88 Correct 1 ms 11100 KB Output is correct
89 Correct 1 ms 11100 KB Output is correct
90 Correct 2 ms 7260 KB Output is correct
91 Correct 1 ms 8792 KB Output is correct
92 Correct 3 ms 15964 KB Output is correct
93 Correct 4 ms 17756 KB Output is correct
94 Correct 1 ms 9052 KB Output is correct
95 Correct 4 ms 16988 KB Output is correct
96 Correct 4 ms 16816 KB Output is correct
97 Correct 2 ms 11100 KB Output is correct
98 Correct 3 ms 15708 KB Output is correct
99 Correct 3 ms 15880 KB Output is correct
100 Correct 2 ms 15452 KB Output is correct
101 Correct 3 ms 15708 KB Output is correct
102 Correct 3 ms 12636 KB Output is correct
103 Correct 7 ms 20988 KB Output is correct
104 Correct 6 ms 19932 KB Output is correct
105 Correct 7 ms 20060 KB Output is correct
106 Correct 6 ms 21260 KB Output is correct
107 Correct 7 ms 21292 KB Output is correct
108 Correct 7 ms 21332 KB Output is correct
109 Correct 6 ms 21336 KB Output is correct
110 Correct 6 ms 21340 KB Output is correct
111 Correct 6 ms 21328 KB Output is correct
112 Correct 6 ms 20060 KB Output is correct
113 Correct 6 ms 20060 KB Output is correct
114 Correct 6 ms 19804 KB Output is correct
115 Correct 6 ms 19972 KB Output is correct
116 Correct 5 ms 19800 KB Output is correct
117 Correct 5 ms 19804 KB Output is correct
118 Correct 7 ms 21248 KB Output is correct
119 Correct 6 ms 20824 KB Output is correct
120 Correct 4 ms 16988 KB Output is correct
121 Correct 7 ms 20828 KB Output is correct
122 Correct 4 ms 16476 KB Output is correct
123 Correct 6 ms 20740 KB Output is correct
124 Correct 3 ms 14172 KB Output is correct
125 Correct 4 ms 17500 KB Output is correct
126 Correct 4 ms 17500 KB Output is correct
127 Correct 4 ms 17500 KB Output is correct
128 Correct 4 ms 17500 KB Output is correct
129 Correct 3 ms 17500 KB Output is correct
130 Correct 5 ms 19352 KB Output is correct
131 Correct 5 ms 19452 KB Output is correct
132 Correct 3 ms 16984 KB Output is correct
133 Correct 4 ms 18524 KB Output is correct
134 Correct 3 ms 11612 KB Output is correct
135 Correct 2 ms 15708 KB Output is correct
136 Correct 3 ms 17976 KB Output is correct
137 Correct 3 ms 17844 KB Output is correct
138 Correct 2 ms 11608 KB Output is correct
139 Correct 3 ms 18012 KB Output is correct
140 Correct 4 ms 16732 KB Output is correct
141 Correct 3 ms 13660 KB Output is correct
142 Correct 4 ms 14684 KB Output is correct
143 Correct 4 ms 14684 KB Output is correct
144 Correct 1 ms 6748 KB Output is correct
145 Correct 4 ms 14656 KB Output is correct
146 Correct 4 ms 14628 KB Output is correct
147 Correct 7 ms 21540 KB Output is correct
148 Correct 8 ms 22364 KB Output is correct
149 Correct 7 ms 22540 KB Output is correct
150 Correct 10 ms 25948 KB Output is correct
151 Correct 10 ms 25916 KB Output is correct
152 Correct 10 ms 25948 KB Output is correct
153 Correct 8 ms 25948 KB Output is correct
154 Correct 8 ms 26048 KB Output is correct
155 Correct 7 ms 25948 KB Output is correct
156 Correct 7 ms 23900 KB Output is correct
157 Correct 7 ms 23900 KB Output is correct
158 Correct 7 ms 23896 KB Output is correct
159 Correct 8 ms 23900 KB Output is correct
160 Correct 7 ms 23984 KB Output is correct
161 Correct 8 ms 23912 KB Output is correct
162 Correct 9 ms 25400 KB Output is correct
163 Correct 8 ms 25172 KB Output is correct
164 Correct 5 ms 19736 KB Output is correct
165 Correct 8 ms 24920 KB Output is correct
166 Correct 6 ms 22712 KB Output is correct
167 Correct 7 ms 24384 KB Output is correct
168 Correct 3 ms 16728 KB Output is correct
169 Correct 5 ms 20316 KB Output is correct
170 Correct 5 ms 20316 KB Output is correct
171 Correct 4 ms 20316 KB Output is correct
172 Correct 4 ms 20248 KB Output is correct
173 Correct 4 ms 20260 KB Output is correct
174 Correct 8 ms 24388 KB Output is correct
175 Correct 5 ms 22360 KB Output is correct
176 Correct 5 ms 22060 KB Output is correct
177 Correct 4 ms 19800 KB Output is correct
178 Correct 4 ms 14428 KB Output is correct
179 Correct 10 ms 29448 KB Output is correct
180 Correct 34 ms 40160 KB Output is correct
181 Correct 23 ms 40152 KB Output is correct
182 Correct 14 ms 29740 KB Output is correct
183 Correct 28 ms 40144 KB Output is correct
184 Correct 26 ms 40076 KB Output is correct
185 Correct 22 ms 37280 KB Output is correct
186 Correct 28 ms 40164 KB Output is correct
187 Correct 25 ms 40276 KB Output is correct
188 Correct 18 ms 34900 KB Output is correct
189 Correct 31 ms 40272 KB Output is correct
190 Correct 25 ms 40272 KB Output is correct
191 Correct 105 ms 100692 KB Output is correct
192 Correct 157 ms 137192 KB Output is correct
193 Correct 116 ms 127056 KB Output is correct
194 Correct 172 ms 181076 KB Output is correct
195 Correct 148 ms 181072 KB Output is correct
196 Correct 146 ms 181072 KB Output is correct
197 Correct 100 ms 181072 KB Output is correct
198 Correct 127 ms 180956 KB Output is correct
199 Correct 142 ms 180916 KB Output is correct
200 Correct 123 ms 145984 KB Output is correct
201 Correct 112 ms 145976 KB Output is correct
202 Correct 99 ms 145492 KB Output is correct
203 Correct 108 ms 145652 KB Output is correct
204 Correct 120 ms 145520 KB Output is correct
205 Correct 102 ms 145568 KB Output is correct
206 Correct 123 ms 162640 KB Output is correct
207 Correct 145 ms 163344 KB Output is correct
208 Correct 120 ms 151548 KB Output is correct
209 Correct 143 ms 165396 KB Output is correct
210 Correct 100 ms 157248 KB Output is correct
211 Correct 148 ms 172824 KB Output is correct
212 Correct 25 ms 39164 KB Output is correct
213 Correct 81 ms 81464 KB Output is correct
214 Correct 62 ms 79060 KB Output is correct
215 Correct 68 ms 82560 KB Output is correct
216 Correct 62 ms 78220 KB Output is correct
217 Correct 79 ms 79112 KB Output is correct
218 Correct 38 ms 55380 KB Output is correct
219 Correct 100 ms 121564 KB Output is correct
220 Correct 94 ms 157268 KB Output is correct
221 Correct 74 ms 125112 KB Output is correct
222 Correct 32 ms 37712 KB Output is correct