#include <bits/stdc++.h>
#include "paint.h"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 1e5 + 2;
const int inf = 1e9;
int st[4 * N];
void Add(int node, int l, int r, int x, int y) {
smin(st[node], y);
if (l == r) return;
int mid = l + r >> 1;
if (x <= mid) Add(2 * node, l, mid, x, y);
else Add(2 * node + 1, mid + 1, r, x, y);
}
int Get(int node, int l, int r, int ql, int qr) {
if (r < ql || qr < l) return inf;
if (ql <= l && r <= qr) return st[node];
int mid = l + r >> 1;
return min(Get(2 * node, l, mid, ql, qr), Get(2 * node + 1, mid + 1, r, ql, qr));
}
int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b) {
vector<vector<int>> pos(k);
for (int i = 0; i < m; i++) {
for (int j = 0; j < a[i]; j++) {
pos[b[i][j]].push_back(i);
}
}
vector<vector<int>> v(m);
for (int i = 0; i < n; i++) {
int oo = i % m;
for (int j : pos[c[i]]) {
int tko = j - oo;
if (tko < 0) tko += m;
v[tko].push_back(i);
}
}
vector<int> moze(n);
for (int i = 0; i < m; i++) {
for (int j = m - 1; j < v[i].size(); j++) {
if (v[i][j - m + 1] + m - 1 == v[i][j]) moze[v[i][j]] = 1;
}
}
for (int i = 1; i <= 4 * n; i++) st[i] = inf;
vector<int> dp92(n, inf);
Add(1, 0, n, 0, 0);
for (int i = 0; i < n; i++) {
if (moze[i] == 0) continue;
int val = Get(1, 0, n, i - m + 1, i);
if (val != inf) dp92[i] = val + 1;
Add(1, 0, n, i + 1, dp92[i]);
}
if (dp92[n - 1] == inf) dp92[n - 1] = -1;
return dp92[n - 1];
}
Compilation message
paint.cpp: In function 'void Add(int, int, int, int, int)':
paint.cpp:16:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
16 | int mid = l + r >> 1;
| ~~^~~
paint.cpp: In function 'int Get(int, int, int, int, int)':
paint.cpp:23:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
23 | int mid = l + r >> 1;
| ~~^~~
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:44:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
44 | for (int j = m - 1; j < v[i].size(); j++) {
| ~~^~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
312 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 |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
312 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2620 KB |
Output is correct |
18 |
Correct |
2 ms |
2620 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2748 KB |
Output is correct |
22 |
Correct |
22 ms |
7120 KB |
Output is correct |
23 |
Correct |
18 ms |
7152 KB |
Output is correct |
24 |
Correct |
19 ms |
7164 KB |
Output is correct |
25 |
Correct |
5 ms |
980 KB |
Output is correct |
26 |
Correct |
6 ms |
980 KB |
Output is correct |
27 |
Correct |
4 ms |
980 KB |
Output is correct |
28 |
Correct |
3 ms |
980 KB |
Output is correct |
29 |
Correct |
3 ms |
1108 KB |
Output is correct |
30 |
Correct |
3 ms |
964 KB |
Output is correct |
31 |
Correct |
13 ms |
4564 KB |
Output is correct |
32 |
Correct |
14 ms |
4544 KB |
Output is correct |
33 |
Correct |
13 ms |
4552 KB |
Output is correct |
34 |
Correct |
13 ms |
4564 KB |
Output is correct |
35 |
Correct |
12 ms |
4548 KB |
Output is correct |
36 |
Correct |
12 ms |
4468 KB |
Output is correct |
37 |
Correct |
24 ms |
8276 KB |
Output is correct |
38 |
Correct |
23 ms |
8260 KB |
Output is correct |
39 |
Correct |
24 ms |
8152 KB |
Output is correct |
40 |
Correct |
26 ms |
3788 KB |
Output is correct |
41 |
Correct |
16 ms |
2572 KB |
Output is correct |
42 |
Correct |
20 ms |
4176 KB |
Output is correct |
43 |
Correct |
9 ms |
2876 KB |
Output is correct |
44 |
Correct |
6 ms |
2628 KB |
Output is correct |
45 |
Correct |
11 ms |
4284 KB |
Output is correct |
46 |
Correct |
53 ms |
16412 KB |
Output is correct |
47 |
Correct |
35 ms |
10256 KB |
Output is correct |
48 |
Correct |
44 ms |
13156 KB |
Output is correct |
49 |
Correct |
47 ms |
14168 KB |
Output is correct |
50 |
Correct |
45 ms |
13992 KB |
Output is correct |
51 |
Correct |
34 ms |
10828 KB |
Output is correct |
52 |
Correct |
26 ms |
4044 KB |
Output is correct |
53 |
Correct |
27 ms |
4044 KB |
Output is correct |
54 |
Correct |
21 ms |
4076 KB |
Output is correct |
55 |
Correct |
13 ms |
4224 KB |
Output is correct |
56 |
Correct |
11 ms |
4156 KB |
Output is correct |
57 |
Correct |
15 ms |
4228 KB |
Output is correct |
58 |
Correct |
62 ms |
17712 KB |
Output is correct |
59 |
Correct |
61 ms |
17728 KB |
Output is correct |
60 |
Correct |
61 ms |
17648 KB |
Output is correct |
61 |
Correct |
60 ms |
17624 KB |
Output is correct |
62 |
Correct |
76 ms |
17604 KB |
Output is correct |
63 |
Correct |
68 ms |
17624 KB |
Output is correct |
64 |
Correct |
68 ms |
17456 KB |
Output is correct |
65 |
Correct |
59 ms |
17460 KB |
Output is correct |
66 |
Correct |
62 ms |
17440 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 |
1 ms |
312 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 |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
312 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
2 ms |
2644 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2620 KB |
Output is correct |
18 |
Correct |
2 ms |
2620 KB |
Output is correct |
19 |
Correct |
2 ms |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
2 ms |
2748 KB |
Output is correct |
22 |
Correct |
1 ms |
312 KB |
Output is correct |
23 |
Correct |
1 ms |
212 KB |
Output is correct |
24 |
Correct |
0 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 |
308 KB |
Output is correct |
28 |
Correct |
1 ms |
340 KB |
Output is correct |
29 |
Correct |
1 ms |
340 KB |
Output is correct |
30 |
Correct |
1 ms |
340 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
2 ms |
2260 KB |
Output is correct |
34 |
Correct |
2 ms |
1876 KB |
Output is correct |
35 |
Correct |
1 ms |
1620 KB |
Output is correct |
36 |
Correct |
3 ms |
2644 KB |
Output is correct |
37 |
Correct |
2 ms |
2232 KB |
Output is correct |
38 |
Correct |
2 ms |
2368 KB |
Output is correct |
39 |
Correct |
1 ms |
340 KB |
Output is correct |
40 |
Correct |
2 ms |
2132 KB |
Output is correct |
41 |
Correct |
1 ms |
340 KB |
Output is correct |
42 |
Correct |
2 ms |
2516 KB |
Output is correct |
43 |
Correct |
1 ms |
2516 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 |
440 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 |
2 ms |
2644 KB |
Output is correct |
51 |
Correct |
3 ms |
2644 KB |
Output is correct |
52 |
Correct |
2 ms |
2644 KB |
Output is correct |
53 |
Correct |
2 ms |
2644 KB |
Output is correct |
54 |
Correct |
2 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2752 KB |
Output is correct |
57 |
Correct |
1 ms |
340 KB |
Output is correct |
58 |
Correct |
2 ms |
2760 KB |
Output is correct |
59 |
Correct |
1 ms |
340 KB |
Output is correct |
60 |
Correct |
2 ms |
2644 KB |
Output is correct |
61 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
312 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 |
312 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
312 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2620 KB |
Output is correct |
20 |
Correct |
2 ms |
2620 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2748 KB |
Output is correct |
24 |
Correct |
22 ms |
7120 KB |
Output is correct |
25 |
Correct |
18 ms |
7152 KB |
Output is correct |
26 |
Correct |
19 ms |
7164 KB |
Output is correct |
27 |
Correct |
0 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 |
308 KB |
Output is correct |
31 |
Correct |
1 ms |
340 KB |
Output is correct |
32 |
Correct |
1 ms |
340 KB |
Output is correct |
33 |
Correct |
1 ms |
340 KB |
Output is correct |
34 |
Correct |
1 ms |
340 KB |
Output is correct |
35 |
Correct |
1 ms |
340 KB |
Output is correct |
36 |
Correct |
2 ms |
2260 KB |
Output is correct |
37 |
Correct |
2 ms |
1876 KB |
Output is correct |
38 |
Correct |
1 ms |
1620 KB |
Output is correct |
39 |
Correct |
3 ms |
2644 KB |
Output is correct |
40 |
Correct |
2 ms |
2232 KB |
Output is correct |
41 |
Correct |
2 ms |
2368 KB |
Output is correct |
42 |
Correct |
1 ms |
340 KB |
Output is correct |
43 |
Correct |
2 ms |
2132 KB |
Output is correct |
44 |
Correct |
1 ms |
340 KB |
Output is correct |
45 |
Correct |
2 ms |
2516 KB |
Output is correct |
46 |
Correct |
1 ms |
2516 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 |
440 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 |
2 ms |
2644 KB |
Output is correct |
54 |
Correct |
3 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2644 KB |
Output is correct |
56 |
Correct |
2 ms |
2644 KB |
Output is correct |
57 |
Correct |
2 ms |
2644 KB |
Output is correct |
58 |
Correct |
2 ms |
2644 KB |
Output is correct |
59 |
Correct |
2 ms |
2752 KB |
Output is correct |
60 |
Correct |
1 ms |
340 KB |
Output is correct |
61 |
Correct |
2 ms |
2760 KB |
Output is correct |
62 |
Correct |
1 ms |
340 KB |
Output is correct |
63 |
Correct |
2 ms |
2644 KB |
Output is correct |
64 |
Correct |
1 ms |
340 KB |
Output is correct |
65 |
Correct |
1 ms |
468 KB |
Output is correct |
66 |
Correct |
1 ms |
340 KB |
Output is correct |
67 |
Correct |
2 ms |
596 KB |
Output is correct |
68 |
Correct |
1 ms |
468 KB |
Output is correct |
69 |
Correct |
2 ms |
596 KB |
Output is correct |
70 |
Correct |
3 ms |
2516 KB |
Output is correct |
71 |
Correct |
3 ms |
2176 KB |
Output is correct |
72 |
Correct |
4 ms |
2004 KB |
Output is correct |
73 |
Correct |
3 ms |
2132 KB |
Output is correct |
74 |
Correct |
3 ms |
2388 KB |
Output is correct |
75 |
Correct |
4 ms |
2808 KB |
Output is correct |
76 |
Correct |
18 ms |
5240 KB |
Output is correct |
77 |
Correct |
28 ms |
6116 KB |
Output is correct |
78 |
Correct |
27 ms |
6816 KB |
Output is correct |
79 |
Correct |
2 ms |
692 KB |
Output is correct |
80 |
Correct |
2 ms |
724 KB |
Output is correct |
81 |
Correct |
2 ms |
724 KB |
Output is correct |
82 |
Correct |
2 ms |
724 KB |
Output is correct |
83 |
Correct |
2 ms |
724 KB |
Output is correct |
84 |
Correct |
5 ms |
2972 KB |
Output is correct |
85 |
Correct |
4 ms |
2964 KB |
Output is correct |
86 |
Correct |
4 ms |
3028 KB |
Output is correct |
87 |
Correct |
5 ms |
3028 KB |
Output is correct |
88 |
Correct |
3 ms |
3028 KB |
Output is correct |
89 |
Correct |
3 ms |
3016 KB |
Output is correct |
90 |
Correct |
30 ms |
7228 KB |
Output is correct |
91 |
Correct |
35 ms |
7216 KB |
Output is correct |
92 |
Correct |
26 ms |
7284 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
312 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 |
312 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
312 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2620 KB |
Output is correct |
20 |
Correct |
2 ms |
2620 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2748 KB |
Output is correct |
24 |
Correct |
22 ms |
7120 KB |
Output is correct |
25 |
Correct |
18 ms |
7152 KB |
Output is correct |
26 |
Correct |
19 ms |
7164 KB |
Output is correct |
27 |
Correct |
5 ms |
980 KB |
Output is correct |
28 |
Correct |
6 ms |
980 KB |
Output is correct |
29 |
Correct |
4 ms |
980 KB |
Output is correct |
30 |
Correct |
3 ms |
980 KB |
Output is correct |
31 |
Correct |
3 ms |
1108 KB |
Output is correct |
32 |
Correct |
3 ms |
964 KB |
Output is correct |
33 |
Correct |
13 ms |
4564 KB |
Output is correct |
34 |
Correct |
14 ms |
4544 KB |
Output is correct |
35 |
Correct |
13 ms |
4552 KB |
Output is correct |
36 |
Correct |
13 ms |
4564 KB |
Output is correct |
37 |
Correct |
12 ms |
4548 KB |
Output is correct |
38 |
Correct |
12 ms |
4468 KB |
Output is correct |
39 |
Correct |
24 ms |
8276 KB |
Output is correct |
40 |
Correct |
23 ms |
8260 KB |
Output is correct |
41 |
Correct |
24 ms |
8152 KB |
Output is correct |
42 |
Correct |
0 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 |
308 KB |
Output is correct |
46 |
Correct |
1 ms |
340 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 |
1 ms |
340 KB |
Output is correct |
51 |
Correct |
2 ms |
2260 KB |
Output is correct |
52 |
Correct |
2 ms |
1876 KB |
Output is correct |
53 |
Correct |
1 ms |
1620 KB |
Output is correct |
54 |
Correct |
3 ms |
2644 KB |
Output is correct |
55 |
Correct |
2 ms |
2232 KB |
Output is correct |
56 |
Correct |
2 ms |
2368 KB |
Output is correct |
57 |
Correct |
1 ms |
340 KB |
Output is correct |
58 |
Correct |
2 ms |
2132 KB |
Output is correct |
59 |
Correct |
1 ms |
340 KB |
Output is correct |
60 |
Correct |
2 ms |
2516 KB |
Output is correct |
61 |
Correct |
1 ms |
2516 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 |
440 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 |
2 ms |
2644 KB |
Output is correct |
69 |
Correct |
3 ms |
2644 KB |
Output is correct |
70 |
Correct |
2 ms |
2644 KB |
Output is correct |
71 |
Correct |
2 ms |
2644 KB |
Output is correct |
72 |
Correct |
2 ms |
2644 KB |
Output is correct |
73 |
Correct |
2 ms |
2644 KB |
Output is correct |
74 |
Correct |
2 ms |
2752 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
2 ms |
2760 KB |
Output is correct |
77 |
Correct |
1 ms |
340 KB |
Output is correct |
78 |
Correct |
2 ms |
2644 KB |
Output is correct |
79 |
Correct |
1 ms |
340 KB |
Output is correct |
80 |
Correct |
1 ms |
468 KB |
Output is correct |
81 |
Correct |
1 ms |
340 KB |
Output is correct |
82 |
Correct |
2 ms |
596 KB |
Output is correct |
83 |
Correct |
1 ms |
468 KB |
Output is correct |
84 |
Correct |
2 ms |
596 KB |
Output is correct |
85 |
Correct |
3 ms |
2516 KB |
Output is correct |
86 |
Correct |
3 ms |
2176 KB |
Output is correct |
87 |
Correct |
4 ms |
2004 KB |
Output is correct |
88 |
Correct |
3 ms |
2132 KB |
Output is correct |
89 |
Correct |
3 ms |
2388 KB |
Output is correct |
90 |
Correct |
4 ms |
2808 KB |
Output is correct |
91 |
Correct |
18 ms |
5240 KB |
Output is correct |
92 |
Correct |
28 ms |
6116 KB |
Output is correct |
93 |
Correct |
27 ms |
6816 KB |
Output is correct |
94 |
Correct |
2 ms |
692 KB |
Output is correct |
95 |
Correct |
2 ms |
724 KB |
Output is correct |
96 |
Correct |
2 ms |
724 KB |
Output is correct |
97 |
Correct |
2 ms |
724 KB |
Output is correct |
98 |
Correct |
2 ms |
724 KB |
Output is correct |
99 |
Correct |
5 ms |
2972 KB |
Output is correct |
100 |
Correct |
4 ms |
2964 KB |
Output is correct |
101 |
Correct |
4 ms |
3028 KB |
Output is correct |
102 |
Correct |
5 ms |
3028 KB |
Output is correct |
103 |
Correct |
3 ms |
3028 KB |
Output is correct |
104 |
Correct |
3 ms |
3016 KB |
Output is correct |
105 |
Correct |
30 ms |
7228 KB |
Output is correct |
106 |
Correct |
35 ms |
7216 KB |
Output is correct |
107 |
Correct |
26 ms |
7284 KB |
Output is correct |
108 |
Correct |
5 ms |
1096 KB |
Output is correct |
109 |
Correct |
116 ms |
39904 KB |
Output is correct |
110 |
Correct |
58 ms |
23372 KB |
Output is correct |
111 |
Correct |
43 ms |
21588 KB |
Output is correct |
112 |
Correct |
48 ms |
24380 KB |
Output is correct |
113 |
Correct |
33 ms |
17124 KB |
Output is correct |
114 |
Correct |
14 ms |
4752 KB |
Output is correct |
115 |
Correct |
13 ms |
4436 KB |
Output is correct |
116 |
Correct |
19 ms |
5356 KB |
Output is correct |
117 |
Correct |
13 ms |
4044 KB |
Output is correct |
118 |
Correct |
17 ms |
4836 KB |
Output is correct |
119 |
Correct |
15 ms |
4436 KB |
Output is correct |
120 |
Correct |
18 ms |
5332 KB |
Output is correct |
121 |
Correct |
7 ms |
1728 KB |
Output is correct |
122 |
Correct |
21 ms |
5360 KB |
Output is correct |
123 |
Correct |
8 ms |
1528 KB |
Output is correct |
124 |
Correct |
22 ms |
6760 KB |
Output is correct |
125 |
Correct |
10 ms |
2260 KB |
Output is correct |
126 |
Correct |
7 ms |
3140 KB |
Output is correct |
127 |
Correct |
8 ms |
4052 KB |
Output is correct |
128 |
Correct |
7 ms |
3412 KB |
Output is correct |
129 |
Correct |
7 ms |
2900 KB |
Output is correct |
130 |
Correct |
6 ms |
1108 KB |
Output is correct |
131 |
Correct |
176 ms |
67464 KB |
Output is correct |
132 |
Correct |
100 ms |
49984 KB |
Output is correct |
133 |
Correct |
83 ms |
33228 KB |
Output is correct |
134 |
Correct |
73 ms |
34296 KB |
Output is correct |
135 |
Correct |
70 ms |
34380 KB |
Output is correct |
136 |
Correct |
21 ms |
5612 KB |
Output is correct |
137 |
Correct |
23 ms |
5712 KB |
Output is correct |
138 |
Correct |
21 ms |
5624 KB |
Output is correct |
139 |
Correct |
22 ms |
5700 KB |
Output is correct |
140 |
Correct |
23 ms |
5708 KB |
Output is correct |
141 |
Correct |
25 ms |
5604 KB |
Output is correct |
142 |
Correct |
32 ms |
8484 KB |
Output is correct |
143 |
Correct |
12 ms |
2644 KB |
Output is correct |
144 |
Correct |
34 ms |
8400 KB |
Output is correct |
145 |
Correct |
12 ms |
2696 KB |
Output is correct |
146 |
Correct |
36 ms |
8396 KB |
Output is correct |
147 |
Correct |
14 ms |
2628 KB |
Output is correct |
148 |
Correct |
10 ms |
4692 KB |
Output is correct |
149 |
Correct |
11 ms |
4692 KB |
Output is correct |
150 |
Correct |
10 ms |
4692 KB |
Output is correct |
151 |
Correct |
9 ms |
4564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
312 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 |
312 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
312 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
2 ms |
2644 KB |
Output is correct |
16 |
Correct |
2 ms |
2644 KB |
Output is correct |
17 |
Correct |
2 ms |
2644 KB |
Output is correct |
18 |
Correct |
2 ms |
2644 KB |
Output is correct |
19 |
Correct |
2 ms |
2620 KB |
Output is correct |
20 |
Correct |
2 ms |
2620 KB |
Output is correct |
21 |
Correct |
2 ms |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
2 ms |
2748 KB |
Output is correct |
24 |
Correct |
22 ms |
7120 KB |
Output is correct |
25 |
Correct |
18 ms |
7152 KB |
Output is correct |
26 |
Correct |
19 ms |
7164 KB |
Output is correct |
27 |
Correct |
5 ms |
980 KB |
Output is correct |
28 |
Correct |
6 ms |
980 KB |
Output is correct |
29 |
Correct |
4 ms |
980 KB |
Output is correct |
30 |
Correct |
3 ms |
980 KB |
Output is correct |
31 |
Correct |
3 ms |
1108 KB |
Output is correct |
32 |
Correct |
3 ms |
964 KB |
Output is correct |
33 |
Correct |
13 ms |
4564 KB |
Output is correct |
34 |
Correct |
14 ms |
4544 KB |
Output is correct |
35 |
Correct |
13 ms |
4552 KB |
Output is correct |
36 |
Correct |
13 ms |
4564 KB |
Output is correct |
37 |
Correct |
12 ms |
4548 KB |
Output is correct |
38 |
Correct |
12 ms |
4468 KB |
Output is correct |
39 |
Correct |
24 ms |
8276 KB |
Output is correct |
40 |
Correct |
23 ms |
8260 KB |
Output is correct |
41 |
Correct |
24 ms |
8152 KB |
Output is correct |
42 |
Correct |
26 ms |
3788 KB |
Output is correct |
43 |
Correct |
16 ms |
2572 KB |
Output is correct |
44 |
Correct |
20 ms |
4176 KB |
Output is correct |
45 |
Correct |
9 ms |
2876 KB |
Output is correct |
46 |
Correct |
6 ms |
2628 KB |
Output is correct |
47 |
Correct |
11 ms |
4284 KB |
Output is correct |
48 |
Correct |
53 ms |
16412 KB |
Output is correct |
49 |
Correct |
35 ms |
10256 KB |
Output is correct |
50 |
Correct |
44 ms |
13156 KB |
Output is correct |
51 |
Correct |
47 ms |
14168 KB |
Output is correct |
52 |
Correct |
45 ms |
13992 KB |
Output is correct |
53 |
Correct |
34 ms |
10828 KB |
Output is correct |
54 |
Correct |
26 ms |
4044 KB |
Output is correct |
55 |
Correct |
27 ms |
4044 KB |
Output is correct |
56 |
Correct |
21 ms |
4076 KB |
Output is correct |
57 |
Correct |
13 ms |
4224 KB |
Output is correct |
58 |
Correct |
11 ms |
4156 KB |
Output is correct |
59 |
Correct |
15 ms |
4228 KB |
Output is correct |
60 |
Correct |
62 ms |
17712 KB |
Output is correct |
61 |
Correct |
61 ms |
17728 KB |
Output is correct |
62 |
Correct |
61 ms |
17648 KB |
Output is correct |
63 |
Correct |
60 ms |
17624 KB |
Output is correct |
64 |
Correct |
76 ms |
17604 KB |
Output is correct |
65 |
Correct |
68 ms |
17624 KB |
Output is correct |
66 |
Correct |
68 ms |
17456 KB |
Output is correct |
67 |
Correct |
59 ms |
17460 KB |
Output is correct |
68 |
Correct |
62 ms |
17440 KB |
Output is correct |
69 |
Correct |
0 ms |
212 KB |
Output is correct |
70 |
Correct |
1 ms |
212 KB |
Output is correct |
71 |
Correct |
1 ms |
212 KB |
Output is correct |
72 |
Correct |
1 ms |
308 KB |
Output is correct |
73 |
Correct |
1 ms |
340 KB |
Output is correct |
74 |
Correct |
1 ms |
340 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
1 ms |
340 KB |
Output is correct |
77 |
Correct |
1 ms |
340 KB |
Output is correct |
78 |
Correct |
2 ms |
2260 KB |
Output is correct |
79 |
Correct |
2 ms |
1876 KB |
Output is correct |
80 |
Correct |
1 ms |
1620 KB |
Output is correct |
81 |
Correct |
3 ms |
2644 KB |
Output is correct |
82 |
Correct |
2 ms |
2232 KB |
Output is correct |
83 |
Correct |
2 ms |
2368 KB |
Output is correct |
84 |
Correct |
1 ms |
340 KB |
Output is correct |
85 |
Correct |
2 ms |
2132 KB |
Output is correct |
86 |
Correct |
1 ms |
340 KB |
Output is correct |
87 |
Correct |
2 ms |
2516 KB |
Output is correct |
88 |
Correct |
1 ms |
2516 KB |
Output is correct |
89 |
Correct |
1 ms |
340 KB |
Output is correct |
90 |
Correct |
1 ms |
340 KB |
Output is correct |
91 |
Correct |
1 ms |
440 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 |
340 KB |
Output is correct |
95 |
Correct |
2 ms |
2644 KB |
Output is correct |
96 |
Correct |
3 ms |
2644 KB |
Output is correct |
97 |
Correct |
2 ms |
2644 KB |
Output is correct |
98 |
Correct |
2 ms |
2644 KB |
Output is correct |
99 |
Correct |
2 ms |
2644 KB |
Output is correct |
100 |
Correct |
2 ms |
2644 KB |
Output is correct |
101 |
Correct |
2 ms |
2752 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
2 ms |
2760 KB |
Output is correct |
104 |
Correct |
1 ms |
340 KB |
Output is correct |
105 |
Correct |
2 ms |
2644 KB |
Output is correct |
106 |
Correct |
1 ms |
340 KB |
Output is correct |
107 |
Correct |
1 ms |
468 KB |
Output is correct |
108 |
Correct |
1 ms |
340 KB |
Output is correct |
109 |
Correct |
2 ms |
596 KB |
Output is correct |
110 |
Correct |
1 ms |
468 KB |
Output is correct |
111 |
Correct |
2 ms |
596 KB |
Output is correct |
112 |
Correct |
3 ms |
2516 KB |
Output is correct |
113 |
Correct |
3 ms |
2176 KB |
Output is correct |
114 |
Correct |
4 ms |
2004 KB |
Output is correct |
115 |
Correct |
3 ms |
2132 KB |
Output is correct |
116 |
Correct |
3 ms |
2388 KB |
Output is correct |
117 |
Correct |
4 ms |
2808 KB |
Output is correct |
118 |
Correct |
18 ms |
5240 KB |
Output is correct |
119 |
Correct |
28 ms |
6116 KB |
Output is correct |
120 |
Correct |
27 ms |
6816 KB |
Output is correct |
121 |
Correct |
2 ms |
692 KB |
Output is correct |
122 |
Correct |
2 ms |
724 KB |
Output is correct |
123 |
Correct |
2 ms |
724 KB |
Output is correct |
124 |
Correct |
2 ms |
724 KB |
Output is correct |
125 |
Correct |
2 ms |
724 KB |
Output is correct |
126 |
Correct |
5 ms |
2972 KB |
Output is correct |
127 |
Correct |
4 ms |
2964 KB |
Output is correct |
128 |
Correct |
4 ms |
3028 KB |
Output is correct |
129 |
Correct |
5 ms |
3028 KB |
Output is correct |
130 |
Correct |
3 ms |
3028 KB |
Output is correct |
131 |
Correct |
3 ms |
3016 KB |
Output is correct |
132 |
Correct |
30 ms |
7228 KB |
Output is correct |
133 |
Correct |
35 ms |
7216 KB |
Output is correct |
134 |
Correct |
26 ms |
7284 KB |
Output is correct |
135 |
Correct |
5 ms |
1096 KB |
Output is correct |
136 |
Correct |
116 ms |
39904 KB |
Output is correct |
137 |
Correct |
58 ms |
23372 KB |
Output is correct |
138 |
Correct |
43 ms |
21588 KB |
Output is correct |
139 |
Correct |
48 ms |
24380 KB |
Output is correct |
140 |
Correct |
33 ms |
17124 KB |
Output is correct |
141 |
Correct |
14 ms |
4752 KB |
Output is correct |
142 |
Correct |
13 ms |
4436 KB |
Output is correct |
143 |
Correct |
19 ms |
5356 KB |
Output is correct |
144 |
Correct |
13 ms |
4044 KB |
Output is correct |
145 |
Correct |
17 ms |
4836 KB |
Output is correct |
146 |
Correct |
15 ms |
4436 KB |
Output is correct |
147 |
Correct |
18 ms |
5332 KB |
Output is correct |
148 |
Correct |
7 ms |
1728 KB |
Output is correct |
149 |
Correct |
21 ms |
5360 KB |
Output is correct |
150 |
Correct |
8 ms |
1528 KB |
Output is correct |
151 |
Correct |
22 ms |
6760 KB |
Output is correct |
152 |
Correct |
10 ms |
2260 KB |
Output is correct |
153 |
Correct |
7 ms |
3140 KB |
Output is correct |
154 |
Correct |
8 ms |
4052 KB |
Output is correct |
155 |
Correct |
7 ms |
3412 KB |
Output is correct |
156 |
Correct |
7 ms |
2900 KB |
Output is correct |
157 |
Correct |
6 ms |
1108 KB |
Output is correct |
158 |
Correct |
176 ms |
67464 KB |
Output is correct |
159 |
Correct |
100 ms |
49984 KB |
Output is correct |
160 |
Correct |
83 ms |
33228 KB |
Output is correct |
161 |
Correct |
73 ms |
34296 KB |
Output is correct |
162 |
Correct |
70 ms |
34380 KB |
Output is correct |
163 |
Correct |
21 ms |
5612 KB |
Output is correct |
164 |
Correct |
23 ms |
5712 KB |
Output is correct |
165 |
Correct |
21 ms |
5624 KB |
Output is correct |
166 |
Correct |
22 ms |
5700 KB |
Output is correct |
167 |
Correct |
23 ms |
5708 KB |
Output is correct |
168 |
Correct |
25 ms |
5604 KB |
Output is correct |
169 |
Correct |
32 ms |
8484 KB |
Output is correct |
170 |
Correct |
12 ms |
2644 KB |
Output is correct |
171 |
Correct |
34 ms |
8400 KB |
Output is correct |
172 |
Correct |
12 ms |
2696 KB |
Output is correct |
173 |
Correct |
36 ms |
8396 KB |
Output is correct |
174 |
Correct |
14 ms |
2628 KB |
Output is correct |
175 |
Correct |
10 ms |
4692 KB |
Output is correct |
176 |
Correct |
11 ms |
4692 KB |
Output is correct |
177 |
Correct |
10 ms |
4692 KB |
Output is correct |
178 |
Correct |
9 ms |
4564 KB |
Output is correct |
179 |
Correct |
19 ms |
3024 KB |
Output is correct |
180 |
Correct |
311 ms |
108664 KB |
Output is correct |
181 |
Correct |
349 ms |
142332 KB |
Output is correct |
182 |
Correct |
428 ms |
177292 KB |
Output is correct |
183 |
Correct |
216 ms |
100528 KB |
Output is correct |
184 |
Correct |
177 ms |
74732 KB |
Output is correct |
185 |
Correct |
37 ms |
7720 KB |
Output is correct |
186 |
Correct |
39 ms |
9936 KB |
Output is correct |
187 |
Correct |
59 ms |
9144 KB |
Output is correct |
188 |
Correct |
35 ms |
9472 KB |
Output is correct |
189 |
Correct |
52 ms |
9800 KB |
Output is correct |
190 |
Correct |
45 ms |
10760 KB |
Output is correct |
191 |
Correct |
51 ms |
10568 KB |
Output is correct |
192 |
Correct |
28 ms |
7764 KB |
Output is correct |
193 |
Correct |
39 ms |
7236 KB |
Output is correct |
194 |
Correct |
33 ms |
4612 KB |
Output is correct |
195 |
Correct |
910 ms |
263636 KB |
Output is correct |
196 |
Correct |
536 ms |
203852 KB |
Output is correct |
197 |
Correct |
466 ms |
192328 KB |
Output is correct |
198 |
Correct |
394 ms |
158624 KB |
Output is correct |
199 |
Correct |
383 ms |
161820 KB |
Output is correct |
200 |
Correct |
84 ms |
18796 KB |
Output is correct |
201 |
Correct |
85 ms |
18832 KB |
Output is correct |
202 |
Correct |
78 ms |
18732 KB |
Output is correct |
203 |
Correct |
84 ms |
18832 KB |
Output is correct |
204 |
Correct |
81 ms |
18772 KB |
Output is correct |
205 |
Correct |
80 ms |
18908 KB |
Output is correct |
206 |
Correct |
74 ms |
18288 KB |
Output is correct |
207 |
Correct |
77 ms |
17820 KB |
Output is correct |
208 |
Correct |
82 ms |
18340 KB |
Output is correct |
209 |
Correct |
74 ms |
17776 KB |
Output is correct |
210 |
Correct |
74 ms |
18404 KB |
Output is correct |
211 |
Correct |
73 ms |
17812 KB |
Output is correct |
212 |
Correct |
63 ms |
18144 KB |
Output is correct |
213 |
Correct |
50 ms |
14740 KB |
Output is correct |
214 |
Correct |
48 ms |
13968 KB |
Output is correct |
215 |
Correct |
50 ms |
13812 KB |
Output is correct |