답안 #570794

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
570794 2022-05-31T09:52:30 Z 8e7 분수 공원 (IOI21_parks) C++17
100 / 100
749 ms 99060 KB
//Challenge: Accepted
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef zisk
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
	while (l != r) cout << *l << " ", l++;
	cout << endl;
}
#else
#define debug(...) 0
#define pary(...) 0
#endif
#define ll long long
#define maxn 200005
#define pii pair<ll, ll>
#define ff first
#define ss second
vector<pii> xv[maxn], yv[maxn];
unordered_map<ll, vector<ll> > g;
unordered_set<ll> bad;
unordered_map<ll, bool> vis;
vector<ll> outside;
ll h(int x, int y) {
	return (ll)x * maxn + y;
}

struct DSU{
	int par[maxn];
	int merges = 0;
	void init(int n) {
		for (int i = 0;i < n;i++) par[i] = i;
	}
	int find(int a) {
		return a == par[a] ? a : (par[a] = find(par[a]));
	}
	void Union(int a, int b) {
		a = find(a), b = find(b);
		if (a == b) return;
		merges++;
		par[a] = b;
	}
} dsu;
vector<int> u, v, a, b;
void dfs(ll n) {
	vis[n] = 1;
	for (auto p:g[n]) {
		if (!vis[p]) {
			int vx = (p / maxn + n / maxn) / 2, vy = (p % maxn + n % maxn) / 2;
			bad.insert(h(vx, vy));
			dfs(p);
		}
	}
}

unordered_set<ll> vert, block;
int construct_roads(std::vector<int> X, std::vector<int> Y) {
	int n = X.size();
	dsu.init(n);
	for (int i = 0;i < n;i++) {
		xv[X[i]].push_back({Y[i], i});
		yv[Y[i]].push_back({X[i], i});
		vert.insert(h(X[i], Y[i]));
	}
	auto found = [&] (int x, int y){
		return vert.find(h(x, y)) != vert.end();
	};
	for (auto i:vert) {
		int x = i / maxn, y = i % maxn;
		if (found(x+2, y) && found(x+2, y+2) && found(x, y+2)) {
			block.insert(h(x+1, y+1));
		}
	}
	for (auto i:block) {
		int x = i / maxn, y = i % maxn;
		if ((x + y) % 4) {
			g[h(x+2, y)].push_back(i);	
			g[h(x-2, y)].push_back(i);
			if (block.find(h(x+2, y)) == block.end()) {
				outside.push_back(h(x+2, y));	
			}
			if (block.find(h(x-2, y)) == block.end()) {
				outside.push_back(h(x-2, y));	
			}
		} else {
			g[h(x, y+2)].push_back(i);	
			g[h(x, y-2)].push_back(i);
			if (block.find(h(x, y+2)) == block.end()) {
				outside.push_back(h(x, y+2));	
			}
			if (block.find(h(x, y-2)) == block.end()) {
				outside.push_back(h(x, y-2));	
			}
		}
	}
	for (auto i:outside) dfs(i);
	for (int i = 0;i < maxn;i += 2) {
		sort(xv[i].begin(), xv[i].end());
		sort(yv[i].begin(), yv[i].end());
		for (int j = 0;j < (int)xv[i].size() - 1;j++) {
			if (xv[i][j].ff + 2 == xv[i][j+1].ff) {
				dsu.Union(xv[i][j].ss, xv[i][j+1].ss);
				if (bad.find(h(i, xv[i][j].ff + 1)) != bad.end()) continue;
				u.push_back(xv[i][j].ss);
				v.push_back(xv[i][j+1].ss);
				b.push_back(xv[i][j].ff + 1);	
				if ((xv[i][j].ff + i + 2) % 4) {
					a.push_back(i+1);
				} else {
					a.push_back(i-1);
				}
			}
		}
		for (int j = 0;j < (int)yv[i].size() - 1;j++) {
			if (yv[i][j].ff + 2 == yv[i][j+1].ff) {
				dsu.Union(yv[i][j].ss, yv[i][j+1].ss);
				if (bad.find(h(yv[i][j].ff + 1, i)) != bad.end()) continue;
				u.push_back(yv[i][j].ss);
				v.push_back(yv[i][j+1].ss);
				a.push_back(yv[i][j].ff + 1);	
				if ((yv[i][j].ff + i) % 4) {
					b.push_back(i+1);
				} else {
					b.push_back(i-1);
				}
			}
		}
	}
	if (dsu.merges != n - 1) return 0;
	build(u, v, a, b);
    return 1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
17 Correct 8 ms 9684 KB Output is correct
18 Correct 7 ms 9700 KB Output is correct
19 Correct 9 ms 9664 KB Output is correct
20 Correct 7 ms 9696 KB Output is correct
21 Correct 9 ms 9684 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 656 ms 81988 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 9 ms 10068 KB Output is correct
26 Correct 10 ms 10580 KB Output is correct
27 Correct 15 ms 10836 KB Output is correct
28 Correct 151 ms 37092 KB Output is correct
29 Correct 293 ms 51576 KB Output is correct
30 Correct 379 ms 64888 KB Output is correct
31 Correct 566 ms 82000 KB Output is correct
32 Correct 6 ms 9684 KB Output is correct
33 Correct 8 ms 9696 KB Output is correct
34 Correct 7 ms 9684 KB Output is correct
35 Correct 7 ms 9700 KB Output is correct
36 Correct 7 ms 9684 KB Output is correct
37 Correct 6 ms 9684 KB Output is correct
38 Correct 7 ms 9700 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9700 KB Output is correct
41 Correct 8 ms 9684 KB Output is correct
42 Correct 7 ms 9664 KB Output is correct
43 Correct 7 ms 9964 KB Output is correct
44 Correct 9 ms 10108 KB Output is correct
45 Correct 141 ms 27596 KB Output is correct
46 Correct 196 ms 35748 KB Output is correct
47 Correct 192 ms 35756 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
17 Correct 8 ms 9684 KB Output is correct
18 Correct 7 ms 9700 KB Output is correct
19 Correct 9 ms 9664 KB Output is correct
20 Correct 7 ms 9696 KB Output is correct
21 Correct 9 ms 9684 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 656 ms 81988 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 9 ms 10068 KB Output is correct
26 Correct 10 ms 10580 KB Output is correct
27 Correct 15 ms 10836 KB Output is correct
28 Correct 151 ms 37092 KB Output is correct
29 Correct 293 ms 51576 KB Output is correct
30 Correct 379 ms 64888 KB Output is correct
31 Correct 566 ms 82000 KB Output is correct
32 Correct 6 ms 9684 KB Output is correct
33 Correct 8 ms 9696 KB Output is correct
34 Correct 7 ms 9684 KB Output is correct
35 Correct 7 ms 9700 KB Output is correct
36 Correct 7 ms 9684 KB Output is correct
37 Correct 6 ms 9684 KB Output is correct
38 Correct 7 ms 9700 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9700 KB Output is correct
41 Correct 8 ms 9684 KB Output is correct
42 Correct 7 ms 9664 KB Output is correct
43 Correct 7 ms 9964 KB Output is correct
44 Correct 9 ms 10108 KB Output is correct
45 Correct 141 ms 27596 KB Output is correct
46 Correct 196 ms 35748 KB Output is correct
47 Correct 192 ms 35756 KB Output is correct
48 Correct 7 ms 9684 KB Output is correct
49 Correct 7 ms 9696 KB Output is correct
50 Correct 7 ms 9700 KB Output is correct
51 Correct 7 ms 9684 KB Output is correct
52 Correct 7 ms 9684 KB Output is correct
53 Correct 6 ms 9696 KB Output is correct
54 Correct 6 ms 9704 KB Output is correct
55 Correct 570 ms 97580 KB Output is correct
56 Correct 8 ms 9684 KB Output is correct
57 Correct 11 ms 10452 KB Output is correct
58 Correct 16 ms 12144 KB Output is correct
59 Correct 22 ms 13032 KB Output is correct
60 Correct 218 ms 51900 KB Output is correct
61 Correct 367 ms 67220 KB Output is correct
62 Correct 546 ms 75324 KB Output is correct
63 Correct 643 ms 97836 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 8 ms 9700 KB Output is correct
66 Correct 6 ms 9684 KB Output is correct
67 Correct 259 ms 44936 KB Output is correct
68 Correct 269 ms 46476 KB Output is correct
69 Correct 275 ms 45580 KB Output is correct
70 Correct 10 ms 10196 KB Output is correct
71 Correct 11 ms 10708 KB Output is correct
72 Correct 123 ms 27224 KB Output is correct
73 Correct 207 ms 35976 KB Output is correct
74 Correct 295 ms 45240 KB Output is correct
75 Correct 287 ms 48856 KB Output is correct
76 Correct 286 ms 46412 KB Output is correct
77 Correct 11 ms 10324 KB Output is correct
78 Correct 15 ms 10964 KB Output is correct
79 Correct 131 ms 27824 KB Output is correct
80 Correct 267 ms 36968 KB Output is correct
81 Correct 326 ms 46528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 7 ms 9684 KB Output is correct
19 Correct 7 ms 9704 KB Output is correct
20 Correct 373 ms 48884 KB Output is correct
21 Correct 382 ms 46772 KB Output is correct
22 Correct 404 ms 46804 KB Output is correct
23 Correct 297 ms 40236 KB Output is correct
24 Correct 131 ms 32064 KB Output is correct
25 Correct 205 ms 36864 KB Output is correct
26 Correct 133 ms 36892 KB Output is correct
27 Correct 194 ms 44308 KB Output is correct
28 Correct 193 ms 44324 KB Output is correct
29 Correct 214 ms 44720 KB Output is correct
30 Correct 215 ms 44260 KB Output is correct
31 Correct 6 ms 9684 KB Output is correct
32 Correct 18 ms 12372 KB Output is correct
33 Correct 127 ms 23640 KB Output is correct
34 Correct 327 ms 48972 KB Output is correct
35 Correct 11 ms 11092 KB Output is correct
36 Correct 37 ms 17304 KB Output is correct
37 Correct 73 ms 25036 KB Output is correct
38 Correct 96 ms 24520 KB Output is correct
39 Correct 110 ms 31048 KB Output is correct
40 Correct 133 ms 37136 KB Output is correct
41 Correct 210 ms 41896 KB Output is correct
42 Correct 228 ms 47900 KB Output is correct
43 Correct 6 ms 9684 KB Output is correct
44 Correct 8 ms 9700 KB Output is correct
45 Correct 6 ms 9684 KB Output is correct
46 Correct 8 ms 9684 KB Output is correct
47 Correct 7 ms 9696 KB Output is correct
48 Correct 7 ms 9684 KB Output is correct
49 Correct 7 ms 9596 KB Output is correct
50 Correct 6 ms 9684 KB Output is correct
51 Correct 8 ms 9684 KB Output is correct
52 Correct 6 ms 9684 KB Output is correct
53 Correct 8 ms 9704 KB Output is correct
54 Correct 7 ms 9964 KB Output is correct
55 Correct 8 ms 10068 KB Output is correct
56 Correct 114 ms 27516 KB Output is correct
57 Correct 248 ms 35744 KB Output is correct
58 Correct 227 ms 35740 KB Output is correct
59 Correct 7 ms 9700 KB Output is correct
60 Correct 7 ms 9700 KB Output is correct
61 Correct 7 ms 9684 KB Output is correct
62 Correct 323 ms 44908 KB Output is correct
63 Correct 318 ms 46432 KB Output is correct
64 Correct 285 ms 45548 KB Output is correct
65 Correct 10 ms 10196 KB Output is correct
66 Correct 10 ms 10708 KB Output is correct
67 Correct 122 ms 27176 KB Output is correct
68 Correct 212 ms 36020 KB Output is correct
69 Correct 298 ms 45248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
17 Correct 302 ms 47300 KB Output is correct
18 Correct 304 ms 47320 KB Output is correct
19 Correct 338 ms 46832 KB Output is correct
20 Correct 258 ms 46988 KB Output is correct
21 Correct 232 ms 44608 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 46 ms 16148 KB Output is correct
24 Correct 18 ms 12624 KB Output is correct
25 Correct 58 ms 20444 KB Output is correct
26 Correct 105 ms 28948 KB Output is correct
27 Correct 139 ms 30536 KB Output is correct
28 Correct 158 ms 36428 KB Output is correct
29 Correct 196 ms 39592 KB Output is correct
30 Correct 260 ms 45596 KB Output is correct
31 Correct 290 ms 50032 KB Output is correct
32 Correct 373 ms 48740 KB Output is correct
33 Correct 317 ms 46528 KB Output is correct
34 Correct 9 ms 10324 KB Output is correct
35 Correct 12 ms 10876 KB Output is correct
36 Correct 128 ms 27792 KB Output is correct
37 Correct 217 ms 36992 KB Output is correct
38 Correct 352 ms 46544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 9704 KB Output is correct
2 Correct 6 ms 9684 KB Output is correct
3 Correct 6 ms 9608 KB Output is correct
4 Correct 6 ms 9700 KB Output is correct
5 Correct 6 ms 9676 KB Output is correct
6 Correct 6 ms 9684 KB Output is correct
7 Correct 7 ms 9700 KB Output is correct
8 Correct 7 ms 9684 KB Output is correct
9 Correct 116 ms 27980 KB Output is correct
10 Correct 14 ms 11500 KB Output is correct
11 Correct 42 ms 19320 KB Output is correct
12 Correct 18 ms 12392 KB Output is correct
13 Correct 26 ms 16356 KB Output is correct
14 Correct 7 ms 9812 KB Output is correct
15 Correct 8 ms 9972 KB Output is correct
16 Correct 116 ms 27916 KB Output is correct
17 Correct 8 ms 9684 KB Output is correct
18 Correct 7 ms 9700 KB Output is correct
19 Correct 9 ms 9664 KB Output is correct
20 Correct 7 ms 9696 KB Output is correct
21 Correct 9 ms 9684 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 656 ms 81988 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 9 ms 10068 KB Output is correct
26 Correct 10 ms 10580 KB Output is correct
27 Correct 15 ms 10836 KB Output is correct
28 Correct 151 ms 37092 KB Output is correct
29 Correct 293 ms 51576 KB Output is correct
30 Correct 379 ms 64888 KB Output is correct
31 Correct 566 ms 82000 KB Output is correct
32 Correct 6 ms 9684 KB Output is correct
33 Correct 8 ms 9696 KB Output is correct
34 Correct 7 ms 9684 KB Output is correct
35 Correct 7 ms 9700 KB Output is correct
36 Correct 7 ms 9684 KB Output is correct
37 Correct 6 ms 9684 KB Output is correct
38 Correct 7 ms 9700 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9700 KB Output is correct
41 Correct 8 ms 9684 KB Output is correct
42 Correct 7 ms 9664 KB Output is correct
43 Correct 7 ms 9964 KB Output is correct
44 Correct 9 ms 10108 KB Output is correct
45 Correct 141 ms 27596 KB Output is correct
46 Correct 196 ms 35748 KB Output is correct
47 Correct 192 ms 35756 KB Output is correct
48 Correct 7 ms 9684 KB Output is correct
49 Correct 7 ms 9696 KB Output is correct
50 Correct 7 ms 9700 KB Output is correct
51 Correct 7 ms 9684 KB Output is correct
52 Correct 7 ms 9684 KB Output is correct
53 Correct 6 ms 9696 KB Output is correct
54 Correct 6 ms 9704 KB Output is correct
55 Correct 570 ms 97580 KB Output is correct
56 Correct 8 ms 9684 KB Output is correct
57 Correct 11 ms 10452 KB Output is correct
58 Correct 16 ms 12144 KB Output is correct
59 Correct 22 ms 13032 KB Output is correct
60 Correct 218 ms 51900 KB Output is correct
61 Correct 367 ms 67220 KB Output is correct
62 Correct 546 ms 75324 KB Output is correct
63 Correct 643 ms 97836 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 8 ms 9700 KB Output is correct
66 Correct 6 ms 9684 KB Output is correct
67 Correct 259 ms 44936 KB Output is correct
68 Correct 269 ms 46476 KB Output is correct
69 Correct 275 ms 45580 KB Output is correct
70 Correct 10 ms 10196 KB Output is correct
71 Correct 11 ms 10708 KB Output is correct
72 Correct 123 ms 27224 KB Output is correct
73 Correct 207 ms 35976 KB Output is correct
74 Correct 295 ms 45240 KB Output is correct
75 Correct 287 ms 48856 KB Output is correct
76 Correct 286 ms 46412 KB Output is correct
77 Correct 11 ms 10324 KB Output is correct
78 Correct 15 ms 10964 KB Output is correct
79 Correct 131 ms 27824 KB Output is correct
80 Correct 267 ms 36968 KB Output is correct
81 Correct 326 ms 46528 KB Output is correct
82 Correct 6 ms 9684 KB Output is correct
83 Correct 7 ms 9684 KB Output is correct
84 Correct 7 ms 9704 KB Output is correct
85 Correct 373 ms 48884 KB Output is correct
86 Correct 382 ms 46772 KB Output is correct
87 Correct 404 ms 46804 KB Output is correct
88 Correct 297 ms 40236 KB Output is correct
89 Correct 131 ms 32064 KB Output is correct
90 Correct 205 ms 36864 KB Output is correct
91 Correct 133 ms 36892 KB Output is correct
92 Correct 194 ms 44308 KB Output is correct
93 Correct 193 ms 44324 KB Output is correct
94 Correct 214 ms 44720 KB Output is correct
95 Correct 215 ms 44260 KB Output is correct
96 Correct 6 ms 9684 KB Output is correct
97 Correct 18 ms 12372 KB Output is correct
98 Correct 127 ms 23640 KB Output is correct
99 Correct 327 ms 48972 KB Output is correct
100 Correct 11 ms 11092 KB Output is correct
101 Correct 37 ms 17304 KB Output is correct
102 Correct 73 ms 25036 KB Output is correct
103 Correct 96 ms 24520 KB Output is correct
104 Correct 110 ms 31048 KB Output is correct
105 Correct 133 ms 37136 KB Output is correct
106 Correct 210 ms 41896 KB Output is correct
107 Correct 228 ms 47900 KB Output is correct
108 Correct 6 ms 9684 KB Output is correct
109 Correct 8 ms 9700 KB Output is correct
110 Correct 6 ms 9684 KB Output is correct
111 Correct 8 ms 9684 KB Output is correct
112 Correct 7 ms 9696 KB Output is correct
113 Correct 7 ms 9684 KB Output is correct
114 Correct 7 ms 9596 KB Output is correct
115 Correct 6 ms 9684 KB Output is correct
116 Correct 8 ms 9684 KB Output is correct
117 Correct 6 ms 9684 KB Output is correct
118 Correct 8 ms 9704 KB Output is correct
119 Correct 7 ms 9964 KB Output is correct
120 Correct 8 ms 10068 KB Output is correct
121 Correct 114 ms 27516 KB Output is correct
122 Correct 248 ms 35744 KB Output is correct
123 Correct 227 ms 35740 KB Output is correct
124 Correct 7 ms 9700 KB Output is correct
125 Correct 7 ms 9700 KB Output is correct
126 Correct 7 ms 9684 KB Output is correct
127 Correct 323 ms 44908 KB Output is correct
128 Correct 318 ms 46432 KB Output is correct
129 Correct 285 ms 45548 KB Output is correct
130 Correct 10 ms 10196 KB Output is correct
131 Correct 10 ms 10708 KB Output is correct
132 Correct 122 ms 27176 KB Output is correct
133 Correct 212 ms 36020 KB Output is correct
134 Correct 298 ms 45248 KB Output is correct
135 Correct 302 ms 47300 KB Output is correct
136 Correct 304 ms 47320 KB Output is correct
137 Correct 338 ms 46832 KB Output is correct
138 Correct 258 ms 46988 KB Output is correct
139 Correct 232 ms 44608 KB Output is correct
140 Correct 7 ms 9684 KB Output is correct
141 Correct 46 ms 16148 KB Output is correct
142 Correct 18 ms 12624 KB Output is correct
143 Correct 58 ms 20444 KB Output is correct
144 Correct 105 ms 28948 KB Output is correct
145 Correct 139 ms 30536 KB Output is correct
146 Correct 158 ms 36428 KB Output is correct
147 Correct 196 ms 39592 KB Output is correct
148 Correct 260 ms 45596 KB Output is correct
149 Correct 290 ms 50032 KB Output is correct
150 Correct 373 ms 48740 KB Output is correct
151 Correct 317 ms 46528 KB Output is correct
152 Correct 9 ms 10324 KB Output is correct
153 Correct 12 ms 10876 KB Output is correct
154 Correct 128 ms 27792 KB Output is correct
155 Correct 217 ms 36992 KB Output is correct
156 Correct 352 ms 46544 KB Output is correct
157 Correct 7 ms 9684 KB Output is correct
158 Correct 7 ms 9684 KB Output is correct
159 Correct 8 ms 9684 KB Output is correct
160 Correct 6 ms 9684 KB Output is correct
161 Correct 678 ms 94308 KB Output is correct
162 Correct 364 ms 49104 KB Output is correct
163 Correct 548 ms 81788 KB Output is correct
164 Correct 579 ms 81684 KB Output is correct
165 Correct 749 ms 97124 KB Output is correct
166 Correct 681 ms 99060 KB Output is correct
167 Correct 111 ms 27976 KB Output is correct
168 Correct 62 ms 20916 KB Output is correct
169 Correct 179 ms 37592 KB Output is correct
170 Correct 372 ms 62496 KB Output is correct
171 Correct 687 ms 83560 KB Output is correct
172 Correct 319 ms 54064 KB Output is correct
173 Correct 332 ms 60224 KB Output is correct
174 Correct 439 ms 68144 KB Output is correct
175 Correct 469 ms 74520 KB Output is correct
176 Correct 586 ms 89240 KB Output is correct
177 Correct 643 ms 95572 KB Output is correct