#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int nax = 1e5;
const int snax = 1e4;
vector<int> col_to_wall[nax], cand[nax];
vector<bitset<nax/2>>is(snax);
bool good[nax];
bool on[nax];
int minimumInstructions(
int N, int M, int K, vector<int> C,
vector<int> A, vector<vector<int>> B) {
for(int i=0; i<N; ++i) {
col_to_wall[C[i]].push_back(i);
}
for(int i=0; i<M; ++i) {
for(int j=0; j<A[i]; ++j) {
for(int x : col_to_wall[B[i][j]]) {
cand[x].push_back(i);
if(x<snax) is[x][i] = 1;
}
}
}
int prev_succ = -1;
for(int i=0; i<=N-M; ++i) {
int cur_succ = -1;
for(int j : cand[i]) {
int pre_tag = (j-1+M)%M;
bool yasss = true;
if(pre_tag==prev_succ) {
if(i+M-1<snax) {
if(is[i+M-1][pre_tag]) {
cur_succ = j;
break;
} else continue;
} else {
if(binary_search(cand[i+M-1].begin(), cand[i+M-1].end(), pre_tag)) {
cur_succ = j;
break;
} else continue;
}
} else if(on[pre_tag]) {
continue;
}
for(int l=1, cr=j+1; l<M; ++l, ++cr) {
if(cr==M) cr = 0;
if(i+l<snax) yasss &= is[i+l][cr];
else yasss &= binary_search(cand[i+l].begin(), cand[i+l].end(), cr);
if(!yasss) break;
}
if(yasss) {
cur_succ = j;
break;
}
}
if(i) {
for(int x : cand[i-1]) {
if(x==prev_succ) break;
on[x] = 0;
}
}
for(int x : cand[i]) {
if(x==cur_succ) break;
on[x] = 1;
}
prev_succ = cur_succ;
if(cur_succ!=-1) {
good[i] = 1;
}
}
if(!good[0]) return -1;
int last = 0, pending = -1;
int ans = 1;
for(int i=1; i<N; ++i) {
if(good[i]) {
pending = i;
}
if(last+M==i) {
if(pending==-1) return -1;
last = pending;
pending = -1;
++ans;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
66136 KB |
Output is correct |
2 |
Correct |
27 ms |
66132 KB |
Output is correct |
3 |
Correct |
29 ms |
66148 KB |
Output is correct |
4 |
Correct |
29 ms |
66132 KB |
Output is correct |
5 |
Correct |
27 ms |
66124 KB |
Output is correct |
6 |
Correct |
27 ms |
66208 KB |
Output is correct |
7 |
Correct |
27 ms |
66132 KB |
Output is correct |
8 |
Correct |
26 ms |
66196 KB |
Output is correct |
9 |
Correct |
28 ms |
66132 KB |
Output is correct |
10 |
Correct |
27 ms |
66196 KB |
Output is correct |
11 |
Correct |
28 ms |
66372 KB |
Output is correct |
12 |
Correct |
27 ms |
66184 KB |
Output is correct |
13 |
Correct |
26 ms |
66260 KB |
Output is correct |
14 |
Correct |
26 ms |
66264 KB |
Output is correct |
15 |
Correct |
26 ms |
66260 KB |
Output is correct |
16 |
Correct |
29 ms |
66204 KB |
Output is correct |
17 |
Correct |
27 ms |
66180 KB |
Output is correct |
18 |
Correct |
30 ms |
66200 KB |
Output is correct |
19 |
Correct |
26 ms |
66172 KB |
Output is correct |
20 |
Correct |
27 ms |
66188 KB |
Output is correct |
21 |
Correct |
27 ms |
66224 KB |
Output is correct |
22 |
Correct |
36 ms |
66924 KB |
Output is correct |
23 |
Correct |
41 ms |
67028 KB |
Output is correct |
24 |
Correct |
35 ms |
67020 KB |
Output is correct |
25 |
Correct |
30 ms |
67084 KB |
Output is correct |
26 |
Correct |
30 ms |
66996 KB |
Output is correct |
27 |
Correct |
31 ms |
67044 KB |
Output is correct |
28 |
Correct |
31 ms |
67032 KB |
Output is correct |
29 |
Correct |
33 ms |
67088 KB |
Output is correct |
30 |
Correct |
31 ms |
67048 KB |
Output is correct |
31 |
Correct |
37 ms |
67852 KB |
Output is correct |
32 |
Correct |
38 ms |
67880 KB |
Output is correct |
33 |
Correct |
39 ms |
67900 KB |
Output is correct |
34 |
Correct |
39 ms |
67884 KB |
Output is correct |
35 |
Correct |
37 ms |
67936 KB |
Output is correct |
36 |
Correct |
36 ms |
67928 KB |
Output is correct |
37 |
Correct |
44 ms |
68404 KB |
Output is correct |
38 |
Correct |
45 ms |
68400 KB |
Output is correct |
39 |
Correct |
43 ms |
68404 KB |
Output is correct |
40 |
Correct |
39 ms |
70180 KB |
Output is correct |
41 |
Correct |
34 ms |
68808 KB |
Output is correct |
42 |
Correct |
44 ms |
70772 KB |
Output is correct |
43 |
Correct |
41 ms |
69208 KB |
Output is correct |
44 |
Correct |
38 ms |
68940 KB |
Output is correct |
45 |
Correct |
48 ms |
70876 KB |
Output is correct |
46 |
Correct |
74 ms |
79064 KB |
Output is correct |
47 |
Correct |
54 ms |
73672 KB |
Output is correct |
48 |
Correct |
57 ms |
76164 KB |
Output is correct |
49 |
Correct |
68 ms |
75448 KB |
Output is correct |
50 |
Correct |
68 ms |
75468 KB |
Output is correct |
51 |
Correct |
72 ms |
73652 KB |
Output is correct |
52 |
Correct |
42 ms |
70824 KB |
Output is correct |
53 |
Correct |
43 ms |
70808 KB |
Output is correct |
54 |
Correct |
48 ms |
70704 KB |
Output is correct |
55 |
Correct |
46 ms |
70764 KB |
Output is correct |
56 |
Correct |
46 ms |
70744 KB |
Output is correct |
57 |
Correct |
45 ms |
70872 KB |
Output is correct |
58 |
Correct |
73 ms |
80332 KB |
Output is correct |
59 |
Correct |
75 ms |
80300 KB |
Output is correct |
60 |
Correct |
75 ms |
80308 KB |
Output is correct |
61 |
Correct |
82 ms |
80328 KB |
Output is correct |
62 |
Correct |
73 ms |
80316 KB |
Output is correct |
63 |
Correct |
76 ms |
80404 KB |
Output is correct |
64 |
Correct |
86 ms |
78372 KB |
Output is correct |
65 |
Correct |
88 ms |
78468 KB |
Output is correct |
66 |
Correct |
94 ms |
78364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
66136 KB |
Output is correct |
2 |
Correct |
27 ms |
66132 KB |
Output is correct |
3 |
Correct |
29 ms |
66148 KB |
Output is correct |
4 |
Correct |
29 ms |
66132 KB |
Output is correct |
5 |
Correct |
27 ms |
66124 KB |
Output is correct |
6 |
Correct |
27 ms |
66208 KB |
Output is correct |
7 |
Correct |
27 ms |
66132 KB |
Output is correct |
8 |
Correct |
26 ms |
66196 KB |
Output is correct |
9 |
Correct |
28 ms |
66132 KB |
Output is correct |
10 |
Correct |
27 ms |
66196 KB |
Output is correct |
11 |
Correct |
28 ms |
66372 KB |
Output is correct |
12 |
Correct |
27 ms |
66184 KB |
Output is correct |
13 |
Correct |
26 ms |
66260 KB |
Output is correct |
14 |
Correct |
26 ms |
66264 KB |
Output is correct |
15 |
Correct |
26 ms |
66260 KB |
Output is correct |
16 |
Correct |
29 ms |
66204 KB |
Output is correct |
17 |
Correct |
27 ms |
66180 KB |
Output is correct |
18 |
Correct |
30 ms |
66200 KB |
Output is correct |
19 |
Correct |
26 ms |
66172 KB |
Output is correct |
20 |
Correct |
27 ms |
66188 KB |
Output is correct |
21 |
Correct |
27 ms |
66224 KB |
Output is correct |
22 |
Correct |
29 ms |
66132 KB |
Output is correct |
23 |
Correct |
28 ms |
66208 KB |
Output is correct |
24 |
Correct |
28 ms |
66204 KB |
Output is correct |
25 |
Correct |
31 ms |
66204 KB |
Output is correct |
26 |
Correct |
28 ms |
66124 KB |
Output is correct |
27 |
Correct |
32 ms |
66140 KB |
Output is correct |
28 |
Correct |
29 ms |
66260 KB |
Output is correct |
29 |
Correct |
28 ms |
66260 KB |
Output is correct |
30 |
Correct |
28 ms |
66180 KB |
Output is correct |
31 |
Correct |
29 ms |
66140 KB |
Output is correct |
32 |
Correct |
32 ms |
66172 KB |
Output is correct |
33 |
Correct |
33 ms |
66148 KB |
Output is correct |
34 |
Correct |
34 ms |
66252 KB |
Output is correct |
35 |
Correct |
30 ms |
66144 KB |
Output is correct |
36 |
Correct |
29 ms |
66184 KB |
Output is correct |
37 |
Correct |
28 ms |
66160 KB |
Output is correct |
38 |
Correct |
29 ms |
66184 KB |
Output is correct |
39 |
Correct |
28 ms |
66220 KB |
Output is correct |
40 |
Correct |
29 ms |
66172 KB |
Output is correct |
41 |
Correct |
28 ms |
66264 KB |
Output is correct |
42 |
Correct |
29 ms |
66204 KB |
Output is correct |
43 |
Correct |
28 ms |
66236 KB |
Output is correct |
44 |
Correct |
31 ms |
66136 KB |
Output is correct |
45 |
Correct |
30 ms |
66284 KB |
Output is correct |
46 |
Correct |
29 ms |
66220 KB |
Output is correct |
47 |
Correct |
28 ms |
66324 KB |
Output is correct |
48 |
Correct |
27 ms |
66172 KB |
Output is correct |
49 |
Correct |
28 ms |
66172 KB |
Output is correct |
50 |
Correct |
29 ms |
66216 KB |
Output is correct |
51 |
Correct |
28 ms |
66184 KB |
Output is correct |
52 |
Correct |
29 ms |
66164 KB |
Output is correct |
53 |
Correct |
29 ms |
66252 KB |
Output is correct |
54 |
Correct |
29 ms |
66192 KB |
Output is correct |
55 |
Correct |
28 ms |
66148 KB |
Output is correct |
56 |
Correct |
28 ms |
66180 KB |
Output is correct |
57 |
Correct |
28 ms |
66252 KB |
Output is correct |
58 |
Correct |
28 ms |
66244 KB |
Output is correct |
59 |
Correct |
28 ms |
66260 KB |
Output is correct |
60 |
Correct |
28 ms |
66256 KB |
Output is correct |
61 |
Correct |
28 ms |
66196 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
66132 KB |
Output is correct |
2 |
Correct |
28 ms |
66208 KB |
Output is correct |
3 |
Correct |
28 ms |
66136 KB |
Output is correct |
4 |
Correct |
27 ms |
66132 KB |
Output is correct |
5 |
Correct |
29 ms |
66148 KB |
Output is correct |
6 |
Correct |
29 ms |
66132 KB |
Output is correct |
7 |
Correct |
27 ms |
66124 KB |
Output is correct |
8 |
Correct |
27 ms |
66208 KB |
Output is correct |
9 |
Correct |
27 ms |
66132 KB |
Output is correct |
10 |
Correct |
26 ms |
66196 KB |
Output is correct |
11 |
Correct |
28 ms |
66132 KB |
Output is correct |
12 |
Correct |
27 ms |
66196 KB |
Output is correct |
13 |
Correct |
28 ms |
66372 KB |
Output is correct |
14 |
Correct |
27 ms |
66184 KB |
Output is correct |
15 |
Correct |
26 ms |
66260 KB |
Output is correct |
16 |
Correct |
26 ms |
66264 KB |
Output is correct |
17 |
Correct |
26 ms |
66260 KB |
Output is correct |
18 |
Correct |
29 ms |
66204 KB |
Output is correct |
19 |
Correct |
27 ms |
66180 KB |
Output is correct |
20 |
Correct |
30 ms |
66200 KB |
Output is correct |
21 |
Correct |
26 ms |
66172 KB |
Output is correct |
22 |
Correct |
27 ms |
66188 KB |
Output is correct |
23 |
Correct |
27 ms |
66224 KB |
Output is correct |
24 |
Correct |
36 ms |
66924 KB |
Output is correct |
25 |
Correct |
41 ms |
67028 KB |
Output is correct |
26 |
Correct |
35 ms |
67020 KB |
Output is correct |
27 |
Correct |
28 ms |
66204 KB |
Output is correct |
28 |
Correct |
31 ms |
66204 KB |
Output is correct |
29 |
Correct |
28 ms |
66124 KB |
Output is correct |
30 |
Correct |
32 ms |
66140 KB |
Output is correct |
31 |
Correct |
29 ms |
66260 KB |
Output is correct |
32 |
Correct |
28 ms |
66260 KB |
Output is correct |
33 |
Correct |
28 ms |
66180 KB |
Output is correct |
34 |
Correct |
29 ms |
66140 KB |
Output is correct |
35 |
Correct |
32 ms |
66172 KB |
Output is correct |
36 |
Correct |
33 ms |
66148 KB |
Output is correct |
37 |
Correct |
34 ms |
66252 KB |
Output is correct |
38 |
Correct |
30 ms |
66144 KB |
Output is correct |
39 |
Correct |
29 ms |
66184 KB |
Output is correct |
40 |
Correct |
28 ms |
66160 KB |
Output is correct |
41 |
Correct |
29 ms |
66184 KB |
Output is correct |
42 |
Correct |
28 ms |
66220 KB |
Output is correct |
43 |
Correct |
29 ms |
66172 KB |
Output is correct |
44 |
Correct |
28 ms |
66264 KB |
Output is correct |
45 |
Correct |
29 ms |
66204 KB |
Output is correct |
46 |
Correct |
28 ms |
66236 KB |
Output is correct |
47 |
Correct |
31 ms |
66136 KB |
Output is correct |
48 |
Correct |
30 ms |
66284 KB |
Output is correct |
49 |
Correct |
29 ms |
66220 KB |
Output is correct |
50 |
Correct |
28 ms |
66324 KB |
Output is correct |
51 |
Correct |
27 ms |
66172 KB |
Output is correct |
52 |
Correct |
28 ms |
66172 KB |
Output is correct |
53 |
Correct |
29 ms |
66216 KB |
Output is correct |
54 |
Correct |
28 ms |
66184 KB |
Output is correct |
55 |
Correct |
29 ms |
66164 KB |
Output is correct |
56 |
Correct |
29 ms |
66252 KB |
Output is correct |
57 |
Correct |
29 ms |
66192 KB |
Output is correct |
58 |
Correct |
28 ms |
66148 KB |
Output is correct |
59 |
Correct |
28 ms |
66180 KB |
Output is correct |
60 |
Correct |
28 ms |
66252 KB |
Output is correct |
61 |
Correct |
28 ms |
66244 KB |
Output is correct |
62 |
Correct |
28 ms |
66260 KB |
Output is correct |
63 |
Correct |
28 ms |
66256 KB |
Output is correct |
64 |
Correct |
28 ms |
66196 KB |
Output is correct |
65 |
Correct |
28 ms |
66516 KB |
Output is correct |
66 |
Correct |
32 ms |
66364 KB |
Output is correct |
67 |
Correct |
29 ms |
66476 KB |
Output is correct |
68 |
Correct |
35 ms |
66464 KB |
Output is correct |
69 |
Correct |
28 ms |
66444 KB |
Output is correct |
70 |
Correct |
29 ms |
66292 KB |
Output is correct |
71 |
Correct |
29 ms |
66376 KB |
Output is correct |
72 |
Correct |
33 ms |
66328 KB |
Output is correct |
73 |
Correct |
29 ms |
66232 KB |
Output is correct |
74 |
Correct |
32 ms |
66360 KB |
Output is correct |
75 |
Correct |
29 ms |
66316 KB |
Output is correct |
76 |
Correct |
38 ms |
67008 KB |
Output is correct |
77 |
Correct |
39 ms |
67156 KB |
Output is correct |
78 |
Correct |
44 ms |
67320 KB |
Output is correct |
79 |
Correct |
29 ms |
66696 KB |
Output is correct |
80 |
Correct |
28 ms |
66640 KB |
Output is correct |
81 |
Correct |
29 ms |
66788 KB |
Output is correct |
82 |
Correct |
28 ms |
66680 KB |
Output is correct |
83 |
Correct |
29 ms |
66772 KB |
Output is correct |
84 |
Correct |
29 ms |
66440 KB |
Output is correct |
85 |
Correct |
35 ms |
66372 KB |
Output is correct |
86 |
Correct |
30 ms |
66400 KB |
Output is correct |
87 |
Correct |
30 ms |
66504 KB |
Output is correct |
88 |
Correct |
29 ms |
66464 KB |
Output is correct |
89 |
Correct |
29 ms |
66468 KB |
Output is correct |
90 |
Correct |
43 ms |
67440 KB |
Output is correct |
91 |
Correct |
41 ms |
67416 KB |
Output is correct |
92 |
Correct |
42 ms |
67416 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
66132 KB |
Output is correct |
2 |
Correct |
28 ms |
66208 KB |
Output is correct |
3 |
Correct |
28 ms |
66136 KB |
Output is correct |
4 |
Correct |
27 ms |
66132 KB |
Output is correct |
5 |
Correct |
29 ms |
66148 KB |
Output is correct |
6 |
Correct |
29 ms |
66132 KB |
Output is correct |
7 |
Correct |
27 ms |
66124 KB |
Output is correct |
8 |
Correct |
27 ms |
66208 KB |
Output is correct |
9 |
Correct |
27 ms |
66132 KB |
Output is correct |
10 |
Correct |
26 ms |
66196 KB |
Output is correct |
11 |
Correct |
28 ms |
66132 KB |
Output is correct |
12 |
Correct |
27 ms |
66196 KB |
Output is correct |
13 |
Correct |
28 ms |
66372 KB |
Output is correct |
14 |
Correct |
27 ms |
66184 KB |
Output is correct |
15 |
Correct |
26 ms |
66260 KB |
Output is correct |
16 |
Correct |
26 ms |
66264 KB |
Output is correct |
17 |
Correct |
26 ms |
66260 KB |
Output is correct |
18 |
Correct |
29 ms |
66204 KB |
Output is correct |
19 |
Correct |
27 ms |
66180 KB |
Output is correct |
20 |
Correct |
30 ms |
66200 KB |
Output is correct |
21 |
Correct |
26 ms |
66172 KB |
Output is correct |
22 |
Correct |
27 ms |
66188 KB |
Output is correct |
23 |
Correct |
27 ms |
66224 KB |
Output is correct |
24 |
Correct |
36 ms |
66924 KB |
Output is correct |
25 |
Correct |
41 ms |
67028 KB |
Output is correct |
26 |
Correct |
35 ms |
67020 KB |
Output is correct |
27 |
Correct |
30 ms |
67084 KB |
Output is correct |
28 |
Correct |
30 ms |
66996 KB |
Output is correct |
29 |
Correct |
31 ms |
67044 KB |
Output is correct |
30 |
Correct |
31 ms |
67032 KB |
Output is correct |
31 |
Correct |
33 ms |
67088 KB |
Output is correct |
32 |
Correct |
31 ms |
67048 KB |
Output is correct |
33 |
Correct |
37 ms |
67852 KB |
Output is correct |
34 |
Correct |
38 ms |
67880 KB |
Output is correct |
35 |
Correct |
39 ms |
67900 KB |
Output is correct |
36 |
Correct |
39 ms |
67884 KB |
Output is correct |
37 |
Correct |
37 ms |
67936 KB |
Output is correct |
38 |
Correct |
36 ms |
67928 KB |
Output is correct |
39 |
Correct |
44 ms |
68404 KB |
Output is correct |
40 |
Correct |
45 ms |
68400 KB |
Output is correct |
41 |
Correct |
43 ms |
68404 KB |
Output is correct |
42 |
Correct |
28 ms |
66204 KB |
Output is correct |
43 |
Correct |
31 ms |
66204 KB |
Output is correct |
44 |
Correct |
28 ms |
66124 KB |
Output is correct |
45 |
Correct |
32 ms |
66140 KB |
Output is correct |
46 |
Correct |
29 ms |
66260 KB |
Output is correct |
47 |
Correct |
28 ms |
66260 KB |
Output is correct |
48 |
Correct |
28 ms |
66180 KB |
Output is correct |
49 |
Correct |
29 ms |
66140 KB |
Output is correct |
50 |
Correct |
32 ms |
66172 KB |
Output is correct |
51 |
Correct |
33 ms |
66148 KB |
Output is correct |
52 |
Correct |
34 ms |
66252 KB |
Output is correct |
53 |
Correct |
30 ms |
66144 KB |
Output is correct |
54 |
Correct |
29 ms |
66184 KB |
Output is correct |
55 |
Correct |
28 ms |
66160 KB |
Output is correct |
56 |
Correct |
29 ms |
66184 KB |
Output is correct |
57 |
Correct |
28 ms |
66220 KB |
Output is correct |
58 |
Correct |
29 ms |
66172 KB |
Output is correct |
59 |
Correct |
28 ms |
66264 KB |
Output is correct |
60 |
Correct |
29 ms |
66204 KB |
Output is correct |
61 |
Correct |
28 ms |
66236 KB |
Output is correct |
62 |
Correct |
31 ms |
66136 KB |
Output is correct |
63 |
Correct |
30 ms |
66284 KB |
Output is correct |
64 |
Correct |
29 ms |
66220 KB |
Output is correct |
65 |
Correct |
28 ms |
66324 KB |
Output is correct |
66 |
Correct |
27 ms |
66172 KB |
Output is correct |
67 |
Correct |
28 ms |
66172 KB |
Output is correct |
68 |
Correct |
29 ms |
66216 KB |
Output is correct |
69 |
Correct |
28 ms |
66184 KB |
Output is correct |
70 |
Correct |
29 ms |
66164 KB |
Output is correct |
71 |
Correct |
29 ms |
66252 KB |
Output is correct |
72 |
Correct |
29 ms |
66192 KB |
Output is correct |
73 |
Correct |
28 ms |
66148 KB |
Output is correct |
74 |
Correct |
28 ms |
66180 KB |
Output is correct |
75 |
Correct |
28 ms |
66252 KB |
Output is correct |
76 |
Correct |
28 ms |
66244 KB |
Output is correct |
77 |
Correct |
28 ms |
66260 KB |
Output is correct |
78 |
Correct |
28 ms |
66256 KB |
Output is correct |
79 |
Correct |
28 ms |
66196 KB |
Output is correct |
80 |
Correct |
28 ms |
66516 KB |
Output is correct |
81 |
Correct |
32 ms |
66364 KB |
Output is correct |
82 |
Correct |
29 ms |
66476 KB |
Output is correct |
83 |
Correct |
35 ms |
66464 KB |
Output is correct |
84 |
Correct |
28 ms |
66444 KB |
Output is correct |
85 |
Correct |
29 ms |
66292 KB |
Output is correct |
86 |
Correct |
29 ms |
66376 KB |
Output is correct |
87 |
Correct |
33 ms |
66328 KB |
Output is correct |
88 |
Correct |
29 ms |
66232 KB |
Output is correct |
89 |
Correct |
32 ms |
66360 KB |
Output is correct |
90 |
Correct |
29 ms |
66316 KB |
Output is correct |
91 |
Correct |
38 ms |
67008 KB |
Output is correct |
92 |
Correct |
39 ms |
67156 KB |
Output is correct |
93 |
Correct |
44 ms |
67320 KB |
Output is correct |
94 |
Correct |
29 ms |
66696 KB |
Output is correct |
95 |
Correct |
28 ms |
66640 KB |
Output is correct |
96 |
Correct |
29 ms |
66788 KB |
Output is correct |
97 |
Correct |
28 ms |
66680 KB |
Output is correct |
98 |
Correct |
29 ms |
66772 KB |
Output is correct |
99 |
Correct |
29 ms |
66440 KB |
Output is correct |
100 |
Correct |
35 ms |
66372 KB |
Output is correct |
101 |
Correct |
30 ms |
66400 KB |
Output is correct |
102 |
Correct |
30 ms |
66504 KB |
Output is correct |
103 |
Correct |
29 ms |
66464 KB |
Output is correct |
104 |
Correct |
29 ms |
66468 KB |
Output is correct |
105 |
Correct |
43 ms |
67440 KB |
Output is correct |
106 |
Correct |
41 ms |
67416 KB |
Output is correct |
107 |
Correct |
42 ms |
67416 KB |
Output is correct |
108 |
Correct |
31 ms |
67080 KB |
Output is correct |
109 |
Correct |
273 ms |
124968 KB |
Output is correct |
110 |
Correct |
213 ms |
91340 KB |
Output is correct |
111 |
Correct |
169 ms |
89696 KB |
Output is correct |
112 |
Correct |
225 ms |
97656 KB |
Output is correct |
113 |
Correct |
133 ms |
81700 KB |
Output is correct |
114 |
Correct |
45 ms |
67804 KB |
Output is correct |
115 |
Correct |
43 ms |
67660 KB |
Output is correct |
116 |
Correct |
49 ms |
68056 KB |
Output is correct |
117 |
Correct |
42 ms |
67684 KB |
Output is correct |
118 |
Correct |
43 ms |
67912 KB |
Output is correct |
119 |
Correct |
44 ms |
67668 KB |
Output is correct |
120 |
Correct |
42 ms |
67656 KB |
Output is correct |
121 |
Correct |
34 ms |
67148 KB |
Output is correct |
122 |
Correct |
43 ms |
67896 KB |
Output is correct |
123 |
Correct |
38 ms |
66968 KB |
Output is correct |
124 |
Correct |
46 ms |
68300 KB |
Output is correct |
125 |
Correct |
36 ms |
67424 KB |
Output is correct |
126 |
Correct |
37 ms |
67468 KB |
Output is correct |
127 |
Correct |
39 ms |
67748 KB |
Output is correct |
128 |
Correct |
36 ms |
67276 KB |
Output is correct |
129 |
Correct |
37 ms |
67336 KB |
Output is correct |
130 |
Correct |
34 ms |
66992 KB |
Output is correct |
131 |
Correct |
449 ms |
147188 KB |
Output is correct |
132 |
Correct |
445 ms |
106972 KB |
Output is correct |
133 |
Correct |
390 ms |
107084 KB |
Output is correct |
134 |
Correct |
353 ms |
107028 KB |
Output is correct |
135 |
Correct |
312 ms |
103024 KB |
Output is correct |
136 |
Correct |
48 ms |
68400 KB |
Output is correct |
137 |
Correct |
50 ms |
68336 KB |
Output is correct |
138 |
Correct |
57 ms |
68320 KB |
Output is correct |
139 |
Correct |
51 ms |
68428 KB |
Output is correct |
140 |
Correct |
49 ms |
68428 KB |
Output is correct |
141 |
Correct |
51 ms |
68416 KB |
Output is correct |
142 |
Correct |
53 ms |
68744 KB |
Output is correct |
143 |
Correct |
38 ms |
67652 KB |
Output is correct |
144 |
Correct |
52 ms |
68732 KB |
Output is correct |
145 |
Correct |
42 ms |
67680 KB |
Output is correct |
146 |
Correct |
53 ms |
68820 KB |
Output is correct |
147 |
Correct |
44 ms |
67600 KB |
Output is correct |
148 |
Correct |
48 ms |
68044 KB |
Output is correct |
149 |
Correct |
45 ms |
67960 KB |
Output is correct |
150 |
Correct |
42 ms |
67868 KB |
Output is correct |
151 |
Correct |
42 ms |
67876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
66132 KB |
Output is correct |
2 |
Correct |
28 ms |
66208 KB |
Output is correct |
3 |
Correct |
28 ms |
66136 KB |
Output is correct |
4 |
Correct |
27 ms |
66132 KB |
Output is correct |
5 |
Correct |
29 ms |
66148 KB |
Output is correct |
6 |
Correct |
29 ms |
66132 KB |
Output is correct |
7 |
Correct |
27 ms |
66124 KB |
Output is correct |
8 |
Correct |
27 ms |
66208 KB |
Output is correct |
9 |
Correct |
27 ms |
66132 KB |
Output is correct |
10 |
Correct |
26 ms |
66196 KB |
Output is correct |
11 |
Correct |
28 ms |
66132 KB |
Output is correct |
12 |
Correct |
27 ms |
66196 KB |
Output is correct |
13 |
Correct |
28 ms |
66372 KB |
Output is correct |
14 |
Correct |
27 ms |
66184 KB |
Output is correct |
15 |
Correct |
26 ms |
66260 KB |
Output is correct |
16 |
Correct |
26 ms |
66264 KB |
Output is correct |
17 |
Correct |
26 ms |
66260 KB |
Output is correct |
18 |
Correct |
29 ms |
66204 KB |
Output is correct |
19 |
Correct |
27 ms |
66180 KB |
Output is correct |
20 |
Correct |
30 ms |
66200 KB |
Output is correct |
21 |
Correct |
26 ms |
66172 KB |
Output is correct |
22 |
Correct |
27 ms |
66188 KB |
Output is correct |
23 |
Correct |
27 ms |
66224 KB |
Output is correct |
24 |
Correct |
36 ms |
66924 KB |
Output is correct |
25 |
Correct |
41 ms |
67028 KB |
Output is correct |
26 |
Correct |
35 ms |
67020 KB |
Output is correct |
27 |
Correct |
30 ms |
67084 KB |
Output is correct |
28 |
Correct |
30 ms |
66996 KB |
Output is correct |
29 |
Correct |
31 ms |
67044 KB |
Output is correct |
30 |
Correct |
31 ms |
67032 KB |
Output is correct |
31 |
Correct |
33 ms |
67088 KB |
Output is correct |
32 |
Correct |
31 ms |
67048 KB |
Output is correct |
33 |
Correct |
37 ms |
67852 KB |
Output is correct |
34 |
Correct |
38 ms |
67880 KB |
Output is correct |
35 |
Correct |
39 ms |
67900 KB |
Output is correct |
36 |
Correct |
39 ms |
67884 KB |
Output is correct |
37 |
Correct |
37 ms |
67936 KB |
Output is correct |
38 |
Correct |
36 ms |
67928 KB |
Output is correct |
39 |
Correct |
44 ms |
68404 KB |
Output is correct |
40 |
Correct |
45 ms |
68400 KB |
Output is correct |
41 |
Correct |
43 ms |
68404 KB |
Output is correct |
42 |
Correct |
39 ms |
70180 KB |
Output is correct |
43 |
Correct |
34 ms |
68808 KB |
Output is correct |
44 |
Correct |
44 ms |
70772 KB |
Output is correct |
45 |
Correct |
41 ms |
69208 KB |
Output is correct |
46 |
Correct |
38 ms |
68940 KB |
Output is correct |
47 |
Correct |
48 ms |
70876 KB |
Output is correct |
48 |
Correct |
74 ms |
79064 KB |
Output is correct |
49 |
Correct |
54 ms |
73672 KB |
Output is correct |
50 |
Correct |
57 ms |
76164 KB |
Output is correct |
51 |
Correct |
68 ms |
75448 KB |
Output is correct |
52 |
Correct |
68 ms |
75468 KB |
Output is correct |
53 |
Correct |
72 ms |
73652 KB |
Output is correct |
54 |
Correct |
42 ms |
70824 KB |
Output is correct |
55 |
Correct |
43 ms |
70808 KB |
Output is correct |
56 |
Correct |
48 ms |
70704 KB |
Output is correct |
57 |
Correct |
46 ms |
70764 KB |
Output is correct |
58 |
Correct |
46 ms |
70744 KB |
Output is correct |
59 |
Correct |
45 ms |
70872 KB |
Output is correct |
60 |
Correct |
73 ms |
80332 KB |
Output is correct |
61 |
Correct |
75 ms |
80300 KB |
Output is correct |
62 |
Correct |
75 ms |
80308 KB |
Output is correct |
63 |
Correct |
82 ms |
80328 KB |
Output is correct |
64 |
Correct |
73 ms |
80316 KB |
Output is correct |
65 |
Correct |
76 ms |
80404 KB |
Output is correct |
66 |
Correct |
86 ms |
78372 KB |
Output is correct |
67 |
Correct |
88 ms |
78468 KB |
Output is correct |
68 |
Correct |
94 ms |
78364 KB |
Output is correct |
69 |
Correct |
28 ms |
66204 KB |
Output is correct |
70 |
Correct |
31 ms |
66204 KB |
Output is correct |
71 |
Correct |
28 ms |
66124 KB |
Output is correct |
72 |
Correct |
32 ms |
66140 KB |
Output is correct |
73 |
Correct |
29 ms |
66260 KB |
Output is correct |
74 |
Correct |
28 ms |
66260 KB |
Output is correct |
75 |
Correct |
28 ms |
66180 KB |
Output is correct |
76 |
Correct |
29 ms |
66140 KB |
Output is correct |
77 |
Correct |
32 ms |
66172 KB |
Output is correct |
78 |
Correct |
33 ms |
66148 KB |
Output is correct |
79 |
Correct |
34 ms |
66252 KB |
Output is correct |
80 |
Correct |
30 ms |
66144 KB |
Output is correct |
81 |
Correct |
29 ms |
66184 KB |
Output is correct |
82 |
Correct |
28 ms |
66160 KB |
Output is correct |
83 |
Correct |
29 ms |
66184 KB |
Output is correct |
84 |
Correct |
28 ms |
66220 KB |
Output is correct |
85 |
Correct |
29 ms |
66172 KB |
Output is correct |
86 |
Correct |
28 ms |
66264 KB |
Output is correct |
87 |
Correct |
29 ms |
66204 KB |
Output is correct |
88 |
Correct |
28 ms |
66236 KB |
Output is correct |
89 |
Correct |
31 ms |
66136 KB |
Output is correct |
90 |
Correct |
30 ms |
66284 KB |
Output is correct |
91 |
Correct |
29 ms |
66220 KB |
Output is correct |
92 |
Correct |
28 ms |
66324 KB |
Output is correct |
93 |
Correct |
27 ms |
66172 KB |
Output is correct |
94 |
Correct |
28 ms |
66172 KB |
Output is correct |
95 |
Correct |
29 ms |
66216 KB |
Output is correct |
96 |
Correct |
28 ms |
66184 KB |
Output is correct |
97 |
Correct |
29 ms |
66164 KB |
Output is correct |
98 |
Correct |
29 ms |
66252 KB |
Output is correct |
99 |
Correct |
29 ms |
66192 KB |
Output is correct |
100 |
Correct |
28 ms |
66148 KB |
Output is correct |
101 |
Correct |
28 ms |
66180 KB |
Output is correct |
102 |
Correct |
28 ms |
66252 KB |
Output is correct |
103 |
Correct |
28 ms |
66244 KB |
Output is correct |
104 |
Correct |
28 ms |
66260 KB |
Output is correct |
105 |
Correct |
28 ms |
66256 KB |
Output is correct |
106 |
Correct |
28 ms |
66196 KB |
Output is correct |
107 |
Correct |
28 ms |
66516 KB |
Output is correct |
108 |
Correct |
32 ms |
66364 KB |
Output is correct |
109 |
Correct |
29 ms |
66476 KB |
Output is correct |
110 |
Correct |
35 ms |
66464 KB |
Output is correct |
111 |
Correct |
28 ms |
66444 KB |
Output is correct |
112 |
Correct |
29 ms |
66292 KB |
Output is correct |
113 |
Correct |
29 ms |
66376 KB |
Output is correct |
114 |
Correct |
33 ms |
66328 KB |
Output is correct |
115 |
Correct |
29 ms |
66232 KB |
Output is correct |
116 |
Correct |
32 ms |
66360 KB |
Output is correct |
117 |
Correct |
29 ms |
66316 KB |
Output is correct |
118 |
Correct |
38 ms |
67008 KB |
Output is correct |
119 |
Correct |
39 ms |
67156 KB |
Output is correct |
120 |
Correct |
44 ms |
67320 KB |
Output is correct |
121 |
Correct |
29 ms |
66696 KB |
Output is correct |
122 |
Correct |
28 ms |
66640 KB |
Output is correct |
123 |
Correct |
29 ms |
66788 KB |
Output is correct |
124 |
Correct |
28 ms |
66680 KB |
Output is correct |
125 |
Correct |
29 ms |
66772 KB |
Output is correct |
126 |
Correct |
29 ms |
66440 KB |
Output is correct |
127 |
Correct |
35 ms |
66372 KB |
Output is correct |
128 |
Correct |
30 ms |
66400 KB |
Output is correct |
129 |
Correct |
30 ms |
66504 KB |
Output is correct |
130 |
Correct |
29 ms |
66464 KB |
Output is correct |
131 |
Correct |
29 ms |
66468 KB |
Output is correct |
132 |
Correct |
43 ms |
67440 KB |
Output is correct |
133 |
Correct |
41 ms |
67416 KB |
Output is correct |
134 |
Correct |
42 ms |
67416 KB |
Output is correct |
135 |
Correct |
31 ms |
67080 KB |
Output is correct |
136 |
Correct |
273 ms |
124968 KB |
Output is correct |
137 |
Correct |
213 ms |
91340 KB |
Output is correct |
138 |
Correct |
169 ms |
89696 KB |
Output is correct |
139 |
Correct |
225 ms |
97656 KB |
Output is correct |
140 |
Correct |
133 ms |
81700 KB |
Output is correct |
141 |
Correct |
45 ms |
67804 KB |
Output is correct |
142 |
Correct |
43 ms |
67660 KB |
Output is correct |
143 |
Correct |
49 ms |
68056 KB |
Output is correct |
144 |
Correct |
42 ms |
67684 KB |
Output is correct |
145 |
Correct |
43 ms |
67912 KB |
Output is correct |
146 |
Correct |
44 ms |
67668 KB |
Output is correct |
147 |
Correct |
42 ms |
67656 KB |
Output is correct |
148 |
Correct |
34 ms |
67148 KB |
Output is correct |
149 |
Correct |
43 ms |
67896 KB |
Output is correct |
150 |
Correct |
38 ms |
66968 KB |
Output is correct |
151 |
Correct |
46 ms |
68300 KB |
Output is correct |
152 |
Correct |
36 ms |
67424 KB |
Output is correct |
153 |
Correct |
37 ms |
67468 KB |
Output is correct |
154 |
Correct |
39 ms |
67748 KB |
Output is correct |
155 |
Correct |
36 ms |
67276 KB |
Output is correct |
156 |
Correct |
37 ms |
67336 KB |
Output is correct |
157 |
Correct |
34 ms |
66992 KB |
Output is correct |
158 |
Correct |
449 ms |
147188 KB |
Output is correct |
159 |
Correct |
445 ms |
106972 KB |
Output is correct |
160 |
Correct |
390 ms |
107084 KB |
Output is correct |
161 |
Correct |
353 ms |
107028 KB |
Output is correct |
162 |
Correct |
312 ms |
103024 KB |
Output is correct |
163 |
Correct |
48 ms |
68400 KB |
Output is correct |
164 |
Correct |
50 ms |
68336 KB |
Output is correct |
165 |
Correct |
57 ms |
68320 KB |
Output is correct |
166 |
Correct |
51 ms |
68428 KB |
Output is correct |
167 |
Correct |
49 ms |
68428 KB |
Output is correct |
168 |
Correct |
51 ms |
68416 KB |
Output is correct |
169 |
Correct |
53 ms |
68744 KB |
Output is correct |
170 |
Correct |
38 ms |
67652 KB |
Output is correct |
171 |
Correct |
52 ms |
68732 KB |
Output is correct |
172 |
Correct |
42 ms |
67680 KB |
Output is correct |
173 |
Correct |
53 ms |
68820 KB |
Output is correct |
174 |
Correct |
44 ms |
67600 KB |
Output is correct |
175 |
Correct |
48 ms |
68044 KB |
Output is correct |
176 |
Correct |
45 ms |
67960 KB |
Output is correct |
177 |
Correct |
42 ms |
67868 KB |
Output is correct |
178 |
Correct |
42 ms |
67876 KB |
Output is correct |
179 |
Correct |
40 ms |
69064 KB |
Output is correct |
180 |
Correct |
1004 ms |
172464 KB |
Output is correct |
181 |
Execution timed out |
1574 ms |
219572 KB |
Time limit exceeded |
182 |
Halted |
0 ms |
0 KB |
- |