Submission #547226

# Submission time Handle Problem Language Result Execution time Memory
547226 2022-04-09T21:39:28 Z skittles1412 Alternating Current (BOI18_alternating) C++17
100 / 100
100 ms 14580 KB
#include "bits/extc++.h"

using namespace std;

template <typename T>
void dbgh(const T& t) {
	cerr << t << endl;
}

template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
	cerr << t << " | ";
	dbgh(u...);
}

#ifdef DEBUG
#define dbg(...)                                           \
	cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
		 << ": ";                                          \
	dbgh(__VA_ARGS__)
#else
#define cerr   \
	if (false) \
	cerr
#define dbg(...)
#endif

#define endl "\n"
#define long int64_t
#define sz(x) int((x).size())

void solve() {
	int n, m;
	cin >> n >> m;
	array<int, 3> arr[m];
	for (int i = 0; i < m; i++) {
		auto& [l, r, ci] = arr[i];
		cin >> l >> r;
		l--;
		r--;
		ci = i;
		if (l > r) {
			r += n;
		}
	}
	sort(arr, arr + m, [&](const auto& a, const auto& b) -> bool {
		if (a[0] != b[0]) {
			return a[0] < b[0];
		}
		return a[1] > b[1];
	});
	for (auto& [l, r, _] : arr) {
		if (r >= n) {
			r -= n;
		}
	}
	int par[m];
	pair<int, int> mx {-1, -1};
	for (int i = 0; i < 2 * m; i++) {
		int ci = i >= m ? i - m : i;
		auto [l, r, _] = arr[ci];
		if (l > r) {
			r += n;
		}
		if (i >= m) {
			l += n;
			r += n;
		}
		if (r <= mx.first) {
			par[ci] = mx.second;
		} else {
			par[ci] = ci;
			mx = {r, ci};
		}
	}
	for (int i = 0; i < m; i++) {
		int u = i;
		while (par[u] != u) {
			u = par[u];
		}
		par[i] = u;
	}
	vector<int> vals;
	int inds[m];
	for (int i = 0; i < m; i++) {
		if (par[i] == i) {
			inds[i] = sz(vals);
			vals.push_back(i);
		}
		dbg(i, arr[i][0], arr[i][1], par[i]);
	}
	auto covers_all = [&](const vector<pair<int, int>>& arr) -> bool {
		vector<int> e[n];
		for (auto& [l, r] : arr) {
			e[l].push_back(r);
		}
		int mx = -1;
		for (int i = 0; i < n; i++) {
			for (auto& a : e[i]) {
				mx = max(mx, a);
			}
			if (mx < i) {
				return false;
			}
		}
		return true;
	};
	auto check = [&](const vector<bool>& distr) -> void {
		vector<pair<int, int>> segs[2];
		auto add = [&](int i, int l, int r) -> void {
			if (r >= n) {
				r -= n;
			}
			if (l > r) {
				segs[i].emplace_back(l, n - 1);
				segs[i].emplace_back(0, r);
			} else {
				segs[i].emplace_back(l, r);
			}
		};
		bool ans[m];
		for (int i = 0; i < m; i++) {
			auto& [l, r, ci] = arr[i];
			if (par[i] == i) {
				ans[ci] = distr[inds[i]];
			} else {
				ans[ci] = !distr[inds[par[i]]];
			}
			dbg(i, inds[par[i]], ans[ci]);
			add(ans[ci], l, r);
		}
		if (covers_all(segs[0]) && covers_all(segs[1])) {
			for (auto& a : ans) {
				cout << a;
			}
			cout << endl;
			exit(0);
		}
	};
	int k = sz(vals);
	dbg(k);
	if (k % 2 == 0 || k == 1) {
		vector<bool> distr(k);
		for (int i = 0; i < k; i++) {
			distr[i] = i & 1;
		}
		check(distr);
		cout << "impossible" << endl;
		return;
	} else if (k <= 3) {
		for (int i = 0; i < k; i++) {
			vector<bool> distr(k);
			int j = i;
			bool cur = true;
			while (true) {
				distr[j] = cur;
				cur ^= true;
				j = j + 1 == k ? 0 : j + 1;
				if (j == i) {
					break;
				}
			}
			check(distr);
		}
		cout << "impossible" << endl;
		return;
	}
	{
		vector<pair<int, int>> cur;
		for (auto& [l, r, _] : arr) {
			if (l > r) {
				cur.emplace_back(l, n - 1);
				cur.emplace_back(0, r);
			} else {
				cur.emplace_back(l, r);
			}
		}
		if (!covers_all(cur)) {
			cout << "impossible" << endl;
			return;
		}
	}
	auto covers = [&](const vector<pair<int, int>>& segs, int ql, int qr) -> bool {
		if (!sz(segs)) {
			return false;
		}
		vector<pair<int, int>> evts;
		for (auto& [l, r] : segs) {
			evts.emplace_back(l - n, 1);
			evts.emplace_back(r - n + 1, -1);
			evts.emplace_back(l, 1);
			evts.emplace_back(r + 1, -1);
			evts.emplace_back(l + n, 1);
			evts.emplace_back(r + n + 1, -1);
		}
		sort(begin(evts), end(evts));
		int prev = -1, cur = 0;
		for (auto& [ind, x] : evts) {
			if (prev != -1 && ind != prev) {
				if (!cur) {
					if (ql <= ind - 1 && ind - 1 <= qr) {
						return false;
					} else if (ql <= prev && prev <= qr) {
						return false;
					}
				}
			}
			cur += x;
			prev = ind;
		}
		return true;
	};
	bool can[k];
	vector<pair<int, int>> child[k];
	for (int i = 0; i < m; i++) {
		auto& [l, r, _] = arr[i];
		if (l > r) {
			r += n;
		}
		if (par[i] != i) {
			child[inds[par[i]]].emplace_back(l, r);
		}
	}
	array<int, 2> carr[k];
	for (int i = 0; i < k; i++) {
		carr[i] = {arr[vals[i]][0], arr[vals[i]][1]};
	}
	for (int i = 0; i < k; i++) {
		int a = (i + k - 1) % k, b = (i + 1) % k;
		vector<pair<int, int>> cur = child[i];
		cur.emplace_back(carr[a][0], carr[a][1]);
		cur.emplace_back(carr[b][0], carr[b][1]);
		can[i] = covers(cur, carr[i][0], carr[i][1]);
		dbg(i, can[i], carr[a][0], carr[a][1], carr[b][0], carr[b][1], carr[i][0], carr[i][1]);
	}
	int cnt = 0;
	for (auto& a : can) {
		cnt += a;
	}
	for (int i = 0; i < k; i++) {
		int a = i, b = (i + 1) % k, c = (i + 2) % k, d = (i + 3) % k;
		int ccnt = cnt - can[b] - can[c];
		if (ccnt != k - 2) {
			continue;
		}
		vector<pair<int, int>> cur;
		cur.insert(cur.end(), begin(child[b]), end(child[b]));
		cur.insert(cur.end(), begin(child[c]), end(child[c]));
		cur.emplace_back(carr[a][0], carr[a][1]);
		cur.emplace_back(carr[d][0], carr[d][1]);
		if (!covers(cur, carr[b][0], carr[c][1])) {
			continue;
		}
		dbg(i, carr[b][0], carr[c][1]);
		vector<bool> distr(k);
		bool cb = true;
		while (true) {
			distr[c] = cb;
			cb ^= true;
			if (c == b) {
				break;
			}
			c = c + 1 == k ? 0 : c + 1;
		}
		check(distr);
//		assert(false);
	}
	cout << "impossible" << endl;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cin.exceptions(ios::failbit);
	solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 3 ms 212 KB Output is correct
61 Correct 1 ms 316 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 3 ms 212 KB Output is correct
61 Correct 1 ms 316 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 320 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 320 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 324 KB Output is correct
78 Correct 1 ms 340 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 324 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 2 ms 336 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 1 ms 324 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 320 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 6344 KB Output is correct
2 Correct 3 ms 2644 KB Output is correct
3 Correct 15 ms 5628 KB Output is correct
4 Correct 16 ms 5716 KB Output is correct
5 Correct 41 ms 7116 KB Output is correct
6 Correct 72 ms 7612 KB Output is correct
7 Correct 64 ms 8440 KB Output is correct
8 Correct 5 ms 2772 KB Output is correct
9 Correct 2 ms 2516 KB Output is correct
10 Correct 70 ms 10024 KB Output is correct
11 Correct 30 ms 6080 KB Output is correct
12 Correct 32 ms 8004 KB Output is correct
13 Correct 2 ms 2644 KB Output is correct
14 Correct 2 ms 2644 KB Output is correct
15 Correct 34 ms 7364 KB Output is correct
16 Correct 31 ms 6956 KB Output is correct
17 Correct 100 ms 14580 KB Output is correct
18 Correct 88 ms 11612 KB Output is correct
19 Correct 3 ms 3028 KB Output is correct
20 Correct 36 ms 7328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 1 ms 212 KB Output is correct
46 Correct 1 ms 212 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 212 KB Output is correct
49 Correct 1 ms 212 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 1 ms 212 KB Output is correct
52 Correct 1 ms 212 KB Output is correct
53 Correct 1 ms 212 KB Output is correct
54 Correct 1 ms 212 KB Output is correct
55 Correct 1 ms 212 KB Output is correct
56 Correct 1 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 3 ms 212 KB Output is correct
61 Correct 1 ms 316 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 1 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 1 ms 212 KB Output is correct
67 Correct 1 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 1 ms 340 KB Output is correct
72 Correct 1 ms 340 KB Output is correct
73 Correct 1 ms 320 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 320 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 324 KB Output is correct
78 Correct 1 ms 340 KB Output is correct
79 Correct 1 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 324 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 2 ms 336 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 1 ms 340 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 1 ms 324 KB Output is correct
90 Correct 1 ms 340 KB Output is correct
91 Correct 1 ms 340 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 1 ms 320 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 1 ms 340 KB Output is correct
97 Correct 1 ms 340 KB Output is correct
98 Correct 1 ms 340 KB Output is correct
99 Correct 27 ms 6344 KB Output is correct
100 Correct 3 ms 2644 KB Output is correct
101 Correct 15 ms 5628 KB Output is correct
102 Correct 16 ms 5716 KB Output is correct
103 Correct 41 ms 7116 KB Output is correct
104 Correct 72 ms 7612 KB Output is correct
105 Correct 64 ms 8440 KB Output is correct
106 Correct 5 ms 2772 KB Output is correct
107 Correct 2 ms 2516 KB Output is correct
108 Correct 70 ms 10024 KB Output is correct
109 Correct 30 ms 6080 KB Output is correct
110 Correct 32 ms 8004 KB Output is correct
111 Correct 2 ms 2644 KB Output is correct
112 Correct 2 ms 2644 KB Output is correct
113 Correct 34 ms 7364 KB Output is correct
114 Correct 31 ms 6956 KB Output is correct
115 Correct 100 ms 14580 KB Output is correct
116 Correct 88 ms 11612 KB Output is correct
117 Correct 3 ms 3028 KB Output is correct
118 Correct 36 ms 7328 KB Output is correct
119 Correct 2 ms 2644 KB Output is correct
120 Correct 69 ms 9872 KB Output is correct
121 Correct 42 ms 7044 KB Output is correct
122 Correct 0 ms 212 KB Output is correct
123 Correct 5 ms 3020 KB Output is correct
124 Correct 13 ms 4732 KB Output is correct
125 Correct 12 ms 4296 KB Output is correct
126 Correct 2 ms 2644 KB Output is correct
127 Correct 9 ms 3400 KB Output is correct
128 Correct 33 ms 7248 KB Output is correct
129 Correct 34 ms 6192 KB Output is correct
130 Correct 22 ms 5948 KB Output is correct
131 Correct 2 ms 2628 KB Output is correct
132 Correct 2 ms 2644 KB Output is correct
133 Correct 85 ms 9872 KB Output is correct
134 Correct 29 ms 4812 KB Output is correct
135 Correct 3 ms 2616 KB Output is correct
136 Correct 19 ms 5904 KB Output is correct
137 Correct 49 ms 7484 KB Output is correct
138 Correct 3 ms 2644 KB Output is correct