#include "paint.h"
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int N = 4e5 + 5;
const int oo = 1e18 + 7, mod = 1e9 + 7;
int n, m, k;
int arr[N];
vector<int> like[N];
int total[N], cnt[N];
bool okay[N];
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B){
n = N, m = M, k = K;
for(int i = 0; i < n; i++) arr[i + 1] = C[i] + 1;
for(int i = 0; i < m; i++){
for(auto it : B[i]) like[it + 1].pb(i + 1);
}
for(int i = 1; i <= k; i++) assert(like[i].size() <= 700);
for(int i = 1; i <= m; i++){
for(auto it : like[arr[i]]){
int temp = (it - (i - 1) + 2 * m) % m;
if(!temp) temp = m;
total[temp]++;
//okay[1] |= (total[temp] == m);
}
}
for(int i = 1; i <= m; i++) cnt[total[i]]++;
okay[1] = (cnt[m] != 0);
for(int i = m + 1; i <= n; i++){
for(auto it : like[arr[i - m]]){
int temp = (((it - (i - 1)) % m) + m) % m;
// cout << i << " " << temp << "\n";
if(!temp) temp = m;
cnt[total[temp]]--;
total[temp]--;
cnt[total[temp]]++;
//total[temp]++;
}
for(auto it : like[arr[i]]){
int temp = (((it - (i - 1)) % m) + m) % m;
if(!temp) temp = m;
cnt[total[temp]]--;
total[temp]++;
cnt[total[temp]]++;
}
okay[i - m + 1] = (cnt[m] != 0);
}
//for(int i = 1; i <= (n - m + 1); i++) cout << okay[i] << " ";
//cout << "\n";
if(!okay[1]) return -1;
vector<int> okays;
for(int i = 1; i <= n - m + 1; i++) if(okay[i]) okays.pb(i);
int ans = 1, itr = m;
while(itr < n){
//cout << itr << "\n";
vector<int>::iterator it = lower_bound(okays.begin(), okays.end(), itr + 2);
assert(it != okays.begin());
it--;
int temp = ((*it) + m - 1);
if(temp <= itr) return -1;
itr = temp;
ans++;
}
return ans;
}
Compilation message
paint.cpp:16:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
16 | const int oo = 1e18 + 7, mod = 1e9 + 7;
| ~~~~~^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
6 ms |
9684 KB |
Output is correct |
3 |
Correct |
9 ms |
9724 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
9 ms |
9684 KB |
Output is correct |
9 |
Correct |
7 ms |
9684 KB |
Output is correct |
10 |
Correct |
10 ms |
9684 KB |
Output is correct |
11 |
Correct |
5 ms |
9684 KB |
Output is correct |
12 |
Correct |
5 ms |
9728 KB |
Output is correct |
13 |
Correct |
7 ms |
9684 KB |
Output is correct |
14 |
Correct |
6 ms |
9684 KB |
Output is correct |
15 |
Correct |
5 ms |
9684 KB |
Output is correct |
16 |
Correct |
7 ms |
9684 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
26 ms |
13556 KB |
Output is correct |
23 |
Correct |
24 ms |
13652 KB |
Output is correct |
24 |
Correct |
24 ms |
13636 KB |
Output is correct |
25 |
Correct |
8 ms |
10068 KB |
Output is correct |
26 |
Correct |
8 ms |
10172 KB |
Output is correct |
27 |
Correct |
7 ms |
9940 KB |
Output is correct |
28 |
Correct |
9 ms |
9920 KB |
Output is correct |
29 |
Correct |
8 ms |
9940 KB |
Output is correct |
30 |
Correct |
8 ms |
9940 KB |
Output is correct |
31 |
Correct |
17 ms |
11092 KB |
Output is correct |
32 |
Correct |
15 ms |
11068 KB |
Output is correct |
33 |
Correct |
14 ms |
11092 KB |
Output is correct |
34 |
Correct |
17 ms |
10996 KB |
Output is correct |
35 |
Correct |
14 ms |
10996 KB |
Output is correct |
36 |
Correct |
14 ms |
11092 KB |
Output is correct |
37 |
Correct |
33 ms |
14036 KB |
Output is correct |
38 |
Correct |
29 ms |
14040 KB |
Output is correct |
39 |
Correct |
30 ms |
14008 KB |
Output is correct |
40 |
Correct |
21 ms |
11472 KB |
Output is correct |
41 |
Correct |
16 ms |
10836 KB |
Output is correct |
42 |
Correct |
21 ms |
11260 KB |
Output is correct |
43 |
Correct |
19 ms |
10620 KB |
Output is correct |
44 |
Correct |
18 ms |
10584 KB |
Output is correct |
45 |
Correct |
24 ms |
11092 KB |
Output is correct |
46 |
Correct |
46 ms |
20544 KB |
Output is correct |
47 |
Correct |
37 ms |
15900 KB |
Output is correct |
48 |
Correct |
34 ms |
18328 KB |
Output is correct |
49 |
Correct |
46 ms |
18612 KB |
Output is correct |
50 |
Correct |
47 ms |
18364 KB |
Output is correct |
51 |
Correct |
56 ms |
16092 KB |
Output is correct |
52 |
Correct |
23 ms |
11808 KB |
Output is correct |
53 |
Correct |
33 ms |
11712 KB |
Output is correct |
54 |
Correct |
21 ms |
11552 KB |
Output is correct |
55 |
Correct |
18 ms |
11092 KB |
Output is correct |
56 |
Correct |
18 ms |
11076 KB |
Output is correct |
57 |
Correct |
20 ms |
11112 KB |
Output is correct |
58 |
Correct |
51 ms |
21512 KB |
Output is correct |
59 |
Correct |
47 ms |
21560 KB |
Output is correct |
60 |
Correct |
52 ms |
21552 KB |
Output is correct |
61 |
Correct |
49 ms |
21536 KB |
Output is correct |
62 |
Correct |
62 ms |
21484 KB |
Output is correct |
63 |
Correct |
58 ms |
21580 KB |
Output is correct |
64 |
Correct |
67 ms |
20544 KB |
Output is correct |
65 |
Correct |
68 ms |
20464 KB |
Output is correct |
66 |
Correct |
71 ms |
20456 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9684 KB |
Output is correct |
2 |
Correct |
6 ms |
9684 KB |
Output is correct |
3 |
Correct |
9 ms |
9724 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
5 ms |
9684 KB |
Output is correct |
6 |
Correct |
5 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
9 ms |
9684 KB |
Output is correct |
9 |
Correct |
7 ms |
9684 KB |
Output is correct |
10 |
Correct |
10 ms |
9684 KB |
Output is correct |
11 |
Correct |
5 ms |
9684 KB |
Output is correct |
12 |
Correct |
5 ms |
9728 KB |
Output is correct |
13 |
Correct |
7 ms |
9684 KB |
Output is correct |
14 |
Correct |
6 ms |
9684 KB |
Output is correct |
15 |
Correct |
5 ms |
9684 KB |
Output is correct |
16 |
Correct |
7 ms |
9684 KB |
Output is correct |
17 |
Correct |
6 ms |
9684 KB |
Output is correct |
18 |
Correct |
6 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
5 ms |
9676 KB |
Output is correct |
23 |
Correct |
6 ms |
9724 KB |
Output is correct |
24 |
Correct |
7 ms |
9684 KB |
Output is correct |
25 |
Correct |
5 ms |
9684 KB |
Output is correct |
26 |
Correct |
5 ms |
9684 KB |
Output is correct |
27 |
Correct |
4 ms |
9720 KB |
Output is correct |
28 |
Correct |
5 ms |
9684 KB |
Output is correct |
29 |
Correct |
5 ms |
9684 KB |
Output is correct |
30 |
Correct |
5 ms |
9684 KB |
Output is correct |
31 |
Correct |
5 ms |
9684 KB |
Output is correct |
32 |
Correct |
8 ms |
9684 KB |
Output is correct |
33 |
Correct |
6 ms |
9684 KB |
Output is correct |
34 |
Correct |
6 ms |
9684 KB |
Output is correct |
35 |
Correct |
5 ms |
9684 KB |
Output is correct |
36 |
Correct |
6 ms |
9684 KB |
Output is correct |
37 |
Correct |
9 ms |
9684 KB |
Output is correct |
38 |
Correct |
9 ms |
9684 KB |
Output is correct |
39 |
Correct |
10 ms |
9684 KB |
Output is correct |
40 |
Correct |
6 ms |
9684 KB |
Output is correct |
41 |
Correct |
5 ms |
9684 KB |
Output is correct |
42 |
Correct |
5 ms |
9684 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9712 KB |
Output is correct |
45 |
Correct |
6 ms |
9684 KB |
Output is correct |
46 |
Correct |
7 ms |
9716 KB |
Output is correct |
47 |
Correct |
6 ms |
9684 KB |
Output is correct |
48 |
Correct |
7 ms |
9684 KB |
Output is correct |
49 |
Correct |
6 ms |
9716 KB |
Output is correct |
50 |
Correct |
6 ms |
9752 KB |
Output is correct |
51 |
Correct |
6 ms |
9712 KB |
Output is correct |
52 |
Correct |
5 ms |
9712 KB |
Output is correct |
53 |
Correct |
6 ms |
9684 KB |
Output is correct |
54 |
Correct |
8 ms |
9684 KB |
Output is correct |
55 |
Correct |
6 ms |
9684 KB |
Output is correct |
56 |
Correct |
6 ms |
9720 KB |
Output is correct |
57 |
Correct |
8 ms |
9684 KB |
Output is correct |
58 |
Correct |
6 ms |
9684 KB |
Output is correct |
59 |
Correct |
6 ms |
9716 KB |
Output is correct |
60 |
Correct |
6 ms |
9700 KB |
Output is correct |
61 |
Correct |
6 ms |
9704 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9676 KB |
Output is correct |
2 |
Correct |
6 ms |
9724 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
9 ms |
9724 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
5 ms |
9684 KB |
Output is correct |
10 |
Correct |
9 ms |
9684 KB |
Output is correct |
11 |
Correct |
7 ms |
9684 KB |
Output is correct |
12 |
Correct |
10 ms |
9684 KB |
Output is correct |
13 |
Correct |
5 ms |
9684 KB |
Output is correct |
14 |
Correct |
5 ms |
9728 KB |
Output is correct |
15 |
Correct |
7 ms |
9684 KB |
Output is correct |
16 |
Correct |
6 ms |
9684 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
7 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
6 ms |
9684 KB |
Output is correct |
24 |
Correct |
26 ms |
13556 KB |
Output is correct |
25 |
Correct |
24 ms |
13652 KB |
Output is correct |
26 |
Correct |
24 ms |
13636 KB |
Output is correct |
27 |
Correct |
7 ms |
9684 KB |
Output is correct |
28 |
Correct |
5 ms |
9684 KB |
Output is correct |
29 |
Correct |
5 ms |
9684 KB |
Output is correct |
30 |
Correct |
4 ms |
9720 KB |
Output is correct |
31 |
Correct |
5 ms |
9684 KB |
Output is correct |
32 |
Correct |
5 ms |
9684 KB |
Output is correct |
33 |
Correct |
5 ms |
9684 KB |
Output is correct |
34 |
Correct |
5 ms |
9684 KB |
Output is correct |
35 |
Correct |
8 ms |
9684 KB |
Output is correct |
36 |
Correct |
6 ms |
9684 KB |
Output is correct |
37 |
Correct |
6 ms |
9684 KB |
Output is correct |
38 |
Correct |
5 ms |
9684 KB |
Output is correct |
39 |
Correct |
6 ms |
9684 KB |
Output is correct |
40 |
Correct |
9 ms |
9684 KB |
Output is correct |
41 |
Correct |
9 ms |
9684 KB |
Output is correct |
42 |
Correct |
10 ms |
9684 KB |
Output is correct |
43 |
Correct |
6 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9684 KB |
Output is correct |
45 |
Correct |
5 ms |
9684 KB |
Output is correct |
46 |
Correct |
5 ms |
9684 KB |
Output is correct |
47 |
Correct |
5 ms |
9712 KB |
Output is correct |
48 |
Correct |
6 ms |
9684 KB |
Output is correct |
49 |
Correct |
7 ms |
9716 KB |
Output is correct |
50 |
Correct |
6 ms |
9684 KB |
Output is correct |
51 |
Correct |
7 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9716 KB |
Output is correct |
53 |
Correct |
6 ms |
9752 KB |
Output is correct |
54 |
Correct |
6 ms |
9712 KB |
Output is correct |
55 |
Correct |
5 ms |
9712 KB |
Output is correct |
56 |
Correct |
6 ms |
9684 KB |
Output is correct |
57 |
Correct |
8 ms |
9684 KB |
Output is correct |
58 |
Correct |
6 ms |
9684 KB |
Output is correct |
59 |
Correct |
6 ms |
9720 KB |
Output is correct |
60 |
Correct |
8 ms |
9684 KB |
Output is correct |
61 |
Correct |
6 ms |
9684 KB |
Output is correct |
62 |
Correct |
6 ms |
9716 KB |
Output is correct |
63 |
Correct |
6 ms |
9700 KB |
Output is correct |
64 |
Correct |
6 ms |
9704 KB |
Output is correct |
65 |
Correct |
6 ms |
9720 KB |
Output is correct |
66 |
Correct |
6 ms |
9716 KB |
Output is correct |
67 |
Correct |
6 ms |
9672 KB |
Output is correct |
68 |
Correct |
7 ms |
9684 KB |
Output is correct |
69 |
Correct |
10 ms |
9684 KB |
Output is correct |
70 |
Correct |
7 ms |
9848 KB |
Output is correct |
71 |
Correct |
8 ms |
9976 KB |
Output is correct |
72 |
Correct |
13 ms |
9984 KB |
Output is correct |
73 |
Correct |
9 ms |
9832 KB |
Output is correct |
74 |
Correct |
9 ms |
9920 KB |
Output is correct |
75 |
Correct |
7 ms |
9852 KB |
Output is correct |
76 |
Correct |
26 ms |
13012 KB |
Output is correct |
77 |
Correct |
48 ms |
13456 KB |
Output is correct |
78 |
Correct |
29 ms |
14024 KB |
Output is correct |
79 |
Correct |
8 ms |
9704 KB |
Output is correct |
80 |
Correct |
8 ms |
9760 KB |
Output is correct |
81 |
Correct |
9 ms |
9712 KB |
Output is correct |
82 |
Correct |
12 ms |
9720 KB |
Output is correct |
83 |
Correct |
8 ms |
9756 KB |
Output is correct |
84 |
Correct |
8 ms |
9940 KB |
Output is correct |
85 |
Correct |
8 ms |
10040 KB |
Output is correct |
86 |
Correct |
8 ms |
9940 KB |
Output is correct |
87 |
Correct |
11 ms |
9988 KB |
Output is correct |
88 |
Correct |
10 ms |
9928 KB |
Output is correct |
89 |
Correct |
8 ms |
9940 KB |
Output is correct |
90 |
Correct |
36 ms |
14268 KB |
Output is correct |
91 |
Correct |
32 ms |
14312 KB |
Output is correct |
92 |
Correct |
35 ms |
14284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9676 KB |
Output is correct |
2 |
Correct |
6 ms |
9724 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
9 ms |
9724 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
5 ms |
9684 KB |
Output is correct |
10 |
Correct |
9 ms |
9684 KB |
Output is correct |
11 |
Correct |
7 ms |
9684 KB |
Output is correct |
12 |
Correct |
10 ms |
9684 KB |
Output is correct |
13 |
Correct |
5 ms |
9684 KB |
Output is correct |
14 |
Correct |
5 ms |
9728 KB |
Output is correct |
15 |
Correct |
7 ms |
9684 KB |
Output is correct |
16 |
Correct |
6 ms |
9684 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
7 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
6 ms |
9684 KB |
Output is correct |
24 |
Correct |
26 ms |
13556 KB |
Output is correct |
25 |
Correct |
24 ms |
13652 KB |
Output is correct |
26 |
Correct |
24 ms |
13636 KB |
Output is correct |
27 |
Correct |
8 ms |
10068 KB |
Output is correct |
28 |
Correct |
8 ms |
10172 KB |
Output is correct |
29 |
Correct |
7 ms |
9940 KB |
Output is correct |
30 |
Correct |
9 ms |
9920 KB |
Output is correct |
31 |
Correct |
8 ms |
9940 KB |
Output is correct |
32 |
Correct |
8 ms |
9940 KB |
Output is correct |
33 |
Correct |
17 ms |
11092 KB |
Output is correct |
34 |
Correct |
15 ms |
11068 KB |
Output is correct |
35 |
Correct |
14 ms |
11092 KB |
Output is correct |
36 |
Correct |
17 ms |
10996 KB |
Output is correct |
37 |
Correct |
14 ms |
10996 KB |
Output is correct |
38 |
Correct |
14 ms |
11092 KB |
Output is correct |
39 |
Correct |
33 ms |
14036 KB |
Output is correct |
40 |
Correct |
29 ms |
14040 KB |
Output is correct |
41 |
Correct |
30 ms |
14008 KB |
Output is correct |
42 |
Correct |
7 ms |
9684 KB |
Output is correct |
43 |
Correct |
5 ms |
9684 KB |
Output is correct |
44 |
Correct |
5 ms |
9684 KB |
Output is correct |
45 |
Correct |
4 ms |
9720 KB |
Output is correct |
46 |
Correct |
5 ms |
9684 KB |
Output is correct |
47 |
Correct |
5 ms |
9684 KB |
Output is correct |
48 |
Correct |
5 ms |
9684 KB |
Output is correct |
49 |
Correct |
5 ms |
9684 KB |
Output is correct |
50 |
Correct |
8 ms |
9684 KB |
Output is correct |
51 |
Correct |
6 ms |
9684 KB |
Output is correct |
52 |
Correct |
6 ms |
9684 KB |
Output is correct |
53 |
Correct |
5 ms |
9684 KB |
Output is correct |
54 |
Correct |
6 ms |
9684 KB |
Output is correct |
55 |
Correct |
9 ms |
9684 KB |
Output is correct |
56 |
Correct |
9 ms |
9684 KB |
Output is correct |
57 |
Correct |
10 ms |
9684 KB |
Output is correct |
58 |
Correct |
6 ms |
9684 KB |
Output is correct |
59 |
Correct |
5 ms |
9684 KB |
Output is correct |
60 |
Correct |
5 ms |
9684 KB |
Output is correct |
61 |
Correct |
5 ms |
9684 KB |
Output is correct |
62 |
Correct |
5 ms |
9712 KB |
Output is correct |
63 |
Correct |
6 ms |
9684 KB |
Output is correct |
64 |
Correct |
7 ms |
9716 KB |
Output is correct |
65 |
Correct |
6 ms |
9684 KB |
Output is correct |
66 |
Correct |
7 ms |
9684 KB |
Output is correct |
67 |
Correct |
6 ms |
9716 KB |
Output is correct |
68 |
Correct |
6 ms |
9752 KB |
Output is correct |
69 |
Correct |
6 ms |
9712 KB |
Output is correct |
70 |
Correct |
5 ms |
9712 KB |
Output is correct |
71 |
Correct |
6 ms |
9684 KB |
Output is correct |
72 |
Correct |
8 ms |
9684 KB |
Output is correct |
73 |
Correct |
6 ms |
9684 KB |
Output is correct |
74 |
Correct |
6 ms |
9720 KB |
Output is correct |
75 |
Correct |
8 ms |
9684 KB |
Output is correct |
76 |
Correct |
6 ms |
9684 KB |
Output is correct |
77 |
Correct |
6 ms |
9716 KB |
Output is correct |
78 |
Correct |
6 ms |
9700 KB |
Output is correct |
79 |
Correct |
6 ms |
9704 KB |
Output is correct |
80 |
Correct |
6 ms |
9720 KB |
Output is correct |
81 |
Correct |
6 ms |
9716 KB |
Output is correct |
82 |
Correct |
6 ms |
9672 KB |
Output is correct |
83 |
Correct |
7 ms |
9684 KB |
Output is correct |
84 |
Correct |
10 ms |
9684 KB |
Output is correct |
85 |
Correct |
7 ms |
9848 KB |
Output is correct |
86 |
Correct |
8 ms |
9976 KB |
Output is correct |
87 |
Correct |
13 ms |
9984 KB |
Output is correct |
88 |
Correct |
9 ms |
9832 KB |
Output is correct |
89 |
Correct |
9 ms |
9920 KB |
Output is correct |
90 |
Correct |
7 ms |
9852 KB |
Output is correct |
91 |
Correct |
26 ms |
13012 KB |
Output is correct |
92 |
Correct |
48 ms |
13456 KB |
Output is correct |
93 |
Correct |
29 ms |
14024 KB |
Output is correct |
94 |
Correct |
8 ms |
9704 KB |
Output is correct |
95 |
Correct |
8 ms |
9760 KB |
Output is correct |
96 |
Correct |
9 ms |
9712 KB |
Output is correct |
97 |
Correct |
12 ms |
9720 KB |
Output is correct |
98 |
Correct |
8 ms |
9756 KB |
Output is correct |
99 |
Correct |
8 ms |
9940 KB |
Output is correct |
100 |
Correct |
8 ms |
10040 KB |
Output is correct |
101 |
Correct |
8 ms |
9940 KB |
Output is correct |
102 |
Correct |
11 ms |
9988 KB |
Output is correct |
103 |
Correct |
10 ms |
9928 KB |
Output is correct |
104 |
Correct |
8 ms |
9940 KB |
Output is correct |
105 |
Correct |
36 ms |
14268 KB |
Output is correct |
106 |
Correct |
32 ms |
14312 KB |
Output is correct |
107 |
Correct |
35 ms |
14284 KB |
Output is correct |
108 |
Correct |
12 ms |
10208 KB |
Output is correct |
109 |
Correct |
283 ms |
10000 KB |
Output is correct |
110 |
Correct |
140 ms |
9968 KB |
Output is correct |
111 |
Correct |
108 ms |
9964 KB |
Output is correct |
112 |
Correct |
147 ms |
10044 KB |
Output is correct |
113 |
Correct |
91 ms |
10060 KB |
Output is correct |
114 |
Correct |
21 ms |
11464 KB |
Output is correct |
115 |
Correct |
21 ms |
11272 KB |
Output is correct |
116 |
Correct |
24 ms |
11764 KB |
Output is correct |
117 |
Correct |
19 ms |
11388 KB |
Output is correct |
118 |
Correct |
21 ms |
11504 KB |
Output is correct |
119 |
Correct |
24 ms |
11188 KB |
Output is correct |
120 |
Correct |
23 ms |
12756 KB |
Output is correct |
121 |
Correct |
12 ms |
10488 KB |
Output is correct |
122 |
Correct |
42 ms |
13080 KB |
Output is correct |
123 |
Correct |
9 ms |
10452 KB |
Output is correct |
124 |
Correct |
31 ms |
13668 KB |
Output is correct |
125 |
Correct |
19 ms |
10828 KB |
Output is correct |
126 |
Correct |
13 ms |
10744 KB |
Output is correct |
127 |
Correct |
16 ms |
10964 KB |
Output is correct |
128 |
Correct |
14 ms |
10580 KB |
Output is correct |
129 |
Correct |
16 ms |
10612 KB |
Output is correct |
130 |
Correct |
11 ms |
10196 KB |
Output is correct |
131 |
Correct |
385 ms |
10328 KB |
Output is correct |
132 |
Correct |
268 ms |
10204 KB |
Output is correct |
133 |
Correct |
226 ms |
10096 KB |
Output is correct |
134 |
Correct |
193 ms |
10136 KB |
Output is correct |
135 |
Correct |
159 ms |
10144 KB |
Output is correct |
136 |
Correct |
39 ms |
12096 KB |
Output is correct |
137 |
Correct |
30 ms |
12108 KB |
Output is correct |
138 |
Correct |
26 ms |
12116 KB |
Output is correct |
139 |
Correct |
24 ms |
12100 KB |
Output is correct |
140 |
Correct |
24 ms |
12148 KB |
Output is correct |
141 |
Correct |
23 ms |
12108 KB |
Output is correct |
142 |
Correct |
41 ms |
14812 KB |
Output is correct |
143 |
Correct |
13 ms |
11092 KB |
Output is correct |
144 |
Correct |
37 ms |
14824 KB |
Output is correct |
145 |
Correct |
21 ms |
11012 KB |
Output is correct |
146 |
Correct |
75 ms |
14844 KB |
Output is correct |
147 |
Correct |
13 ms |
11092 KB |
Output is correct |
148 |
Correct |
15 ms |
11220 KB |
Output is correct |
149 |
Correct |
16 ms |
11132 KB |
Output is correct |
150 |
Correct |
17 ms |
11132 KB |
Output is correct |
151 |
Correct |
14 ms |
11132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
9676 KB |
Output is correct |
2 |
Correct |
6 ms |
9724 KB |
Output is correct |
3 |
Correct |
5 ms |
9684 KB |
Output is correct |
4 |
Correct |
6 ms |
9684 KB |
Output is correct |
5 |
Correct |
9 ms |
9724 KB |
Output is correct |
6 |
Correct |
6 ms |
9684 KB |
Output is correct |
7 |
Correct |
5 ms |
9684 KB |
Output is correct |
8 |
Correct |
5 ms |
9684 KB |
Output is correct |
9 |
Correct |
5 ms |
9684 KB |
Output is correct |
10 |
Correct |
9 ms |
9684 KB |
Output is correct |
11 |
Correct |
7 ms |
9684 KB |
Output is correct |
12 |
Correct |
10 ms |
9684 KB |
Output is correct |
13 |
Correct |
5 ms |
9684 KB |
Output is correct |
14 |
Correct |
5 ms |
9728 KB |
Output is correct |
15 |
Correct |
7 ms |
9684 KB |
Output is correct |
16 |
Correct |
6 ms |
9684 KB |
Output is correct |
17 |
Correct |
5 ms |
9684 KB |
Output is correct |
18 |
Correct |
7 ms |
9684 KB |
Output is correct |
19 |
Correct |
6 ms |
9684 KB |
Output is correct |
20 |
Correct |
6 ms |
9684 KB |
Output is correct |
21 |
Correct |
6 ms |
9684 KB |
Output is correct |
22 |
Correct |
6 ms |
9684 KB |
Output is correct |
23 |
Correct |
6 ms |
9684 KB |
Output is correct |
24 |
Correct |
26 ms |
13556 KB |
Output is correct |
25 |
Correct |
24 ms |
13652 KB |
Output is correct |
26 |
Correct |
24 ms |
13636 KB |
Output is correct |
27 |
Correct |
8 ms |
10068 KB |
Output is correct |
28 |
Correct |
8 ms |
10172 KB |
Output is correct |
29 |
Correct |
7 ms |
9940 KB |
Output is correct |
30 |
Correct |
9 ms |
9920 KB |
Output is correct |
31 |
Correct |
8 ms |
9940 KB |
Output is correct |
32 |
Correct |
8 ms |
9940 KB |
Output is correct |
33 |
Correct |
17 ms |
11092 KB |
Output is correct |
34 |
Correct |
15 ms |
11068 KB |
Output is correct |
35 |
Correct |
14 ms |
11092 KB |
Output is correct |
36 |
Correct |
17 ms |
10996 KB |
Output is correct |
37 |
Correct |
14 ms |
10996 KB |
Output is correct |
38 |
Correct |
14 ms |
11092 KB |
Output is correct |
39 |
Correct |
33 ms |
14036 KB |
Output is correct |
40 |
Correct |
29 ms |
14040 KB |
Output is correct |
41 |
Correct |
30 ms |
14008 KB |
Output is correct |
42 |
Correct |
21 ms |
11472 KB |
Output is correct |
43 |
Correct |
16 ms |
10836 KB |
Output is correct |
44 |
Correct |
21 ms |
11260 KB |
Output is correct |
45 |
Correct |
19 ms |
10620 KB |
Output is correct |
46 |
Correct |
18 ms |
10584 KB |
Output is correct |
47 |
Correct |
24 ms |
11092 KB |
Output is correct |
48 |
Correct |
46 ms |
20544 KB |
Output is correct |
49 |
Correct |
37 ms |
15900 KB |
Output is correct |
50 |
Correct |
34 ms |
18328 KB |
Output is correct |
51 |
Correct |
46 ms |
18612 KB |
Output is correct |
52 |
Correct |
47 ms |
18364 KB |
Output is correct |
53 |
Correct |
56 ms |
16092 KB |
Output is correct |
54 |
Correct |
23 ms |
11808 KB |
Output is correct |
55 |
Correct |
33 ms |
11712 KB |
Output is correct |
56 |
Correct |
21 ms |
11552 KB |
Output is correct |
57 |
Correct |
18 ms |
11092 KB |
Output is correct |
58 |
Correct |
18 ms |
11076 KB |
Output is correct |
59 |
Correct |
20 ms |
11112 KB |
Output is correct |
60 |
Correct |
51 ms |
21512 KB |
Output is correct |
61 |
Correct |
47 ms |
21560 KB |
Output is correct |
62 |
Correct |
52 ms |
21552 KB |
Output is correct |
63 |
Correct |
49 ms |
21536 KB |
Output is correct |
64 |
Correct |
62 ms |
21484 KB |
Output is correct |
65 |
Correct |
58 ms |
21580 KB |
Output is correct |
66 |
Correct |
67 ms |
20544 KB |
Output is correct |
67 |
Correct |
68 ms |
20464 KB |
Output is correct |
68 |
Correct |
71 ms |
20456 KB |
Output is correct |
69 |
Correct |
7 ms |
9684 KB |
Output is correct |
70 |
Correct |
5 ms |
9684 KB |
Output is correct |
71 |
Correct |
5 ms |
9684 KB |
Output is correct |
72 |
Correct |
4 ms |
9720 KB |
Output is correct |
73 |
Correct |
5 ms |
9684 KB |
Output is correct |
74 |
Correct |
5 ms |
9684 KB |
Output is correct |
75 |
Correct |
5 ms |
9684 KB |
Output is correct |
76 |
Correct |
5 ms |
9684 KB |
Output is correct |
77 |
Correct |
8 ms |
9684 KB |
Output is correct |
78 |
Correct |
6 ms |
9684 KB |
Output is correct |
79 |
Correct |
6 ms |
9684 KB |
Output is correct |
80 |
Correct |
5 ms |
9684 KB |
Output is correct |
81 |
Correct |
6 ms |
9684 KB |
Output is correct |
82 |
Correct |
9 ms |
9684 KB |
Output is correct |
83 |
Correct |
9 ms |
9684 KB |
Output is correct |
84 |
Correct |
10 ms |
9684 KB |
Output is correct |
85 |
Correct |
6 ms |
9684 KB |
Output is correct |
86 |
Correct |
5 ms |
9684 KB |
Output is correct |
87 |
Correct |
5 ms |
9684 KB |
Output is correct |
88 |
Correct |
5 ms |
9684 KB |
Output is correct |
89 |
Correct |
5 ms |
9712 KB |
Output is correct |
90 |
Correct |
6 ms |
9684 KB |
Output is correct |
91 |
Correct |
7 ms |
9716 KB |
Output is correct |
92 |
Correct |
6 ms |
9684 KB |
Output is correct |
93 |
Correct |
7 ms |
9684 KB |
Output is correct |
94 |
Correct |
6 ms |
9716 KB |
Output is correct |
95 |
Correct |
6 ms |
9752 KB |
Output is correct |
96 |
Correct |
6 ms |
9712 KB |
Output is correct |
97 |
Correct |
5 ms |
9712 KB |
Output is correct |
98 |
Correct |
6 ms |
9684 KB |
Output is correct |
99 |
Correct |
8 ms |
9684 KB |
Output is correct |
100 |
Correct |
6 ms |
9684 KB |
Output is correct |
101 |
Correct |
6 ms |
9720 KB |
Output is correct |
102 |
Correct |
8 ms |
9684 KB |
Output is correct |
103 |
Correct |
6 ms |
9684 KB |
Output is correct |
104 |
Correct |
6 ms |
9716 KB |
Output is correct |
105 |
Correct |
6 ms |
9700 KB |
Output is correct |
106 |
Correct |
6 ms |
9704 KB |
Output is correct |
107 |
Correct |
6 ms |
9720 KB |
Output is correct |
108 |
Correct |
6 ms |
9716 KB |
Output is correct |
109 |
Correct |
6 ms |
9672 KB |
Output is correct |
110 |
Correct |
7 ms |
9684 KB |
Output is correct |
111 |
Correct |
10 ms |
9684 KB |
Output is correct |
112 |
Correct |
7 ms |
9848 KB |
Output is correct |
113 |
Correct |
8 ms |
9976 KB |
Output is correct |
114 |
Correct |
13 ms |
9984 KB |
Output is correct |
115 |
Correct |
9 ms |
9832 KB |
Output is correct |
116 |
Correct |
9 ms |
9920 KB |
Output is correct |
117 |
Correct |
7 ms |
9852 KB |
Output is correct |
118 |
Correct |
26 ms |
13012 KB |
Output is correct |
119 |
Correct |
48 ms |
13456 KB |
Output is correct |
120 |
Correct |
29 ms |
14024 KB |
Output is correct |
121 |
Correct |
8 ms |
9704 KB |
Output is correct |
122 |
Correct |
8 ms |
9760 KB |
Output is correct |
123 |
Correct |
9 ms |
9712 KB |
Output is correct |
124 |
Correct |
12 ms |
9720 KB |
Output is correct |
125 |
Correct |
8 ms |
9756 KB |
Output is correct |
126 |
Correct |
8 ms |
9940 KB |
Output is correct |
127 |
Correct |
8 ms |
10040 KB |
Output is correct |
128 |
Correct |
8 ms |
9940 KB |
Output is correct |
129 |
Correct |
11 ms |
9988 KB |
Output is correct |
130 |
Correct |
10 ms |
9928 KB |
Output is correct |
131 |
Correct |
8 ms |
9940 KB |
Output is correct |
132 |
Correct |
36 ms |
14268 KB |
Output is correct |
133 |
Correct |
32 ms |
14312 KB |
Output is correct |
134 |
Correct |
35 ms |
14284 KB |
Output is correct |
135 |
Correct |
12 ms |
10208 KB |
Output is correct |
136 |
Correct |
283 ms |
10000 KB |
Output is correct |
137 |
Correct |
140 ms |
9968 KB |
Output is correct |
138 |
Correct |
108 ms |
9964 KB |
Output is correct |
139 |
Correct |
147 ms |
10044 KB |
Output is correct |
140 |
Correct |
91 ms |
10060 KB |
Output is correct |
141 |
Correct |
21 ms |
11464 KB |
Output is correct |
142 |
Correct |
21 ms |
11272 KB |
Output is correct |
143 |
Correct |
24 ms |
11764 KB |
Output is correct |
144 |
Correct |
19 ms |
11388 KB |
Output is correct |
145 |
Correct |
21 ms |
11504 KB |
Output is correct |
146 |
Correct |
24 ms |
11188 KB |
Output is correct |
147 |
Correct |
23 ms |
12756 KB |
Output is correct |
148 |
Correct |
12 ms |
10488 KB |
Output is correct |
149 |
Correct |
42 ms |
13080 KB |
Output is correct |
150 |
Correct |
9 ms |
10452 KB |
Output is correct |
151 |
Correct |
31 ms |
13668 KB |
Output is correct |
152 |
Correct |
19 ms |
10828 KB |
Output is correct |
153 |
Correct |
13 ms |
10744 KB |
Output is correct |
154 |
Correct |
16 ms |
10964 KB |
Output is correct |
155 |
Correct |
14 ms |
10580 KB |
Output is correct |
156 |
Correct |
16 ms |
10612 KB |
Output is correct |
157 |
Correct |
11 ms |
10196 KB |
Output is correct |
158 |
Correct |
385 ms |
10328 KB |
Output is correct |
159 |
Correct |
268 ms |
10204 KB |
Output is correct |
160 |
Correct |
226 ms |
10096 KB |
Output is correct |
161 |
Correct |
193 ms |
10136 KB |
Output is correct |
162 |
Correct |
159 ms |
10144 KB |
Output is correct |
163 |
Correct |
39 ms |
12096 KB |
Output is correct |
164 |
Correct |
30 ms |
12108 KB |
Output is correct |
165 |
Correct |
26 ms |
12116 KB |
Output is correct |
166 |
Correct |
24 ms |
12100 KB |
Output is correct |
167 |
Correct |
24 ms |
12148 KB |
Output is correct |
168 |
Correct |
23 ms |
12108 KB |
Output is correct |
169 |
Correct |
41 ms |
14812 KB |
Output is correct |
170 |
Correct |
13 ms |
11092 KB |
Output is correct |
171 |
Correct |
37 ms |
14824 KB |
Output is correct |
172 |
Correct |
21 ms |
11012 KB |
Output is correct |
173 |
Correct |
75 ms |
14844 KB |
Output is correct |
174 |
Correct |
13 ms |
11092 KB |
Output is correct |
175 |
Correct |
15 ms |
11220 KB |
Output is correct |
176 |
Correct |
16 ms |
11132 KB |
Output is correct |
177 |
Correct |
17 ms |
11132 KB |
Output is correct |
178 |
Correct |
14 ms |
11132 KB |
Output is correct |
179 |
Correct |
16 ms |
10964 KB |
Output is correct |
180 |
Correct |
816 ms |
11008 KB |
Output is correct |
181 |
Correct |
896 ms |
11132 KB |
Output is correct |
182 |
Correct |
1037 ms |
11480 KB |
Output is correct |
183 |
Correct |
555 ms |
10800 KB |
Output is correct |
184 |
Correct |
418 ms |
10700 KB |
Output is correct |
185 |
Correct |
59 ms |
14508 KB |
Output is correct |
186 |
Correct |
32 ms |
15968 KB |
Output is correct |
187 |
Correct |
40 ms |
15312 KB |
Output is correct |
188 |
Correct |
43 ms |
14672 KB |
Output is correct |
189 |
Correct |
48 ms |
15160 KB |
Output is correct |
190 |
Correct |
43 ms |
15708 KB |
Output is correct |
191 |
Correct |
44 ms |
15584 KB |
Output is correct |
192 |
Correct |
57 ms |
13800 KB |
Output is correct |
193 |
Correct |
30 ms |
13548 KB |
Output is correct |
194 |
Correct |
34 ms |
11844 KB |
Output is correct |
195 |
Execution timed out |
1567 ms |
11440 KB |
Time limit exceeded |
196 |
Halted |
0 ms |
0 KB |
- |