답안 #218033

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
218033 2020-03-31T13:54:01 Z atoiz 함박 스테이크 (JOI20_hamburg) C++14
100 / 100
1095 ms 35868 KB
/*input
6 4
5 1 8 9
1 2 4 8
2 10 5 10
9 2 10 4
1 1 10 1
5 3 5 10

*/

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <map>
#include <functional>

using namespace std;

const int INF = 1e9 + 8;
void minimize(int &x, int y) { x = (x < y ? x : y); }
void maximize(int &x, int y) { x = (x > y ? x : y); }

struct Rect { int x1, x2, y1, y2; };

vector<pair<int, int>> skewers;

bool contain(Rect r, int x, int y)
{
	return (x >= r.x1 && r.x2 >= x && y >= r.y1 && r.y2 >= y);
}

vector<Rect> cut(vector<Rect> rects, int x, int y)
{
	vector<Rect> leftover;
	for (auto r : rects) {
		if (!contain(r, x, y)) {
			leftover.push_back(r);
		}
	}
	return leftover;
}

bool solve(vector<Rect> rects, int K)
{
	if (rects.empty()) return true;
	if (K == 0) return false;

	int lim_x1 = INF, lim_x2 = 0, lim_y1 = INF, lim_y2 = 0;
	for (auto &r : rects) {
		minimize(lim_x1, r.x2);
		maximize(lim_x2, r.x1);
		minimize(lim_y1, r.y2);
		maximize(lim_y2, r.y1);
	}

	skewers.emplace_back(lim_x1, lim_y1);
	if (solve(cut(rects, lim_x1, lim_y1), K - 1)) return true;
	skewers.pop_back();

	skewers.emplace_back(lim_x2, lim_y1);
	if (solve(cut(rects, lim_x2, lim_y1), K - 1)) return true;
	skewers.pop_back();

	skewers.emplace_back(lim_x1, lim_y2);
	if (solve(cut(rects, lim_x1, lim_y2), K - 1)) return true;
	skewers.pop_back();

	skewers.emplace_back(lim_x2, lim_y2);
	if (solve(cut(rects, lim_x2, lim_y2), K - 1)) return true;
	skewers.pop_back();

	if (K != 4) return false;

	assert(lim_x1 < lim_x2);
	assert(lim_y1 < lim_y2);

	// solve 4-sides
	map<string, vector<pair<int, int>>> intervals;
	int l_x1 = 0, l_x2 = 0, l_y1 = 0, l_y2 = 0;
	int r_x1 = INF, r_x2 = INF, r_y1 = INF, r_y2 = INF;

	for (auto &r : rects) {
		maximize(r.x1, lim_x1);
		minimize(r.x2, lim_x2);
		maximize(r.y1, lim_y1);
		minimize(r.y2, lim_y2);

		string sides = "";
		if (r.x1 == lim_x1) sides += 'L';
		if (r.x2 == lim_x2) sides += 'R';
		if (r.y1 == lim_y1) sides += 'D';
		if (r.y2 == lim_y2) sides += 'U';

		assert(!sides.empty());
		if ((int) sides.size() > 2) continue;

		if (sides == "LR") intervals[sides].emplace_back(r.y1, r.y2);
		else if (sides == "DU") intervals[sides].emplace_back(r.x1, r.x2);
		else if (sides == "L") maximize(l_x1, r.y1), minimize(r_x1, r.y2);
		else if (sides == "R") maximize(l_x2, r.y1), minimize(r_x2, r.y2);
		else if (sides == "D") maximize(l_y1, r.x1), minimize(r_y1, r.x2);
		else if (sides == "U") maximize(l_y2, r.x1), minimize(r_y2, r.x2);
		else if (sides == "LD") intervals[sides].emplace_back(r.x2, r.y2);
		else if (sides == "RD") intervals[sides].emplace_back(r.x1, r.y2);
		else if (sides == "LU") intervals[sides].emplace_back(r.x2, r.y1);
		else if (sides == "RU") intervals[sides].emplace_back(r.x1, r.y1);
		else assert(false);
	}
	assert(l_x1 <= r_x1), assert(l_x2 <= r_x2);
	assert(l_y1 <= r_y1), assert(l_y2 <= r_y2);

	// identify important points
	vector<int> pnts_l, pnts_d, pnts_u, pnts_r;
	pnts_l.push_back(l_x1), pnts_l.push_back(r_x1);
	pnts_r.push_back(l_x2), pnts_r.push_back(r_x2);
	pnts_d.push_back(l_y1), pnts_d.push_back(r_y1);
	pnts_u.push_back(l_y2), pnts_u.push_back(r_y2);
	for (auto p : intervals["LD"]) pnts_l.push_back(p.second), pnts_d.push_back(p.first);
	for (auto p : intervals["RD"]) pnts_r.push_back(p.second), pnts_d.push_back(p.first);
	for (auto p : intervals["LU"]) pnts_l.push_back(p.second), pnts_u.push_back(p.first);
	for (auto p : intervals["RU"]) pnts_r.push_back(p.second), pnts_u.push_back(p.first);
	for (auto p : intervals["LR"]) pnts_l.push_back(p.first), pnts_r.push_back(p.first), pnts_l.push_back(p.second), pnts_r.push_back(p.second);
	for (auto p : intervals["DU"]) pnts_d.push_back(p.first), pnts_u.push_back(p.first), pnts_d.push_back(p.second), pnts_u.push_back(p.second);
	sort(pnts_l.begin(), pnts_l.end());
	sort(pnts_r.begin(), pnts_r.end());
	sort(pnts_d.begin(), pnts_d.end());
	sort(pnts_u.begin(), pnts_u.end());
	pnts_l.erase(unique(pnts_l.begin(), pnts_l.end()), pnts_l.end());
	pnts_r.erase(unique(pnts_r.begin(), pnts_r.end()), pnts_r.end());
	pnts_d.erase(unique(pnts_d.begin(), pnts_d.end()), pnts_d.end());
	pnts_u.erase(unique(pnts_u.begin(), pnts_u.end()), pnts_u.end());

	auto get_pos = [&](vector<int> &vec, int x) -> int { return int(lower_bound(vec.begin(), vec.end(), x) - vec.begin()); };

	// identify range (corner)
	vector<int> range_dl(pnts_d.size(), pnts_l.back()), range_dr(pnts_d.size(), pnts_r.back());
	vector<int> range_lu(pnts_l.size(), pnts_u.back()), range_ru(pnts_r.size(), pnts_u.front());

	for (auto p : intervals["LD"]) minimize(range_dl[get_pos(pnts_d, p.first)], p.second);
	for (auto p : intervals["RD"]) minimize(range_dr[get_pos(pnts_d, p.first)], p.second);
	for (auto p : intervals["LU"]) minimize(range_lu[get_pos(pnts_l, p.second)], p.first);
	for (auto p : intervals["RU"]) maximize(range_ru[get_pos(pnts_r, p.second)], p.first);

	for (int i = 1; i < (int) pnts_d.size(); ++i) minimize(range_dl[i], range_dl[i - 1]);
	for (int i = (int) pnts_d.size() - 2; i >= 0; --i) minimize(range_dr[i], range_dr[i + 1]);
	for (int i = (int) pnts_l.size() - 2; i >= 0; --i) minimize(range_lu[i], range_lu[i + 1]);
	for (int i = (int) pnts_r.size() - 2; i >= 0; --i) maximize(range_ru[i], range_ru[i + 1]);

	// identify range (edges)
	for (string sides : {"LR", "DU"}) {
		vector<pair<int, int>> &vec = intervals[sides];
		sort(vec.begin(), vec.end());
		vector<pair<int, int>> tmp;
		tmp.swap(vec);
		for (auto &p : tmp) {
			while (!vec.empty() && vec.back().second >= p.second) vec.pop_back();
			if (vec.empty() || vec.back().first < p.first) vec.push_back(p);
		}
		// for (auto p : vec) cout << sides << ": " << p.first << ' ' << p.second << endl;
	}

	// check skewer locations
	// auto comp_by_second = [&](pair<int, int> &lhs, pair<int, int> &rhs) -> bool {
	// 	return (lhs.second == rhs.second ? lhs.first < rhs.first : lhs.second < rhs.second);
	// };
	auto check_du = [&](int x_d, int y_l, int y_r) -> bool {
		if (y_l < l_x1) return false;
		if (y_r < l_x2) return false;

		int id_l = get_pos(pnts_l, y_l), id_r = get_pos(pnts_r, y_r);
		int x1_u = (id_r + 1 != (int) pnts_r.size() ? range_ru[id_r + 1] : pnts_u.front());
		int x2_u = (id_l + 1 != (int) pnts_l.size() ? range_lu[id_l + 1] : pnts_u.back());
		// cout << x1_u << ' ' << x2_u << endl;
		maximize(x1_u, l_y2), minimize(x2_u, r_y2);
		// cout << x1_u << ' ' << x2_u << endl;
		if (x1_u > x2_u) return false;

		if (intervals["DU"].empty()) return true;
		if (x_d <= intervals["DU"].front().second && x_d >= intervals["DU"].back().first) return true;
		if (x_d <= intervals["DU"].front().second) {
			int lim1_u = max(x1_u, intervals["DU"].back().first);
			int lim2_u = min(x2_u, intervals["DU"].back().second);
			if (lim1_u <= lim2_u) {
				auto it = upper_bound(intervals["DU"].begin(), intervals["DU"].end(), make_pair(x_d, INF));
				if (it == intervals["DU"].end() || lim1_u <= it->second) return true;
			}
		}

		if (x_d >= intervals["DU"].back().first) {
			int lim1_u = max(x1_u, intervals["DU"].front().first);
			int lim2_u = min(x2_u, intervals["DU"].front().second);
			if (lim1_u <= lim2_u) {
				auto it = upper_bound(intervals["DU"].begin(), intervals["DU"].end(), make_pair(lim2_u, INF));
				if (it == intervals["DU"].end() || x_d <= it->second) return true;
			}
		}

		return false;
	};
	for (int x_d : pnts_d) if (l_y1 <= x_d && r_y1 >= x_d) {
		int id = get_pos(pnts_d, x_d);
		int y_l = (id ? range_dl[id - 1] : pnts_l.back());
		int y_r = (id + 1 != (int) pnts_d.size() ? range_dr[id + 1] : pnts_r.back());
		minimize(y_l, r_x1), minimize(y_r, r_x2);

		// empty
		if (intervals["LR"].empty()) {
			if (check_du(x_d, y_l, y_r)) {
				skewers.emplace_back(x_d, lim_y1);
				return solve(cut(rects, x_d, lim_y1), K - 1);
			}
			continue;
		}

		// prefix-suffix
		{
			bool valid = true;
			int lim_l = min(y_l, intervals["LR"].front().second), lim_r = y_r;
			auto it = upper_bound(intervals["LR"].begin(), intervals["LR"].end(), make_pair(lim_l, INF));

			if (it != intervals["LR"].end()) {
				minimize(lim_r, it->second);
				if (lim_r < intervals["LR"].back().first) valid = false;
			}
			// if (valid) cout << "pref-suff: " << x_d << ": " << lim_l << ' ' << lim_r << endl;
			if (valid && check_du(x_d, lim_l, lim_r)) {
				skewers.emplace_back(x_d, lim_y1);
				return solve(cut(rects, x_d, lim_y1), K - 1);
			}
		}

		// suffix-prefix
		{
			bool valid = true;
			int lim_l = y_l, lim_r = min(y_r, intervals["LR"][0].second);
			auto it = upper_bound(intervals["LR"].begin(), intervals["LR"].end(), make_pair(lim_r, INF));

			if (it != intervals["LR"].end()) {
				minimize(lim_l, it->second);
				if (lim_l < intervals["LR"].back().first) valid = false;
			}

			// if (valid) cout << "suff-pref: " << x_d << ": " << lim_l << ' ' << lim_r << endl;
			if (valid && check_du(x_d, lim_l, lim_r)) {
				skewers.emplace_back(x_d, lim_y1);
				return solve(cut(rects, x_d, lim_y1), K - 1);
			}
		}
	}

	assert(false);
	return false;
}

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int N, K;
	cin >> N >> K;
	vector<Rect> rects(N);
	for (auto &r : rects) cin >> r.x1 >> r.y1 >> r.x2 >> r.y2;
	assert(solve(rects, K));
	while ((int) skewers.size() < K) skewers.push_back(skewers.back());
	for (auto &p : skewers) cout << p.first << ' ' << p.second << '\n';

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 512 KB Output is correct
8 Correct 2 ms 512 KB Output is correct
9 Correct 4 ms 640 KB Output is correct
10 Correct 2 ms 628 KB Output is correct
11 Correct 3 ms 640 KB Output is correct
12 Correct 2 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 488 KB Output is correct
6 Correct 1 ms 512 KB Output is correct
7 Correct 2 ms 512 KB Output is correct
8 Correct 2 ms 512 KB Output is correct
9 Correct 2 ms 512 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 512 KB Output is correct
12 Correct 2 ms 512 KB Output is correct
13 Correct 4 ms 640 KB Output is correct
14 Correct 5 ms 640 KB Output is correct
15 Correct 4 ms 668 KB Output is correct
16 Correct 3 ms 640 KB Output is correct
17 Correct 5 ms 640 KB Output is correct
18 Correct 3 ms 640 KB Output is correct
19 Correct 5 ms 680 KB Output is correct
20 Correct 6 ms 716 KB Output is correct
21 Correct 6 ms 712 KB Output is correct
22 Correct 4 ms 640 KB Output is correct
23 Correct 6 ms 692 KB Output is correct
24 Correct 4 ms 680 KB Output is correct
25 Correct 4 ms 640 KB Output is correct
26 Correct 4 ms 716 KB Output is correct
27 Correct 4 ms 644 KB Output is correct
28 Correct 3 ms 512 KB Output is correct
29 Correct 3 ms 640 KB Output is correct
30 Correct 3 ms 640 KB Output is correct
31 Correct 5 ms 700 KB Output is correct
32 Correct 4 ms 680 KB Output is correct
33 Correct 6 ms 640 KB Output is correct
34 Correct 6 ms 640 KB Output is correct
35 Correct 8 ms 712 KB Output is correct
36 Correct 5 ms 644 KB Output is correct
37 Correct 8 ms 728 KB Output is correct
38 Correct 8 ms 712 KB Output is correct
39 Correct 5 ms 664 KB Output is correct
40 Correct 5 ms 644 KB Output is correct
41 Correct 5 ms 688 KB Output is correct
42 Correct 6 ms 660 KB Output is correct
43 Correct 7 ms 680 KB Output is correct
44 Correct 6 ms 712 KB Output is correct
45 Correct 4 ms 704 KB Output is correct
46 Correct 6 ms 688 KB Output is correct
47 Correct 7 ms 676 KB Output is correct
48 Correct 8 ms 696 KB Output is correct
49 Correct 7 ms 708 KB Output is correct
50 Correct 5 ms 684 KB Output is correct
51 Correct 8 ms 720 KB Output is correct
52 Correct 5 ms 644 KB Output is correct
53 Correct 7 ms 708 KB Output is correct
54 Correct 8 ms 704 KB Output is correct
55 Correct 4 ms 640 KB Output is correct
56 Correct 4 ms 628 KB Output is correct
57 Correct 5 ms 512 KB Output is correct
58 Correct 4 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 95 ms 9668 KB Output is correct
6 Correct 108 ms 9672 KB Output is correct
7 Correct 99 ms 9720 KB Output is correct
8 Correct 115 ms 9804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 101 ms 12268 KB Output is correct
6 Correct 110 ms 11688 KB Output is correct
7 Correct 101 ms 12220 KB Output is correct
8 Correct 120 ms 20792 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 512 KB Output is correct
8 Correct 2 ms 512 KB Output is correct
9 Correct 4 ms 640 KB Output is correct
10 Correct 2 ms 628 KB Output is correct
11 Correct 3 ms 640 KB Output is correct
12 Correct 2 ms 640 KB Output is correct
13 Correct 115 ms 13244 KB Output is correct
14 Correct 134 ms 13376 KB Output is correct
15 Correct 101 ms 12016 KB Output is correct
16 Correct 120 ms 12144 KB Output is correct
17 Correct 111 ms 14700 KB Output is correct
18 Correct 107 ms 12096 KB Output is correct
19 Correct 110 ms 14956 KB Output is correct
20 Correct 124 ms 18624 KB Output is correct
21 Correct 319 ms 29280 KB Output is correct
22 Correct 144 ms 17596 KB Output is correct
23 Correct 196 ms 25064 KB Output is correct
24 Correct 220 ms 27496 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 488 KB Output is correct
6 Correct 1 ms 512 KB Output is correct
7 Correct 2 ms 512 KB Output is correct
8 Correct 2 ms 512 KB Output is correct
9 Correct 2 ms 512 KB Output is correct
10 Correct 2 ms 512 KB Output is correct
11 Correct 2 ms 512 KB Output is correct
12 Correct 2 ms 512 KB Output is correct
13 Correct 4 ms 640 KB Output is correct
14 Correct 5 ms 640 KB Output is correct
15 Correct 4 ms 668 KB Output is correct
16 Correct 3 ms 640 KB Output is correct
17 Correct 5 ms 640 KB Output is correct
18 Correct 3 ms 640 KB Output is correct
19 Correct 5 ms 680 KB Output is correct
20 Correct 6 ms 716 KB Output is correct
21 Correct 6 ms 712 KB Output is correct
22 Correct 4 ms 640 KB Output is correct
23 Correct 6 ms 692 KB Output is correct
24 Correct 4 ms 680 KB Output is correct
25 Correct 4 ms 640 KB Output is correct
26 Correct 4 ms 716 KB Output is correct
27 Correct 4 ms 644 KB Output is correct
28 Correct 3 ms 512 KB Output is correct
29 Correct 3 ms 640 KB Output is correct
30 Correct 3 ms 640 KB Output is correct
31 Correct 5 ms 700 KB Output is correct
32 Correct 4 ms 680 KB Output is correct
33 Correct 6 ms 640 KB Output is correct
34 Correct 6 ms 640 KB Output is correct
35 Correct 8 ms 712 KB Output is correct
36 Correct 5 ms 644 KB Output is correct
37 Correct 8 ms 728 KB Output is correct
38 Correct 8 ms 712 KB Output is correct
39 Correct 5 ms 664 KB Output is correct
40 Correct 5 ms 644 KB Output is correct
41 Correct 5 ms 688 KB Output is correct
42 Correct 6 ms 660 KB Output is correct
43 Correct 7 ms 680 KB Output is correct
44 Correct 6 ms 712 KB Output is correct
45 Correct 4 ms 704 KB Output is correct
46 Correct 6 ms 688 KB Output is correct
47 Correct 7 ms 676 KB Output is correct
48 Correct 8 ms 696 KB Output is correct
49 Correct 7 ms 708 KB Output is correct
50 Correct 5 ms 684 KB Output is correct
51 Correct 8 ms 720 KB Output is correct
52 Correct 5 ms 644 KB Output is correct
53 Correct 7 ms 708 KB Output is correct
54 Correct 8 ms 704 KB Output is correct
55 Correct 4 ms 640 KB Output is correct
56 Correct 4 ms 628 KB Output is correct
57 Correct 5 ms 512 KB Output is correct
58 Correct 4 ms 512 KB Output is correct
59 Correct 133 ms 16952 KB Output is correct
60 Correct 101 ms 14444 KB Output is correct
61 Correct 168 ms 14956 KB Output is correct
62 Correct 99 ms 13804 KB Output is correct
63 Correct 102 ms 15464 KB Output is correct
64 Correct 101 ms 12784 KB Output is correct
65 Correct 111 ms 15980 KB Output is correct
66 Correct 106 ms 15424 KB Output is correct
67 Correct 234 ms 26276 KB Output is correct
68 Correct 152 ms 19820 KB Output is correct
69 Correct 155 ms 22644 KB Output is correct
70 Correct 166 ms 25140 KB Output is correct
71 Correct 833 ms 35484 KB Output is correct
72 Correct 830 ms 35428 KB Output is correct
73 Correct 668 ms 33792 KB Output is correct
74 Correct 298 ms 30920 KB Output is correct
75 Correct 474 ms 31768 KB Output is correct
76 Correct 312 ms 29284 KB Output is correct
77 Correct 598 ms 32512 KB Output is correct
78 Correct 1094 ms 34044 KB Output is correct
79 Correct 565 ms 32244 KB Output is correct
80 Correct 371 ms 32888 KB Output is correct
81 Correct 845 ms 31916 KB Output is correct
82 Correct 277 ms 25508 KB Output is correct
83 Correct 452 ms 32360 KB Output is correct
84 Correct 386 ms 25828 KB Output is correct
85 Correct 770 ms 35312 KB Output is correct
86 Correct 268 ms 29152 KB Output is correct
87 Correct 715 ms 35600 KB Output is correct
88 Correct 390 ms 34700 KB Output is correct
89 Correct 606 ms 30824 KB Output is correct
90 Correct 976 ms 34976 KB Output is correct
91 Correct 568 ms 30056 KB Output is correct
92 Correct 1044 ms 35588 KB Output is correct
93 Correct 829 ms 34636 KB Output is correct
94 Correct 947 ms 34748 KB Output is correct
95 Correct 964 ms 34992 KB Output is correct
96 Correct 743 ms 34296 KB Output is correct
97 Correct 835 ms 34992 KB Output is correct
98 Correct 734 ms 33040 KB Output is correct
99 Correct 624 ms 33212 KB Output is correct
100 Correct 922 ms 35084 KB Output is correct
101 Correct 910 ms 34668 KB Output is correct
102 Correct 503 ms 25424 KB Output is correct
103 Correct 1095 ms 35360 KB Output is correct
104 Correct 571 ms 30236 KB Output is correct
105 Correct 1052 ms 35868 KB Output is correct
106 Correct 938 ms 34196 KB Output is correct
107 Correct 794 ms 34740 KB Output is correct
108 Correct 1049 ms 34060 KB Output is correct
109 Correct 1070 ms 35212 KB Output is correct
110 Correct 870 ms 35620 KB Output is correct
111 Correct 752 ms 32416 KB Output is correct
112 Correct 1027 ms 35140 KB Output is correct
113 Correct 459 ms 23836 KB Output is correct
114 Correct 449 ms 23864 KB Output is correct
115 Correct 462 ms 23836 KB Output is correct
116 Correct 436 ms 23840 KB Output is correct
117 Correct 619 ms 31688 KB Output is correct
118 Correct 636 ms 31724 KB Output is correct
119 Correct 612 ms 31712 KB Output is correct
120 Correct 614 ms 31876 KB Output is correct
121 Correct 647 ms 31680 KB Output is correct
122 Correct 664 ms 31852 KB Output is correct
123 Correct 626 ms 31776 KB Output is correct
124 Correct 636 ms 31692 KB Output is correct
125 Correct 626 ms 31676 KB Output is correct
126 Correct 636 ms 31752 KB Output is correct