#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 69;
int seg[4 * N];
void upd(int l, int r, int pos, int qp, int v){
if (l == r){
seg[pos] = v;
return;
}
int mid = (l + r)/2;
if (qp <= mid) upd(l, mid, pos*2, qp, v);
else upd(mid + 1, r, pos*2 + 1, qp, v);
seg[pos] = min(seg[pos * 2], seg[pos * 2 + 1]);
}
int query(int l, int r, int pos, int ql, int qr){
if (l >= ql && r <= qr) return seg[pos];
else if (l > qr || r < ql) return 1e8;
int mid = (l + r)/2;
return min(query(l, mid, pos*2, ql, qr), query(mid + 1, r, pos*2 + 1, ql, qr));
}
int minimumInstructions(int n, int m, int k, vector<int> c, vector<int> a, vector<vector<int>> b) {
vector<vector<int>> adj(k);
for (int i = 0; i < m; i++){
for (auto x : b[i]){
adj[x].push_back(i);
}
}
//adj[x] size is atmost sqrt(4e5) = 650
vector<bool> can(n + 1, false);
map <int, int> mp;
for (int i = 0; i < n; i++){
//if painter x can do y, then increase frequency of x - y mod m ofc
//then a thing can be done if and only if frequency = m
int y = c[i];
if (i >= m){
for (auto x : adj[c[i - m]]){
int lol = (x - i) % m;
lol = (lol + m) % m;
// cout << "SUB " << i - m << " " << " COLOUR " << c[i - m] << " PAINTER " << x << " DIFF " << lol << "\n";
mp[lol]--;
}
}
for (auto x : adj[y]){
int lol = (x - i) % m;
lol = (lol + m) % m;
// cout << "ADD " << i << " " << " COLOUR " << y << " PAINTER " << x << " DIFF " << lol << "\n";
mp[lol]++;
if (mp[lol] == m) {
// cout << "NOOOO\n";
can[i + 1] = true;
}
}
}
vector <int> dp(n + 1, 1e8);
dp[0] = 0;
for (int i = 0; i <= n; i++) upd(0, n, 1, i, dp[i]);
for (int i = 1; i <= n; i++){
if (can[i]){
dp[i] = min(dp[i], 1 + query(0, n, 1, i - m, i - 1));
}
upd(0, n, 1, i, dp[i]);
}
if (dp[n] > n) return -1;
else return dp[n];
}
# |
결과 |
실행 시간 |
메모리 |
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 |
308 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 |
212 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 |
2720 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2620 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 |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
4 ms |
2620 KB |
Output is correct |
22 |
Correct |
14 ms |
7124 KB |
Output is correct |
23 |
Correct |
14 ms |
7156 KB |
Output is correct |
24 |
Correct |
14 ms |
7108 KB |
Output is correct |
25 |
Correct |
8 ms |
832 KB |
Output is correct |
26 |
Correct |
8 ms |
836 KB |
Output is correct |
27 |
Correct |
7 ms |
724 KB |
Output is correct |
28 |
Correct |
6 ms |
724 KB |
Output is correct |
29 |
Correct |
6 ms |
728 KB |
Output is correct |
30 |
Correct |
6 ms |
724 KB |
Output is correct |
31 |
Correct |
14 ms |
4288 KB |
Output is correct |
32 |
Correct |
13 ms |
4308 KB |
Output is correct |
33 |
Correct |
14 ms |
4308 KB |
Output is correct |
34 |
Correct |
13 ms |
4228 KB |
Output is correct |
35 |
Correct |
13 ms |
4208 KB |
Output is correct |
36 |
Correct |
14 ms |
4204 KB |
Output is correct |
37 |
Correct |
25 ms |
7884 KB |
Output is correct |
38 |
Correct |
26 ms |
7964 KB |
Output is correct |
39 |
Correct |
25 ms |
8020 KB |
Output is correct |
40 |
Correct |
43 ms |
2488 KB |
Output is correct |
41 |
Correct |
23 ms |
1544 KB |
Output is correct |
42 |
Correct |
38 ms |
2620 KB |
Output is correct |
43 |
Correct |
20 ms |
1604 KB |
Output is correct |
44 |
Correct |
19 ms |
1652 KB |
Output is correct |
45 |
Correct |
37 ms |
2736 KB |
Output is correct |
46 |
Correct |
56 ms |
14060 KB |
Output is correct |
47 |
Correct |
37 ms |
8840 KB |
Output is correct |
48 |
Correct |
36 ms |
11184 KB |
Output is correct |
49 |
Correct |
61 ms |
12984 KB |
Output is correct |
50 |
Correct |
64 ms |
13320 KB |
Output is correct |
51 |
Correct |
61 ms |
10060 KB |
Output is correct |
52 |
Correct |
41 ms |
2740 KB |
Output is correct |
53 |
Correct |
48 ms |
2624 KB |
Output is correct |
54 |
Correct |
36 ms |
2656 KB |
Output is correct |
55 |
Correct |
31 ms |
2584 KB |
Output is correct |
56 |
Correct |
32 ms |
2700 KB |
Output is correct |
57 |
Correct |
31 ms |
2616 KB |
Output is correct |
58 |
Correct |
70 ms |
15092 KB |
Output is correct |
59 |
Correct |
80 ms |
15084 KB |
Output is correct |
60 |
Correct |
68 ms |
15008 KB |
Output is correct |
61 |
Correct |
64 ms |
15024 KB |
Output is correct |
62 |
Correct |
68 ms |
14992 KB |
Output is correct |
63 |
Correct |
67 ms |
15020 KB |
Output is correct |
64 |
Correct |
100 ms |
16108 KB |
Output is correct |
65 |
Correct |
99 ms |
16076 KB |
Output is correct |
66 |
Correct |
91 ms |
16160 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 |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
308 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 |
212 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 |
2720 KB |
Output is correct |
14 |
Correct |
2 ms |
2644 KB |
Output is correct |
15 |
Correct |
2 ms |
2620 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 |
2644 KB |
Output is correct |
20 |
Correct |
2 ms |
2644 KB |
Output is correct |
21 |
Correct |
4 ms |
2620 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 |
304 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 |
212 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
308 KB |
Output is correct |
33 |
Correct |
2 ms |
2260 KB |
Output is correct |
34 |
Correct |
2 ms |
1844 KB |
Output is correct |
35 |
Correct |
1 ms |
1620 KB |
Output is correct |
36 |
Correct |
4 ms |
2620 KB |
Output is correct |
37 |
Correct |
1 ms |
2132 KB |
Output is correct |
38 |
Correct |
2 ms |
2360 KB |
Output is correct |
39 |
Correct |
1 ms |
212 KB |
Output is correct |
40 |
Correct |
1 ms |
2100 KB |
Output is correct |
41 |
Correct |
1 ms |
308 KB |
Output is correct |
42 |
Correct |
2 ms |
2516 KB |
Output is correct |
43 |
Correct |
2 ms |
2388 KB |
Output is correct |
44 |
Correct |
1 ms |
212 KB |
Output is correct |
45 |
Correct |
1 ms |
212 KB |
Output is correct |
46 |
Correct |
1 ms |
308 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
308 KB |
Output is correct |
50 |
Correct |
2 ms |
2644 KB |
Output is correct |
51 |
Correct |
2 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 |
2620 KB |
Output is correct |
55 |
Correct |
2 ms |
2616 KB |
Output is correct |
56 |
Correct |
2 ms |
2616 KB |
Output is correct |
57 |
Correct |
1 ms |
340 KB |
Output is correct |
58 |
Correct |
2 ms |
2644 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 |
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 |
308 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 |
212 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 |
2720 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 |
2644 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 |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
4 ms |
2620 KB |
Output is correct |
24 |
Correct |
14 ms |
7124 KB |
Output is correct |
25 |
Correct |
14 ms |
7156 KB |
Output is correct |
26 |
Correct |
14 ms |
7108 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 |
304 KB |
Output is correct |
30 |
Correct |
1 ms |
212 KB |
Output is correct |
31 |
Correct |
1 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
308 KB |
Output is correct |
36 |
Correct |
2 ms |
2260 KB |
Output is correct |
37 |
Correct |
2 ms |
1844 KB |
Output is correct |
38 |
Correct |
1 ms |
1620 KB |
Output is correct |
39 |
Correct |
4 ms |
2620 KB |
Output is correct |
40 |
Correct |
1 ms |
2132 KB |
Output is correct |
41 |
Correct |
2 ms |
2360 KB |
Output is correct |
42 |
Correct |
1 ms |
212 KB |
Output is correct |
43 |
Correct |
1 ms |
2100 KB |
Output is correct |
44 |
Correct |
1 ms |
308 KB |
Output is correct |
45 |
Correct |
2 ms |
2516 KB |
Output is correct |
46 |
Correct |
2 ms |
2388 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
308 KB |
Output is correct |
50 |
Correct |
1 ms |
212 KB |
Output is correct |
51 |
Correct |
1 ms |
212 KB |
Output is correct |
52 |
Correct |
1 ms |
308 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 |
2644 KB |
Output is correct |
57 |
Correct |
2 ms |
2620 KB |
Output is correct |
58 |
Correct |
2 ms |
2616 KB |
Output is correct |
59 |
Correct |
2 ms |
2616 KB |
Output is correct |
60 |
Correct |
1 ms |
340 KB |
Output is correct |
61 |
Correct |
2 ms |
2644 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 |
2 ms |
340 KB |
Output is correct |
66 |
Correct |
1 ms |
212 KB |
Output is correct |
67 |
Correct |
3 ms |
304 KB |
Output is correct |
68 |
Correct |
2 ms |
212 KB |
Output is correct |
69 |
Correct |
2 ms |
340 KB |
Output is correct |
70 |
Correct |
3 ms |
2516 KB |
Output is correct |
71 |
Correct |
3 ms |
2132 KB |
Output is correct |
72 |
Correct |
2 ms |
1876 KB |
Output is correct |
73 |
Correct |
2 ms |
2004 KB |
Output is correct |
74 |
Correct |
3 ms |
2388 KB |
Output is correct |
75 |
Correct |
2 ms |
2752 KB |
Output is correct |
76 |
Correct |
16 ms |
5228 KB |
Output is correct |
77 |
Correct |
15 ms |
6132 KB |
Output is correct |
78 |
Correct |
19 ms |
6884 KB |
Output is correct |
79 |
Correct |
4 ms |
340 KB |
Output is correct |
80 |
Correct |
4 ms |
308 KB |
Output is correct |
81 |
Correct |
4 ms |
340 KB |
Output is correct |
82 |
Correct |
6 ms |
340 KB |
Output is correct |
83 |
Correct |
4 ms |
308 KB |
Output is correct |
84 |
Correct |
3 ms |
2880 KB |
Output is correct |
85 |
Correct |
3 ms |
2900 KB |
Output is correct |
86 |
Correct |
3 ms |
2900 KB |
Output is correct |
87 |
Correct |
3 ms |
2900 KB |
Output is correct |
88 |
Correct |
3 ms |
2900 KB |
Output is correct |
89 |
Correct |
3 ms |
2956 KB |
Output is correct |
90 |
Correct |
21 ms |
7244 KB |
Output is correct |
91 |
Correct |
21 ms |
7268 KB |
Output is correct |
92 |
Correct |
21 ms |
7280 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 |
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 |
308 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 |
212 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 |
2720 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 |
2644 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 |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
4 ms |
2620 KB |
Output is correct |
24 |
Correct |
14 ms |
7124 KB |
Output is correct |
25 |
Correct |
14 ms |
7156 KB |
Output is correct |
26 |
Correct |
14 ms |
7108 KB |
Output is correct |
27 |
Correct |
8 ms |
832 KB |
Output is correct |
28 |
Correct |
8 ms |
836 KB |
Output is correct |
29 |
Correct |
7 ms |
724 KB |
Output is correct |
30 |
Correct |
6 ms |
724 KB |
Output is correct |
31 |
Correct |
6 ms |
728 KB |
Output is correct |
32 |
Correct |
6 ms |
724 KB |
Output is correct |
33 |
Correct |
14 ms |
4288 KB |
Output is correct |
34 |
Correct |
13 ms |
4308 KB |
Output is correct |
35 |
Correct |
14 ms |
4308 KB |
Output is correct |
36 |
Correct |
13 ms |
4228 KB |
Output is correct |
37 |
Correct |
13 ms |
4208 KB |
Output is correct |
38 |
Correct |
14 ms |
4204 KB |
Output is correct |
39 |
Correct |
25 ms |
7884 KB |
Output is correct |
40 |
Correct |
26 ms |
7964 KB |
Output is correct |
41 |
Correct |
25 ms |
8020 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 |
304 KB |
Output is correct |
45 |
Correct |
1 ms |
212 KB |
Output is correct |
46 |
Correct |
1 ms |
212 KB |
Output is correct |
47 |
Correct |
1 ms |
212 KB |
Output is correct |
48 |
Correct |
1 ms |
212 KB |
Output is correct |
49 |
Correct |
1 ms |
212 KB |
Output is correct |
50 |
Correct |
1 ms |
308 KB |
Output is correct |
51 |
Correct |
2 ms |
2260 KB |
Output is correct |
52 |
Correct |
2 ms |
1844 KB |
Output is correct |
53 |
Correct |
1 ms |
1620 KB |
Output is correct |
54 |
Correct |
4 ms |
2620 KB |
Output is correct |
55 |
Correct |
1 ms |
2132 KB |
Output is correct |
56 |
Correct |
2 ms |
2360 KB |
Output is correct |
57 |
Correct |
1 ms |
212 KB |
Output is correct |
58 |
Correct |
1 ms |
2100 KB |
Output is correct |
59 |
Correct |
1 ms |
308 KB |
Output is correct |
60 |
Correct |
2 ms |
2516 KB |
Output is correct |
61 |
Correct |
2 ms |
2388 KB |
Output is correct |
62 |
Correct |
1 ms |
212 KB |
Output is correct |
63 |
Correct |
1 ms |
212 KB |
Output is correct |
64 |
Correct |
1 ms |
308 KB |
Output is correct |
65 |
Correct |
1 ms |
212 KB |
Output is correct |
66 |
Correct |
1 ms |
212 KB |
Output is correct |
67 |
Correct |
1 ms |
308 KB |
Output is correct |
68 |
Correct |
2 ms |
2644 KB |
Output is correct |
69 |
Correct |
2 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 |
2620 KB |
Output is correct |
73 |
Correct |
2 ms |
2616 KB |
Output is correct |
74 |
Correct |
2 ms |
2616 KB |
Output is correct |
75 |
Correct |
1 ms |
340 KB |
Output is correct |
76 |
Correct |
2 ms |
2644 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 |
2 ms |
340 KB |
Output is correct |
81 |
Correct |
1 ms |
212 KB |
Output is correct |
82 |
Correct |
3 ms |
304 KB |
Output is correct |
83 |
Correct |
2 ms |
212 KB |
Output is correct |
84 |
Correct |
2 ms |
340 KB |
Output is correct |
85 |
Correct |
3 ms |
2516 KB |
Output is correct |
86 |
Correct |
3 ms |
2132 KB |
Output is correct |
87 |
Correct |
2 ms |
1876 KB |
Output is correct |
88 |
Correct |
2 ms |
2004 KB |
Output is correct |
89 |
Correct |
3 ms |
2388 KB |
Output is correct |
90 |
Correct |
2 ms |
2752 KB |
Output is correct |
91 |
Correct |
16 ms |
5228 KB |
Output is correct |
92 |
Correct |
15 ms |
6132 KB |
Output is correct |
93 |
Correct |
19 ms |
6884 KB |
Output is correct |
94 |
Correct |
4 ms |
340 KB |
Output is correct |
95 |
Correct |
4 ms |
308 KB |
Output is correct |
96 |
Correct |
4 ms |
340 KB |
Output is correct |
97 |
Correct |
6 ms |
340 KB |
Output is correct |
98 |
Correct |
4 ms |
308 KB |
Output is correct |
99 |
Correct |
3 ms |
2880 KB |
Output is correct |
100 |
Correct |
3 ms |
2900 KB |
Output is correct |
101 |
Correct |
3 ms |
2900 KB |
Output is correct |
102 |
Correct |
3 ms |
2900 KB |
Output is correct |
103 |
Correct |
3 ms |
2900 KB |
Output is correct |
104 |
Correct |
3 ms |
2956 KB |
Output is correct |
105 |
Correct |
21 ms |
7244 KB |
Output is correct |
106 |
Correct |
21 ms |
7268 KB |
Output is correct |
107 |
Correct |
21 ms |
7280 KB |
Output is correct |
108 |
Correct |
8 ms |
808 KB |
Output is correct |
109 |
Correct |
861 ms |
664 KB |
Output is correct |
110 |
Correct |
500 ms |
656 KB |
Output is correct |
111 |
Correct |
399 ms |
716 KB |
Output is correct |
112 |
Correct |
480 ms |
708 KB |
Output is correct |
113 |
Correct |
359 ms |
700 KB |
Output is correct |
114 |
Correct |
14 ms |
4444 KB |
Output is correct |
115 |
Correct |
19 ms |
4040 KB |
Output is correct |
116 |
Correct |
19 ms |
4600 KB |
Output is correct |
117 |
Correct |
13 ms |
3668 KB |
Output is correct |
118 |
Correct |
19 ms |
4292 KB |
Output is correct |
119 |
Correct |
14 ms |
4052 KB |
Output is correct |
120 |
Correct |
20 ms |
5076 KB |
Output is correct |
121 |
Correct |
10 ms |
1492 KB |
Output is correct |
122 |
Correct |
22 ms |
5216 KB |
Output is correct |
123 |
Correct |
9 ms |
1236 KB |
Output is correct |
124 |
Correct |
25 ms |
6428 KB |
Output is correct |
125 |
Correct |
14 ms |
1876 KB |
Output is correct |
126 |
Correct |
9 ms |
2768 KB |
Output is correct |
127 |
Correct |
10 ms |
3816 KB |
Output is correct |
128 |
Correct |
8 ms |
3136 KB |
Output is correct |
129 |
Correct |
8 ms |
2644 KB |
Output is correct |
130 |
Correct |
8 ms |
724 KB |
Output is correct |
131 |
Correct |
1250 ms |
856 KB |
Output is correct |
132 |
Correct |
1032 ms |
976 KB |
Output is correct |
133 |
Correct |
935 ms |
908 KB |
Output is correct |
134 |
Correct |
834 ms |
920 KB |
Output is correct |
135 |
Correct |
769 ms |
932 KB |
Output is correct |
136 |
Correct |
21 ms |
5068 KB |
Output is correct |
137 |
Correct |
21 ms |
5052 KB |
Output is correct |
138 |
Correct |
21 ms |
5076 KB |
Output is correct |
139 |
Correct |
25 ms |
5068 KB |
Output is correct |
140 |
Correct |
20 ms |
5100 KB |
Output is correct |
141 |
Correct |
20 ms |
5124 KB |
Output is correct |
142 |
Correct |
34 ms |
8140 KB |
Output is correct |
143 |
Correct |
17 ms |
2260 KB |
Output is correct |
144 |
Correct |
33 ms |
8040 KB |
Output is correct |
145 |
Correct |
17 ms |
2212 KB |
Output is correct |
146 |
Correct |
35 ms |
8116 KB |
Output is correct |
147 |
Correct |
18 ms |
2260 KB |
Output is correct |
148 |
Correct |
11 ms |
4392 KB |
Output is correct |
149 |
Correct |
11 ms |
4424 KB |
Output is correct |
150 |
Correct |
11 ms |
4308 KB |
Output is correct |
151 |
Correct |
11 ms |
4308 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 |
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 |
308 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 |
212 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 |
2720 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 |
2644 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 |
2644 KB |
Output is correct |
22 |
Correct |
2 ms |
2644 KB |
Output is correct |
23 |
Correct |
4 ms |
2620 KB |
Output is correct |
24 |
Correct |
14 ms |
7124 KB |
Output is correct |
25 |
Correct |
14 ms |
7156 KB |
Output is correct |
26 |
Correct |
14 ms |
7108 KB |
Output is correct |
27 |
Correct |
8 ms |
832 KB |
Output is correct |
28 |
Correct |
8 ms |
836 KB |
Output is correct |
29 |
Correct |
7 ms |
724 KB |
Output is correct |
30 |
Correct |
6 ms |
724 KB |
Output is correct |
31 |
Correct |
6 ms |
728 KB |
Output is correct |
32 |
Correct |
6 ms |
724 KB |
Output is correct |
33 |
Correct |
14 ms |
4288 KB |
Output is correct |
34 |
Correct |
13 ms |
4308 KB |
Output is correct |
35 |
Correct |
14 ms |
4308 KB |
Output is correct |
36 |
Correct |
13 ms |
4228 KB |
Output is correct |
37 |
Correct |
13 ms |
4208 KB |
Output is correct |
38 |
Correct |
14 ms |
4204 KB |
Output is correct |
39 |
Correct |
25 ms |
7884 KB |
Output is correct |
40 |
Correct |
26 ms |
7964 KB |
Output is correct |
41 |
Correct |
25 ms |
8020 KB |
Output is correct |
42 |
Correct |
43 ms |
2488 KB |
Output is correct |
43 |
Correct |
23 ms |
1544 KB |
Output is correct |
44 |
Correct |
38 ms |
2620 KB |
Output is correct |
45 |
Correct |
20 ms |
1604 KB |
Output is correct |
46 |
Correct |
19 ms |
1652 KB |
Output is correct |
47 |
Correct |
37 ms |
2736 KB |
Output is correct |
48 |
Correct |
56 ms |
14060 KB |
Output is correct |
49 |
Correct |
37 ms |
8840 KB |
Output is correct |
50 |
Correct |
36 ms |
11184 KB |
Output is correct |
51 |
Correct |
61 ms |
12984 KB |
Output is correct |
52 |
Correct |
64 ms |
13320 KB |
Output is correct |
53 |
Correct |
61 ms |
10060 KB |
Output is correct |
54 |
Correct |
41 ms |
2740 KB |
Output is correct |
55 |
Correct |
48 ms |
2624 KB |
Output is correct |
56 |
Correct |
36 ms |
2656 KB |
Output is correct |
57 |
Correct |
31 ms |
2584 KB |
Output is correct |
58 |
Correct |
32 ms |
2700 KB |
Output is correct |
59 |
Correct |
31 ms |
2616 KB |
Output is correct |
60 |
Correct |
70 ms |
15092 KB |
Output is correct |
61 |
Correct |
80 ms |
15084 KB |
Output is correct |
62 |
Correct |
68 ms |
15008 KB |
Output is correct |
63 |
Correct |
64 ms |
15024 KB |
Output is correct |
64 |
Correct |
68 ms |
14992 KB |
Output is correct |
65 |
Correct |
67 ms |
15020 KB |
Output is correct |
66 |
Correct |
100 ms |
16108 KB |
Output is correct |
67 |
Correct |
99 ms |
16076 KB |
Output is correct |
68 |
Correct |
91 ms |
16160 KB |
Output is correct |
69 |
Correct |
1 ms |
212 KB |
Output is correct |
70 |
Correct |
1 ms |
212 KB |
Output is correct |
71 |
Correct |
1 ms |
304 KB |
Output is correct |
72 |
Correct |
1 ms |
212 KB |
Output is correct |
73 |
Correct |
1 ms |
212 KB |
Output is correct |
74 |
Correct |
1 ms |
212 KB |
Output is correct |
75 |
Correct |
1 ms |
212 KB |
Output is correct |
76 |
Correct |
1 ms |
212 KB |
Output is correct |
77 |
Correct |
1 ms |
308 KB |
Output is correct |
78 |
Correct |
2 ms |
2260 KB |
Output is correct |
79 |
Correct |
2 ms |
1844 KB |
Output is correct |
80 |
Correct |
1 ms |
1620 KB |
Output is correct |
81 |
Correct |
4 ms |
2620 KB |
Output is correct |
82 |
Correct |
1 ms |
2132 KB |
Output is correct |
83 |
Correct |
2 ms |
2360 KB |
Output is correct |
84 |
Correct |
1 ms |
212 KB |
Output is correct |
85 |
Correct |
1 ms |
2100 KB |
Output is correct |
86 |
Correct |
1 ms |
308 KB |
Output is correct |
87 |
Correct |
2 ms |
2516 KB |
Output is correct |
88 |
Correct |
2 ms |
2388 KB |
Output is correct |
89 |
Correct |
1 ms |
212 KB |
Output is correct |
90 |
Correct |
1 ms |
212 KB |
Output is correct |
91 |
Correct |
1 ms |
308 KB |
Output is correct |
92 |
Correct |
1 ms |
212 KB |
Output is correct |
93 |
Correct |
1 ms |
212 KB |
Output is correct |
94 |
Correct |
1 ms |
308 KB |
Output is correct |
95 |
Correct |
2 ms |
2644 KB |
Output is correct |
96 |
Correct |
2 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 |
2620 KB |
Output is correct |
100 |
Correct |
2 ms |
2616 KB |
Output is correct |
101 |
Correct |
2 ms |
2616 KB |
Output is correct |
102 |
Correct |
1 ms |
340 KB |
Output is correct |
103 |
Correct |
2 ms |
2644 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 |
2 ms |
340 KB |
Output is correct |
108 |
Correct |
1 ms |
212 KB |
Output is correct |
109 |
Correct |
3 ms |
304 KB |
Output is correct |
110 |
Correct |
2 ms |
212 KB |
Output is correct |
111 |
Correct |
2 ms |
340 KB |
Output is correct |
112 |
Correct |
3 ms |
2516 KB |
Output is correct |
113 |
Correct |
3 ms |
2132 KB |
Output is correct |
114 |
Correct |
2 ms |
1876 KB |
Output is correct |
115 |
Correct |
2 ms |
2004 KB |
Output is correct |
116 |
Correct |
3 ms |
2388 KB |
Output is correct |
117 |
Correct |
2 ms |
2752 KB |
Output is correct |
118 |
Correct |
16 ms |
5228 KB |
Output is correct |
119 |
Correct |
15 ms |
6132 KB |
Output is correct |
120 |
Correct |
19 ms |
6884 KB |
Output is correct |
121 |
Correct |
4 ms |
340 KB |
Output is correct |
122 |
Correct |
4 ms |
308 KB |
Output is correct |
123 |
Correct |
4 ms |
340 KB |
Output is correct |
124 |
Correct |
6 ms |
340 KB |
Output is correct |
125 |
Correct |
4 ms |
308 KB |
Output is correct |
126 |
Correct |
3 ms |
2880 KB |
Output is correct |
127 |
Correct |
3 ms |
2900 KB |
Output is correct |
128 |
Correct |
3 ms |
2900 KB |
Output is correct |
129 |
Correct |
3 ms |
2900 KB |
Output is correct |
130 |
Correct |
3 ms |
2900 KB |
Output is correct |
131 |
Correct |
3 ms |
2956 KB |
Output is correct |
132 |
Correct |
21 ms |
7244 KB |
Output is correct |
133 |
Correct |
21 ms |
7268 KB |
Output is correct |
134 |
Correct |
21 ms |
7280 KB |
Output is correct |
135 |
Correct |
8 ms |
808 KB |
Output is correct |
136 |
Correct |
861 ms |
664 KB |
Output is correct |
137 |
Correct |
500 ms |
656 KB |
Output is correct |
138 |
Correct |
399 ms |
716 KB |
Output is correct |
139 |
Correct |
480 ms |
708 KB |
Output is correct |
140 |
Correct |
359 ms |
700 KB |
Output is correct |
141 |
Correct |
14 ms |
4444 KB |
Output is correct |
142 |
Correct |
19 ms |
4040 KB |
Output is correct |
143 |
Correct |
19 ms |
4600 KB |
Output is correct |
144 |
Correct |
13 ms |
3668 KB |
Output is correct |
145 |
Correct |
19 ms |
4292 KB |
Output is correct |
146 |
Correct |
14 ms |
4052 KB |
Output is correct |
147 |
Correct |
20 ms |
5076 KB |
Output is correct |
148 |
Correct |
10 ms |
1492 KB |
Output is correct |
149 |
Correct |
22 ms |
5216 KB |
Output is correct |
150 |
Correct |
9 ms |
1236 KB |
Output is correct |
151 |
Correct |
25 ms |
6428 KB |
Output is correct |
152 |
Correct |
14 ms |
1876 KB |
Output is correct |
153 |
Correct |
9 ms |
2768 KB |
Output is correct |
154 |
Correct |
10 ms |
3816 KB |
Output is correct |
155 |
Correct |
8 ms |
3136 KB |
Output is correct |
156 |
Correct |
8 ms |
2644 KB |
Output is correct |
157 |
Correct |
8 ms |
724 KB |
Output is correct |
158 |
Correct |
1250 ms |
856 KB |
Output is correct |
159 |
Correct |
1032 ms |
976 KB |
Output is correct |
160 |
Correct |
935 ms |
908 KB |
Output is correct |
161 |
Correct |
834 ms |
920 KB |
Output is correct |
162 |
Correct |
769 ms |
932 KB |
Output is correct |
163 |
Correct |
21 ms |
5068 KB |
Output is correct |
164 |
Correct |
21 ms |
5052 KB |
Output is correct |
165 |
Correct |
21 ms |
5076 KB |
Output is correct |
166 |
Correct |
25 ms |
5068 KB |
Output is correct |
167 |
Correct |
20 ms |
5100 KB |
Output is correct |
168 |
Correct |
20 ms |
5124 KB |
Output is correct |
169 |
Correct |
34 ms |
8140 KB |
Output is correct |
170 |
Correct |
17 ms |
2260 KB |
Output is correct |
171 |
Correct |
33 ms |
8040 KB |
Output is correct |
172 |
Correct |
17 ms |
2212 KB |
Output is correct |
173 |
Correct |
35 ms |
8116 KB |
Output is correct |
174 |
Correct |
18 ms |
2260 KB |
Output is correct |
175 |
Correct |
11 ms |
4392 KB |
Output is correct |
176 |
Correct |
11 ms |
4424 KB |
Output is correct |
177 |
Correct |
11 ms |
4308 KB |
Output is correct |
178 |
Correct |
11 ms |
4308 KB |
Output is correct |
179 |
Correct |
26 ms |
1600 KB |
Output is correct |
180 |
Correct |
1098 ms |
1536 KB |
Output is correct |
181 |
Execution timed out |
1560 ms |
1108 KB |
Time limit exceeded |
182 |
Halted |
0 ms |
0 KB |
- |