답안 #878412

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
878412 2023-11-24T10:27:35 Z SanguineChameleon 봉쇄 시간 (IOI23_closing) C++17
100 / 100
789 ms 77416 KB
#include "closing.h"
#include <bits/stdc++.h>
using namespace std;

const long long inf = 1e18L + 20;

namespace cardboard {
	vector<pair<int, long long>> boxes;
	long long K;

	bool cmp(pair<int, int> p1, pair<int, int> p2) {
		return boxes[p1.second].second - boxes[p1.first].second > boxes[p2.second].second - boxes[p2.first].second;
	}

	namespace whole {
		struct half {
			set<int> ids;
			set<pair<long long, int>> ones;
			set<pair<long long, int>> twos;
			long long sum = 0;
			int cnt = 0;
			int side;

			half(int _side): side(_side) {};

			void clear() {
				ids.clear();
				ones.clear();
				twos.clear();
				sum = 0;
				cnt = 0;
			}

			void add(int id) {
				if (side == 1) {
					sum += boxes[id].second;
				}
				ids.insert(id);
				if (boxes[id].first == 1) {
					ones.emplace(boxes[id].second, id);
					cnt += 1;
				}
				else {
					twos.emplace(boxes[id].second, id);
					cnt += 2;
				}
			}

			void rem(int id) {
				if (side == 1) {
					sum -= boxes[id].second;
				}
				ids.erase(id);
				if (boxes[id].first == 1) {
					ones.erase({boxes[id].second, id});
					cnt -= 1;
				}
				else {
					twos.erase({boxes[id].second, id});
					cnt -= 2;
				}
			}
		} left_half(1), right_half(2);

		void clear() {
			left_half.clear();
			right_half.clear();
		}

		void fix() {
			while (left_half.sum > K) {
				int id = *left_half.ids.rbegin();
				left_half.rem(id);
				right_half.add(id);
			}
			while (!right_half.ids.empty()) {
				int id = *right_half.ids.begin();
				if (left_half.sum + boxes[id].second <= K) {
					right_half.rem(id);
					left_half.add(id);
				}
				else {
					break;
				}
			}
		}
		
		void add(int id) {
			if (!right_half.ids.empty() && id > *right_half.ids.begin()) {
				right_half.add(id);
			}
			else {
				left_half.add(id);
			}
			fix();
		}

		void rem(int id) {
			if (left_half.ids.count(id)) {
				left_half.rem(id);
			}
			else {
				right_half.rem(id);
			}
			fix();
		}

		int get() {
			int res = left_half.cnt;
			if (!right_half.ones.empty() && left_half.sum + right_half.ones.begin()->first <= K) {
				res++;
			}
			else if (!left_half.ones.empty() && !right_half.twos.empty() && left_half.sum - left_half.ones.rbegin()->first + right_half.twos.begin()->first <= K) {
				res++;
			}
			return res;
		}
	}

	int solve(int N, long long _K, vector<pair<long long, long long>> costs) {
		K = _K;
		vector<pair<long long, int>> order(N << 1);
		for (int i = 0; i < N; i++) {
			order[i << 1] = {costs[i].first << 1, i << 1};
			order[i << 1 | 1] = {costs[i].second, i << 1 | 1};
		}
		sort(order.begin(), order.end());
		vector<pair<int, int>> ids(N);
		boxes.resize(N << 1);
		for (int i = 0; i < (N << 1); i++) {
			if (order[i].second & 1) {
				boxes[i] = {2, order[i].first};
				ids[order[i].second >> 1].second = i;
			}
			else {
				boxes[i] = {1, order[i].first >> 1};
				ids[order[i].second >> 1].first = i;
			}
		}
		sort(ids.begin(), ids.end(), cmp);
		whole::clear();
		for (int i = 0; i < N; i++) {
			whole::add(ids[i].second);
		}
		int res = whole::get();
		for (int i = 0; i < N; i++) {
			whole::add(ids[i].first);
			whole::rem(ids[i].second);
			res = max(res, whole::get());
		}
		return res;
	}
}

namespace tree {
	vector<vector<pair<int, int>>> adj;

	void init(int N) {
		adj.resize(N);
		for (int i = 0; i < N; i++) {
			adj[i].clear();
		}
	}

	void add_edge(int u, int v, int w) {
		adj[u].emplace_back(v, w);
		adj[v].emplace_back(u, w);
	}

	void dfs(int u, int p, vector<long long> &dist) {
		for (auto [v, w]: adj[u]) {
			if (v != p) {
				dist[v] = dist[u] + w;
				dfs(v, u, dist);
			}
		}
	}
}

int max_score(int N, int X, int Y, long long K, vector<int> U, vector<int> V, vector<int> W) {
	tree::init(N);
	for (int i = 0; i < N - 1; i++) {
		tree::add_edge(U[i], V[i], W[i]);
	}
	vector<long long> distX(N), distY(N);
	tree::dfs(X, -1, distX);
	tree::dfs(Y, -1, distY);
	vector<long long> dists(distX.begin(), distX.end());
	dists.insert(dists.end(), distY.begin(), distY.end());
	sort(dists.begin(), dists.end());
	int res = 0;
	long long sum = 0;
	for (auto d: dists) {
		if (sum + d <= K) {
			sum += d;
			res++;
		}
		else {
			break;
		}
	}
	int cnt = 0;
	vector<pair<long long, long long>> costs(N);
	for (int i = 0; i < N; i++) {
		if (distX[i] + distY[i] == distX[Y]) {
			cnt++;
			K -= min(distX[i], distY[i]);
			costs[i] = {max(distX[i], distY[i]) - min(distX[i], distY[i]), inf};
		}
		else {
			costs[i] = {min(distX[i], distY[i]), max(distX[i], distY[i])};
		}
	}
	if (K >= 0) {
		res = max(res, cnt + cardboard::solve(N, K, costs));
	}
	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 30844 KB Output is correct
2 Correct 122 ms 35276 KB Output is correct
3 Correct 62 ms 3016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 600 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 804 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 600 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 604 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 804 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 3 ms 348 KB Output is correct
26 Correct 4 ms 1372 KB Output is correct
27 Correct 4 ms 1372 KB Output is correct
28 Correct 4 ms 1372 KB Output is correct
29 Correct 4 ms 1372 KB Output is correct
30 Correct 2 ms 860 KB Output is correct
31 Correct 2 ms 860 KB Output is correct
32 Correct 2 ms 860 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 600 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 1 ms 600 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 344 KB Output is correct
38 Correct 1 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 1 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 1 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 600 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 804 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 1 ms 600 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 1 ms 344 KB Output is correct
45 Correct 1 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 1 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 1 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 1 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 1 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 344 KB Output is correct
65 Correct 1 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 600 KB Output is correct
70 Correct 1 ms 344 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 2 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 600 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 804 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 3 ms 348 KB Output is correct
27 Correct 4 ms 1372 KB Output is correct
28 Correct 4 ms 1372 KB Output is correct
29 Correct 4 ms 1372 KB Output is correct
30 Correct 4 ms 1372 KB Output is correct
31 Correct 2 ms 860 KB Output is correct
32 Correct 2 ms 860 KB Output is correct
33 Correct 2 ms 860 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 1 ms 600 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 348 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 600 KB Output is correct
78 Correct 1 ms 344 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 2 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 4 ms 488 KB Output is correct
85 Correct 4 ms 604 KB Output is correct
86 Correct 3 ms 348 KB Output is correct
87 Correct 3 ms 552 KB Output is correct
88 Correct 4 ms 348 KB Output is correct
89 Correct 5 ms 1372 KB Output is correct
90 Correct 4 ms 1212 KB Output is correct
91 Correct 5 ms 1372 KB Output is correct
92 Correct 4 ms 1376 KB Output is correct
93 Correct 2 ms 864 KB Output is correct
94 Correct 4 ms 1524 KB Output is correct
95 Correct 4 ms 1376 KB Output is correct
96 Correct 2 ms 864 KB Output is correct
97 Correct 4 ms 1376 KB Output is correct
98 Correct 5 ms 1280 KB Output is correct
99 Correct 5 ms 1372 KB Output is correct
100 Correct 4 ms 1120 KB Output is correct
101 Correct 4 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 600 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 804 KB Output is correct
23 Correct 1 ms 600 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 3 ms 348 KB Output is correct
27 Correct 4 ms 1372 KB Output is correct
28 Correct 4 ms 1372 KB Output is correct
29 Correct 4 ms 1372 KB Output is correct
30 Correct 4 ms 1372 KB Output is correct
31 Correct 2 ms 860 KB Output is correct
32 Correct 2 ms 860 KB Output is correct
33 Correct 2 ms 860 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 1 ms 600 KB Output is correct
42 Correct 0 ms 348 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 0 ms 348 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 0 ms 348 KB Output is correct
52 Correct 1 ms 344 KB Output is correct
53 Correct 1 ms 348 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 1 ms 348 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 344 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 1 ms 348 KB Output is correct
77 Correct 1 ms 600 KB Output is correct
78 Correct 1 ms 344 KB Output is correct
79 Correct 1 ms 348 KB Output is correct
80 Correct 2 ms 348 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 1 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 4 ms 488 KB Output is correct
85 Correct 4 ms 604 KB Output is correct
86 Correct 3 ms 348 KB Output is correct
87 Correct 3 ms 552 KB Output is correct
88 Correct 4 ms 348 KB Output is correct
89 Correct 5 ms 1372 KB Output is correct
90 Correct 4 ms 1212 KB Output is correct
91 Correct 5 ms 1372 KB Output is correct
92 Correct 4 ms 1376 KB Output is correct
93 Correct 2 ms 864 KB Output is correct
94 Correct 4 ms 1524 KB Output is correct
95 Correct 4 ms 1376 KB Output is correct
96 Correct 2 ms 864 KB Output is correct
97 Correct 4 ms 1376 KB Output is correct
98 Correct 5 ms 1280 KB Output is correct
99 Correct 5 ms 1372 KB Output is correct
100 Correct 4 ms 1120 KB Output is correct
101 Correct 4 ms 600 KB Output is correct
102 Correct 227 ms 4436 KB Output is correct
103 Correct 244 ms 4504 KB Output is correct
104 Correct 449 ms 74508 KB Output is correct
105 Correct 334 ms 8836 KB Output is correct
106 Correct 316 ms 7760 KB Output is correct
107 Correct 239 ms 62696 KB Output is correct
108 Correct 233 ms 64544 KB Output is correct
109 Correct 90 ms 37772 KB Output is correct
110 Correct 789 ms 69684 KB Output is correct
111 Correct 326 ms 71612 KB Output is correct
112 Correct 636 ms 68340 KB Output is correct
113 Correct 114 ms 28804 KB Output is correct
114 Correct 414 ms 68148 KB Output is correct
115 Correct 337 ms 77416 KB Output is correct
116 Correct 652 ms 68584 KB Output is correct
117 Correct 134 ms 33256 KB Output is correct
118 Correct 731 ms 69684 KB Output is correct
119 Correct 363 ms 14000 KB Output is correct
120 Correct 202 ms 5208 KB Output is correct