#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) {
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];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 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 |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
4 ms |
6484 KB |
Output is correct |
14 |
Correct |
4 ms |
6484 KB |
Output is correct |
15 |
Correct |
4 ms |
6444 KB |
Output is correct |
16 |
Correct |
5 ms |
6484 KB |
Output is correct |
17 |
Correct |
4 ms |
6484 KB |
Output is correct |
18 |
Correct |
4 ms |
6484 KB |
Output is correct |
19 |
Correct |
4 ms |
6484 KB |
Output is correct |
20 |
Correct |
4 ms |
6484 KB |
Output is correct |
21 |
Correct |
4 ms |
6484 KB |
Output is correct |
22 |
Correct |
13 ms |
7420 KB |
Output is correct |
23 |
Correct |
13 ms |
7476 KB |
Output is correct |
24 |
Correct |
12 ms |
7516 KB |
Output is correct |
25 |
Correct |
8 ms |
2388 KB |
Output is correct |
26 |
Correct |
8 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 |
11 ms |
2464 KB |
Output is correct |
30 |
Correct |
15 ms |
2388 KB |
Output is correct |
31 |
Correct |
507 ms |
247248 KB |
Output is correct |
32 |
Correct |
549 ms |
247248 KB |
Output is correct |
33 |
Correct |
521 ms |
247244 KB |
Output is correct |
34 |
Correct |
528 ms |
247256 KB |
Output is correct |
35 |
Correct |
518 ms |
247252 KB |
Output is correct |
36 |
Correct |
554 ms |
247248 KB |
Output is correct |
37 |
Correct |
317 ms |
247912 KB |
Output is correct |
38 |
Correct |
335 ms |
247992 KB |
Output is correct |
39 |
Correct |
305 ms |
247916 KB |
Output is correct |
40 |
Correct |
35 ms |
9940 KB |
Output is correct |
41 |
Correct |
22 ms |
6020 KB |
Output is correct |
42 |
Correct |
43 ms |
10640 KB |
Output is correct |
43 |
Correct |
32 ms |
6828 KB |
Output is correct |
44 |
Correct |
29 ms |
6288 KB |
Output is correct |
45 |
Correct |
55 ms |
10708 KB |
Output is correct |
46 |
Runtime error |
255 ms |
524288 KB |
Execution killed with signal 9 |
47 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 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 |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
0 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
1 ms |
340 KB |
Output is correct |
13 |
Correct |
4 ms |
6484 KB |
Output is correct |
14 |
Correct |
4 ms |
6484 KB |
Output is correct |
15 |
Correct |
4 ms |
6444 KB |
Output is correct |
16 |
Correct |
5 ms |
6484 KB |
Output is correct |
17 |
Correct |
4 ms |
6484 KB |
Output is correct |
18 |
Correct |
4 ms |
6484 KB |
Output is correct |
19 |
Correct |
4 ms |
6484 KB |
Output is correct |
20 |
Correct |
4 ms |
6484 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 |
212 KB |
Output is correct |
25 |
Correct |
1 ms |
212 KB |
Output is correct |
26 |
Correct |
1 ms |
212 KB |
Output is correct |
27 |
Correct |
1 ms |
300 KB |
Output is correct |
28 |
Correct |
1 ms |
296 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
300 KB |
Output is correct |
31 |
Correct |
1 ms |
304 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
3 ms |
4652 KB |
Output is correct |
34 |
Correct |
3 ms |
3668 KB |
Output is correct |
35 |
Correct |
2 ms |
2260 KB |
Output is correct |
36 |
Correct |
4 ms |
4820 KB |
Output is correct |
37 |
Correct |
2 ms |
3540 KB |
Output is correct |
38 |
Correct |
2 ms |
3504 KB |
Output is correct |
39 |
Correct |
1 ms |
300 KB |
Output is correct |
40 |
Correct |
3 ms |
3244 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
3 ms |
5204 KB |
Output is correct |
43 |
Correct |
3 ms |
3796 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 |
340 KB |
Output is correct |
49 |
Correct |
1 ms |
340 KB |
Output is correct |
50 |
Correct |
4 ms |
6484 KB |
Output is correct |
51 |
Correct |
4 ms |
6484 KB |
Output is correct |
52 |
Correct |
4 ms |
6444 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 |
6484 KB |
Output is correct |
57 |
Correct |
1 ms |
404 KB |
Output is correct |
58 |
Correct |
4 ms |
6484 KB |
Output is correct |
59 |
Correct |
2 ms |
348 KB |
Output is correct |
60 |
Correct |
4 ms |
6448 KB |
Output is correct |
61 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
0 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 |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
6484 KB |
Output is correct |
16 |
Correct |
4 ms |
6484 KB |
Output is correct |
17 |
Correct |
4 ms |
6444 KB |
Output is correct |
18 |
Correct |
5 ms |
6484 KB |
Output is correct |
19 |
Correct |
4 ms |
6484 KB |
Output is correct |
20 |
Correct |
4 ms |
6484 KB |
Output is correct |
21 |
Correct |
4 ms |
6484 KB |
Output is correct |
22 |
Correct |
4 ms |
6484 KB |
Output is correct |
23 |
Correct |
4 ms |
6484 KB |
Output is correct |
24 |
Correct |
13 ms |
7420 KB |
Output is correct |
25 |
Correct |
13 ms |
7476 KB |
Output is correct |
26 |
Correct |
12 ms |
7516 KB |
Output is correct |
27 |
Correct |
1 ms |
212 KB |
Output is correct |
28 |
Correct |
1 ms |
212 KB |
Output is correct |
29 |
Correct |
1 ms |
212 KB |
Output is correct |
30 |
Correct |
1 ms |
300 KB |
Output is correct |
31 |
Correct |
1 ms |
296 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
300 KB |
Output is correct |
34 |
Correct |
1 ms |
304 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
3 ms |
4652 KB |
Output is correct |
37 |
Correct |
3 ms |
3668 KB |
Output is correct |
38 |
Correct |
2 ms |
2260 KB |
Output is correct |
39 |
Correct |
4 ms |
4820 KB |
Output is correct |
40 |
Correct |
2 ms |
3540 KB |
Output is correct |
41 |
Correct |
2 ms |
3504 KB |
Output is correct |
42 |
Correct |
1 ms |
300 KB |
Output is correct |
43 |
Correct |
3 ms |
3244 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
3 ms |
5204 KB |
Output is correct |
46 |
Correct |
3 ms |
3796 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 |
340 KB |
Output is correct |
52 |
Correct |
1 ms |
340 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 |
6444 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 |
6484 KB |
Output is correct |
60 |
Correct |
1 ms |
404 KB |
Output is correct |
61 |
Correct |
4 ms |
6484 KB |
Output is correct |
62 |
Correct |
2 ms |
348 KB |
Output is correct |
63 |
Correct |
4 ms |
6448 KB |
Output is correct |
64 |
Correct |
2 ms |
340 KB |
Output is correct |
65 |
Correct |
1 ms |
296 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 |
4024 KB |
Output is correct |
72 |
Correct |
3 ms |
3284 KB |
Output is correct |
73 |
Correct |
2 ms |
3640 KB |
Output is correct |
74 |
Correct |
6 ms |
3764 KB |
Output is correct |
75 |
Correct |
3 ms |
4436 KB |
Output is correct |
76 |
Correct |
12 ms |
4068 KB |
Output is correct |
77 |
Correct |
19 ms |
5312 KB |
Output is correct |
78 |
Correct |
16 ms |
5848 KB |
Output is correct |
79 |
Correct |
1 ms |
304 KB |
Output is correct |
80 |
Correct |
2 ms |
296 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 |
6612 KB |
Output is correct |
85 |
Correct |
5 ms |
6612 KB |
Output is correct |
86 |
Correct |
6 ms |
6664 KB |
Output is correct |
87 |
Correct |
5 ms |
6612 KB |
Output is correct |
88 |
Correct |
5 ms |
6584 KB |
Output is correct |
89 |
Correct |
6 ms |
6584 KB |
Output is correct |
90 |
Correct |
19 ms |
8020 KB |
Output is correct |
91 |
Correct |
16 ms |
8040 KB |
Output is correct |
92 |
Correct |
28 ms |
7988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
0 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 |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
6484 KB |
Output is correct |
16 |
Correct |
4 ms |
6484 KB |
Output is correct |
17 |
Correct |
4 ms |
6444 KB |
Output is correct |
18 |
Correct |
5 ms |
6484 KB |
Output is correct |
19 |
Correct |
4 ms |
6484 KB |
Output is correct |
20 |
Correct |
4 ms |
6484 KB |
Output is correct |
21 |
Correct |
4 ms |
6484 KB |
Output is correct |
22 |
Correct |
4 ms |
6484 KB |
Output is correct |
23 |
Correct |
4 ms |
6484 KB |
Output is correct |
24 |
Correct |
13 ms |
7420 KB |
Output is correct |
25 |
Correct |
13 ms |
7476 KB |
Output is correct |
26 |
Correct |
12 ms |
7516 KB |
Output is correct |
27 |
Correct |
8 ms |
2388 KB |
Output is correct |
28 |
Correct |
8 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 |
11 ms |
2464 KB |
Output is correct |
32 |
Correct |
15 ms |
2388 KB |
Output is correct |
33 |
Correct |
507 ms |
247248 KB |
Output is correct |
34 |
Correct |
549 ms |
247248 KB |
Output is correct |
35 |
Correct |
521 ms |
247244 KB |
Output is correct |
36 |
Correct |
528 ms |
247256 KB |
Output is correct |
37 |
Correct |
518 ms |
247252 KB |
Output is correct |
38 |
Correct |
554 ms |
247248 KB |
Output is correct |
39 |
Correct |
317 ms |
247912 KB |
Output is correct |
40 |
Correct |
335 ms |
247992 KB |
Output is correct |
41 |
Correct |
305 ms |
247916 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 |
300 KB |
Output is correct |
46 |
Correct |
1 ms |
296 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
300 KB |
Output is correct |
49 |
Correct |
1 ms |
304 KB |
Output is correct |
50 |
Correct |
1 ms |
340 KB |
Output is correct |
51 |
Correct |
3 ms |
4652 KB |
Output is correct |
52 |
Correct |
3 ms |
3668 KB |
Output is correct |
53 |
Correct |
2 ms |
2260 KB |
Output is correct |
54 |
Correct |
4 ms |
4820 KB |
Output is correct |
55 |
Correct |
2 ms |
3540 KB |
Output is correct |
56 |
Correct |
2 ms |
3504 KB |
Output is correct |
57 |
Correct |
1 ms |
300 KB |
Output is correct |
58 |
Correct |
3 ms |
3244 KB |
Output is correct |
59 |
Correct |
1 ms |
340 KB |
Output is correct |
60 |
Correct |
3 ms |
5204 KB |
Output is correct |
61 |
Correct |
3 ms |
3796 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 |
340 KB |
Output is correct |
67 |
Correct |
1 ms |
340 KB |
Output is correct |
68 |
Correct |
4 ms |
6484 KB |
Output is correct |
69 |
Correct |
4 ms |
6484 KB |
Output is correct |
70 |
Correct |
4 ms |
6444 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 |
6484 KB |
Output is correct |
75 |
Correct |
1 ms |
404 KB |
Output is correct |
76 |
Correct |
4 ms |
6484 KB |
Output is correct |
77 |
Correct |
2 ms |
348 KB |
Output is correct |
78 |
Correct |
4 ms |
6448 KB |
Output is correct |
79 |
Correct |
2 ms |
340 KB |
Output is correct |
80 |
Correct |
1 ms |
296 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 |
4024 KB |
Output is correct |
87 |
Correct |
3 ms |
3284 KB |
Output is correct |
88 |
Correct |
2 ms |
3640 KB |
Output is correct |
89 |
Correct |
6 ms |
3764 KB |
Output is correct |
90 |
Correct |
3 ms |
4436 KB |
Output is correct |
91 |
Correct |
12 ms |
4068 KB |
Output is correct |
92 |
Correct |
19 ms |
5312 KB |
Output is correct |
93 |
Correct |
16 ms |
5848 KB |
Output is correct |
94 |
Correct |
1 ms |
304 KB |
Output is correct |
95 |
Correct |
2 ms |
296 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 |
6612 KB |
Output is correct |
100 |
Correct |
5 ms |
6612 KB |
Output is correct |
101 |
Correct |
6 ms |
6664 KB |
Output is correct |
102 |
Correct |
5 ms |
6612 KB |
Output is correct |
103 |
Correct |
5 ms |
6584 KB |
Output is correct |
104 |
Correct |
6 ms |
6584 KB |
Output is correct |
105 |
Correct |
19 ms |
8020 KB |
Output is correct |
106 |
Correct |
16 ms |
8040 KB |
Output is correct |
107 |
Correct |
28 ms |
7988 KB |
Output is correct |
108 |
Correct |
9 ms |
2388 KB |
Output is correct |
109 |
Correct |
47 ms |
1876 KB |
Output is correct |
110 |
Correct |
90 ms |
1680 KB |
Output is correct |
111 |
Correct |
72 ms |
1584 KB |
Output is correct |
112 |
Correct |
121 ms |
1960 KB |
Output is correct |
113 |
Correct |
82 ms |
1596 KB |
Output is correct |
114 |
Correct |
212 ms |
134852 KB |
Output is correct |
115 |
Correct |
65 ms |
111100 KB |
Output is correct |
116 |
Correct |
195 ms |
210696 KB |
Output is correct |
117 |
Correct |
162 ms |
95012 KB |
Output is correct |
118 |
Correct |
83 ms |
140836 KB |
Output is correct |
119 |
Correct |
347 ms |
169508 KB |
Output is correct |
120 |
Correct |
146 ms |
93992 KB |
Output is correct |
121 |
Correct |
122 ms |
18644 KB |
Output is correct |
122 |
Correct |
90 ms |
82252 KB |
Output is correct |
123 |
Correct |
50 ms |
17492 KB |
Output is correct |
124 |
Correct |
125 ms |
183928 KB |
Output is correct |
125 |
Correct |
51 ms |
45104 KB |
Output is correct |
126 |
Correct |
64 ms |
110324 KB |
Output is correct |
127 |
Correct |
152 ms |
186452 KB |
Output is correct |
128 |
Correct |
75 ms |
126816 KB |
Output is correct |
129 |
Correct |
70 ms |
94020 KB |
Output is correct |
130 |
Correct |
14 ms |
2516 KB |
Output is correct |
131 |
Correct |
64 ms |
2516 KB |
Output is correct |
132 |
Correct |
174 ms |
2604 KB |
Output is correct |
133 |
Correct |
187 ms |
2516 KB |
Output is correct |
134 |
Correct |
171 ms |
2644 KB |
Output is correct |
135 |
Correct |
179 ms |
2652 KB |
Output is correct |
136 |
Correct |
1065 ms |
247908 KB |
Output is correct |
137 |
Correct |
729 ms |
247884 KB |
Output is correct |
138 |
Correct |
853 ms |
247980 KB |
Output is correct |
139 |
Correct |
907 ms |
247912 KB |
Output is correct |
140 |
Correct |
838 ms |
248000 KB |
Output is correct |
141 |
Correct |
807 ms |
247908 KB |
Output is correct |
142 |
Correct |
293 ms |
248524 KB |
Output is correct |
143 |
Correct |
275 ms |
51532 KB |
Output is correct |
144 |
Correct |
322 ms |
248504 KB |
Output is correct |
145 |
Correct |
223 ms |
51532 KB |
Output is correct |
146 |
Correct |
319 ms |
248372 KB |
Output is correct |
147 |
Correct |
232 ms |
51528 KB |
Output is correct |
148 |
Correct |
418 ms |
247504 KB |
Output is correct |
149 |
Correct |
224 ms |
247372 KB |
Output is correct |
150 |
Correct |
235 ms |
247220 KB |
Output is correct |
151 |
Correct |
176 ms |
247216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
0 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 |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
340 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
1 ms |
340 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
1 ms |
340 KB |
Output is correct |
14 |
Correct |
1 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
6484 KB |
Output is correct |
16 |
Correct |
4 ms |
6484 KB |
Output is correct |
17 |
Correct |
4 ms |
6444 KB |
Output is correct |
18 |
Correct |
5 ms |
6484 KB |
Output is correct |
19 |
Correct |
4 ms |
6484 KB |
Output is correct |
20 |
Correct |
4 ms |
6484 KB |
Output is correct |
21 |
Correct |
4 ms |
6484 KB |
Output is correct |
22 |
Correct |
4 ms |
6484 KB |
Output is correct |
23 |
Correct |
4 ms |
6484 KB |
Output is correct |
24 |
Correct |
13 ms |
7420 KB |
Output is correct |
25 |
Correct |
13 ms |
7476 KB |
Output is correct |
26 |
Correct |
12 ms |
7516 KB |
Output is correct |
27 |
Correct |
8 ms |
2388 KB |
Output is correct |
28 |
Correct |
8 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 |
11 ms |
2464 KB |
Output is correct |
32 |
Correct |
15 ms |
2388 KB |
Output is correct |
33 |
Correct |
507 ms |
247248 KB |
Output is correct |
34 |
Correct |
549 ms |
247248 KB |
Output is correct |
35 |
Correct |
521 ms |
247244 KB |
Output is correct |
36 |
Correct |
528 ms |
247256 KB |
Output is correct |
37 |
Correct |
518 ms |
247252 KB |
Output is correct |
38 |
Correct |
554 ms |
247248 KB |
Output is correct |
39 |
Correct |
317 ms |
247912 KB |
Output is correct |
40 |
Correct |
335 ms |
247992 KB |
Output is correct |
41 |
Correct |
305 ms |
247916 KB |
Output is correct |
42 |
Correct |
35 ms |
9940 KB |
Output is correct |
43 |
Correct |
22 ms |
6020 KB |
Output is correct |
44 |
Correct |
43 ms |
10640 KB |
Output is correct |
45 |
Correct |
32 ms |
6828 KB |
Output is correct |
46 |
Correct |
29 ms |
6288 KB |
Output is correct |
47 |
Correct |
55 ms |
10708 KB |
Output is correct |
48 |
Runtime error |
255 ms |
524288 KB |
Execution killed with signal 9 |
49 |
Halted |
0 ms |
0 KB |
- |