Submission #1039569

# Submission time Handle Problem Language Result Execution time Memory
1039569 2024-07-31T04:38:30 Z 박영우(#11029) Toy (CEOI24_toy) C++17
100 / 100
329 ms 283476 KB
//#define LOCAL
#include <bits/stdc++.h>
#include <cassert>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<short, short> pss;
#define MAX 2020
#define MAXS 20
#define INF 1'000'000'010'000'000'000
#define bb ' '
#define ln '\n'
#define Ln '\n'
#define TC 0
#ifdef LOCAL
#define DEBUG(a) cout<<a
#else
#define DEBUG(...) 
#endif
int mp[MAX][MAX];
int chkh[MAX][MAX];
int chkv[MAX][MAX];
int dpu[MAX][MAX];
int dpd[MAX][MAX];
int dpl[MAX][MAX];
int dpr[MAX][MAX];
vector<int> adj[MAX * MAX];
int vis[MAX * MAX];
void dfs(int x) {
	vis[x] = 1;
	for (auto v : adj[x]) if (!vis[v]) dfs(v);
}
signed main() {
	ios::sync_with_stdio(false), cin.tie(0);
	int N, M, K, L;
	cin >> N >> M >> K >> L;
	swap(N, M);
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	swap(a, b);
	swap(c, d);
	a++;
	d++;
	int x, y;
	x = a;
	y = d;
	int i, j;
	string s;
	int gx, gy;
	for (i = 1; i <= N; i++) {
		cin >> s;
		for (j = 1; j <= M; j++) {
			mp[i][j] = 1;
			if (s[j - 1] == 'X') mp[i][j] = 0;
			if (s[j - 1] == '*') {
				gx = i;
				gy = j;
			}
		}
	}
	for (i = 1; i <= N; i++) {
		for (j = 1; j <= M; j++) {
			if (mp[i][j]) {
				dpu[i][j] = dpu[i - 1][j] + 1;
				dpl[i][j] = dpl[i][j - 1] + 1;
			}
		}
	}
	for (i = N; i > 0; i--) {
		for (j = M; j > 0; j--) {
			if (mp[i][j]) {
				dpd[i][j] = dpd[i + 1][j] + 1;
				dpr[i][j] = dpr[i][j + 1] + 1;
			}
		}
	}
	for (i = N; i > 0; i--) {
		for (j = M; j > 0; j--) {
			if (dpu[i][j] + dpd[i][j] - 1 < L) mp[i][j] = 0;
			if (dpl[i][j] + dpr[i][j] - 1 < K) mp[i][j] = 0;
		}
	}
	auto get = [&](int x, int y) { return (x - 1) * M + y; };
	auto add = [&](int a, int b) {
		adj[a].push_back(b);
		adj[b].push_back(a);
	};
	for (i = 1; i <= N; i++) {
		for (j = 1; j <= M; j++) DEBUG(mp[i][j] << bb);
		DEBUG(ln);
	}
	for (i = 1; i <= N; i++) {
		for (j = 1; j <= M; j++) {
			if (mp[i][j] && mp[i][j + 1]) {
				int um = min(dpu[i][j], dpu[i][j + 1]);
				int dm = min(dpd[i][j], dpd[i][j + 1]);
				if (um + dm - 1 >= L) add(get(i, j), get(i, j + 1));
			}
			if (mp[i][j] && mp[i + 1][j]) {
				int lm = min(dpl[i][j], dpl[i + 1][j]);
				int rm = min(dpr[i][j], dpr[i + 1][j]);
				if (lm + rm - 1 >= K) add(get(i, j), get(i + 1, j));
			}
		}
	}
	dfs(get(x, y));
	if (vis[get(gx, gy)]) cout << "YES";
	else cout << "NO";
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:113:13: warning: 'gy' may be used uninitialized in this function [-Wmaybe-uninitialized]
  113 |  if (vis[get(gx, gy)]) cout << "YES";
      |          ~~~^~~~~~~~
Main.cpp:113:13: warning: 'gx' may be used uninitialized in this function [-Wmaybe-uninitialized]
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
3 Correct 36 ms 97884 KB Output is correct
4 Correct 37 ms 98900 KB Output is correct
5 Correct 37 ms 98764 KB Output is correct
6 Correct 44 ms 98644 KB Output is correct
7 Correct 43 ms 98640 KB Output is correct
8 Correct 36 ms 98640 KB Output is correct
9 Correct 35 ms 98388 KB Output is correct
10 Correct 36 ms 98644 KB Output is correct
11 Correct 35 ms 98668 KB Output is correct
12 Correct 38 ms 97636 KB Output is correct
13 Correct 36 ms 98652 KB Output is correct
14 Correct 36 ms 98648 KB Output is correct
15 Correct 39 ms 98908 KB Output is correct
16 Correct 37 ms 98748 KB Output is correct
17 Correct 36 ms 98704 KB Output is correct
18 Correct 41 ms 98896 KB Output is correct
19 Correct 35 ms 98900 KB Output is correct
20 Correct 36 ms 98896 KB Output is correct
21 Correct 42 ms 98900 KB Output is correct
22 Correct 44 ms 98896 KB Output is correct
23 Correct 36 ms 98908 KB Output is correct
24 Correct 37 ms 98900 KB Output is correct
25 Correct 36 ms 98900 KB Output is correct
26 Correct 35 ms 98640 KB Output is correct
27 Correct 37 ms 98716 KB Output is correct
28 Correct 36 ms 98908 KB Output is correct
29 Correct 41 ms 99008 KB Output is correct
30 Correct 44 ms 98644 KB Output is correct
31 Correct 34 ms 98644 KB Output is correct
32 Correct 33 ms 98652 KB Output is correct
33 Correct 36 ms 98908 KB Output is correct
34 Correct 34 ms 98640 KB Output is correct
35 Correct 36 ms 98844 KB Output is correct
36 Correct 35 ms 98640 KB Output is correct
37 Correct 36 ms 98900 KB Output is correct
38 Correct 34 ms 98652 KB Output is correct
39 Correct 33 ms 98808 KB Output is correct
40 Correct 36 ms 98780 KB Output is correct
41 Correct 39 ms 98808 KB Output is correct
42 Correct 33 ms 98900 KB Output is correct
43 Correct 34 ms 98900 KB Output is correct
44 Correct 31 ms 98908 KB Output is correct
45 Correct 38 ms 98724 KB Output is correct
46 Correct 34 ms 98388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
3 Correct 36 ms 97884 KB Output is correct
4 Correct 37 ms 98900 KB Output is correct
5 Correct 37 ms 98764 KB Output is correct
6 Correct 44 ms 98644 KB Output is correct
7 Correct 43 ms 98640 KB Output is correct
8 Correct 36 ms 98640 KB Output is correct
9 Correct 35 ms 98388 KB Output is correct
10 Correct 36 ms 98644 KB Output is correct
11 Correct 35 ms 98668 KB Output is correct
12 Correct 38 ms 97636 KB Output is correct
13 Correct 36 ms 98652 KB Output is correct
14 Correct 36 ms 98648 KB Output is correct
15 Correct 39 ms 98908 KB Output is correct
16 Correct 37 ms 98748 KB Output is correct
17 Correct 36 ms 98704 KB Output is correct
18 Correct 41 ms 98896 KB Output is correct
19 Correct 35 ms 98900 KB Output is correct
20 Correct 36 ms 98896 KB Output is correct
21 Correct 42 ms 98900 KB Output is correct
22 Correct 44 ms 98896 KB Output is correct
23 Correct 36 ms 98908 KB Output is correct
24 Correct 37 ms 98900 KB Output is correct
25 Correct 36 ms 98900 KB Output is correct
26 Correct 35 ms 98640 KB Output is correct
27 Correct 37 ms 98716 KB Output is correct
28 Correct 36 ms 98908 KB Output is correct
29 Correct 41 ms 99008 KB Output is correct
30 Correct 44 ms 98644 KB Output is correct
31 Correct 34 ms 98644 KB Output is correct
32 Correct 33 ms 98652 KB Output is correct
33 Correct 36 ms 98908 KB Output is correct
34 Correct 34 ms 98640 KB Output is correct
35 Correct 36 ms 98844 KB Output is correct
36 Correct 35 ms 98640 KB Output is correct
37 Correct 36 ms 98900 KB Output is correct
38 Correct 34 ms 98652 KB Output is correct
39 Correct 33 ms 98808 KB Output is correct
40 Correct 36 ms 98780 KB Output is correct
41 Correct 39 ms 98808 KB Output is correct
42 Correct 33 ms 98900 KB Output is correct
43 Correct 34 ms 98900 KB Output is correct
44 Correct 31 ms 98908 KB Output is correct
45 Correct 38 ms 98724 KB Output is correct
46 Correct 34 ms 98388 KB Output is correct
47 Correct 32 ms 98388 KB Output is correct
48 Correct 36 ms 99928 KB Output is correct
49 Correct 35 ms 99720 KB Output is correct
50 Correct 34 ms 99676 KB Output is correct
51 Correct 36 ms 99676 KB Output is correct
52 Correct 34 ms 99500 KB Output is correct
53 Correct 36 ms 98900 KB Output is correct
54 Correct 35 ms 99444 KB Output is correct
55 Correct 37 ms 99668 KB Output is correct
56 Correct 34 ms 99420 KB Output is correct
57 Correct 35 ms 99664 KB Output is correct
58 Correct 45 ms 99672 KB Output is correct
59 Correct 37 ms 99920 KB Output is correct
60 Correct 37 ms 99916 KB Output is correct
61 Correct 36 ms 99768 KB Output is correct
62 Correct 36 ms 99932 KB Output is correct
63 Correct 37 ms 100096 KB Output is correct
64 Correct 37 ms 99924 KB Output is correct
65 Correct 42 ms 99928 KB Output is correct
66 Correct 38 ms 99924 KB Output is correct
67 Correct 38 ms 99920 KB Output is correct
68 Correct 39 ms 100000 KB Output is correct
69 Correct 40 ms 99924 KB Output is correct
70 Correct 35 ms 99932 KB Output is correct
71 Correct 38 ms 100060 KB Output is correct
72 Correct 38 ms 99920 KB Output is correct
73 Correct 39 ms 99924 KB Output is correct
74 Correct 35 ms 99936 KB Output is correct
75 Correct 35 ms 99676 KB Output is correct
76 Correct 35 ms 99920 KB Output is correct
77 Correct 34 ms 99928 KB Output is correct
78 Correct 37 ms 99924 KB Output is correct
79 Correct 37 ms 99808 KB Output is correct
80 Correct 34 ms 99416 KB Output is correct
81 Correct 35 ms 99656 KB Output is correct
82 Correct 35 ms 99664 KB Output is correct
83 Correct 37 ms 99664 KB Output is correct
84 Correct 33 ms 99676 KB Output is correct
85 Correct 41 ms 99888 KB Output is correct
86 Correct 33 ms 100128 KB Output is correct
87 Correct 36 ms 99912 KB Output is correct
88 Correct 33 ms 99928 KB Output is correct
89 Correct 41 ms 99924 KB Output is correct
90 Correct 34 ms 99544 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
3 Correct 32 ms 98392 KB Output is correct
4 Correct 43 ms 110384 KB Output is correct
5 Correct 44 ms 110264 KB Output is correct
6 Correct 35 ms 99676 KB Output is correct
7 Correct 47 ms 110160 KB Output is correct
8 Correct 46 ms 109904 KB Output is correct
9 Correct 38 ms 100956 KB Output is correct
10 Correct 45 ms 107348 KB Output is correct
11 Correct 40 ms 106580 KB Output is correct
12 Correct 44 ms 103256 KB Output is correct
13 Correct 43 ms 105376 KB Output is correct
14 Correct 39 ms 105240 KB Output is correct
15 Correct 46 ms 109908 KB Output is correct
16 Correct 45 ms 109444 KB Output is correct
17 Correct 47 ms 109656 KB Output is correct
18 Correct 47 ms 110500 KB Output is correct
19 Correct 48 ms 110420 KB Output is correct
20 Correct 52 ms 110420 KB Output is correct
21 Correct 45 ms 110416 KB Output is correct
22 Correct 43 ms 110416 KB Output is correct
23 Correct 49 ms 110416 KB Output is correct
24 Correct 50 ms 110420 KB Output is correct
25 Correct 50 ms 110416 KB Output is correct
26 Correct 44 ms 109812 KB Output is correct
27 Correct 45 ms 109868 KB Output is correct
28 Correct 43 ms 109792 KB Output is correct
29 Correct 44 ms 109904 KB Output is correct
30 Correct 45 ms 109904 KB Output is correct
31 Correct 44 ms 109660 KB Output is correct
32 Correct 43 ms 110176 KB Output is correct
33 Correct 43 ms 109404 KB Output is correct
34 Correct 48 ms 109392 KB Output is correct
35 Correct 49 ms 109396 KB Output is correct
36 Correct 40 ms 105116 KB Output is correct
37 Correct 47 ms 108624 KB Output is correct
38 Correct 50 ms 108376 KB Output is correct
39 Correct 46 ms 108380 KB Output is correct
40 Correct 49 ms 108624 KB Output is correct
41 Correct 46 ms 108368 KB Output is correct
42 Correct 55 ms 110328 KB Output is correct
43 Correct 48 ms 110424 KB Output is correct
44 Correct 50 ms 110348 KB Output is correct
45 Correct 60 ms 110388 KB Output is correct
46 Correct 40 ms 103520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
3 Correct 36 ms 97884 KB Output is correct
4 Correct 37 ms 98900 KB Output is correct
5 Correct 37 ms 98764 KB Output is correct
6 Correct 44 ms 98644 KB Output is correct
7 Correct 43 ms 98640 KB Output is correct
8 Correct 36 ms 98640 KB Output is correct
9 Correct 35 ms 98388 KB Output is correct
10 Correct 36 ms 98644 KB Output is correct
11 Correct 35 ms 98668 KB Output is correct
12 Correct 38 ms 97636 KB Output is correct
13 Correct 36 ms 98652 KB Output is correct
14 Correct 36 ms 98648 KB Output is correct
15 Correct 39 ms 98908 KB Output is correct
16 Correct 37 ms 98748 KB Output is correct
17 Correct 36 ms 98704 KB Output is correct
18 Correct 41 ms 98896 KB Output is correct
19 Correct 35 ms 98900 KB Output is correct
20 Correct 36 ms 98896 KB Output is correct
21 Correct 42 ms 98900 KB Output is correct
22 Correct 44 ms 98896 KB Output is correct
23 Correct 36 ms 98908 KB Output is correct
24 Correct 37 ms 98900 KB Output is correct
25 Correct 36 ms 98900 KB Output is correct
26 Correct 35 ms 98640 KB Output is correct
27 Correct 37 ms 98716 KB Output is correct
28 Correct 36 ms 98908 KB Output is correct
29 Correct 41 ms 99008 KB Output is correct
30 Correct 44 ms 98644 KB Output is correct
31 Correct 34 ms 98644 KB Output is correct
32 Correct 33 ms 98652 KB Output is correct
33 Correct 36 ms 98908 KB Output is correct
34 Correct 34 ms 98640 KB Output is correct
35 Correct 36 ms 98844 KB Output is correct
36 Correct 35 ms 98640 KB Output is correct
37 Correct 36 ms 98900 KB Output is correct
38 Correct 34 ms 98652 KB Output is correct
39 Correct 33 ms 98808 KB Output is correct
40 Correct 36 ms 98780 KB Output is correct
41 Correct 39 ms 98808 KB Output is correct
42 Correct 33 ms 98900 KB Output is correct
43 Correct 34 ms 98900 KB Output is correct
44 Correct 31 ms 98908 KB Output is correct
45 Correct 38 ms 98724 KB Output is correct
46 Correct 34 ms 98388 KB Output is correct
47 Correct 32 ms 98388 KB Output is correct
48 Correct 36 ms 99928 KB Output is correct
49 Correct 35 ms 99720 KB Output is correct
50 Correct 34 ms 99676 KB Output is correct
51 Correct 36 ms 99676 KB Output is correct
52 Correct 34 ms 99500 KB Output is correct
53 Correct 36 ms 98900 KB Output is correct
54 Correct 35 ms 99444 KB Output is correct
55 Correct 37 ms 99668 KB Output is correct
56 Correct 34 ms 99420 KB Output is correct
57 Correct 35 ms 99664 KB Output is correct
58 Correct 45 ms 99672 KB Output is correct
59 Correct 37 ms 99920 KB Output is correct
60 Correct 37 ms 99916 KB Output is correct
61 Correct 36 ms 99768 KB Output is correct
62 Correct 36 ms 99932 KB Output is correct
63 Correct 37 ms 100096 KB Output is correct
64 Correct 37 ms 99924 KB Output is correct
65 Correct 42 ms 99928 KB Output is correct
66 Correct 38 ms 99924 KB Output is correct
67 Correct 38 ms 99920 KB Output is correct
68 Correct 39 ms 100000 KB Output is correct
69 Correct 40 ms 99924 KB Output is correct
70 Correct 35 ms 99932 KB Output is correct
71 Correct 38 ms 100060 KB Output is correct
72 Correct 38 ms 99920 KB Output is correct
73 Correct 39 ms 99924 KB Output is correct
74 Correct 35 ms 99936 KB Output is correct
75 Correct 35 ms 99676 KB Output is correct
76 Correct 35 ms 99920 KB Output is correct
77 Correct 34 ms 99928 KB Output is correct
78 Correct 37 ms 99924 KB Output is correct
79 Correct 37 ms 99808 KB Output is correct
80 Correct 34 ms 99416 KB Output is correct
81 Correct 35 ms 99656 KB Output is correct
82 Correct 35 ms 99664 KB Output is correct
83 Correct 37 ms 99664 KB Output is correct
84 Correct 33 ms 99676 KB Output is correct
85 Correct 41 ms 99888 KB Output is correct
86 Correct 33 ms 100128 KB Output is correct
87 Correct 36 ms 99912 KB Output is correct
88 Correct 33 ms 99928 KB Output is correct
89 Correct 41 ms 99924 KB Output is correct
90 Correct 34 ms 99544 KB Output is correct
91 Correct 32 ms 98392 KB Output is correct
92 Correct 43 ms 110384 KB Output is correct
93 Correct 44 ms 110264 KB Output is correct
94 Correct 35 ms 99676 KB Output is correct
95 Correct 47 ms 110160 KB Output is correct
96 Correct 46 ms 109904 KB Output is correct
97 Correct 38 ms 100956 KB Output is correct
98 Correct 45 ms 107348 KB Output is correct
99 Correct 40 ms 106580 KB Output is correct
100 Correct 44 ms 103256 KB Output is correct
101 Correct 43 ms 105376 KB Output is correct
102 Correct 39 ms 105240 KB Output is correct
103 Correct 46 ms 109908 KB Output is correct
104 Correct 45 ms 109444 KB Output is correct
105 Correct 47 ms 109656 KB Output is correct
106 Correct 47 ms 110500 KB Output is correct
107 Correct 48 ms 110420 KB Output is correct
108 Correct 52 ms 110420 KB Output is correct
109 Correct 45 ms 110416 KB Output is correct
110 Correct 43 ms 110416 KB Output is correct
111 Correct 49 ms 110416 KB Output is correct
112 Correct 50 ms 110420 KB Output is correct
113 Correct 50 ms 110416 KB Output is correct
114 Correct 44 ms 109812 KB Output is correct
115 Correct 45 ms 109868 KB Output is correct
116 Correct 43 ms 109792 KB Output is correct
117 Correct 44 ms 109904 KB Output is correct
118 Correct 45 ms 109904 KB Output is correct
119 Correct 44 ms 109660 KB Output is correct
120 Correct 43 ms 110176 KB Output is correct
121 Correct 43 ms 109404 KB Output is correct
122 Correct 48 ms 109392 KB Output is correct
123 Correct 49 ms 109396 KB Output is correct
124 Correct 40 ms 105116 KB Output is correct
125 Correct 47 ms 108624 KB Output is correct
126 Correct 50 ms 108376 KB Output is correct
127 Correct 46 ms 108380 KB Output is correct
128 Correct 49 ms 108624 KB Output is correct
129 Correct 46 ms 108368 KB Output is correct
130 Correct 55 ms 110328 KB Output is correct
131 Correct 48 ms 110424 KB Output is correct
132 Correct 50 ms 110348 KB Output is correct
133 Correct 60 ms 110388 KB Output is correct
134 Correct 40 ms 103520 KB Output is correct
135 Correct 39 ms 104084 KB Output is correct
136 Correct 57 ms 110928 KB Output is correct
137 Correct 54 ms 109392 KB Output is correct
138 Correct 48 ms 102480 KB Output is correct
139 Correct 43 ms 108284 KB Output is correct
140 Correct 40 ms 107356 KB Output is correct
141 Correct 40 ms 105564 KB Output is correct
142 Correct 44 ms 107348 KB Output is correct
143 Correct 48 ms 107344 KB Output is correct
144 Correct 36 ms 98356 KB Output is correct
145 Correct 44 ms 107356 KB Output is correct
146 Correct 41 ms 107272 KB Output is correct
147 Correct 51 ms 113412 KB Output is correct
148 Correct 51 ms 113488 KB Output is correct
149 Correct 57 ms 112644 KB Output is correct
150 Correct 53 ms 114516 KB Output is correct
151 Correct 53 ms 114516 KB Output is correct
152 Correct 53 ms 114748 KB Output is correct
153 Correct 53 ms 114512 KB Output is correct
154 Correct 62 ms 114516 KB Output is correct
155 Correct 52 ms 114512 KB Output is correct
156 Correct 54 ms 114712 KB Output is correct
157 Correct 53 ms 114512 KB Output is correct
158 Correct 52 ms 114188 KB Output is correct
159 Correct 53 ms 114256 KB Output is correct
160 Correct 52 ms 114164 KB Output is correct
161 Correct 53 ms 114004 KB Output is correct
162 Correct 50 ms 113368 KB Output is correct
163 Correct 51 ms 113232 KB Output is correct
164 Correct 54 ms 114004 KB Output is correct
165 Correct 51 ms 112724 KB Output is correct
166 Correct 53 ms 113744 KB Output is correct
167 Correct 51 ms 113112 KB Output is correct
168 Correct 40 ms 106840 KB Output is correct
169 Correct 50 ms 111696 KB Output is correct
170 Correct 52 ms 112000 KB Output is correct
171 Correct 50 ms 111320 KB Output is correct
172 Correct 52 ms 110932 KB Output is correct
173 Correct 50 ms 111696 KB Output is correct
174 Correct 52 ms 114512 KB Output is correct
175 Correct 53 ms 114520 KB Output is correct
176 Correct 55 ms 114512 KB Output is correct
177 Correct 65 ms 114516 KB Output is correct
178 Correct 42 ms 105044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 97616 KB Output is correct
2 Correct 36 ms 97688 KB Output is correct
3 Correct 36 ms 97884 KB Output is correct
4 Correct 37 ms 98900 KB Output is correct
5 Correct 37 ms 98764 KB Output is correct
6 Correct 44 ms 98644 KB Output is correct
7 Correct 43 ms 98640 KB Output is correct
8 Correct 36 ms 98640 KB Output is correct
9 Correct 35 ms 98388 KB Output is correct
10 Correct 36 ms 98644 KB Output is correct
11 Correct 35 ms 98668 KB Output is correct
12 Correct 38 ms 97636 KB Output is correct
13 Correct 36 ms 98652 KB Output is correct
14 Correct 36 ms 98648 KB Output is correct
15 Correct 39 ms 98908 KB Output is correct
16 Correct 37 ms 98748 KB Output is correct
17 Correct 36 ms 98704 KB Output is correct
18 Correct 41 ms 98896 KB Output is correct
19 Correct 35 ms 98900 KB Output is correct
20 Correct 36 ms 98896 KB Output is correct
21 Correct 42 ms 98900 KB Output is correct
22 Correct 44 ms 98896 KB Output is correct
23 Correct 36 ms 98908 KB Output is correct
24 Correct 37 ms 98900 KB Output is correct
25 Correct 36 ms 98900 KB Output is correct
26 Correct 35 ms 98640 KB Output is correct
27 Correct 37 ms 98716 KB Output is correct
28 Correct 36 ms 98908 KB Output is correct
29 Correct 41 ms 99008 KB Output is correct
30 Correct 44 ms 98644 KB Output is correct
31 Correct 34 ms 98644 KB Output is correct
32 Correct 33 ms 98652 KB Output is correct
33 Correct 36 ms 98908 KB Output is correct
34 Correct 34 ms 98640 KB Output is correct
35 Correct 36 ms 98844 KB Output is correct
36 Correct 35 ms 98640 KB Output is correct
37 Correct 36 ms 98900 KB Output is correct
38 Correct 34 ms 98652 KB Output is correct
39 Correct 33 ms 98808 KB Output is correct
40 Correct 36 ms 98780 KB Output is correct
41 Correct 39 ms 98808 KB Output is correct
42 Correct 33 ms 98900 KB Output is correct
43 Correct 34 ms 98900 KB Output is correct
44 Correct 31 ms 98908 KB Output is correct
45 Correct 38 ms 98724 KB Output is correct
46 Correct 34 ms 98388 KB Output is correct
47 Correct 32 ms 98388 KB Output is correct
48 Correct 36 ms 99928 KB Output is correct
49 Correct 35 ms 99720 KB Output is correct
50 Correct 34 ms 99676 KB Output is correct
51 Correct 36 ms 99676 KB Output is correct
52 Correct 34 ms 99500 KB Output is correct
53 Correct 36 ms 98900 KB Output is correct
54 Correct 35 ms 99444 KB Output is correct
55 Correct 37 ms 99668 KB Output is correct
56 Correct 34 ms 99420 KB Output is correct
57 Correct 35 ms 99664 KB Output is correct
58 Correct 45 ms 99672 KB Output is correct
59 Correct 37 ms 99920 KB Output is correct
60 Correct 37 ms 99916 KB Output is correct
61 Correct 36 ms 99768 KB Output is correct
62 Correct 36 ms 99932 KB Output is correct
63 Correct 37 ms 100096 KB Output is correct
64 Correct 37 ms 99924 KB Output is correct
65 Correct 42 ms 99928 KB Output is correct
66 Correct 38 ms 99924 KB Output is correct
67 Correct 38 ms 99920 KB Output is correct
68 Correct 39 ms 100000 KB Output is correct
69 Correct 40 ms 99924 KB Output is correct
70 Correct 35 ms 99932 KB Output is correct
71 Correct 38 ms 100060 KB Output is correct
72 Correct 38 ms 99920 KB Output is correct
73 Correct 39 ms 99924 KB Output is correct
74 Correct 35 ms 99936 KB Output is correct
75 Correct 35 ms 99676 KB Output is correct
76 Correct 35 ms 99920 KB Output is correct
77 Correct 34 ms 99928 KB Output is correct
78 Correct 37 ms 99924 KB Output is correct
79 Correct 37 ms 99808 KB Output is correct
80 Correct 34 ms 99416 KB Output is correct
81 Correct 35 ms 99656 KB Output is correct
82 Correct 35 ms 99664 KB Output is correct
83 Correct 37 ms 99664 KB Output is correct
84 Correct 33 ms 99676 KB Output is correct
85 Correct 41 ms 99888 KB Output is correct
86 Correct 33 ms 100128 KB Output is correct
87 Correct 36 ms 99912 KB Output is correct
88 Correct 33 ms 99928 KB Output is correct
89 Correct 41 ms 99924 KB Output is correct
90 Correct 34 ms 99544 KB Output is correct
91 Correct 32 ms 98392 KB Output is correct
92 Correct 43 ms 110384 KB Output is correct
93 Correct 44 ms 110264 KB Output is correct
94 Correct 35 ms 99676 KB Output is correct
95 Correct 47 ms 110160 KB Output is correct
96 Correct 46 ms 109904 KB Output is correct
97 Correct 38 ms 100956 KB Output is correct
98 Correct 45 ms 107348 KB Output is correct
99 Correct 40 ms 106580 KB Output is correct
100 Correct 44 ms 103256 KB Output is correct
101 Correct 43 ms 105376 KB Output is correct
102 Correct 39 ms 105240 KB Output is correct
103 Correct 46 ms 109908 KB Output is correct
104 Correct 45 ms 109444 KB Output is correct
105 Correct 47 ms 109656 KB Output is correct
106 Correct 47 ms 110500 KB Output is correct
107 Correct 48 ms 110420 KB Output is correct
108 Correct 52 ms 110420 KB Output is correct
109 Correct 45 ms 110416 KB Output is correct
110 Correct 43 ms 110416 KB Output is correct
111 Correct 49 ms 110416 KB Output is correct
112 Correct 50 ms 110420 KB Output is correct
113 Correct 50 ms 110416 KB Output is correct
114 Correct 44 ms 109812 KB Output is correct
115 Correct 45 ms 109868 KB Output is correct
116 Correct 43 ms 109792 KB Output is correct
117 Correct 44 ms 109904 KB Output is correct
118 Correct 45 ms 109904 KB Output is correct
119 Correct 44 ms 109660 KB Output is correct
120 Correct 43 ms 110176 KB Output is correct
121 Correct 43 ms 109404 KB Output is correct
122 Correct 48 ms 109392 KB Output is correct
123 Correct 49 ms 109396 KB Output is correct
124 Correct 40 ms 105116 KB Output is correct
125 Correct 47 ms 108624 KB Output is correct
126 Correct 50 ms 108376 KB Output is correct
127 Correct 46 ms 108380 KB Output is correct
128 Correct 49 ms 108624 KB Output is correct
129 Correct 46 ms 108368 KB Output is correct
130 Correct 55 ms 110328 KB Output is correct
131 Correct 48 ms 110424 KB Output is correct
132 Correct 50 ms 110348 KB Output is correct
133 Correct 60 ms 110388 KB Output is correct
134 Correct 40 ms 103520 KB Output is correct
135 Correct 39 ms 104084 KB Output is correct
136 Correct 57 ms 110928 KB Output is correct
137 Correct 54 ms 109392 KB Output is correct
138 Correct 48 ms 102480 KB Output is correct
139 Correct 43 ms 108284 KB Output is correct
140 Correct 40 ms 107356 KB Output is correct
141 Correct 40 ms 105564 KB Output is correct
142 Correct 44 ms 107348 KB Output is correct
143 Correct 48 ms 107344 KB Output is correct
144 Correct 36 ms 98356 KB Output is correct
145 Correct 44 ms 107356 KB Output is correct
146 Correct 41 ms 107272 KB Output is correct
147 Correct 51 ms 113412 KB Output is correct
148 Correct 51 ms 113488 KB Output is correct
149 Correct 57 ms 112644 KB Output is correct
150 Correct 53 ms 114516 KB Output is correct
151 Correct 53 ms 114516 KB Output is correct
152 Correct 53 ms 114748 KB Output is correct
153 Correct 53 ms 114512 KB Output is correct
154 Correct 62 ms 114516 KB Output is correct
155 Correct 52 ms 114512 KB Output is correct
156 Correct 54 ms 114712 KB Output is correct
157 Correct 53 ms 114512 KB Output is correct
158 Correct 52 ms 114188 KB Output is correct
159 Correct 53 ms 114256 KB Output is correct
160 Correct 52 ms 114164 KB Output is correct
161 Correct 53 ms 114004 KB Output is correct
162 Correct 50 ms 113368 KB Output is correct
163 Correct 51 ms 113232 KB Output is correct
164 Correct 54 ms 114004 KB Output is correct
165 Correct 51 ms 112724 KB Output is correct
166 Correct 53 ms 113744 KB Output is correct
167 Correct 51 ms 113112 KB Output is correct
168 Correct 40 ms 106840 KB Output is correct
169 Correct 50 ms 111696 KB Output is correct
170 Correct 52 ms 112000 KB Output is correct
171 Correct 50 ms 111320 KB Output is correct
172 Correct 52 ms 110932 KB Output is correct
173 Correct 50 ms 111696 KB Output is correct
174 Correct 52 ms 114512 KB Output is correct
175 Correct 53 ms 114520 KB Output is correct
176 Correct 55 ms 114512 KB Output is correct
177 Correct 65 ms 114516 KB Output is correct
178 Correct 42 ms 105044 KB Output is correct
179 Correct 86 ms 140624 KB Output is correct
180 Correct 197 ms 185172 KB Output is correct
181 Correct 79 ms 159568 KB Output is correct
182 Correct 52 ms 128788 KB Output is correct
183 Correct 73 ms 156992 KB Output is correct
184 Correct 76 ms 157008 KB Output is correct
185 Correct 74 ms 149588 KB Output is correct
186 Correct 82 ms 157008 KB Output is correct
187 Correct 81 ms 157008 KB Output is correct
188 Correct 71 ms 143700 KB Output is correct
189 Correct 97 ms 157012 KB Output is correct
190 Correct 95 ms 156988 KB Output is correct
191 Correct 306 ms 257620 KB Output is correct
192 Correct 295 ms 270164 KB Output is correct
193 Correct 279 ms 263248 KB Output is correct
194 Correct 313 ms 283216 KB Output is correct
195 Correct 302 ms 283216 KB Output is correct
196 Correct 322 ms 283220 KB Output is correct
197 Correct 314 ms 283476 KB Output is correct
198 Correct 300 ms 283112 KB Output is correct
199 Correct 310 ms 283216 KB Output is correct
200 Correct 329 ms 282964 KB Output is correct
201 Correct 310 ms 282960 KB Output is correct
202 Correct 310 ms 274256 KB Output is correct
203 Correct 309 ms 274352 KB Output is correct
204 Correct 319 ms 274220 KB Output is correct
205 Correct 301 ms 274256 KB Output is correct
206 Correct 276 ms 265040 KB Output is correct
207 Correct 293 ms 263624 KB Output is correct
208 Correct 268 ms 258384 KB Output is correct
209 Correct 276 ms 268112 KB Output is correct
210 Correct 275 ms 266056 KB Output is correct
211 Correct 298 ms 273816 KB Output is correct
212 Correct 67 ms 151376 KB Output is correct
213 Correct 269 ms 234324 KB Output is correct
214 Correct 253 ms 229716 KB Output is correct
215 Correct 254 ms 237140 KB Output is correct
216 Correct 235 ms 227920 KB Output is correct
217 Correct 252 ms 230736 KB Output is correct
218 Correct 315 ms 283244 KB Output is correct
219 Correct 302 ms 283216 KB Output is correct
220 Correct 314 ms 283156 KB Output is correct
221 Correct 307 ms 283220 KB Output is correct
222 Correct 62 ms 131020 KB Output is correct