답안 #845896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
845896 2023-09-06T18:09:03 Z sebinkim 참나무 (IOI23_beechtree) C++17
100 / 100
752 ms 222668 KB
#include <bits/stdc++.h>
#include "beechtree.h"

using namespace std;
using pii = pair<int, int>;
using piii = tuple<int, int, int>;

vector<int> T[202020], C;
priority_queue<piii> Q;
int S[202020], I[202020];
set<pii> P1[202020];
set<piii> P2[202020];
int n, m;

bool dfs(int u, vector<int> &A) {
	bool f = 1;

	P1[u].emplace(I[u], u);
	for (int &v: T[u]) {
		auto it = P2[u].emplace(C[v], I[v], u).first;
		if (it != P2[u].begin() && get<0>(*prev(it)) == C[v]) f = 0;
		if (next(it) != P2[u].end() && get<0>(*next(it)) == C[v]) f = 0;
	}

	for (int &v: T[u]) {
		f &= dfs(v, A);

		if (P1[u].size() < P1[v].size()) {
			swap(P1[u], P1[v]); swap(P2[u], P2[v]);
		}
		for (auto [i, w]: P1[v]) {
			auto it1 = P1[u].emplace(i, w).first;
			int c = 0;
			for (int &x: T[w]) {
				auto it2 = P2[u].emplace(C[x], I[x], w).first;
				if (next(it2) != P2[u].end() && get<0>(*next(it2)) == C[x]) {
					if (next(it1) == P1[u].end() || next(it1)->second != get<2>(*next(it2))) f = 0;
					c++;
				}
				if (it1 != P1[u].begin()) {
					if (it2 == P2[u].begin() || get<0>(*prev(it2)) != C[x] \
						|| get<2>(*prev(it2)) != prev(it1)->second) f = 0;
				}
			}
			if (next(it1) != P1[u].end() && c != T[next(it1)->second].size()) f = 0;
		}
	}

	return A[u] = f;
}

vector<int> beechtree(int n, int m, vector<int> P, vector<int> C) {
	::C = C; ::n = n; ::m = m;

	int i;

	for (i = 1; i < n; i++) {
		T[P[i]].push_back(i);
	}
	fill(S, S + n, 1);
	for (i = n - 1; i >= 1; i--) {
		S[P[i]] += S[i];
	}

	Q.emplace(S[0], 0, 0);
	for (i = 0; !Q.empty(); i++) {
		auto [_, j, v] = Q.top();
		I[v] = i; Q.pop();
		for (int &w: T[v]) {
			Q.emplace(S[w], -i, w);
		}
	}

	vector<int> A(n);

	dfs(0, A);

	return A;
}

Compilation message

beechtree.cpp: In function 'bool dfs(int, std::vector<int>&)':
beechtree.cpp:45:38: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |    if (next(it1) != P1[u].end() && c != T[next(it1)->second].size()) f = 0;
      |                                    ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
beechtree.cpp:49:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   49 |  return A[u] = f;
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25692 KB Output is correct
2 Correct 5 ms 25692 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25944 KB Output is correct
2 Correct 5 ms 25728 KB Output is correct
3 Correct 5 ms 25512 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 5 ms 25692 KB Output is correct
6 Correct 5 ms 25692 KB Output is correct
7 Correct 5 ms 25692 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 6 ms 25692 KB Output is correct
12 Correct 5 ms 25688 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 5 ms 25692 KB Output is correct
15 Correct 5 ms 25688 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 6 ms 25692 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 5 ms 25692 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 5 ms 25724 KB Output is correct
26 Correct 5 ms 25692 KB Output is correct
27 Correct 5 ms 25692 KB Output is correct
28 Correct 5 ms 25692 KB Output is correct
29 Correct 5 ms 25692 KB Output is correct
30 Correct 5 ms 25692 KB Output is correct
31 Correct 5 ms 25692 KB Output is correct
32 Correct 5 ms 25692 KB Output is correct
33 Correct 5 ms 25944 KB Output is correct
34 Correct 5 ms 25692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25944 KB Output is correct
2 Correct 5 ms 25728 KB Output is correct
3 Correct 5 ms 25512 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 5 ms 25692 KB Output is correct
6 Correct 5 ms 25692 KB Output is correct
7 Correct 273 ms 114948 KB Output is correct
8 Correct 236 ms 114920 KB Output is correct
9 Correct 6 ms 25800 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25692 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 6 ms 26460 KB Output is correct
14 Correct 7 ms 26460 KB Output is correct
15 Correct 7 ms 26628 KB Output is correct
16 Correct 7 ms 26460 KB Output is correct
17 Correct 188 ms 114848 KB Output is correct
18 Correct 190 ms 114884 KB Output is correct
19 Correct 226 ms 114844 KB Output is correct
20 Correct 276 ms 114716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25692 KB Output is correct
2 Correct 5 ms 25692 KB Output is correct
3 Correct 5 ms 25716 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 5 ms 25692 KB Output is correct
6 Correct 5 ms 25724 KB Output is correct
7 Correct 5 ms 25692 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 5 ms 25688 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 6 ms 26056 KB Output is correct
12 Correct 6 ms 25948 KB Output is correct
13 Correct 6 ms 25948 KB Output is correct
14 Correct 6 ms 25944 KB Output is correct
15 Correct 134 ms 57552 KB Output is correct
16 Correct 123 ms 55492 KB Output is correct
17 Correct 126 ms 56004 KB Output is correct
18 Correct 131 ms 56808 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25944 KB Output is correct
2 Correct 5 ms 25728 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 273 ms 114948 KB Output is correct
6 Correct 236 ms 114920 KB Output is correct
7 Correct 5 ms 25688 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 8 ms 26204 KB Output is correct
10 Correct 8 ms 26308 KB Output is correct
11 Correct 342 ms 97552 KB Output is correct
12 Correct 305 ms 87772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25692 KB Output is correct
2 Correct 5 ms 25692 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25944 KB Output is correct
5 Correct 5 ms 25728 KB Output is correct
6 Correct 5 ms 25512 KB Output is correct
7 Correct 5 ms 25692 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25692 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 6 ms 25692 KB Output is correct
15 Correct 5 ms 25688 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 5 ms 25688 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 6 ms 25692 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 5 ms 25692 KB Output is correct
26 Correct 5 ms 25692 KB Output is correct
27 Correct 5 ms 25692 KB Output is correct
28 Correct 5 ms 25724 KB Output is correct
29 Correct 5 ms 25692 KB Output is correct
30 Correct 5 ms 25692 KB Output is correct
31 Correct 5 ms 25692 KB Output is correct
32 Correct 5 ms 25692 KB Output is correct
33 Correct 5 ms 25692 KB Output is correct
34 Correct 5 ms 25692 KB Output is correct
35 Correct 5 ms 25692 KB Output is correct
36 Correct 5 ms 25944 KB Output is correct
37 Correct 5 ms 25692 KB Output is correct
38 Correct 6 ms 25800 KB Output is correct
39 Correct 5 ms 25692 KB Output is correct
40 Correct 5 ms 25692 KB Output is correct
41 Correct 5 ms 25692 KB Output is correct
42 Correct 5 ms 25692 KB Output is correct
43 Correct 5 ms 25692 KB Output is correct
44 Correct 5 ms 25716 KB Output is correct
45 Correct 5 ms 25692 KB Output is correct
46 Correct 5 ms 25692 KB Output is correct
47 Correct 5 ms 25724 KB Output is correct
48 Correct 5 ms 25692 KB Output is correct
49 Correct 5 ms 25692 KB Output is correct
50 Correct 5 ms 25688 KB Output is correct
51 Correct 5 ms 25692 KB Output is correct
52 Correct 5 ms 25688 KB Output is correct
53 Correct 5 ms 25692 KB Output is correct
54 Correct 5 ms 25692 KB Output is correct
55 Correct 6 ms 25688 KB Output is correct
56 Correct 5 ms 25692 KB Output is correct
57 Correct 5 ms 25692 KB Output is correct
58 Correct 5 ms 25692 KB Output is correct
59 Correct 5 ms 25692 KB Output is correct
60 Correct 5 ms 25692 KB Output is correct
61 Correct 5 ms 25692 KB Output is correct
62 Correct 5 ms 25692 KB Output is correct
63 Correct 5 ms 25692 KB Output is correct
64 Correct 5 ms 25692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25944 KB Output is correct
2 Correct 5 ms 25728 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 5 ms 25692 KB Output is correct
6 Correct 5 ms 25692 KB Output is correct
7 Correct 6 ms 25692 KB Output is correct
8 Correct 5 ms 25688 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25688 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 6 ms 25692 KB Output is correct
15 Correct 5 ms 25692 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 5 ms 25692 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 5 ms 25724 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 6 ms 26460 KB Output is correct
26 Correct 6 ms 26556 KB Output is correct
27 Correct 7 ms 26456 KB Output is correct
28 Correct 7 ms 26456 KB Output is correct
29 Correct 6 ms 26460 KB Output is correct
30 Correct 7 ms 26460 KB Output is correct
31 Correct 8 ms 26716 KB Output is correct
32 Correct 8 ms 26716 KB Output is correct
33 Correct 8 ms 26460 KB Output is correct
34 Correct 9 ms 26972 KB Output is correct
35 Correct 9 ms 26748 KB Output is correct
36 Correct 8 ms 26460 KB Output is correct
37 Correct 7 ms 26204 KB Output is correct
38 Correct 7 ms 26460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25692 KB Output is correct
2 Correct 5 ms 25692 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25944 KB Output is correct
5 Correct 5 ms 25728 KB Output is correct
6 Correct 5 ms 25512 KB Output is correct
7 Correct 5 ms 25692 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25692 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 6 ms 25692 KB Output is correct
15 Correct 5 ms 25688 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 5 ms 25688 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 6 ms 25692 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 5 ms 25692 KB Output is correct
26 Correct 5 ms 25692 KB Output is correct
27 Correct 5 ms 25692 KB Output is correct
28 Correct 5 ms 25724 KB Output is correct
29 Correct 5 ms 25692 KB Output is correct
30 Correct 5 ms 25692 KB Output is correct
31 Correct 5 ms 25692 KB Output is correct
32 Correct 5 ms 25692 KB Output is correct
33 Correct 5 ms 25692 KB Output is correct
34 Correct 5 ms 25692 KB Output is correct
35 Correct 5 ms 25692 KB Output is correct
36 Correct 5 ms 25944 KB Output is correct
37 Correct 5 ms 25692 KB Output is correct
38 Correct 6 ms 25800 KB Output is correct
39 Correct 5 ms 25692 KB Output is correct
40 Correct 5 ms 25692 KB Output is correct
41 Correct 5 ms 25692 KB Output is correct
42 Correct 6 ms 26460 KB Output is correct
43 Correct 7 ms 26460 KB Output is correct
44 Correct 7 ms 26628 KB Output is correct
45 Correct 7 ms 26460 KB Output is correct
46 Correct 5 ms 25692 KB Output is correct
47 Correct 5 ms 25692 KB Output is correct
48 Correct 5 ms 25716 KB Output is correct
49 Correct 5 ms 25692 KB Output is correct
50 Correct 5 ms 25692 KB Output is correct
51 Correct 5 ms 25724 KB Output is correct
52 Correct 5 ms 25692 KB Output is correct
53 Correct 5 ms 25692 KB Output is correct
54 Correct 5 ms 25688 KB Output is correct
55 Correct 5 ms 25692 KB Output is correct
56 Correct 6 ms 26056 KB Output is correct
57 Correct 6 ms 25948 KB Output is correct
58 Correct 6 ms 25948 KB Output is correct
59 Correct 6 ms 25944 KB Output is correct
60 Correct 5 ms 25688 KB Output is correct
61 Correct 5 ms 25692 KB Output is correct
62 Correct 8 ms 26204 KB Output is correct
63 Correct 8 ms 26308 KB Output is correct
64 Correct 5 ms 25692 KB Output is correct
65 Correct 6 ms 25688 KB Output is correct
66 Correct 5 ms 25692 KB Output is correct
67 Correct 5 ms 25692 KB Output is correct
68 Correct 5 ms 25692 KB Output is correct
69 Correct 5 ms 25692 KB Output is correct
70 Correct 5 ms 25692 KB Output is correct
71 Correct 5 ms 25692 KB Output is correct
72 Correct 5 ms 25692 KB Output is correct
73 Correct 5 ms 25692 KB Output is correct
74 Correct 5 ms 25692 KB Output is correct
75 Correct 6 ms 26460 KB Output is correct
76 Correct 6 ms 26556 KB Output is correct
77 Correct 7 ms 26456 KB Output is correct
78 Correct 7 ms 26456 KB Output is correct
79 Correct 6 ms 26460 KB Output is correct
80 Correct 7 ms 26460 KB Output is correct
81 Correct 8 ms 26716 KB Output is correct
82 Correct 8 ms 26716 KB Output is correct
83 Correct 8 ms 26460 KB Output is correct
84 Correct 9 ms 26972 KB Output is correct
85 Correct 9 ms 26748 KB Output is correct
86 Correct 8 ms 26460 KB Output is correct
87 Correct 7 ms 26204 KB Output is correct
88 Correct 7 ms 26460 KB Output is correct
89 Correct 8 ms 26712 KB Output is correct
90 Correct 7 ms 26460 KB Output is correct
91 Correct 8 ms 26524 KB Output is correct
92 Correct 8 ms 26716 KB Output is correct
93 Correct 7 ms 26460 KB Output is correct
94 Correct 8 ms 26460 KB Output is correct
95 Correct 9 ms 26716 KB Output is correct
96 Correct 8 ms 26460 KB Output is correct
97 Correct 7 ms 26200 KB Output is correct
98 Correct 7 ms 26456 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25944 KB Output is correct
2 Correct 5 ms 25728 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25692 KB Output is correct
5 Correct 5 ms 25692 KB Output is correct
6 Correct 5 ms 25692 KB Output is correct
7 Correct 6 ms 25692 KB Output is correct
8 Correct 5 ms 25688 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25688 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 6 ms 25692 KB Output is correct
15 Correct 5 ms 25692 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 5 ms 25692 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 5 ms 25724 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 6 ms 26460 KB Output is correct
26 Correct 6 ms 26556 KB Output is correct
27 Correct 7 ms 26456 KB Output is correct
28 Correct 7 ms 26456 KB Output is correct
29 Correct 6 ms 26460 KB Output is correct
30 Correct 7 ms 26460 KB Output is correct
31 Correct 8 ms 26716 KB Output is correct
32 Correct 8 ms 26716 KB Output is correct
33 Correct 8 ms 26460 KB Output is correct
34 Correct 9 ms 26972 KB Output is correct
35 Correct 9 ms 26748 KB Output is correct
36 Correct 8 ms 26460 KB Output is correct
37 Correct 7 ms 26204 KB Output is correct
38 Correct 7 ms 26460 KB Output is correct
39 Correct 185 ms 114752 KB Output is correct
40 Correct 183 ms 114920 KB Output is correct
41 Correct 183 ms 114800 KB Output is correct
42 Correct 195 ms 115084 KB Output is correct
43 Correct 201 ms 110340 KB Output is correct
44 Correct 254 ms 113240 KB Output is correct
45 Correct 695 ms 198528 KB Output is correct
46 Correct 567 ms 180524 KB Output is correct
47 Correct 500 ms 159584 KB Output is correct
48 Correct 464 ms 132484 KB Output is correct
49 Correct 413 ms 108752 KB Output is correct
50 Correct 752 ms 222668 KB Output is correct
51 Correct 610 ms 204372 KB Output is correct
52 Correct 522 ms 170180 KB Output is correct
53 Correct 443 ms 135236 KB Output is correct
54 Correct 379 ms 105992 KB Output is correct
55 Correct 249 ms 100236 KB Output is correct
56 Correct 237 ms 100308 KB Output is correct
57 Correct 281 ms 109228 KB Output is correct
58 Correct 305 ms 109840 KB Output is correct
59 Correct 313 ms 109932 KB Output is correct
60 Correct 320 ms 109856 KB Output is correct
61 Correct 322 ms 109696 KB Output is correct
62 Correct 309 ms 109256 KB Output is correct
63 Correct 257 ms 97992 KB Output is correct
64 Correct 263 ms 111692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 25692 KB Output is correct
2 Correct 5 ms 25692 KB Output is correct
3 Correct 5 ms 25692 KB Output is correct
4 Correct 5 ms 25944 KB Output is correct
5 Correct 5 ms 25728 KB Output is correct
6 Correct 5 ms 25512 KB Output is correct
7 Correct 5 ms 25692 KB Output is correct
8 Correct 5 ms 25692 KB Output is correct
9 Correct 5 ms 25692 KB Output is correct
10 Correct 5 ms 25692 KB Output is correct
11 Correct 5 ms 25692 KB Output is correct
12 Correct 5 ms 25692 KB Output is correct
13 Correct 5 ms 25692 KB Output is correct
14 Correct 6 ms 25692 KB Output is correct
15 Correct 5 ms 25688 KB Output is correct
16 Correct 5 ms 25692 KB Output is correct
17 Correct 5 ms 25692 KB Output is correct
18 Correct 5 ms 25688 KB Output is correct
19 Correct 5 ms 25692 KB Output is correct
20 Correct 5 ms 25692 KB Output is correct
21 Correct 6 ms 25692 KB Output is correct
22 Correct 5 ms 25692 KB Output is correct
23 Correct 5 ms 25692 KB Output is correct
24 Correct 5 ms 25692 KB Output is correct
25 Correct 5 ms 25692 KB Output is correct
26 Correct 5 ms 25692 KB Output is correct
27 Correct 5 ms 25692 KB Output is correct
28 Correct 5 ms 25724 KB Output is correct
29 Correct 5 ms 25692 KB Output is correct
30 Correct 5 ms 25692 KB Output is correct
31 Correct 5 ms 25692 KB Output is correct
32 Correct 5 ms 25692 KB Output is correct
33 Correct 5 ms 25692 KB Output is correct
34 Correct 5 ms 25692 KB Output is correct
35 Correct 5 ms 25692 KB Output is correct
36 Correct 5 ms 25944 KB Output is correct
37 Correct 5 ms 25692 KB Output is correct
38 Correct 273 ms 114948 KB Output is correct
39 Correct 236 ms 114920 KB Output is correct
40 Correct 6 ms 25800 KB Output is correct
41 Correct 5 ms 25692 KB Output is correct
42 Correct 5 ms 25692 KB Output is correct
43 Correct 5 ms 25692 KB Output is correct
44 Correct 6 ms 26460 KB Output is correct
45 Correct 7 ms 26460 KB Output is correct
46 Correct 7 ms 26628 KB Output is correct
47 Correct 7 ms 26460 KB Output is correct
48 Correct 188 ms 114848 KB Output is correct
49 Correct 190 ms 114884 KB Output is correct
50 Correct 226 ms 114844 KB Output is correct
51 Correct 276 ms 114716 KB Output is correct
52 Correct 5 ms 25692 KB Output is correct
53 Correct 5 ms 25692 KB Output is correct
54 Correct 5 ms 25716 KB Output is correct
55 Correct 5 ms 25692 KB Output is correct
56 Correct 5 ms 25692 KB Output is correct
57 Correct 5 ms 25724 KB Output is correct
58 Correct 5 ms 25692 KB Output is correct
59 Correct 5 ms 25692 KB Output is correct
60 Correct 5 ms 25688 KB Output is correct
61 Correct 5 ms 25692 KB Output is correct
62 Correct 6 ms 26056 KB Output is correct
63 Correct 6 ms 25948 KB Output is correct
64 Correct 6 ms 25948 KB Output is correct
65 Correct 6 ms 25944 KB Output is correct
66 Correct 134 ms 57552 KB Output is correct
67 Correct 123 ms 55492 KB Output is correct
68 Correct 126 ms 56004 KB Output is correct
69 Correct 131 ms 56808 KB Output is correct
70 Correct 5 ms 25688 KB Output is correct
71 Correct 5 ms 25692 KB Output is correct
72 Correct 8 ms 26204 KB Output is correct
73 Correct 8 ms 26308 KB Output is correct
74 Correct 342 ms 97552 KB Output is correct
75 Correct 305 ms 87772 KB Output is correct
76 Correct 5 ms 25692 KB Output is correct
77 Correct 6 ms 25688 KB Output is correct
78 Correct 5 ms 25692 KB Output is correct
79 Correct 5 ms 25692 KB Output is correct
80 Correct 5 ms 25692 KB Output is correct
81 Correct 5 ms 25692 KB Output is correct
82 Correct 5 ms 25692 KB Output is correct
83 Correct 5 ms 25692 KB Output is correct
84 Correct 5 ms 25692 KB Output is correct
85 Correct 5 ms 25692 KB Output is correct
86 Correct 5 ms 25692 KB Output is correct
87 Correct 6 ms 26460 KB Output is correct
88 Correct 6 ms 26556 KB Output is correct
89 Correct 7 ms 26456 KB Output is correct
90 Correct 7 ms 26456 KB Output is correct
91 Correct 6 ms 26460 KB Output is correct
92 Correct 7 ms 26460 KB Output is correct
93 Correct 8 ms 26716 KB Output is correct
94 Correct 8 ms 26716 KB Output is correct
95 Correct 8 ms 26460 KB Output is correct
96 Correct 9 ms 26972 KB Output is correct
97 Correct 9 ms 26748 KB Output is correct
98 Correct 8 ms 26460 KB Output is correct
99 Correct 7 ms 26204 KB Output is correct
100 Correct 7 ms 26460 KB Output is correct
101 Correct 8 ms 26712 KB Output is correct
102 Correct 7 ms 26460 KB Output is correct
103 Correct 8 ms 26524 KB Output is correct
104 Correct 8 ms 26716 KB Output is correct
105 Correct 7 ms 26460 KB Output is correct
106 Correct 8 ms 26460 KB Output is correct
107 Correct 9 ms 26716 KB Output is correct
108 Correct 8 ms 26460 KB Output is correct
109 Correct 7 ms 26200 KB Output is correct
110 Correct 7 ms 26456 KB Output is correct
111 Correct 185 ms 114752 KB Output is correct
112 Correct 183 ms 114920 KB Output is correct
113 Correct 183 ms 114800 KB Output is correct
114 Correct 195 ms 115084 KB Output is correct
115 Correct 201 ms 110340 KB Output is correct
116 Correct 254 ms 113240 KB Output is correct
117 Correct 695 ms 198528 KB Output is correct
118 Correct 567 ms 180524 KB Output is correct
119 Correct 500 ms 159584 KB Output is correct
120 Correct 464 ms 132484 KB Output is correct
121 Correct 413 ms 108752 KB Output is correct
122 Correct 752 ms 222668 KB Output is correct
123 Correct 610 ms 204372 KB Output is correct
124 Correct 522 ms 170180 KB Output is correct
125 Correct 443 ms 135236 KB Output is correct
126 Correct 379 ms 105992 KB Output is correct
127 Correct 249 ms 100236 KB Output is correct
128 Correct 237 ms 100308 KB Output is correct
129 Correct 281 ms 109228 KB Output is correct
130 Correct 305 ms 109840 KB Output is correct
131 Correct 313 ms 109932 KB Output is correct
132 Correct 320 ms 109856 KB Output is correct
133 Correct 322 ms 109696 KB Output is correct
134 Correct 309 ms 109256 KB Output is correct
135 Correct 257 ms 97992 KB Output is correct
136 Correct 263 ms 111692 KB Output is correct
137 Correct 218 ms 107680 KB Output is correct
138 Correct 254 ms 113704 KB Output is correct
139 Correct 564 ms 158452 KB Output is correct
140 Correct 487 ms 159176 KB Output is correct
141 Correct 461 ms 142252 KB Output is correct
142 Correct 426 ms 123924 KB Output is correct
143 Correct 379 ms 104536 KB Output is correct
144 Correct 540 ms 167464 KB Output is correct
145 Correct 513 ms 172552 KB Output is correct
146 Correct 480 ms 156180 KB Output is correct
147 Correct 422 ms 134924 KB Output is correct
148 Correct 344 ms 102120 KB Output is correct
149 Correct 248 ms 100356 KB Output is correct
150 Correct 251 ms 100508 KB Output is correct
151 Correct 311 ms 109256 KB Output is correct
152 Correct 313 ms 109760 KB Output is correct
153 Correct 318 ms 109764 KB Output is correct
154 Correct 311 ms 109724 KB Output is correct
155 Correct 317 ms 109592 KB Output is correct
156 Correct 310 ms 109148 KB Output is correct
157 Correct 246 ms 97992 KB Output is correct
158 Correct 271 ms 111688 KB Output is correct