#include <bits/stdc++.h>
#include "paint.h"
//#include "grader.cpp"
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)
#define pb push_back
#define all(s) s.begin(), s.end()
#define szof(s) (int)s.size()
using namespace std;
const int MAXN = (int)1e5 + 5;
const int INF = 1e9 + 7;
int pos[MAXN];
int dp[MAXN];
int pref[MAXN];
struct Segment_Tree {
vector <int> tree;
vector <int> lazy;
Segment_Tree (int n) {
tree.resize(n * 4, INF);
lazy.resize(n * 4, INF);
}
void push(int v, int tl, int tr) {
if (lazy[v] == INF) {
return;
}
if (tl != tr) {
chkmin(lazy[v + v], lazy[v]);
chkmin(lazy[v + v + 1], lazy[v]);
}
chkmin(tree[v], lazy[v]);
lazy[v] = INF;
}
void upd(int l, int r, int val, int v, int tl, int tr) {
push(v, tl, tr);
if (l > tr || tl > r) {
return;
}
if (l <= tl && tr <= r) {
lazy[v] = val;
push(v, tl, tr);
return;
}
int mid = (tl + tr) >> 1;
upd(l, r, val, v + v, tl, mid);
upd(l, r, val, v + v + 1, mid + 1, tr);
tree[v] = min(tree[v + v], tree[v + v + 1]);
}
int get(int l, int r, int v, int tl, int tr) {
push(v, tl, tr);
if (l > tr || tl > r) {
return INF;
}
if (l <= tl && tr <= r) {
return tree[v];
}
int mid = (tl + tr) >> 1;
return min(get(l, r, v + v, tl, mid), get(l, r, v + v + 1, mid + 1, tr));
}
};
vector <int> color[MAXN];
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) {
for (int i = 0; i < M; i++) {
for (int el : B[i]) {
color[el].pb(i);
}
}
vector <vector<int>> Q;
vector <int> MAXQ;
Q.resize(N + 1);
MAXQ.resize(N + 1, 0);
for (auto &el : Q) {
el.resize(635, 0);
}
int p;
int sum = 0;
for (int i = 0; i < N; i++) {
sum += szof(color[C[i]]);
}
assert(sum <= 400000);
auto get_pos = [&](vector <int> vec, int x) {
auto it = lower_bound(all(vec), x);
if (it != vec.end() && *it == x) {
return (int)(it - vec.begin());
} else {
return -1;
}
};
for (int i = N - 1; i >= 0; i--) {
for (int j = 0; j < szof(color[C[i]]); j++) {
if (i == N - 1) {
Q[i][j] = 1;
} else {
p = color[C[i]][j];
int kek = get_pos(color[C[i + 1]], (p + 1) % M);
int add = 0;
if (kek != -1) {
add = Q[i + 1][kek];
}
Q[i][j] = 1 + add;
}
MAXQ[i] = max(MAXQ[i], Q[i][j]);
}
}
auto can = [&](int l, int r) {
return l + MAXQ[l] - 1 >= r;
};
fill(dp, dp + MAXN, INF);
Segment_Tree T(N);
if (can(0, M - 1)) {
T.upd(0, M - 1, 1, 1, 0, N - 1);
}
for (int i = M; i < N; i++) {
if (can(i - M + 1, i)) {
int best = T.get(i - M, i - 1, 1, 0, N - 1);
T.upd(i - M + 1, i, best + 1, 1, 0, N - 1);
}
}
if (T.get(N - 1, N - 1, 1, 0, N - 1) < INF) {
return T.get(N - 1, N - 1, 1, 0, N - 1);
} else {
return -1;
}
}
/*
5 3 10
0 2 1 4 3
2 0 4
2 3 2
1 1
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3052 KB |
Output is correct |
2 |
Correct |
3 ms |
3052 KB |
Output is correct |
3 |
Correct |
3 ms |
3052 KB |
Output is correct |
4 |
Correct |
3 ms |
3052 KB |
Output is correct |
5 |
Correct |
3 ms |
3052 KB |
Output is correct |
6 |
Correct |
3 ms |
3052 KB |
Output is correct |
7 |
Correct |
4 ms |
4332 KB |
Output is correct |
8 |
Correct |
4 ms |
4332 KB |
Output is correct |
9 |
Correct |
2 ms |
4332 KB |
Output is correct |
10 |
Correct |
4 ms |
4332 KB |
Output is correct |
11 |
Correct |
4 ms |
4332 KB |
Output is correct |
12 |
Correct |
4 ms |
4332 KB |
Output is correct |
13 |
Correct |
4 ms |
4332 KB |
Output is correct |
14 |
Correct |
4 ms |
4332 KB |
Output is correct |
15 |
Correct |
4 ms |
4352 KB |
Output is correct |
16 |
Correct |
4 ms |
4344 KB |
Output is correct |
17 |
Correct |
4 ms |
4332 KB |
Output is correct |
18 |
Correct |
4 ms |
4332 KB |
Output is correct |
19 |
Correct |
4 ms |
4332 KB |
Output is correct |
20 |
Correct |
4 ms |
4332 KB |
Output is correct |
21 |
Correct |
4 ms |
4332 KB |
Output is correct |
22 |
Correct |
26 ms |
8300 KB |
Output is correct |
23 |
Correct |
26 ms |
8320 KB |
Output is correct |
24 |
Correct |
27 ms |
8300 KB |
Output is correct |
25 |
Correct |
48 ms |
54508 KB |
Output is correct |
26 |
Correct |
49 ms |
54508 KB |
Output is correct |
27 |
Correct |
46 ms |
54508 KB |
Output is correct |
28 |
Correct |
42 ms |
54508 KB |
Output is correct |
29 |
Correct |
41 ms |
54508 KB |
Output is correct |
30 |
Correct |
42 ms |
54508 KB |
Output is correct |
31 |
Correct |
62 ms |
55532 KB |
Output is correct |
32 |
Correct |
60 ms |
55532 KB |
Output is correct |
33 |
Correct |
60 ms |
55552 KB |
Output is correct |
34 |
Correct |
60 ms |
55404 KB |
Output is correct |
35 |
Correct |
60 ms |
55404 KB |
Output is correct |
36 |
Correct |
62 ms |
55532 KB |
Output is correct |
37 |
Correct |
68 ms |
58732 KB |
Output is correct |
38 |
Correct |
67 ms |
58604 KB |
Output is correct |
39 |
Correct |
68 ms |
58604 KB |
Output is correct |
40 |
Correct |
207 ms |
236524 KB |
Output is correct |
41 |
Correct |
133 ms |
149100 KB |
Output is correct |
42 |
Correct |
208 ms |
256236 KB |
Output is correct |
43 |
Correct |
126 ms |
171244 KB |
Output is correct |
44 |
Correct |
111 ms |
155884 KB |
Output is correct |
45 |
Correct |
182 ms |
259692 KB |
Output is correct |
46 |
Correct |
233 ms |
233324 KB |
Output is correct |
47 |
Correct |
158 ms |
150380 KB |
Output is correct |
48 |
Correct |
141 ms |
153196 KB |
Output is correct |
49 |
Correct |
151 ms |
166124 KB |
Output is correct |
50 |
Correct |
170 ms |
189804 KB |
Output is correct |
51 |
Correct |
166 ms |
197228 KB |
Output is correct |
52 |
Correct |
237 ms |
260332 KB |
Output is correct |
53 |
Correct |
231 ms |
260204 KB |
Output is correct |
54 |
Correct |
208 ms |
260204 KB |
Output is correct |
55 |
Correct |
188 ms |
260204 KB |
Output is correct |
56 |
Correct |
185 ms |
260288 KB |
Output is correct |
57 |
Correct |
188 ms |
260204 KB |
Output is correct |
58 |
Correct |
273 ms |
269288 KB |
Output is correct |
59 |
Correct |
276 ms |
269164 KB |
Output is correct |
60 |
Correct |
276 ms |
269292 KB |
Output is correct |
61 |
Correct |
272 ms |
269292 KB |
Output is correct |
62 |
Correct |
269 ms |
269164 KB |
Output is correct |
63 |
Correct |
271 ms |
269164 KB |
Output is correct |
64 |
Correct |
239 ms |
268396 KB |
Output is correct |
65 |
Correct |
234 ms |
268396 KB |
Output is correct |
66 |
Correct |
233 ms |
268644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3052 KB |
Output is correct |
2 |
Correct |
3 ms |
3052 KB |
Output is correct |
3 |
Correct |
3 ms |
3052 KB |
Output is correct |
4 |
Correct |
3 ms |
3052 KB |
Output is correct |
5 |
Correct |
3 ms |
3052 KB |
Output is correct |
6 |
Correct |
3 ms |
3052 KB |
Output is correct |
7 |
Correct |
4 ms |
4332 KB |
Output is correct |
8 |
Correct |
4 ms |
4332 KB |
Output is correct |
9 |
Correct |
2 ms |
4332 KB |
Output is correct |
10 |
Correct |
4 ms |
4332 KB |
Output is correct |
11 |
Correct |
4 ms |
4332 KB |
Output is correct |
12 |
Correct |
4 ms |
4332 KB |
Output is correct |
13 |
Correct |
4 ms |
4332 KB |
Output is correct |
14 |
Correct |
4 ms |
4332 KB |
Output is correct |
15 |
Correct |
4 ms |
4352 KB |
Output is correct |
16 |
Correct |
4 ms |
4344 KB |
Output is correct |
17 |
Correct |
4 ms |
4332 KB |
Output is correct |
18 |
Correct |
4 ms |
4332 KB |
Output is correct |
19 |
Correct |
4 ms |
4332 KB |
Output is correct |
20 |
Correct |
4 ms |
4332 KB |
Output is correct |
21 |
Correct |
4 ms |
4332 KB |
Output is correct |
22 |
Correct |
3 ms |
3052 KB |
Output is correct |
23 |
Correct |
3 ms |
3052 KB |
Output is correct |
24 |
Correct |
3 ms |
3052 KB |
Output is correct |
25 |
Correct |
3 ms |
3052 KB |
Output is correct |
26 |
Correct |
3 ms |
3052 KB |
Output is correct |
27 |
Correct |
3 ms |
3820 KB |
Output is correct |
28 |
Correct |
4 ms |
3948 KB |
Output is correct |
29 |
Correct |
4 ms |
3692 KB |
Output is correct |
30 |
Correct |
4 ms |
3948 KB |
Output is correct |
31 |
Correct |
4 ms |
4204 KB |
Output is correct |
32 |
Correct |
4 ms |
4076 KB |
Output is correct |
33 |
Correct |
4 ms |
4352 KB |
Output is correct |
34 |
Correct |
4 ms |
4204 KB |
Output is correct |
35 |
Correct |
3 ms |
3820 KB |
Output is correct |
36 |
Correct |
4 ms |
4076 KB |
Output is correct |
37 |
Correct |
4 ms |
3948 KB |
Output is correct |
38 |
Correct |
3 ms |
3820 KB |
Output is correct |
39 |
Correct |
3 ms |
3820 KB |
Output is correct |
40 |
Correct |
4 ms |
3948 KB |
Output is correct |
41 |
Correct |
3 ms |
3948 KB |
Output is correct |
42 |
Correct |
4 ms |
4204 KB |
Output is correct |
43 |
Correct |
3 ms |
3820 KB |
Output is correct |
44 |
Correct |
4 ms |
4332 KB |
Output is correct |
45 |
Correct |
5 ms |
4332 KB |
Output is correct |
46 |
Correct |
4 ms |
4332 KB |
Output is correct |
47 |
Correct |
4 ms |
4332 KB |
Output is correct |
48 |
Correct |
4 ms |
4332 KB |
Output is correct |
49 |
Correct |
4 ms |
4332 KB |
Output is correct |
50 |
Correct |
4 ms |
4332 KB |
Output is correct |
51 |
Correct |
4 ms |
4332 KB |
Output is correct |
52 |
Correct |
4 ms |
4332 KB |
Output is correct |
53 |
Correct |
4 ms |
4332 KB |
Output is correct |
54 |
Correct |
4 ms |
4332 KB |
Output is correct |
55 |
Correct |
4 ms |
4332 KB |
Output is correct |
56 |
Correct |
4 ms |
4480 KB |
Output is correct |
57 |
Correct |
6 ms |
4332 KB |
Output is correct |
58 |
Correct |
4 ms |
4480 KB |
Output is correct |
59 |
Correct |
4 ms |
4332 KB |
Output is correct |
60 |
Correct |
4 ms |
4460 KB |
Output is correct |
61 |
Correct |
4 ms |
4332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3052 KB |
Output is correct |
2 |
Correct |
3 ms |
3052 KB |
Output is correct |
3 |
Correct |
3 ms |
3052 KB |
Output is correct |
4 |
Correct |
3 ms |
3052 KB |
Output is correct |
5 |
Correct |
3 ms |
3052 KB |
Output is correct |
6 |
Correct |
3 ms |
3052 KB |
Output is correct |
7 |
Correct |
3 ms |
3052 KB |
Output is correct |
8 |
Correct |
3 ms |
3052 KB |
Output is correct |
9 |
Correct |
4 ms |
4332 KB |
Output is correct |
10 |
Correct |
4 ms |
4332 KB |
Output is correct |
11 |
Correct |
2 ms |
4332 KB |
Output is correct |
12 |
Correct |
4 ms |
4332 KB |
Output is correct |
13 |
Correct |
4 ms |
4332 KB |
Output is correct |
14 |
Correct |
4 ms |
4332 KB |
Output is correct |
15 |
Correct |
4 ms |
4332 KB |
Output is correct |
16 |
Correct |
4 ms |
4332 KB |
Output is correct |
17 |
Correct |
4 ms |
4352 KB |
Output is correct |
18 |
Correct |
4 ms |
4344 KB |
Output is correct |
19 |
Correct |
4 ms |
4332 KB |
Output is correct |
20 |
Correct |
4 ms |
4332 KB |
Output is correct |
21 |
Correct |
4 ms |
4332 KB |
Output is correct |
22 |
Correct |
4 ms |
4332 KB |
Output is correct |
23 |
Correct |
4 ms |
4332 KB |
Output is correct |
24 |
Correct |
26 ms |
8300 KB |
Output is correct |
25 |
Correct |
26 ms |
8320 KB |
Output is correct |
26 |
Correct |
27 ms |
8300 KB |
Output is correct |
27 |
Correct |
3 ms |
3052 KB |
Output is correct |
28 |
Correct |
3 ms |
3052 KB |
Output is correct |
29 |
Correct |
3 ms |
3052 KB |
Output is correct |
30 |
Correct |
3 ms |
3820 KB |
Output is correct |
31 |
Correct |
4 ms |
3948 KB |
Output is correct |
32 |
Correct |
4 ms |
3692 KB |
Output is correct |
33 |
Correct |
4 ms |
3948 KB |
Output is correct |
34 |
Correct |
4 ms |
4204 KB |
Output is correct |
35 |
Correct |
4 ms |
4076 KB |
Output is correct |
36 |
Correct |
4 ms |
4352 KB |
Output is correct |
37 |
Correct |
4 ms |
4204 KB |
Output is correct |
38 |
Correct |
3 ms |
3820 KB |
Output is correct |
39 |
Correct |
4 ms |
4076 KB |
Output is correct |
40 |
Correct |
4 ms |
3948 KB |
Output is correct |
41 |
Correct |
3 ms |
3820 KB |
Output is correct |
42 |
Correct |
3 ms |
3820 KB |
Output is correct |
43 |
Correct |
4 ms |
3948 KB |
Output is correct |
44 |
Correct |
3 ms |
3948 KB |
Output is correct |
45 |
Correct |
4 ms |
4204 KB |
Output is correct |
46 |
Correct |
3 ms |
3820 KB |
Output is correct |
47 |
Correct |
4 ms |
4332 KB |
Output is correct |
48 |
Correct |
5 ms |
4332 KB |
Output is correct |
49 |
Correct |
4 ms |
4332 KB |
Output is correct |
50 |
Correct |
4 ms |
4332 KB |
Output is correct |
51 |
Correct |
4 ms |
4332 KB |
Output is correct |
52 |
Correct |
4 ms |
4332 KB |
Output is correct |
53 |
Correct |
4 ms |
4332 KB |
Output is correct |
54 |
Correct |
4 ms |
4332 KB |
Output is correct |
55 |
Correct |
4 ms |
4332 KB |
Output is correct |
56 |
Correct |
4 ms |
4332 KB |
Output is correct |
57 |
Correct |
4 ms |
4332 KB |
Output is correct |
58 |
Correct |
4 ms |
4332 KB |
Output is correct |
59 |
Correct |
4 ms |
4480 KB |
Output is correct |
60 |
Correct |
6 ms |
4332 KB |
Output is correct |
61 |
Correct |
4 ms |
4480 KB |
Output is correct |
62 |
Correct |
4 ms |
4332 KB |
Output is correct |
63 |
Correct |
4 ms |
4460 KB |
Output is correct |
64 |
Correct |
4 ms |
4332 KB |
Output is correct |
65 |
Correct |
8 ms |
3840 KB |
Output is correct |
66 |
Correct |
5 ms |
4332 KB |
Output is correct |
67 |
Correct |
8 ms |
4332 KB |
Output is correct |
68 |
Correct |
6 ms |
4332 KB |
Output is correct |
69 |
Correct |
10 ms |
4204 KB |
Output is correct |
70 |
Correct |
6 ms |
4460 KB |
Output is correct |
71 |
Correct |
7 ms |
4332 KB |
Output is correct |
72 |
Correct |
6 ms |
4332 KB |
Output is correct |
73 |
Correct |
5 ms |
4204 KB |
Output is correct |
74 |
Correct |
6 ms |
4204 KB |
Output is correct |
75 |
Correct |
6 ms |
4076 KB |
Output is correct |
76 |
Correct |
27 ms |
6764 KB |
Output is correct |
77 |
Correct |
25 ms |
7276 KB |
Output is correct |
78 |
Correct |
34 ms |
7660 KB |
Output is correct |
79 |
Correct |
13 ms |
4332 KB |
Output is correct |
80 |
Correct |
13 ms |
4332 KB |
Output is correct |
81 |
Correct |
14 ms |
4332 KB |
Output is correct |
82 |
Correct |
14 ms |
4332 KB |
Output is correct |
83 |
Correct |
15 ms |
4332 KB |
Output is correct |
84 |
Correct |
7 ms |
4736 KB |
Output is correct |
85 |
Correct |
7 ms |
4728 KB |
Output is correct |
86 |
Correct |
7 ms |
4716 KB |
Output is correct |
87 |
Correct |
7 ms |
4716 KB |
Output is correct |
88 |
Correct |
7 ms |
4588 KB |
Output is correct |
89 |
Correct |
7 ms |
4588 KB |
Output is correct |
90 |
Correct |
40 ms |
8300 KB |
Output is correct |
91 |
Correct |
39 ms |
8300 KB |
Output is correct |
92 |
Correct |
40 ms |
8300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3052 KB |
Output is correct |
2 |
Correct |
3 ms |
3052 KB |
Output is correct |
3 |
Correct |
3 ms |
3052 KB |
Output is correct |
4 |
Correct |
3 ms |
3052 KB |
Output is correct |
5 |
Correct |
3 ms |
3052 KB |
Output is correct |
6 |
Correct |
3 ms |
3052 KB |
Output is correct |
7 |
Correct |
3 ms |
3052 KB |
Output is correct |
8 |
Correct |
3 ms |
3052 KB |
Output is correct |
9 |
Correct |
4 ms |
4332 KB |
Output is correct |
10 |
Correct |
4 ms |
4332 KB |
Output is correct |
11 |
Correct |
2 ms |
4332 KB |
Output is correct |
12 |
Correct |
4 ms |
4332 KB |
Output is correct |
13 |
Correct |
4 ms |
4332 KB |
Output is correct |
14 |
Correct |
4 ms |
4332 KB |
Output is correct |
15 |
Correct |
4 ms |
4332 KB |
Output is correct |
16 |
Correct |
4 ms |
4332 KB |
Output is correct |
17 |
Correct |
4 ms |
4352 KB |
Output is correct |
18 |
Correct |
4 ms |
4344 KB |
Output is correct |
19 |
Correct |
4 ms |
4332 KB |
Output is correct |
20 |
Correct |
4 ms |
4332 KB |
Output is correct |
21 |
Correct |
4 ms |
4332 KB |
Output is correct |
22 |
Correct |
4 ms |
4332 KB |
Output is correct |
23 |
Correct |
4 ms |
4332 KB |
Output is correct |
24 |
Correct |
26 ms |
8300 KB |
Output is correct |
25 |
Correct |
26 ms |
8320 KB |
Output is correct |
26 |
Correct |
27 ms |
8300 KB |
Output is correct |
27 |
Correct |
48 ms |
54508 KB |
Output is correct |
28 |
Correct |
49 ms |
54508 KB |
Output is correct |
29 |
Correct |
46 ms |
54508 KB |
Output is correct |
30 |
Correct |
42 ms |
54508 KB |
Output is correct |
31 |
Correct |
41 ms |
54508 KB |
Output is correct |
32 |
Correct |
42 ms |
54508 KB |
Output is correct |
33 |
Correct |
62 ms |
55532 KB |
Output is correct |
34 |
Correct |
60 ms |
55532 KB |
Output is correct |
35 |
Correct |
60 ms |
55552 KB |
Output is correct |
36 |
Correct |
60 ms |
55404 KB |
Output is correct |
37 |
Correct |
60 ms |
55404 KB |
Output is correct |
38 |
Correct |
62 ms |
55532 KB |
Output is correct |
39 |
Correct |
68 ms |
58732 KB |
Output is correct |
40 |
Correct |
67 ms |
58604 KB |
Output is correct |
41 |
Correct |
68 ms |
58604 KB |
Output is correct |
42 |
Correct |
3 ms |
3052 KB |
Output is correct |
43 |
Correct |
3 ms |
3052 KB |
Output is correct |
44 |
Correct |
3 ms |
3052 KB |
Output is correct |
45 |
Correct |
3 ms |
3820 KB |
Output is correct |
46 |
Correct |
4 ms |
3948 KB |
Output is correct |
47 |
Correct |
4 ms |
3692 KB |
Output is correct |
48 |
Correct |
4 ms |
3948 KB |
Output is correct |
49 |
Correct |
4 ms |
4204 KB |
Output is correct |
50 |
Correct |
4 ms |
4076 KB |
Output is correct |
51 |
Correct |
4 ms |
4352 KB |
Output is correct |
52 |
Correct |
4 ms |
4204 KB |
Output is correct |
53 |
Correct |
3 ms |
3820 KB |
Output is correct |
54 |
Correct |
4 ms |
4076 KB |
Output is correct |
55 |
Correct |
4 ms |
3948 KB |
Output is correct |
56 |
Correct |
3 ms |
3820 KB |
Output is correct |
57 |
Correct |
3 ms |
3820 KB |
Output is correct |
58 |
Correct |
4 ms |
3948 KB |
Output is correct |
59 |
Correct |
3 ms |
3948 KB |
Output is correct |
60 |
Correct |
4 ms |
4204 KB |
Output is correct |
61 |
Correct |
3 ms |
3820 KB |
Output is correct |
62 |
Correct |
4 ms |
4332 KB |
Output is correct |
63 |
Correct |
5 ms |
4332 KB |
Output is correct |
64 |
Correct |
4 ms |
4332 KB |
Output is correct |
65 |
Correct |
4 ms |
4332 KB |
Output is correct |
66 |
Correct |
4 ms |
4332 KB |
Output is correct |
67 |
Correct |
4 ms |
4332 KB |
Output is correct |
68 |
Correct |
4 ms |
4332 KB |
Output is correct |
69 |
Correct |
4 ms |
4332 KB |
Output is correct |
70 |
Correct |
4 ms |
4332 KB |
Output is correct |
71 |
Correct |
4 ms |
4332 KB |
Output is correct |
72 |
Correct |
4 ms |
4332 KB |
Output is correct |
73 |
Correct |
4 ms |
4332 KB |
Output is correct |
74 |
Correct |
4 ms |
4480 KB |
Output is correct |
75 |
Correct |
6 ms |
4332 KB |
Output is correct |
76 |
Correct |
4 ms |
4480 KB |
Output is correct |
77 |
Correct |
4 ms |
4332 KB |
Output is correct |
78 |
Correct |
4 ms |
4460 KB |
Output is correct |
79 |
Correct |
4 ms |
4332 KB |
Output is correct |
80 |
Correct |
8 ms |
3840 KB |
Output is correct |
81 |
Correct |
5 ms |
4332 KB |
Output is correct |
82 |
Correct |
8 ms |
4332 KB |
Output is correct |
83 |
Correct |
6 ms |
4332 KB |
Output is correct |
84 |
Correct |
10 ms |
4204 KB |
Output is correct |
85 |
Correct |
6 ms |
4460 KB |
Output is correct |
86 |
Correct |
7 ms |
4332 KB |
Output is correct |
87 |
Correct |
6 ms |
4332 KB |
Output is correct |
88 |
Correct |
5 ms |
4204 KB |
Output is correct |
89 |
Correct |
6 ms |
4204 KB |
Output is correct |
90 |
Correct |
6 ms |
4076 KB |
Output is correct |
91 |
Correct |
27 ms |
6764 KB |
Output is correct |
92 |
Correct |
25 ms |
7276 KB |
Output is correct |
93 |
Correct |
34 ms |
7660 KB |
Output is correct |
94 |
Correct |
13 ms |
4332 KB |
Output is correct |
95 |
Correct |
13 ms |
4332 KB |
Output is correct |
96 |
Correct |
14 ms |
4332 KB |
Output is correct |
97 |
Correct |
14 ms |
4332 KB |
Output is correct |
98 |
Correct |
15 ms |
4332 KB |
Output is correct |
99 |
Correct |
7 ms |
4736 KB |
Output is correct |
100 |
Correct |
7 ms |
4728 KB |
Output is correct |
101 |
Correct |
7 ms |
4716 KB |
Output is correct |
102 |
Correct |
7 ms |
4716 KB |
Output is correct |
103 |
Correct |
7 ms |
4588 KB |
Output is correct |
104 |
Correct |
7 ms |
4588 KB |
Output is correct |
105 |
Correct |
40 ms |
8300 KB |
Output is correct |
106 |
Correct |
39 ms |
8300 KB |
Output is correct |
107 |
Correct |
40 ms |
8300 KB |
Output is correct |
108 |
Correct |
51 ms |
54252 KB |
Output is correct |
109 |
Runtime error |
99 ms |
80112 KB |
Execution killed with signal 6 |
110 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3052 KB |
Output is correct |
2 |
Correct |
3 ms |
3052 KB |
Output is correct |
3 |
Correct |
3 ms |
3052 KB |
Output is correct |
4 |
Correct |
3 ms |
3052 KB |
Output is correct |
5 |
Correct |
3 ms |
3052 KB |
Output is correct |
6 |
Correct |
3 ms |
3052 KB |
Output is correct |
7 |
Correct |
3 ms |
3052 KB |
Output is correct |
8 |
Correct |
3 ms |
3052 KB |
Output is correct |
9 |
Correct |
4 ms |
4332 KB |
Output is correct |
10 |
Correct |
4 ms |
4332 KB |
Output is correct |
11 |
Correct |
2 ms |
4332 KB |
Output is correct |
12 |
Correct |
4 ms |
4332 KB |
Output is correct |
13 |
Correct |
4 ms |
4332 KB |
Output is correct |
14 |
Correct |
4 ms |
4332 KB |
Output is correct |
15 |
Correct |
4 ms |
4332 KB |
Output is correct |
16 |
Correct |
4 ms |
4332 KB |
Output is correct |
17 |
Correct |
4 ms |
4352 KB |
Output is correct |
18 |
Correct |
4 ms |
4344 KB |
Output is correct |
19 |
Correct |
4 ms |
4332 KB |
Output is correct |
20 |
Correct |
4 ms |
4332 KB |
Output is correct |
21 |
Correct |
4 ms |
4332 KB |
Output is correct |
22 |
Correct |
4 ms |
4332 KB |
Output is correct |
23 |
Correct |
4 ms |
4332 KB |
Output is correct |
24 |
Correct |
26 ms |
8300 KB |
Output is correct |
25 |
Correct |
26 ms |
8320 KB |
Output is correct |
26 |
Correct |
27 ms |
8300 KB |
Output is correct |
27 |
Correct |
48 ms |
54508 KB |
Output is correct |
28 |
Correct |
49 ms |
54508 KB |
Output is correct |
29 |
Correct |
46 ms |
54508 KB |
Output is correct |
30 |
Correct |
42 ms |
54508 KB |
Output is correct |
31 |
Correct |
41 ms |
54508 KB |
Output is correct |
32 |
Correct |
42 ms |
54508 KB |
Output is correct |
33 |
Correct |
62 ms |
55532 KB |
Output is correct |
34 |
Correct |
60 ms |
55532 KB |
Output is correct |
35 |
Correct |
60 ms |
55552 KB |
Output is correct |
36 |
Correct |
60 ms |
55404 KB |
Output is correct |
37 |
Correct |
60 ms |
55404 KB |
Output is correct |
38 |
Correct |
62 ms |
55532 KB |
Output is correct |
39 |
Correct |
68 ms |
58732 KB |
Output is correct |
40 |
Correct |
67 ms |
58604 KB |
Output is correct |
41 |
Correct |
68 ms |
58604 KB |
Output is correct |
42 |
Correct |
207 ms |
236524 KB |
Output is correct |
43 |
Correct |
133 ms |
149100 KB |
Output is correct |
44 |
Correct |
208 ms |
256236 KB |
Output is correct |
45 |
Correct |
126 ms |
171244 KB |
Output is correct |
46 |
Correct |
111 ms |
155884 KB |
Output is correct |
47 |
Correct |
182 ms |
259692 KB |
Output is correct |
48 |
Correct |
233 ms |
233324 KB |
Output is correct |
49 |
Correct |
158 ms |
150380 KB |
Output is correct |
50 |
Correct |
141 ms |
153196 KB |
Output is correct |
51 |
Correct |
151 ms |
166124 KB |
Output is correct |
52 |
Correct |
170 ms |
189804 KB |
Output is correct |
53 |
Correct |
166 ms |
197228 KB |
Output is correct |
54 |
Correct |
237 ms |
260332 KB |
Output is correct |
55 |
Correct |
231 ms |
260204 KB |
Output is correct |
56 |
Correct |
208 ms |
260204 KB |
Output is correct |
57 |
Correct |
188 ms |
260204 KB |
Output is correct |
58 |
Correct |
185 ms |
260288 KB |
Output is correct |
59 |
Correct |
188 ms |
260204 KB |
Output is correct |
60 |
Correct |
273 ms |
269288 KB |
Output is correct |
61 |
Correct |
276 ms |
269164 KB |
Output is correct |
62 |
Correct |
276 ms |
269292 KB |
Output is correct |
63 |
Correct |
272 ms |
269292 KB |
Output is correct |
64 |
Correct |
269 ms |
269164 KB |
Output is correct |
65 |
Correct |
271 ms |
269164 KB |
Output is correct |
66 |
Correct |
239 ms |
268396 KB |
Output is correct |
67 |
Correct |
234 ms |
268396 KB |
Output is correct |
68 |
Correct |
233 ms |
268644 KB |
Output is correct |
69 |
Correct |
3 ms |
3052 KB |
Output is correct |
70 |
Correct |
3 ms |
3052 KB |
Output is correct |
71 |
Correct |
3 ms |
3052 KB |
Output is correct |
72 |
Correct |
3 ms |
3820 KB |
Output is correct |
73 |
Correct |
4 ms |
3948 KB |
Output is correct |
74 |
Correct |
4 ms |
3692 KB |
Output is correct |
75 |
Correct |
4 ms |
3948 KB |
Output is correct |
76 |
Correct |
4 ms |
4204 KB |
Output is correct |
77 |
Correct |
4 ms |
4076 KB |
Output is correct |
78 |
Correct |
4 ms |
4352 KB |
Output is correct |
79 |
Correct |
4 ms |
4204 KB |
Output is correct |
80 |
Correct |
3 ms |
3820 KB |
Output is correct |
81 |
Correct |
4 ms |
4076 KB |
Output is correct |
82 |
Correct |
4 ms |
3948 KB |
Output is correct |
83 |
Correct |
3 ms |
3820 KB |
Output is correct |
84 |
Correct |
3 ms |
3820 KB |
Output is correct |
85 |
Correct |
4 ms |
3948 KB |
Output is correct |
86 |
Correct |
3 ms |
3948 KB |
Output is correct |
87 |
Correct |
4 ms |
4204 KB |
Output is correct |
88 |
Correct |
3 ms |
3820 KB |
Output is correct |
89 |
Correct |
4 ms |
4332 KB |
Output is correct |
90 |
Correct |
5 ms |
4332 KB |
Output is correct |
91 |
Correct |
4 ms |
4332 KB |
Output is correct |
92 |
Correct |
4 ms |
4332 KB |
Output is correct |
93 |
Correct |
4 ms |
4332 KB |
Output is correct |
94 |
Correct |
4 ms |
4332 KB |
Output is correct |
95 |
Correct |
4 ms |
4332 KB |
Output is correct |
96 |
Correct |
4 ms |
4332 KB |
Output is correct |
97 |
Correct |
4 ms |
4332 KB |
Output is correct |
98 |
Correct |
4 ms |
4332 KB |
Output is correct |
99 |
Correct |
4 ms |
4332 KB |
Output is correct |
100 |
Correct |
4 ms |
4332 KB |
Output is correct |
101 |
Correct |
4 ms |
4480 KB |
Output is correct |
102 |
Correct |
6 ms |
4332 KB |
Output is correct |
103 |
Correct |
4 ms |
4480 KB |
Output is correct |
104 |
Correct |
4 ms |
4332 KB |
Output is correct |
105 |
Correct |
4 ms |
4460 KB |
Output is correct |
106 |
Correct |
4 ms |
4332 KB |
Output is correct |
107 |
Correct |
8 ms |
3840 KB |
Output is correct |
108 |
Correct |
5 ms |
4332 KB |
Output is correct |
109 |
Correct |
8 ms |
4332 KB |
Output is correct |
110 |
Correct |
6 ms |
4332 KB |
Output is correct |
111 |
Correct |
10 ms |
4204 KB |
Output is correct |
112 |
Correct |
6 ms |
4460 KB |
Output is correct |
113 |
Correct |
7 ms |
4332 KB |
Output is correct |
114 |
Correct |
6 ms |
4332 KB |
Output is correct |
115 |
Correct |
5 ms |
4204 KB |
Output is correct |
116 |
Correct |
6 ms |
4204 KB |
Output is correct |
117 |
Correct |
6 ms |
4076 KB |
Output is correct |
118 |
Correct |
27 ms |
6764 KB |
Output is correct |
119 |
Correct |
25 ms |
7276 KB |
Output is correct |
120 |
Correct |
34 ms |
7660 KB |
Output is correct |
121 |
Correct |
13 ms |
4332 KB |
Output is correct |
122 |
Correct |
13 ms |
4332 KB |
Output is correct |
123 |
Correct |
14 ms |
4332 KB |
Output is correct |
124 |
Correct |
14 ms |
4332 KB |
Output is correct |
125 |
Correct |
15 ms |
4332 KB |
Output is correct |
126 |
Correct |
7 ms |
4736 KB |
Output is correct |
127 |
Correct |
7 ms |
4728 KB |
Output is correct |
128 |
Correct |
7 ms |
4716 KB |
Output is correct |
129 |
Correct |
7 ms |
4716 KB |
Output is correct |
130 |
Correct |
7 ms |
4588 KB |
Output is correct |
131 |
Correct |
7 ms |
4588 KB |
Output is correct |
132 |
Correct |
40 ms |
8300 KB |
Output is correct |
133 |
Correct |
39 ms |
8300 KB |
Output is correct |
134 |
Correct |
40 ms |
8300 KB |
Output is correct |
135 |
Correct |
51 ms |
54252 KB |
Output is correct |
136 |
Runtime error |
99 ms |
80112 KB |
Execution killed with signal 6 |
137 |
Halted |
0 ms |
0 KB |
- |