Submission #568470

# Submission time Handle Problem Language Result Execution time Memory
568470 2022-05-25T14:10:49 Z _karan_gandhi Painting Walls (APIO20_paint) C++17
51 / 100
989 ms 524288 KB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define all(v) v.begin(), v.end()
#define endl '\n'
#define pl(var) " [" << #var << ": " << (var) << "] "

template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "[" << p.first << ", " << p.second << "]"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) { cout << "["; for(int i = 0; i < (int)v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) { cin >> p.first; return cin >> p.second; }

struct Seg_tree {
	vector<ll int> tree;
	int array_size;
	int tree_size;

	ll int def = 1e9;

	void init(int n) {
		array_size = n;
		while (__builtin_popcount(array_size) != 1) {
			array_size++;
		}
		tree_size = 2 * array_size - 1;
		tree = vector<ll int>(tree_size, def);
	}

	ll int comb(ll int a, ll int b) {
		return min(a, b);
	}

	void pull(int u) {
		tree[u] = comb(tree[2 * u + 1], tree[2 * u + 2]);
	}

	void update(int idx, ll int val) {
		return update_dfs(0, idx, val, 0, array_size - 1);
	}

	void update_dfs(int u, int idx, ll int val, int node_left, int node_right) {
		if (node_right == node_left) {
			assert(idx == node_left);
			tree[u] = val;
			return;
		}

		ll int mid = (node_right + node_left) / 2;

		if (idx <= mid) {
			update_dfs(2 * u + 1, idx, val, node_left, mid);
		} else {
			update_dfs(2 * u + 2, idx, val, mid + 1, node_right);
		}
		pull(u);
	}

	ll int query(int l, int r) {
		// sum from x+1 to n
		return query_dfs(0, l, r, 0, array_size - 1);
	}

	ll int query_dfs(int u, int q_left, int q_right, int node_left, int node_right) {
		pair<int, int> q = make_pair(q_left, q_right);
		if (!intersects(q, make_pair(node_left, node_right))) return 0;

		if (q_left <= node_left && node_right <= q_right) {
			return tree[u];
		}

		int mid = (node_right + node_left) / 2;
		ll int res = def;

		if (intersects(q, make_pair(node_left, mid))) {
			res = comb(res, query_dfs(2 * u + 1, q_left, q_right, node_left, mid));
		} if (intersects(q, make_pair(mid + 1, node_right))) {
			res = comb(res, query_dfs(2 * u + 2, q_left, q_right, mid + 1, node_right));
		}

		return res;
	}

	bool intersects(pair<int, int> a, pair<int, int> b) {
		if (a.first > b.first) swap(a, b);

		return a.second >= b.first;
	}

	void print() {
		cout << " [";
		for (int i = 0; i < array_size; i++) {
			cout << tree[array_size + i - 1] << ' ';
		}
		cout << "] " << endl;
	}
};

int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b) {
	// dp[i] = min instructions that he has to give to paint the ith prefix
	vector<int> dp(n + 1, 1e9);
	Seg_tree tree;
	tree.init(n + 1);
	tree.update(0, 0);
	dp[0] = 0;

	vector<vector<bool>> possible(n, vector<bool>(k));

	for (int i = 0; i < m; i++) {
		for (int j = 0; j < a[i]; j++) {
			possible[i][b[i][j]] = 1;
		}
	}

	auto cost = [&](int en) -> int {
		// possible to paint en - m + 1 .. en
		en--;

		vector<int> seg;
		for (int i = en - m + 1; i <= en; i++) {
			seg.push_back(c[i]);
		}

		assert((int)seg.size() == m);

		for (int i = 0; i < m; i++) {
			seg.push_back(seg[i]);
		}

		for (int start = 0; start < (int)seg.size(); start++) {
			if (start + m - 1 >= (int)seg.size()) break;
			bool ok = 1;
			for (int i = 0; i < m; i++) {
				if (!possible[i][seg[start + i]]) {
					ok = 0;
					break;
				}
			}

			if (ok) return 1;
		}

		return 1e9;
	};

	for (int i = m; i <= n; i++) {
		dp[i] = min({
			dp[i],
			(int)tree.query(i - m, i - 1) + cost(i)
		});
		tree.update(i, dp[i]);
	}

	if (dp[n] == 1e9) return -1;
    return dp[n];
}
# 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 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 300 KB Output is correct
13 Correct 4 ms 6484 KB Output is correct
14 Correct 3 ms 6484 KB Output is correct
15 Correct 3 ms 6484 KB Output is correct
16 Correct 4 ms 6448 KB Output is correct
17 Correct 5 ms 6444 KB Output is correct
18 Correct 4 ms 6484 KB Output is correct
19 Correct 4 ms 6484 KB Output is correct
20 Correct 6 ms 6392 KB Output is correct
21 Correct 4 ms 6484 KB Output is correct
22 Correct 16 ms 7772 KB Output is correct
23 Correct 12 ms 7764 KB Output is correct
24 Correct 22 ms 7752 KB Output is correct
25 Correct 9 ms 2492 KB Output is correct
26 Correct 9 ms 2388 KB Output is correct
27 Correct 9 ms 2388 KB Output is correct
28 Correct 11 ms 2388 KB Output is correct
29 Correct 10 ms 2388 KB Output is correct
30 Correct 11 ms 2388 KB Output is correct
31 Correct 527 ms 247244 KB Output is correct
32 Correct 644 ms 247248 KB Output is correct
33 Correct 553 ms 247256 KB Output is correct
34 Correct 636 ms 247272 KB Output is correct
35 Correct 638 ms 247248 KB Output is correct
36 Correct 644 ms 247256 KB Output is correct
37 Correct 320 ms 248360 KB Output is correct
38 Correct 293 ms 248468 KB Output is correct
39 Correct 297 ms 248360 KB Output is correct
40 Correct 35 ms 9908 KB Output is correct
41 Correct 21 ms 6072 KB Output is correct
42 Correct 44 ms 10580 KB Output is correct
43 Correct 34 ms 6840 KB Output is correct
44 Correct 32 ms 6348 KB Output is correct
45 Correct 54 ms 10752 KB Output is correct
46 Runtime error 274 ms 524288 KB Execution killed with signal 9
47 Halted 0 ms 0 KB -
# 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 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 300 KB Output is correct
13 Correct 4 ms 6484 KB Output is correct
14 Correct 3 ms 6484 KB Output is correct
15 Correct 3 ms 6484 KB Output is correct
16 Correct 4 ms 6448 KB Output is correct
17 Correct 5 ms 6444 KB Output is correct
18 Correct 4 ms 6484 KB Output is correct
19 Correct 4 ms 6484 KB Output is correct
20 Correct 6 ms 6392 KB Output is correct
21 Correct 4 ms 6484 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 300 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 304 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 1 ms 300 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 3 ms 4564 KB Output is correct
34 Correct 3 ms 3668 KB Output is correct
35 Correct 2 ms 2260 KB Output is correct
36 Correct 3 ms 4804 KB Output is correct
37 Correct 2 ms 3540 KB Output is correct
38 Correct 2 ms 3540 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 3 ms 3156 KB Output is correct
41 Correct 1 ms 340 KB Output is correct
42 Correct 4 ms 5204 KB Output is correct
43 Correct 2 ms 3888 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 1 ms 300 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 300 KB Output is correct
49 Correct 1 ms 296 KB Output is correct
50 Correct 5 ms 6484 KB Output is correct
51 Correct 4 ms 6448 KB Output is correct
52 Correct 5 ms 6484 KB Output is correct
53 Correct 4 ms 6484 KB Output is correct
54 Correct 4 ms 6484 KB Output is correct
55 Correct 4 ms 6484 KB Output is correct
56 Correct 4 ms 6452 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 4 ms 6484 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 5 ms 6484 KB Output is correct
61 Correct 2 ms 340 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 1 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 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 4 ms 6484 KB Output is correct
16 Correct 3 ms 6484 KB Output is correct
17 Correct 3 ms 6484 KB Output is correct
18 Correct 4 ms 6448 KB Output is correct
19 Correct 5 ms 6444 KB Output is correct
20 Correct 4 ms 6484 KB Output is correct
21 Correct 4 ms 6484 KB Output is correct
22 Correct 6 ms 6392 KB Output is correct
23 Correct 4 ms 6484 KB Output is correct
24 Correct 16 ms 7772 KB Output is correct
25 Correct 12 ms 7764 KB Output is correct
26 Correct 22 ms 7752 KB Output is correct
27 Correct 1 ms 300 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 304 KB Output is correct
30 Correct 1 ms 300 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 1 ms 340 KB Output is correct
34 Correct 1 ms 300 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 3 ms 4564 KB Output is correct
37 Correct 3 ms 3668 KB Output is correct
38 Correct 2 ms 2260 KB Output is correct
39 Correct 3 ms 4804 KB Output is correct
40 Correct 2 ms 3540 KB Output is correct
41 Correct 2 ms 3540 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 3 ms 3156 KB Output is correct
44 Correct 1 ms 340 KB Output is correct
45 Correct 4 ms 5204 KB Output is correct
46 Correct 2 ms 3888 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 300 KB Output is correct
52 Correct 1 ms 296 KB Output is correct
53 Correct 5 ms 6484 KB Output is correct
54 Correct 4 ms 6448 KB Output is correct
55 Correct 5 ms 6484 KB Output is correct
56 Correct 4 ms 6484 KB Output is correct
57 Correct 4 ms 6484 KB Output is correct
58 Correct 4 ms 6484 KB Output is correct
59 Correct 4 ms 6452 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 4 ms 6484 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 5 ms 6484 KB Output is correct
64 Correct 2 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 4 ms 4948 KB Output is correct
71 Correct 4 ms 4052 KB Output is correct
72 Correct 4 ms 3284 KB Output is correct
73 Correct 4 ms 3668 KB Output is correct
74 Correct 4 ms 3668 KB Output is correct
75 Correct 4 ms 4532 KB Output is correct
76 Correct 12 ms 4204 KB Output is correct
77 Correct 14 ms 5616 KB Output is correct
78 Correct 16 ms 6252 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 340 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 5 ms 6660 KB Output is correct
85 Correct 6 ms 6612 KB Output is correct
86 Correct 6 ms 6668 KB Output is correct
87 Correct 6 ms 6580 KB Output is correct
88 Correct 6 ms 6612 KB Output is correct
89 Correct 6 ms 6612 KB Output is correct
90 Correct 19 ms 8544 KB Output is correct
91 Correct 19 ms 8504 KB Output is correct
92 Correct 19 ms 8480 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 1 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 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 4 ms 6484 KB Output is correct
16 Correct 3 ms 6484 KB Output is correct
17 Correct 3 ms 6484 KB Output is correct
18 Correct 4 ms 6448 KB Output is correct
19 Correct 5 ms 6444 KB Output is correct
20 Correct 4 ms 6484 KB Output is correct
21 Correct 4 ms 6484 KB Output is correct
22 Correct 6 ms 6392 KB Output is correct
23 Correct 4 ms 6484 KB Output is correct
24 Correct 16 ms 7772 KB Output is correct
25 Correct 12 ms 7764 KB Output is correct
26 Correct 22 ms 7752 KB Output is correct
27 Correct 9 ms 2492 KB Output is correct
28 Correct 9 ms 2388 KB Output is correct
29 Correct 9 ms 2388 KB Output is correct
30 Correct 11 ms 2388 KB Output is correct
31 Correct 10 ms 2388 KB Output is correct
32 Correct 11 ms 2388 KB Output is correct
33 Correct 527 ms 247244 KB Output is correct
34 Correct 644 ms 247248 KB Output is correct
35 Correct 553 ms 247256 KB Output is correct
36 Correct 636 ms 247272 KB Output is correct
37 Correct 638 ms 247248 KB Output is correct
38 Correct 644 ms 247256 KB Output is correct
39 Correct 320 ms 248360 KB Output is correct
40 Correct 293 ms 248468 KB Output is correct
41 Correct 297 ms 248360 KB Output is correct
42 Correct 1 ms 300 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 1 ms 304 KB Output is correct
45 Correct 1 ms 300 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 300 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 3 ms 4564 KB Output is correct
52 Correct 3 ms 3668 KB Output is correct
53 Correct 2 ms 2260 KB Output is correct
54 Correct 3 ms 4804 KB Output is correct
55 Correct 2 ms 3540 KB Output is correct
56 Correct 2 ms 3540 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 3 ms 3156 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 4 ms 5204 KB Output is correct
61 Correct 2 ms 3888 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 300 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 300 KB Output is correct
67 Correct 1 ms 296 KB Output is correct
68 Correct 5 ms 6484 KB Output is correct
69 Correct 4 ms 6448 KB Output is correct
70 Correct 5 ms 6484 KB Output is correct
71 Correct 4 ms 6484 KB Output is correct
72 Correct 4 ms 6484 KB Output is correct
73 Correct 4 ms 6484 KB Output is correct
74 Correct 4 ms 6452 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 4 ms 6484 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 5 ms 6484 KB Output is correct
79 Correct 2 ms 340 KB Output is correct
80 Correct 1 ms 340 KB Output is correct
81 Correct 1 ms 340 KB Output is correct
82 Correct 1 ms 340 KB Output is correct
83 Correct 1 ms 340 KB Output is correct
84 Correct 1 ms 340 KB Output is correct
85 Correct 4 ms 4948 KB Output is correct
86 Correct 4 ms 4052 KB Output is correct
87 Correct 4 ms 3284 KB Output is correct
88 Correct 4 ms 3668 KB Output is correct
89 Correct 4 ms 3668 KB Output is correct
90 Correct 4 ms 4532 KB Output is correct
91 Correct 12 ms 4204 KB Output is correct
92 Correct 14 ms 5616 KB Output is correct
93 Correct 16 ms 6252 KB Output is correct
94 Correct 1 ms 340 KB Output is correct
95 Correct 1 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 5 ms 6660 KB Output is correct
100 Correct 6 ms 6612 KB Output is correct
101 Correct 6 ms 6668 KB Output is correct
102 Correct 6 ms 6580 KB Output is correct
103 Correct 6 ms 6612 KB Output is correct
104 Correct 6 ms 6612 KB Output is correct
105 Correct 19 ms 8544 KB Output is correct
106 Correct 19 ms 8504 KB Output is correct
107 Correct 19 ms 8480 KB Output is correct
108 Correct 10 ms 2388 KB Output is correct
109 Correct 43 ms 1876 KB Output is correct
110 Correct 108 ms 1684 KB Output is correct
111 Correct 78 ms 1620 KB Output is correct
112 Correct 124 ms 1876 KB Output is correct
113 Correct 84 ms 1596 KB Output is correct
114 Correct 205 ms 135004 KB Output is correct
115 Correct 80 ms 111052 KB Output is correct
116 Correct 210 ms 210948 KB Output is correct
117 Correct 105 ms 95016 KB Output is correct
118 Correct 102 ms 140968 KB Output is correct
119 Correct 473 ms 169504 KB Output is correct
120 Correct 157 ms 94116 KB Output is correct
121 Correct 163 ms 18752 KB Output is correct
122 Correct 101 ms 82620 KB Output is correct
123 Correct 55 ms 17616 KB Output is correct
124 Correct 129 ms 184448 KB Output is correct
125 Correct 53 ms 45116 KB Output is correct
126 Correct 80 ms 110412 KB Output is correct
127 Correct 162 ms 186476 KB Output is correct
128 Correct 85 ms 126792 KB Output is correct
129 Correct 74 ms 94008 KB Output is correct
130 Correct 10 ms 2460 KB Output is correct
131 Correct 61 ms 2584 KB Output is correct
132 Correct 176 ms 2592 KB Output is correct
133 Correct 191 ms 2620 KB Output is correct
134 Correct 166 ms 2644 KB Output is correct
135 Correct 184 ms 2644 KB Output is correct
136 Correct 916 ms 248096 KB Output is correct
137 Correct 790 ms 248092 KB Output is correct
138 Correct 989 ms 248096 KB Output is correct
139 Correct 892 ms 248100 KB Output is correct
140 Correct 873 ms 248100 KB Output is correct
141 Correct 878 ms 248100 KB Output is correct
142 Correct 310 ms 249164 KB Output is correct
143 Correct 240 ms 51460 KB Output is correct
144 Correct 325 ms 249120 KB Output is correct
145 Correct 248 ms 51536 KB Output is correct
146 Correct 332 ms 249036 KB Output is correct
147 Correct 233 ms 51532 KB Output is correct
148 Correct 384 ms 247500 KB Output is correct
149 Correct 234 ms 247448 KB Output is correct
150 Correct 189 ms 247284 KB Output is correct
151 Correct 208 ms 247216 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 1 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 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 304 KB Output is correct
11 Correct 1 ms 300 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 300 KB Output is correct
15 Correct 4 ms 6484 KB Output is correct
16 Correct 3 ms 6484 KB Output is correct
17 Correct 3 ms 6484 KB Output is correct
18 Correct 4 ms 6448 KB Output is correct
19 Correct 5 ms 6444 KB Output is correct
20 Correct 4 ms 6484 KB Output is correct
21 Correct 4 ms 6484 KB Output is correct
22 Correct 6 ms 6392 KB Output is correct
23 Correct 4 ms 6484 KB Output is correct
24 Correct 16 ms 7772 KB Output is correct
25 Correct 12 ms 7764 KB Output is correct
26 Correct 22 ms 7752 KB Output is correct
27 Correct 9 ms 2492 KB Output is correct
28 Correct 9 ms 2388 KB Output is correct
29 Correct 9 ms 2388 KB Output is correct
30 Correct 11 ms 2388 KB Output is correct
31 Correct 10 ms 2388 KB Output is correct
32 Correct 11 ms 2388 KB Output is correct
33 Correct 527 ms 247244 KB Output is correct
34 Correct 644 ms 247248 KB Output is correct
35 Correct 553 ms 247256 KB Output is correct
36 Correct 636 ms 247272 KB Output is correct
37 Correct 638 ms 247248 KB Output is correct
38 Correct 644 ms 247256 KB Output is correct
39 Correct 320 ms 248360 KB Output is correct
40 Correct 293 ms 248468 KB Output is correct
41 Correct 297 ms 248360 KB Output is correct
42 Correct 35 ms 9908 KB Output is correct
43 Correct 21 ms 6072 KB Output is correct
44 Correct 44 ms 10580 KB Output is correct
45 Correct 34 ms 6840 KB Output is correct
46 Correct 32 ms 6348 KB Output is correct
47 Correct 54 ms 10752 KB Output is correct
48 Runtime error 274 ms 524288 KB Execution killed with signal 9
49 Halted 0 ms 0 KB -