#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> lseg[200100];
vector<int> liked_by[200100];
int dp[200100]{}, valid_i[200100]{};
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++)
lseg[i].clear(),dp[i]=valid_i[i]=0;
for(int i = 0; i < K; i++) liked_by[i].clear();
multiset<int> st;
for(int i = 0; i < M; i++)
for(int color: B[i])
liked_by[color].push_back(i);
for(int i = N; i--;) {
for(auto j: liked_by[C[i]]) {
lseg[i][j] = 1+lseg[i+1][(j+1)%M];
if(lseg[i][j]>=M) valid_i[i]=1;
}
lseg[i+1].clear();
}
for(int i = 0; i < M; i++) st.insert(0);
for(int i = N; i--;) {
dp[i]=1e9;
if(valid_i[i])
dp[i] = 1+*st.begin();
st.insert(dp[i]);
st.erase(st.find(dp[i+M]));
}
return (dp[0]<1e9?dp[0]:-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15956 KB |
Output is correct |
2 |
Correct |
8 ms |
15884 KB |
Output is correct |
3 |
Correct |
8 ms |
15956 KB |
Output is correct |
4 |
Correct |
8 ms |
15956 KB |
Output is correct |
5 |
Correct |
8 ms |
15856 KB |
Output is correct |
6 |
Correct |
9 ms |
15956 KB |
Output is correct |
7 |
Correct |
9 ms |
15988 KB |
Output is correct |
8 |
Correct |
9 ms |
15964 KB |
Output is correct |
9 |
Correct |
8 ms |
15956 KB |
Output is correct |
10 |
Correct |
8 ms |
15956 KB |
Output is correct |
11 |
Correct |
8 ms |
15980 KB |
Output is correct |
12 |
Correct |
8 ms |
15956 KB |
Output is correct |
13 |
Correct |
8 ms |
16084 KB |
Output is correct |
14 |
Correct |
9 ms |
16032 KB |
Output is correct |
15 |
Correct |
8 ms |
15976 KB |
Output is correct |
16 |
Correct |
9 ms |
16080 KB |
Output is correct |
17 |
Correct |
8 ms |
16084 KB |
Output is correct |
18 |
Correct |
8 ms |
16084 KB |
Output is correct |
19 |
Correct |
9 ms |
15956 KB |
Output is correct |
20 |
Correct |
9 ms |
15956 KB |
Output is correct |
21 |
Correct |
9 ms |
15956 KB |
Output is correct |
22 |
Correct |
25 ms |
19976 KB |
Output is correct |
23 |
Correct |
24 ms |
19924 KB |
Output is correct |
24 |
Correct |
21 ms |
19924 KB |
Output is correct |
25 |
Correct |
14 ms |
18388 KB |
Output is correct |
26 |
Correct |
15 ms |
18516 KB |
Output is correct |
27 |
Correct |
15 ms |
18392 KB |
Output is correct |
28 |
Correct |
15 ms |
18388 KB |
Output is correct |
29 |
Correct |
15 ms |
18420 KB |
Output is correct |
30 |
Correct |
15 ms |
18416 KB |
Output is correct |
31 |
Correct |
19 ms |
19716 KB |
Output is correct |
32 |
Correct |
20 ms |
19708 KB |
Output is correct |
33 |
Correct |
20 ms |
19700 KB |
Output is correct |
34 |
Correct |
26 ms |
19660 KB |
Output is correct |
35 |
Correct |
24 ms |
19632 KB |
Output is correct |
36 |
Correct |
19 ms |
19668 KB |
Output is correct |
37 |
Correct |
30 ms |
23156 KB |
Output is correct |
38 |
Correct |
29 ms |
23076 KB |
Output is correct |
39 |
Correct |
29 ms |
23136 KB |
Output is correct |
40 |
Correct |
39 ms |
27440 KB |
Output is correct |
41 |
Correct |
24 ms |
23132 KB |
Output is correct |
42 |
Correct |
42 ms |
28412 KB |
Output is correct |
43 |
Correct |
32 ms |
24276 KB |
Output is correct |
44 |
Correct |
28 ms |
23408 KB |
Output is correct |
45 |
Correct |
40 ms |
28620 KB |
Output is correct |
46 |
Correct |
79 ms |
37996 KB |
Output is correct |
47 |
Correct |
60 ms |
29132 KB |
Output is correct |
48 |
Correct |
63 ms |
32716 KB |
Output is correct |
49 |
Correct |
63 ms |
33004 KB |
Output is correct |
50 |
Correct |
66 ms |
33524 KB |
Output is correct |
51 |
Correct |
59 ms |
31148 KB |
Output is correct |
52 |
Correct |
38 ms |
28688 KB |
Output is correct |
53 |
Correct |
40 ms |
28588 KB |
Output is correct |
54 |
Correct |
42 ms |
28608 KB |
Output is correct |
55 |
Correct |
41 ms |
28748 KB |
Output is correct |
56 |
Correct |
40 ms |
28588 KB |
Output is correct |
57 |
Correct |
47 ms |
28596 KB |
Output is correct |
58 |
Correct |
90 ms |
40356 KB |
Output is correct |
59 |
Correct |
84 ms |
40232 KB |
Output is correct |
60 |
Correct |
94 ms |
40300 KB |
Output is correct |
61 |
Correct |
83 ms |
40236 KB |
Output is correct |
62 |
Correct |
101 ms |
40340 KB |
Output is correct |
63 |
Correct |
86 ms |
40300 KB |
Output is correct |
64 |
Correct |
88 ms |
39236 KB |
Output is correct |
65 |
Correct |
111 ms |
39172 KB |
Output is correct |
66 |
Correct |
101 ms |
39176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15956 KB |
Output is correct |
2 |
Correct |
8 ms |
15884 KB |
Output is correct |
3 |
Correct |
8 ms |
15956 KB |
Output is correct |
4 |
Correct |
8 ms |
15956 KB |
Output is correct |
5 |
Correct |
8 ms |
15856 KB |
Output is correct |
6 |
Correct |
9 ms |
15956 KB |
Output is correct |
7 |
Correct |
9 ms |
15988 KB |
Output is correct |
8 |
Correct |
9 ms |
15964 KB |
Output is correct |
9 |
Correct |
8 ms |
15956 KB |
Output is correct |
10 |
Correct |
8 ms |
15956 KB |
Output is correct |
11 |
Correct |
8 ms |
15980 KB |
Output is correct |
12 |
Correct |
8 ms |
15956 KB |
Output is correct |
13 |
Correct |
8 ms |
16084 KB |
Output is correct |
14 |
Correct |
9 ms |
16032 KB |
Output is correct |
15 |
Correct |
8 ms |
15976 KB |
Output is correct |
16 |
Correct |
9 ms |
16080 KB |
Output is correct |
17 |
Correct |
8 ms |
16084 KB |
Output is correct |
18 |
Correct |
8 ms |
16084 KB |
Output is correct |
19 |
Correct |
9 ms |
15956 KB |
Output is correct |
20 |
Correct |
9 ms |
15956 KB |
Output is correct |
21 |
Correct |
9 ms |
15956 KB |
Output is correct |
22 |
Correct |
8 ms |
15956 KB |
Output is correct |
23 |
Correct |
9 ms |
15956 KB |
Output is correct |
24 |
Correct |
8 ms |
15976 KB |
Output is correct |
25 |
Correct |
8 ms |
15904 KB |
Output is correct |
26 |
Correct |
8 ms |
15956 KB |
Output is correct |
27 |
Correct |
8 ms |
15984 KB |
Output is correct |
28 |
Correct |
8 ms |
15956 KB |
Output is correct |
29 |
Correct |
9 ms |
15956 KB |
Output is correct |
30 |
Correct |
8 ms |
15956 KB |
Output is correct |
31 |
Correct |
11 ms |
15992 KB |
Output is correct |
32 |
Correct |
8 ms |
15956 KB |
Output is correct |
33 |
Correct |
10 ms |
15992 KB |
Output is correct |
34 |
Correct |
9 ms |
15956 KB |
Output is correct |
35 |
Correct |
9 ms |
15956 KB |
Output is correct |
36 |
Correct |
8 ms |
15952 KB |
Output is correct |
37 |
Correct |
8 ms |
15956 KB |
Output is correct |
38 |
Correct |
8 ms |
16016 KB |
Output is correct |
39 |
Correct |
9 ms |
15964 KB |
Output is correct |
40 |
Correct |
8 ms |
15956 KB |
Output is correct |
41 |
Correct |
8 ms |
15956 KB |
Output is correct |
42 |
Correct |
8 ms |
15948 KB |
Output is correct |
43 |
Correct |
8 ms |
15956 KB |
Output is correct |
44 |
Correct |
8 ms |
16032 KB |
Output is correct |
45 |
Correct |
9 ms |
16200 KB |
Output is correct |
46 |
Correct |
11 ms |
16176 KB |
Output is correct |
47 |
Correct |
9 ms |
16148 KB |
Output is correct |
48 |
Correct |
9 ms |
16084 KB |
Output is correct |
49 |
Correct |
9 ms |
16012 KB |
Output is correct |
50 |
Correct |
8 ms |
16020 KB |
Output is correct |
51 |
Correct |
8 ms |
15956 KB |
Output is correct |
52 |
Correct |
8 ms |
16084 KB |
Output is correct |
53 |
Correct |
8 ms |
16052 KB |
Output is correct |
54 |
Correct |
8 ms |
16032 KB |
Output is correct |
55 |
Correct |
10 ms |
16084 KB |
Output is correct |
56 |
Correct |
8 ms |
15956 KB |
Output is correct |
57 |
Correct |
8 ms |
16056 KB |
Output is correct |
58 |
Correct |
8 ms |
15992 KB |
Output is correct |
59 |
Correct |
8 ms |
16004 KB |
Output is correct |
60 |
Correct |
10 ms |
15976 KB |
Output is correct |
61 |
Correct |
8 ms |
15956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15956 KB |
Output is correct |
2 |
Correct |
9 ms |
15956 KB |
Output is correct |
3 |
Correct |
8 ms |
15956 KB |
Output is correct |
4 |
Correct |
8 ms |
15884 KB |
Output is correct |
5 |
Correct |
8 ms |
15956 KB |
Output is correct |
6 |
Correct |
8 ms |
15956 KB |
Output is correct |
7 |
Correct |
8 ms |
15856 KB |
Output is correct |
8 |
Correct |
9 ms |
15956 KB |
Output is correct |
9 |
Correct |
9 ms |
15988 KB |
Output is correct |
10 |
Correct |
9 ms |
15964 KB |
Output is correct |
11 |
Correct |
8 ms |
15956 KB |
Output is correct |
12 |
Correct |
8 ms |
15956 KB |
Output is correct |
13 |
Correct |
8 ms |
15980 KB |
Output is correct |
14 |
Correct |
8 ms |
15956 KB |
Output is correct |
15 |
Correct |
8 ms |
16084 KB |
Output is correct |
16 |
Correct |
9 ms |
16032 KB |
Output is correct |
17 |
Correct |
8 ms |
15976 KB |
Output is correct |
18 |
Correct |
9 ms |
16080 KB |
Output is correct |
19 |
Correct |
8 ms |
16084 KB |
Output is correct |
20 |
Correct |
8 ms |
16084 KB |
Output is correct |
21 |
Correct |
9 ms |
15956 KB |
Output is correct |
22 |
Correct |
9 ms |
15956 KB |
Output is correct |
23 |
Correct |
9 ms |
15956 KB |
Output is correct |
24 |
Correct |
25 ms |
19976 KB |
Output is correct |
25 |
Correct |
24 ms |
19924 KB |
Output is correct |
26 |
Correct |
21 ms |
19924 KB |
Output is correct |
27 |
Correct |
8 ms |
15976 KB |
Output is correct |
28 |
Correct |
8 ms |
15904 KB |
Output is correct |
29 |
Correct |
8 ms |
15956 KB |
Output is correct |
30 |
Correct |
8 ms |
15984 KB |
Output is correct |
31 |
Correct |
8 ms |
15956 KB |
Output is correct |
32 |
Correct |
9 ms |
15956 KB |
Output is correct |
33 |
Correct |
8 ms |
15956 KB |
Output is correct |
34 |
Correct |
11 ms |
15992 KB |
Output is correct |
35 |
Correct |
8 ms |
15956 KB |
Output is correct |
36 |
Correct |
10 ms |
15992 KB |
Output is correct |
37 |
Correct |
9 ms |
15956 KB |
Output is correct |
38 |
Correct |
9 ms |
15956 KB |
Output is correct |
39 |
Correct |
8 ms |
15952 KB |
Output is correct |
40 |
Correct |
8 ms |
15956 KB |
Output is correct |
41 |
Correct |
8 ms |
16016 KB |
Output is correct |
42 |
Correct |
9 ms |
15964 KB |
Output is correct |
43 |
Correct |
8 ms |
15956 KB |
Output is correct |
44 |
Correct |
8 ms |
15956 KB |
Output is correct |
45 |
Correct |
8 ms |
15948 KB |
Output is correct |
46 |
Correct |
8 ms |
15956 KB |
Output is correct |
47 |
Correct |
8 ms |
16032 KB |
Output is correct |
48 |
Correct |
9 ms |
16200 KB |
Output is correct |
49 |
Correct |
11 ms |
16176 KB |
Output is correct |
50 |
Correct |
9 ms |
16148 KB |
Output is correct |
51 |
Correct |
9 ms |
16084 KB |
Output is correct |
52 |
Correct |
9 ms |
16012 KB |
Output is correct |
53 |
Correct |
8 ms |
16020 KB |
Output is correct |
54 |
Correct |
8 ms |
15956 KB |
Output is correct |
55 |
Correct |
8 ms |
16084 KB |
Output is correct |
56 |
Correct |
8 ms |
16052 KB |
Output is correct |
57 |
Correct |
8 ms |
16032 KB |
Output is correct |
58 |
Correct |
10 ms |
16084 KB |
Output is correct |
59 |
Correct |
8 ms |
15956 KB |
Output is correct |
60 |
Correct |
8 ms |
16056 KB |
Output is correct |
61 |
Correct |
8 ms |
15992 KB |
Output is correct |
62 |
Correct |
8 ms |
16004 KB |
Output is correct |
63 |
Correct |
10 ms |
15976 KB |
Output is correct |
64 |
Correct |
8 ms |
15956 KB |
Output is correct |
65 |
Correct |
10 ms |
16468 KB |
Output is correct |
66 |
Correct |
9 ms |
16212 KB |
Output is correct |
67 |
Correct |
12 ms |
16468 KB |
Output is correct |
68 |
Correct |
10 ms |
16468 KB |
Output is correct |
69 |
Correct |
11 ms |
16404 KB |
Output is correct |
70 |
Correct |
12 ms |
16180 KB |
Output is correct |
71 |
Correct |
13 ms |
16180 KB |
Output is correct |
72 |
Correct |
10 ms |
16232 KB |
Output is correct |
73 |
Correct |
9 ms |
16084 KB |
Output is correct |
74 |
Correct |
10 ms |
16212 KB |
Output is correct |
75 |
Correct |
10 ms |
16084 KB |
Output is correct |
76 |
Correct |
20 ms |
18580 KB |
Output is correct |
77 |
Correct |
20 ms |
19028 KB |
Output is correct |
78 |
Correct |
23 ms |
19500 KB |
Output is correct |
79 |
Correct |
13 ms |
16980 KB |
Output is correct |
80 |
Correct |
13 ms |
17044 KB |
Output is correct |
81 |
Correct |
14 ms |
17032 KB |
Output is correct |
82 |
Correct |
14 ms |
16936 KB |
Output is correct |
83 |
Correct |
14 ms |
17044 KB |
Output is correct |
84 |
Correct |
10 ms |
16212 KB |
Output is correct |
85 |
Correct |
11 ms |
16212 KB |
Output is correct |
86 |
Correct |
11 ms |
16312 KB |
Output is correct |
87 |
Correct |
10 ms |
16224 KB |
Output is correct |
88 |
Correct |
12 ms |
16308 KB |
Output is correct |
89 |
Correct |
9 ms |
16212 KB |
Output is correct |
90 |
Correct |
25 ms |
19664 KB |
Output is correct |
91 |
Correct |
26 ms |
19784 KB |
Output is correct |
92 |
Correct |
25 ms |
19796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15956 KB |
Output is correct |
2 |
Correct |
9 ms |
15956 KB |
Output is correct |
3 |
Correct |
8 ms |
15956 KB |
Output is correct |
4 |
Correct |
8 ms |
15884 KB |
Output is correct |
5 |
Correct |
8 ms |
15956 KB |
Output is correct |
6 |
Correct |
8 ms |
15956 KB |
Output is correct |
7 |
Correct |
8 ms |
15856 KB |
Output is correct |
8 |
Correct |
9 ms |
15956 KB |
Output is correct |
9 |
Correct |
9 ms |
15988 KB |
Output is correct |
10 |
Correct |
9 ms |
15964 KB |
Output is correct |
11 |
Correct |
8 ms |
15956 KB |
Output is correct |
12 |
Correct |
8 ms |
15956 KB |
Output is correct |
13 |
Correct |
8 ms |
15980 KB |
Output is correct |
14 |
Correct |
8 ms |
15956 KB |
Output is correct |
15 |
Correct |
8 ms |
16084 KB |
Output is correct |
16 |
Correct |
9 ms |
16032 KB |
Output is correct |
17 |
Correct |
8 ms |
15976 KB |
Output is correct |
18 |
Correct |
9 ms |
16080 KB |
Output is correct |
19 |
Correct |
8 ms |
16084 KB |
Output is correct |
20 |
Correct |
8 ms |
16084 KB |
Output is correct |
21 |
Correct |
9 ms |
15956 KB |
Output is correct |
22 |
Correct |
9 ms |
15956 KB |
Output is correct |
23 |
Correct |
9 ms |
15956 KB |
Output is correct |
24 |
Correct |
25 ms |
19976 KB |
Output is correct |
25 |
Correct |
24 ms |
19924 KB |
Output is correct |
26 |
Correct |
21 ms |
19924 KB |
Output is correct |
27 |
Correct |
14 ms |
18388 KB |
Output is correct |
28 |
Correct |
15 ms |
18516 KB |
Output is correct |
29 |
Correct |
15 ms |
18392 KB |
Output is correct |
30 |
Correct |
15 ms |
18388 KB |
Output is correct |
31 |
Correct |
15 ms |
18420 KB |
Output is correct |
32 |
Correct |
15 ms |
18416 KB |
Output is correct |
33 |
Correct |
19 ms |
19716 KB |
Output is correct |
34 |
Correct |
20 ms |
19708 KB |
Output is correct |
35 |
Correct |
20 ms |
19700 KB |
Output is correct |
36 |
Correct |
26 ms |
19660 KB |
Output is correct |
37 |
Correct |
24 ms |
19632 KB |
Output is correct |
38 |
Correct |
19 ms |
19668 KB |
Output is correct |
39 |
Correct |
30 ms |
23156 KB |
Output is correct |
40 |
Correct |
29 ms |
23076 KB |
Output is correct |
41 |
Correct |
29 ms |
23136 KB |
Output is correct |
42 |
Correct |
8 ms |
15976 KB |
Output is correct |
43 |
Correct |
8 ms |
15904 KB |
Output is correct |
44 |
Correct |
8 ms |
15956 KB |
Output is correct |
45 |
Correct |
8 ms |
15984 KB |
Output is correct |
46 |
Correct |
8 ms |
15956 KB |
Output is correct |
47 |
Correct |
9 ms |
15956 KB |
Output is correct |
48 |
Correct |
8 ms |
15956 KB |
Output is correct |
49 |
Correct |
11 ms |
15992 KB |
Output is correct |
50 |
Correct |
8 ms |
15956 KB |
Output is correct |
51 |
Correct |
10 ms |
15992 KB |
Output is correct |
52 |
Correct |
9 ms |
15956 KB |
Output is correct |
53 |
Correct |
9 ms |
15956 KB |
Output is correct |
54 |
Correct |
8 ms |
15952 KB |
Output is correct |
55 |
Correct |
8 ms |
15956 KB |
Output is correct |
56 |
Correct |
8 ms |
16016 KB |
Output is correct |
57 |
Correct |
9 ms |
15964 KB |
Output is correct |
58 |
Correct |
8 ms |
15956 KB |
Output is correct |
59 |
Correct |
8 ms |
15956 KB |
Output is correct |
60 |
Correct |
8 ms |
15948 KB |
Output is correct |
61 |
Correct |
8 ms |
15956 KB |
Output is correct |
62 |
Correct |
8 ms |
16032 KB |
Output is correct |
63 |
Correct |
9 ms |
16200 KB |
Output is correct |
64 |
Correct |
11 ms |
16176 KB |
Output is correct |
65 |
Correct |
9 ms |
16148 KB |
Output is correct |
66 |
Correct |
9 ms |
16084 KB |
Output is correct |
67 |
Correct |
9 ms |
16012 KB |
Output is correct |
68 |
Correct |
8 ms |
16020 KB |
Output is correct |
69 |
Correct |
8 ms |
15956 KB |
Output is correct |
70 |
Correct |
8 ms |
16084 KB |
Output is correct |
71 |
Correct |
8 ms |
16052 KB |
Output is correct |
72 |
Correct |
8 ms |
16032 KB |
Output is correct |
73 |
Correct |
10 ms |
16084 KB |
Output is correct |
74 |
Correct |
8 ms |
15956 KB |
Output is correct |
75 |
Correct |
8 ms |
16056 KB |
Output is correct |
76 |
Correct |
8 ms |
15992 KB |
Output is correct |
77 |
Correct |
8 ms |
16004 KB |
Output is correct |
78 |
Correct |
10 ms |
15976 KB |
Output is correct |
79 |
Correct |
8 ms |
15956 KB |
Output is correct |
80 |
Correct |
10 ms |
16468 KB |
Output is correct |
81 |
Correct |
9 ms |
16212 KB |
Output is correct |
82 |
Correct |
12 ms |
16468 KB |
Output is correct |
83 |
Correct |
10 ms |
16468 KB |
Output is correct |
84 |
Correct |
11 ms |
16404 KB |
Output is correct |
85 |
Correct |
12 ms |
16180 KB |
Output is correct |
86 |
Correct |
13 ms |
16180 KB |
Output is correct |
87 |
Correct |
10 ms |
16232 KB |
Output is correct |
88 |
Correct |
9 ms |
16084 KB |
Output is correct |
89 |
Correct |
10 ms |
16212 KB |
Output is correct |
90 |
Correct |
10 ms |
16084 KB |
Output is correct |
91 |
Correct |
20 ms |
18580 KB |
Output is correct |
92 |
Correct |
20 ms |
19028 KB |
Output is correct |
93 |
Correct |
23 ms |
19500 KB |
Output is correct |
94 |
Correct |
13 ms |
16980 KB |
Output is correct |
95 |
Correct |
13 ms |
17044 KB |
Output is correct |
96 |
Correct |
14 ms |
17032 KB |
Output is correct |
97 |
Correct |
14 ms |
16936 KB |
Output is correct |
98 |
Correct |
14 ms |
17044 KB |
Output is correct |
99 |
Correct |
10 ms |
16212 KB |
Output is correct |
100 |
Correct |
11 ms |
16212 KB |
Output is correct |
101 |
Correct |
11 ms |
16312 KB |
Output is correct |
102 |
Correct |
10 ms |
16224 KB |
Output is correct |
103 |
Correct |
12 ms |
16308 KB |
Output is correct |
104 |
Correct |
9 ms |
16212 KB |
Output is correct |
105 |
Correct |
25 ms |
19664 KB |
Output is correct |
106 |
Correct |
26 ms |
19784 KB |
Output is correct |
107 |
Correct |
25 ms |
19796 KB |
Output is correct |
108 |
Correct |
17 ms |
18388 KB |
Output is correct |
109 |
Correct |
543 ms |
142308 KB |
Output is correct |
110 |
Correct |
483 ms |
123012 KB |
Output is correct |
111 |
Correct |
374 ms |
65160 KB |
Output is correct |
112 |
Correct |
419 ms |
81600 KB |
Output is correct |
113 |
Correct |
370 ms |
61960 KB |
Output is correct |
114 |
Correct |
22 ms |
18804 KB |
Output is correct |
115 |
Correct |
22 ms |
18540 KB |
Output is correct |
116 |
Correct |
23 ms |
19924 KB |
Output is correct |
117 |
Correct |
20 ms |
18812 KB |
Output is correct |
118 |
Correct |
22 ms |
19064 KB |
Output is correct |
119 |
Correct |
25 ms |
19004 KB |
Output is correct |
120 |
Correct |
26 ms |
20352 KB |
Output is correct |
121 |
Correct |
15 ms |
18132 KB |
Output is correct |
122 |
Correct |
31 ms |
20372 KB |
Output is correct |
123 |
Correct |
17 ms |
17920 KB |
Output is correct |
124 |
Correct |
32 ms |
21716 KB |
Output is correct |
125 |
Correct |
19 ms |
18924 KB |
Output is correct |
126 |
Correct |
15 ms |
18672 KB |
Output is correct |
127 |
Correct |
18 ms |
19440 KB |
Output is correct |
128 |
Correct |
15 ms |
18412 KB |
Output is correct |
129 |
Correct |
16 ms |
18540 KB |
Output is correct |
130 |
Correct |
15 ms |
18516 KB |
Output is correct |
131 |
Correct |
830 ms |
190200 KB |
Output is correct |
132 |
Correct |
957 ms |
190144 KB |
Output is correct |
133 |
Correct |
848 ms |
190256 KB |
Output is correct |
134 |
Correct |
695 ms |
112460 KB |
Output is correct |
135 |
Correct |
675 ms |
101380 KB |
Output is correct |
136 |
Correct |
27 ms |
20564 KB |
Output is correct |
137 |
Correct |
31 ms |
20436 KB |
Output is correct |
138 |
Correct |
27 ms |
20584 KB |
Output is correct |
139 |
Correct |
25 ms |
20564 KB |
Output is correct |
140 |
Correct |
25 ms |
20464 KB |
Output is correct |
141 |
Correct |
26 ms |
20488 KB |
Output is correct |
142 |
Correct |
34 ms |
22936 KB |
Output is correct |
143 |
Correct |
21 ms |
19420 KB |
Output is correct |
144 |
Correct |
36 ms |
22956 KB |
Output is correct |
145 |
Correct |
19 ms |
19412 KB |
Output is correct |
146 |
Correct |
38 ms |
23104 KB |
Output is correct |
147 |
Correct |
28 ms |
19480 KB |
Output is correct |
148 |
Correct |
28 ms |
19788 KB |
Output is correct |
149 |
Correct |
21 ms |
19788 KB |
Output is correct |
150 |
Correct |
18 ms |
19620 KB |
Output is correct |
151 |
Correct |
25 ms |
19604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15956 KB |
Output is correct |
2 |
Correct |
9 ms |
15956 KB |
Output is correct |
3 |
Correct |
8 ms |
15956 KB |
Output is correct |
4 |
Correct |
8 ms |
15884 KB |
Output is correct |
5 |
Correct |
8 ms |
15956 KB |
Output is correct |
6 |
Correct |
8 ms |
15956 KB |
Output is correct |
7 |
Correct |
8 ms |
15856 KB |
Output is correct |
8 |
Correct |
9 ms |
15956 KB |
Output is correct |
9 |
Correct |
9 ms |
15988 KB |
Output is correct |
10 |
Correct |
9 ms |
15964 KB |
Output is correct |
11 |
Correct |
8 ms |
15956 KB |
Output is correct |
12 |
Correct |
8 ms |
15956 KB |
Output is correct |
13 |
Correct |
8 ms |
15980 KB |
Output is correct |
14 |
Correct |
8 ms |
15956 KB |
Output is correct |
15 |
Correct |
8 ms |
16084 KB |
Output is correct |
16 |
Correct |
9 ms |
16032 KB |
Output is correct |
17 |
Correct |
8 ms |
15976 KB |
Output is correct |
18 |
Correct |
9 ms |
16080 KB |
Output is correct |
19 |
Correct |
8 ms |
16084 KB |
Output is correct |
20 |
Correct |
8 ms |
16084 KB |
Output is correct |
21 |
Correct |
9 ms |
15956 KB |
Output is correct |
22 |
Correct |
9 ms |
15956 KB |
Output is correct |
23 |
Correct |
9 ms |
15956 KB |
Output is correct |
24 |
Correct |
25 ms |
19976 KB |
Output is correct |
25 |
Correct |
24 ms |
19924 KB |
Output is correct |
26 |
Correct |
21 ms |
19924 KB |
Output is correct |
27 |
Correct |
14 ms |
18388 KB |
Output is correct |
28 |
Correct |
15 ms |
18516 KB |
Output is correct |
29 |
Correct |
15 ms |
18392 KB |
Output is correct |
30 |
Correct |
15 ms |
18388 KB |
Output is correct |
31 |
Correct |
15 ms |
18420 KB |
Output is correct |
32 |
Correct |
15 ms |
18416 KB |
Output is correct |
33 |
Correct |
19 ms |
19716 KB |
Output is correct |
34 |
Correct |
20 ms |
19708 KB |
Output is correct |
35 |
Correct |
20 ms |
19700 KB |
Output is correct |
36 |
Correct |
26 ms |
19660 KB |
Output is correct |
37 |
Correct |
24 ms |
19632 KB |
Output is correct |
38 |
Correct |
19 ms |
19668 KB |
Output is correct |
39 |
Correct |
30 ms |
23156 KB |
Output is correct |
40 |
Correct |
29 ms |
23076 KB |
Output is correct |
41 |
Correct |
29 ms |
23136 KB |
Output is correct |
42 |
Correct |
39 ms |
27440 KB |
Output is correct |
43 |
Correct |
24 ms |
23132 KB |
Output is correct |
44 |
Correct |
42 ms |
28412 KB |
Output is correct |
45 |
Correct |
32 ms |
24276 KB |
Output is correct |
46 |
Correct |
28 ms |
23408 KB |
Output is correct |
47 |
Correct |
40 ms |
28620 KB |
Output is correct |
48 |
Correct |
79 ms |
37996 KB |
Output is correct |
49 |
Correct |
60 ms |
29132 KB |
Output is correct |
50 |
Correct |
63 ms |
32716 KB |
Output is correct |
51 |
Correct |
63 ms |
33004 KB |
Output is correct |
52 |
Correct |
66 ms |
33524 KB |
Output is correct |
53 |
Correct |
59 ms |
31148 KB |
Output is correct |
54 |
Correct |
38 ms |
28688 KB |
Output is correct |
55 |
Correct |
40 ms |
28588 KB |
Output is correct |
56 |
Correct |
42 ms |
28608 KB |
Output is correct |
57 |
Correct |
41 ms |
28748 KB |
Output is correct |
58 |
Correct |
40 ms |
28588 KB |
Output is correct |
59 |
Correct |
47 ms |
28596 KB |
Output is correct |
60 |
Correct |
90 ms |
40356 KB |
Output is correct |
61 |
Correct |
84 ms |
40232 KB |
Output is correct |
62 |
Correct |
94 ms |
40300 KB |
Output is correct |
63 |
Correct |
83 ms |
40236 KB |
Output is correct |
64 |
Correct |
101 ms |
40340 KB |
Output is correct |
65 |
Correct |
86 ms |
40300 KB |
Output is correct |
66 |
Correct |
88 ms |
39236 KB |
Output is correct |
67 |
Correct |
111 ms |
39172 KB |
Output is correct |
68 |
Correct |
101 ms |
39176 KB |
Output is correct |
69 |
Correct |
8 ms |
15976 KB |
Output is correct |
70 |
Correct |
8 ms |
15904 KB |
Output is correct |
71 |
Correct |
8 ms |
15956 KB |
Output is correct |
72 |
Correct |
8 ms |
15984 KB |
Output is correct |
73 |
Correct |
8 ms |
15956 KB |
Output is correct |
74 |
Correct |
9 ms |
15956 KB |
Output is correct |
75 |
Correct |
8 ms |
15956 KB |
Output is correct |
76 |
Correct |
11 ms |
15992 KB |
Output is correct |
77 |
Correct |
8 ms |
15956 KB |
Output is correct |
78 |
Correct |
10 ms |
15992 KB |
Output is correct |
79 |
Correct |
9 ms |
15956 KB |
Output is correct |
80 |
Correct |
9 ms |
15956 KB |
Output is correct |
81 |
Correct |
8 ms |
15952 KB |
Output is correct |
82 |
Correct |
8 ms |
15956 KB |
Output is correct |
83 |
Correct |
8 ms |
16016 KB |
Output is correct |
84 |
Correct |
9 ms |
15964 KB |
Output is correct |
85 |
Correct |
8 ms |
15956 KB |
Output is correct |
86 |
Correct |
8 ms |
15956 KB |
Output is correct |
87 |
Correct |
8 ms |
15948 KB |
Output is correct |
88 |
Correct |
8 ms |
15956 KB |
Output is correct |
89 |
Correct |
8 ms |
16032 KB |
Output is correct |
90 |
Correct |
9 ms |
16200 KB |
Output is correct |
91 |
Correct |
11 ms |
16176 KB |
Output is correct |
92 |
Correct |
9 ms |
16148 KB |
Output is correct |
93 |
Correct |
9 ms |
16084 KB |
Output is correct |
94 |
Correct |
9 ms |
16012 KB |
Output is correct |
95 |
Correct |
8 ms |
16020 KB |
Output is correct |
96 |
Correct |
8 ms |
15956 KB |
Output is correct |
97 |
Correct |
8 ms |
16084 KB |
Output is correct |
98 |
Correct |
8 ms |
16052 KB |
Output is correct |
99 |
Correct |
8 ms |
16032 KB |
Output is correct |
100 |
Correct |
10 ms |
16084 KB |
Output is correct |
101 |
Correct |
8 ms |
15956 KB |
Output is correct |
102 |
Correct |
8 ms |
16056 KB |
Output is correct |
103 |
Correct |
8 ms |
15992 KB |
Output is correct |
104 |
Correct |
8 ms |
16004 KB |
Output is correct |
105 |
Correct |
10 ms |
15976 KB |
Output is correct |
106 |
Correct |
8 ms |
15956 KB |
Output is correct |
107 |
Correct |
10 ms |
16468 KB |
Output is correct |
108 |
Correct |
9 ms |
16212 KB |
Output is correct |
109 |
Correct |
12 ms |
16468 KB |
Output is correct |
110 |
Correct |
10 ms |
16468 KB |
Output is correct |
111 |
Correct |
11 ms |
16404 KB |
Output is correct |
112 |
Correct |
12 ms |
16180 KB |
Output is correct |
113 |
Correct |
13 ms |
16180 KB |
Output is correct |
114 |
Correct |
10 ms |
16232 KB |
Output is correct |
115 |
Correct |
9 ms |
16084 KB |
Output is correct |
116 |
Correct |
10 ms |
16212 KB |
Output is correct |
117 |
Correct |
10 ms |
16084 KB |
Output is correct |
118 |
Correct |
20 ms |
18580 KB |
Output is correct |
119 |
Correct |
20 ms |
19028 KB |
Output is correct |
120 |
Correct |
23 ms |
19500 KB |
Output is correct |
121 |
Correct |
13 ms |
16980 KB |
Output is correct |
122 |
Correct |
13 ms |
17044 KB |
Output is correct |
123 |
Correct |
14 ms |
17032 KB |
Output is correct |
124 |
Correct |
14 ms |
16936 KB |
Output is correct |
125 |
Correct |
14 ms |
17044 KB |
Output is correct |
126 |
Correct |
10 ms |
16212 KB |
Output is correct |
127 |
Correct |
11 ms |
16212 KB |
Output is correct |
128 |
Correct |
11 ms |
16312 KB |
Output is correct |
129 |
Correct |
10 ms |
16224 KB |
Output is correct |
130 |
Correct |
12 ms |
16308 KB |
Output is correct |
131 |
Correct |
9 ms |
16212 KB |
Output is correct |
132 |
Correct |
25 ms |
19664 KB |
Output is correct |
133 |
Correct |
26 ms |
19784 KB |
Output is correct |
134 |
Correct |
25 ms |
19796 KB |
Output is correct |
135 |
Correct |
17 ms |
18388 KB |
Output is correct |
136 |
Correct |
543 ms |
142308 KB |
Output is correct |
137 |
Correct |
483 ms |
123012 KB |
Output is correct |
138 |
Correct |
374 ms |
65160 KB |
Output is correct |
139 |
Correct |
419 ms |
81600 KB |
Output is correct |
140 |
Correct |
370 ms |
61960 KB |
Output is correct |
141 |
Correct |
22 ms |
18804 KB |
Output is correct |
142 |
Correct |
22 ms |
18540 KB |
Output is correct |
143 |
Correct |
23 ms |
19924 KB |
Output is correct |
144 |
Correct |
20 ms |
18812 KB |
Output is correct |
145 |
Correct |
22 ms |
19064 KB |
Output is correct |
146 |
Correct |
25 ms |
19004 KB |
Output is correct |
147 |
Correct |
26 ms |
20352 KB |
Output is correct |
148 |
Correct |
15 ms |
18132 KB |
Output is correct |
149 |
Correct |
31 ms |
20372 KB |
Output is correct |
150 |
Correct |
17 ms |
17920 KB |
Output is correct |
151 |
Correct |
32 ms |
21716 KB |
Output is correct |
152 |
Correct |
19 ms |
18924 KB |
Output is correct |
153 |
Correct |
15 ms |
18672 KB |
Output is correct |
154 |
Correct |
18 ms |
19440 KB |
Output is correct |
155 |
Correct |
15 ms |
18412 KB |
Output is correct |
156 |
Correct |
16 ms |
18540 KB |
Output is correct |
157 |
Correct |
15 ms |
18516 KB |
Output is correct |
158 |
Correct |
830 ms |
190200 KB |
Output is correct |
159 |
Correct |
957 ms |
190144 KB |
Output is correct |
160 |
Correct |
848 ms |
190256 KB |
Output is correct |
161 |
Correct |
695 ms |
112460 KB |
Output is correct |
162 |
Correct |
675 ms |
101380 KB |
Output is correct |
163 |
Correct |
27 ms |
20564 KB |
Output is correct |
164 |
Correct |
31 ms |
20436 KB |
Output is correct |
165 |
Correct |
27 ms |
20584 KB |
Output is correct |
166 |
Correct |
25 ms |
20564 KB |
Output is correct |
167 |
Correct |
25 ms |
20464 KB |
Output is correct |
168 |
Correct |
26 ms |
20488 KB |
Output is correct |
169 |
Correct |
34 ms |
22936 KB |
Output is correct |
170 |
Correct |
21 ms |
19420 KB |
Output is correct |
171 |
Correct |
36 ms |
22956 KB |
Output is correct |
172 |
Correct |
19 ms |
19412 KB |
Output is correct |
173 |
Correct |
38 ms |
23104 KB |
Output is correct |
174 |
Correct |
28 ms |
19480 KB |
Output is correct |
175 |
Correct |
28 ms |
19788 KB |
Output is correct |
176 |
Correct |
21 ms |
19788 KB |
Output is correct |
177 |
Correct |
18 ms |
19620 KB |
Output is correct |
178 |
Correct |
25 ms |
19604 KB |
Output is correct |
179 |
Correct |
38 ms |
23840 KB |
Output is correct |
180 |
Correct |
1487 ms |
237684 KB |
Output is correct |
181 |
Execution timed out |
1593 ms |
365412 KB |
Time limit exceeded |
182 |
Halted |
0 ms |
0 KB |
- |