#include <bits/stdc++.h>
#ifndef SKY
#include "paint.h"
#endif // SKY
using namespace std;
#define N 100010
#define ll long long
#define fs first
#define sc second
#define ii pair<int,int>
#define pb push_back
int mp[2][N];
int n,m,k,color[N],dp[N];
vector<int>lis[N];
int minimumInstructions(int NNN, int MMM, int KKK, vector<int> CCC,vector<int> AAA, vector<vector<int>> BBB)
{
n=NNN;
m=MMM;
k=KKK;
for(int i=0;i<n;i++)
color[i]=CCC[i];
for(int i=0;i<m;i++)
for(auto u:BBB[i])
lis[u].pb(i);
if(m==1)
{
for(int i=0;i<n;i++)
if(lis[color[i]].empty())
return -1;
return n;
}
for(int i=n-1;i>=0;i--)
{
memset(mp[(i&1)],0,sizeof(mp[(i&1)]));
for(auto u:lis[color[i]])
if(mp[(i+1)&1][(u+1)%m]!=0)
mp[(i&1)][u]=min(m,mp[(i+1)&1][(u+1)%m]+1);
else mp[(i&1)][u]=1;
for(auto u:lis[color[i]])
if(mp[(i&1)][u]==m)
dp[i]=1;
}
if(dp[0]==0)
return -1;
int vt=0,res=0,x=0;
while(vt<n)
{
if(x+m-1<vt)
return -1;
int new_vt=x+m;
for(int i=vt+1;i<=new_vt;i++)
if(dp[i]==1)
x=max(x,i);
vt=new_vt;
res++;
}
return res;
}
#ifdef SKY
int main()
{
freopen("A.inp","r",stdin);
freopen("A.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int n,m,k;
cin>>n>>m>>k;
vector<int>C(n);
for(int i=0;i<n;i++)
cin>>C[i];
vector<int>A(m);
vector<vector<int>>B(m);
for(int i=0;i<m;i++)
{
cin>>A[i];
B[i].resize(A[i]);
}
for(int i=0;i<m;i++)
{
for(int j=0;j<A[i];j++)
cin>>B[i][j];
}
cout<<minimumInstructions(n,m,k,C,A,B);
return 0;
}
#endif
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
3 ms |
2644 KB |
Output is correct |
9 |
Correct |
8 ms |
3444 KB |
Output is correct |
10 |
Correct |
9 ms |
3412 KB |
Output is correct |
11 |
Correct |
10 ms |
3412 KB |
Output is correct |
12 |
Correct |
9 ms |
3448 KB |
Output is correct |
13 |
Correct |
7 ms |
3416 KB |
Output is correct |
14 |
Correct |
7 ms |
3488 KB |
Output is correct |
15 |
Correct |
8 ms |
3412 KB |
Output is correct |
16 |
Correct |
8 ms |
3408 KB |
Output is correct |
17 |
Correct |
9 ms |
3484 KB |
Output is correct |
18 |
Correct |
8 ms |
3412 KB |
Output is correct |
19 |
Correct |
7 ms |
3412 KB |
Output is correct |
20 |
Correct |
8 ms |
3500 KB |
Output is correct |
21 |
Correct |
8 ms |
3412 KB |
Output is correct |
22 |
Correct |
31 ms |
7356 KB |
Output is correct |
23 |
Correct |
29 ms |
7304 KB |
Output is correct |
24 |
Correct |
31 ms |
7284 KB |
Output is correct |
25 |
Correct |
3 ms |
2772 KB |
Output is correct |
26 |
Correct |
4 ms |
2772 KB |
Output is correct |
27 |
Correct |
261 ms |
3724 KB |
Output is correct |
28 |
Correct |
232 ms |
3688 KB |
Output is correct |
29 |
Correct |
256 ms |
3712 KB |
Output is correct |
30 |
Correct |
276 ms |
3796 KB |
Output is correct |
31 |
Correct |
240 ms |
4640 KB |
Output is correct |
32 |
Correct |
259 ms |
4636 KB |
Output is correct |
33 |
Correct |
222 ms |
4592 KB |
Output is correct |
34 |
Correct |
253 ms |
4608 KB |
Output is correct |
35 |
Correct |
247 ms |
4628 KB |
Output is correct |
36 |
Correct |
289 ms |
4632 KB |
Output is correct |
37 |
Correct |
263 ms |
7740 KB |
Output is correct |
38 |
Correct |
258 ms |
7732 KB |
Output is correct |
39 |
Correct |
264 ms |
7736 KB |
Output is correct |
40 |
Correct |
8 ms |
3668 KB |
Output is correct |
41 |
Correct |
10 ms |
3284 KB |
Output is correct |
42 |
Correct |
1150 ms |
5100 KB |
Output is correct |
43 |
Correct |
716 ms |
4404 KB |
Output is correct |
44 |
Correct |
620 ms |
4300 KB |
Output is correct |
45 |
Correct |
1087 ms |
4848 KB |
Output is correct |
46 |
Correct |
935 ms |
12936 KB |
Output is correct |
47 |
Correct |
725 ms |
8820 KB |
Output is correct |
48 |
Correct |
686 ms |
11348 KB |
Output is correct |
49 |
Correct |
879 ms |
11380 KB |
Output is correct |
50 |
Correct |
752 ms |
11024 KB |
Output is correct |
51 |
Correct |
799 ms |
8828 KB |
Output is correct |
52 |
Correct |
12 ms |
3824 KB |
Output is correct |
53 |
Correct |
15 ms |
3844 KB |
Output is correct |
54 |
Correct |
1162 ms |
4912 KB |
Output is correct |
55 |
Correct |
1059 ms |
4924 KB |
Output is correct |
56 |
Correct |
1016 ms |
4884 KB |
Output is correct |
57 |
Correct |
1301 ms |
4868 KB |
Output is correct |
58 |
Correct |
1137 ms |
13724 KB |
Output is correct |
59 |
Correct |
1191 ms |
13760 KB |
Output is correct |
60 |
Correct |
1156 ms |
13804 KB |
Output is correct |
61 |
Correct |
1223 ms |
13784 KB |
Output is correct |
62 |
Correct |
1480 ms |
13748 KB |
Output is correct |
63 |
Correct |
1365 ms |
13860 KB |
Output is correct |
64 |
Correct |
1296 ms |
12824 KB |
Output is correct |
65 |
Correct |
1292 ms |
12732 KB |
Output is correct |
66 |
Correct |
1417 ms |
12824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2644 KB |
Output is correct |
2 |
Correct |
2 ms |
2644 KB |
Output is correct |
3 |
Correct |
2 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
3412 KB |
Output is correct |
6 |
Correct |
2 ms |
3412 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
3 ms |
2644 KB |
Output is correct |
9 |
Correct |
8 ms |
3444 KB |
Output is correct |
10 |
Correct |
9 ms |
3412 KB |
Output is correct |
11 |
Correct |
10 ms |
3412 KB |
Output is correct |
12 |
Correct |
9 ms |
3448 KB |
Output is correct |
13 |
Correct |
7 ms |
3416 KB |
Output is correct |
14 |
Correct |
7 ms |
3488 KB |
Output is correct |
15 |
Correct |
8 ms |
3412 KB |
Output is correct |
16 |
Correct |
8 ms |
3408 KB |
Output is correct |
17 |
Correct |
9 ms |
3484 KB |
Output is correct |
18 |
Correct |
8 ms |
3412 KB |
Output is correct |
19 |
Correct |
7 ms |
3412 KB |
Output is correct |
20 |
Correct |
8 ms |
3500 KB |
Output is correct |
21 |
Correct |
8 ms |
3412 KB |
Output is correct |
22 |
Correct |
2 ms |
3412 KB |
Output is correct |
23 |
Correct |
2 ms |
3412 KB |
Output is correct |
24 |
Correct |
2 ms |
3412 KB |
Output is correct |
25 |
Correct |
2 ms |
3412 KB |
Output is correct |
26 |
Correct |
3 ms |
3412 KB |
Output is correct |
27 |
Correct |
7 ms |
3412 KB |
Output is correct |
28 |
Correct |
7 ms |
3452 KB |
Output is correct |
29 |
Correct |
5 ms |
3412 KB |
Output is correct |
30 |
Correct |
7 ms |
3412 KB |
Output is correct |
31 |
Correct |
7 ms |
3444 KB |
Output is correct |
32 |
Correct |
8 ms |
3412 KB |
Output is correct |
33 |
Correct |
7 ms |
3412 KB |
Output is correct |
34 |
Correct |
9 ms |
3476 KB |
Output is correct |
35 |
Correct |
7 ms |
3412 KB |
Output is correct |
36 |
Correct |
8 ms |
3404 KB |
Output is correct |
37 |
Correct |
8 ms |
3472 KB |
Output is correct |
38 |
Correct |
5 ms |
3412 KB |
Output is correct |
39 |
Correct |
7 ms |
3412 KB |
Output is correct |
40 |
Correct |
6 ms |
3412 KB |
Output is correct |
41 |
Correct |
7 ms |
3468 KB |
Output is correct |
42 |
Correct |
7 ms |
3412 KB |
Output is correct |
43 |
Correct |
6 ms |
3456 KB |
Output is correct |
44 |
Correct |
10 ms |
3412 KB |
Output is correct |
45 |
Correct |
10 ms |
3412 KB |
Output is correct |
46 |
Correct |
9 ms |
3412 KB |
Output is correct |
47 |
Correct |
10 ms |
3412 KB |
Output is correct |
48 |
Correct |
10 ms |
3452 KB |
Output is correct |
49 |
Correct |
8 ms |
3460 KB |
Output is correct |
50 |
Correct |
10 ms |
3480 KB |
Output is correct |
51 |
Correct |
9 ms |
3412 KB |
Output is correct |
52 |
Correct |
10 ms |
3412 KB |
Output is correct |
53 |
Correct |
8 ms |
3488 KB |
Output is correct |
54 |
Correct |
7 ms |
3484 KB |
Output is correct |
55 |
Correct |
8 ms |
3412 KB |
Output is correct |
56 |
Correct |
9 ms |
3420 KB |
Output is correct |
57 |
Correct |
11 ms |
3480 KB |
Output is correct |
58 |
Correct |
9 ms |
3412 KB |
Output is correct |
59 |
Correct |
7 ms |
3412 KB |
Output is correct |
60 |
Correct |
10 ms |
3412 KB |
Output is correct |
61 |
Correct |
10 ms |
3480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
2 ms |
3412 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
3 ms |
2644 KB |
Output is correct |
11 |
Correct |
8 ms |
3444 KB |
Output is correct |
12 |
Correct |
9 ms |
3412 KB |
Output is correct |
13 |
Correct |
10 ms |
3412 KB |
Output is correct |
14 |
Correct |
9 ms |
3448 KB |
Output is correct |
15 |
Correct |
7 ms |
3416 KB |
Output is correct |
16 |
Correct |
7 ms |
3488 KB |
Output is correct |
17 |
Correct |
8 ms |
3412 KB |
Output is correct |
18 |
Correct |
8 ms |
3408 KB |
Output is correct |
19 |
Correct |
9 ms |
3484 KB |
Output is correct |
20 |
Correct |
8 ms |
3412 KB |
Output is correct |
21 |
Correct |
7 ms |
3412 KB |
Output is correct |
22 |
Correct |
8 ms |
3500 KB |
Output is correct |
23 |
Correct |
8 ms |
3412 KB |
Output is correct |
24 |
Correct |
31 ms |
7356 KB |
Output is correct |
25 |
Correct |
29 ms |
7304 KB |
Output is correct |
26 |
Correct |
31 ms |
7284 KB |
Output is correct |
27 |
Correct |
2 ms |
3412 KB |
Output is correct |
28 |
Correct |
2 ms |
3412 KB |
Output is correct |
29 |
Correct |
3 ms |
3412 KB |
Output is correct |
30 |
Correct |
7 ms |
3412 KB |
Output is correct |
31 |
Correct |
7 ms |
3452 KB |
Output is correct |
32 |
Correct |
5 ms |
3412 KB |
Output is correct |
33 |
Correct |
7 ms |
3412 KB |
Output is correct |
34 |
Correct |
7 ms |
3444 KB |
Output is correct |
35 |
Correct |
8 ms |
3412 KB |
Output is correct |
36 |
Correct |
7 ms |
3412 KB |
Output is correct |
37 |
Correct |
9 ms |
3476 KB |
Output is correct |
38 |
Correct |
7 ms |
3412 KB |
Output is correct |
39 |
Correct |
8 ms |
3404 KB |
Output is correct |
40 |
Correct |
8 ms |
3472 KB |
Output is correct |
41 |
Correct |
5 ms |
3412 KB |
Output is correct |
42 |
Correct |
7 ms |
3412 KB |
Output is correct |
43 |
Correct |
6 ms |
3412 KB |
Output is correct |
44 |
Correct |
7 ms |
3468 KB |
Output is correct |
45 |
Correct |
7 ms |
3412 KB |
Output is correct |
46 |
Correct |
6 ms |
3456 KB |
Output is correct |
47 |
Correct |
10 ms |
3412 KB |
Output is correct |
48 |
Correct |
10 ms |
3412 KB |
Output is correct |
49 |
Correct |
9 ms |
3412 KB |
Output is correct |
50 |
Correct |
10 ms |
3412 KB |
Output is correct |
51 |
Correct |
10 ms |
3452 KB |
Output is correct |
52 |
Correct |
8 ms |
3460 KB |
Output is correct |
53 |
Correct |
10 ms |
3480 KB |
Output is correct |
54 |
Correct |
9 ms |
3412 KB |
Output is correct |
55 |
Correct |
10 ms |
3412 KB |
Output is correct |
56 |
Correct |
8 ms |
3488 KB |
Output is correct |
57 |
Correct |
7 ms |
3484 KB |
Output is correct |
58 |
Correct |
8 ms |
3412 KB |
Output is correct |
59 |
Correct |
9 ms |
3420 KB |
Output is correct |
60 |
Correct |
11 ms |
3480 KB |
Output is correct |
61 |
Correct |
9 ms |
3412 KB |
Output is correct |
62 |
Correct |
7 ms |
3412 KB |
Output is correct |
63 |
Correct |
10 ms |
3412 KB |
Output is correct |
64 |
Correct |
10 ms |
3480 KB |
Output is correct |
65 |
Correct |
7 ms |
3468 KB |
Output is correct |
66 |
Correct |
8 ms |
3412 KB |
Output is correct |
67 |
Correct |
7 ms |
3412 KB |
Output is correct |
68 |
Correct |
8 ms |
3412 KB |
Output is correct |
69 |
Correct |
7 ms |
3412 KB |
Output is correct |
70 |
Correct |
9 ms |
3624 KB |
Output is correct |
71 |
Correct |
8 ms |
3540 KB |
Output is correct |
72 |
Correct |
11 ms |
3628 KB |
Output is correct |
73 |
Correct |
7 ms |
3552 KB |
Output is correct |
74 |
Correct |
7 ms |
3644 KB |
Output is correct |
75 |
Correct |
7 ms |
3636 KB |
Output is correct |
76 |
Correct |
24 ms |
5988 KB |
Output is correct |
77 |
Correct |
24 ms |
6444 KB |
Output is correct |
78 |
Correct |
30 ms |
6912 KB |
Output is correct |
79 |
Correct |
7 ms |
3424 KB |
Output is correct |
80 |
Correct |
11 ms |
3472 KB |
Output is correct |
81 |
Correct |
9 ms |
3468 KB |
Output is correct |
82 |
Correct |
8 ms |
3412 KB |
Output is correct |
83 |
Correct |
7 ms |
3412 KB |
Output is correct |
84 |
Correct |
9 ms |
3684 KB |
Output is correct |
85 |
Correct |
9 ms |
3688 KB |
Output is correct |
86 |
Correct |
9 ms |
3676 KB |
Output is correct |
87 |
Correct |
9 ms |
3668 KB |
Output is correct |
88 |
Correct |
12 ms |
3668 KB |
Output is correct |
89 |
Correct |
8 ms |
3684 KB |
Output is correct |
90 |
Correct |
39 ms |
7168 KB |
Output is correct |
91 |
Correct |
46 ms |
7104 KB |
Output is correct |
92 |
Correct |
35 ms |
7192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
2 ms |
3412 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
3 ms |
2644 KB |
Output is correct |
11 |
Correct |
8 ms |
3444 KB |
Output is correct |
12 |
Correct |
9 ms |
3412 KB |
Output is correct |
13 |
Correct |
10 ms |
3412 KB |
Output is correct |
14 |
Correct |
9 ms |
3448 KB |
Output is correct |
15 |
Correct |
7 ms |
3416 KB |
Output is correct |
16 |
Correct |
7 ms |
3488 KB |
Output is correct |
17 |
Correct |
8 ms |
3412 KB |
Output is correct |
18 |
Correct |
8 ms |
3408 KB |
Output is correct |
19 |
Correct |
9 ms |
3484 KB |
Output is correct |
20 |
Correct |
8 ms |
3412 KB |
Output is correct |
21 |
Correct |
7 ms |
3412 KB |
Output is correct |
22 |
Correct |
8 ms |
3500 KB |
Output is correct |
23 |
Correct |
8 ms |
3412 KB |
Output is correct |
24 |
Correct |
31 ms |
7356 KB |
Output is correct |
25 |
Correct |
29 ms |
7304 KB |
Output is correct |
26 |
Correct |
31 ms |
7284 KB |
Output is correct |
27 |
Correct |
3 ms |
2772 KB |
Output is correct |
28 |
Correct |
4 ms |
2772 KB |
Output is correct |
29 |
Correct |
261 ms |
3724 KB |
Output is correct |
30 |
Correct |
232 ms |
3688 KB |
Output is correct |
31 |
Correct |
256 ms |
3712 KB |
Output is correct |
32 |
Correct |
276 ms |
3796 KB |
Output is correct |
33 |
Correct |
240 ms |
4640 KB |
Output is correct |
34 |
Correct |
259 ms |
4636 KB |
Output is correct |
35 |
Correct |
222 ms |
4592 KB |
Output is correct |
36 |
Correct |
253 ms |
4608 KB |
Output is correct |
37 |
Correct |
247 ms |
4628 KB |
Output is correct |
38 |
Correct |
289 ms |
4632 KB |
Output is correct |
39 |
Correct |
263 ms |
7740 KB |
Output is correct |
40 |
Correct |
258 ms |
7732 KB |
Output is correct |
41 |
Correct |
264 ms |
7736 KB |
Output is correct |
42 |
Correct |
2 ms |
3412 KB |
Output is correct |
43 |
Correct |
2 ms |
3412 KB |
Output is correct |
44 |
Correct |
3 ms |
3412 KB |
Output is correct |
45 |
Correct |
7 ms |
3412 KB |
Output is correct |
46 |
Correct |
7 ms |
3452 KB |
Output is correct |
47 |
Correct |
5 ms |
3412 KB |
Output is correct |
48 |
Correct |
7 ms |
3412 KB |
Output is correct |
49 |
Correct |
7 ms |
3444 KB |
Output is correct |
50 |
Correct |
8 ms |
3412 KB |
Output is correct |
51 |
Correct |
7 ms |
3412 KB |
Output is correct |
52 |
Correct |
9 ms |
3476 KB |
Output is correct |
53 |
Correct |
7 ms |
3412 KB |
Output is correct |
54 |
Correct |
8 ms |
3404 KB |
Output is correct |
55 |
Correct |
8 ms |
3472 KB |
Output is correct |
56 |
Correct |
5 ms |
3412 KB |
Output is correct |
57 |
Correct |
7 ms |
3412 KB |
Output is correct |
58 |
Correct |
6 ms |
3412 KB |
Output is correct |
59 |
Correct |
7 ms |
3468 KB |
Output is correct |
60 |
Correct |
7 ms |
3412 KB |
Output is correct |
61 |
Correct |
6 ms |
3456 KB |
Output is correct |
62 |
Correct |
10 ms |
3412 KB |
Output is correct |
63 |
Correct |
10 ms |
3412 KB |
Output is correct |
64 |
Correct |
9 ms |
3412 KB |
Output is correct |
65 |
Correct |
10 ms |
3412 KB |
Output is correct |
66 |
Correct |
10 ms |
3452 KB |
Output is correct |
67 |
Correct |
8 ms |
3460 KB |
Output is correct |
68 |
Correct |
10 ms |
3480 KB |
Output is correct |
69 |
Correct |
9 ms |
3412 KB |
Output is correct |
70 |
Correct |
10 ms |
3412 KB |
Output is correct |
71 |
Correct |
8 ms |
3488 KB |
Output is correct |
72 |
Correct |
7 ms |
3484 KB |
Output is correct |
73 |
Correct |
8 ms |
3412 KB |
Output is correct |
74 |
Correct |
9 ms |
3420 KB |
Output is correct |
75 |
Correct |
11 ms |
3480 KB |
Output is correct |
76 |
Correct |
9 ms |
3412 KB |
Output is correct |
77 |
Correct |
7 ms |
3412 KB |
Output is correct |
78 |
Correct |
10 ms |
3412 KB |
Output is correct |
79 |
Correct |
10 ms |
3480 KB |
Output is correct |
80 |
Correct |
7 ms |
3468 KB |
Output is correct |
81 |
Correct |
8 ms |
3412 KB |
Output is correct |
82 |
Correct |
7 ms |
3412 KB |
Output is correct |
83 |
Correct |
8 ms |
3412 KB |
Output is correct |
84 |
Correct |
7 ms |
3412 KB |
Output is correct |
85 |
Correct |
9 ms |
3624 KB |
Output is correct |
86 |
Correct |
8 ms |
3540 KB |
Output is correct |
87 |
Correct |
11 ms |
3628 KB |
Output is correct |
88 |
Correct |
7 ms |
3552 KB |
Output is correct |
89 |
Correct |
7 ms |
3644 KB |
Output is correct |
90 |
Correct |
7 ms |
3636 KB |
Output is correct |
91 |
Correct |
24 ms |
5988 KB |
Output is correct |
92 |
Correct |
24 ms |
6444 KB |
Output is correct |
93 |
Correct |
30 ms |
6912 KB |
Output is correct |
94 |
Correct |
7 ms |
3424 KB |
Output is correct |
95 |
Correct |
11 ms |
3472 KB |
Output is correct |
96 |
Correct |
9 ms |
3468 KB |
Output is correct |
97 |
Correct |
8 ms |
3412 KB |
Output is correct |
98 |
Correct |
7 ms |
3412 KB |
Output is correct |
99 |
Correct |
9 ms |
3684 KB |
Output is correct |
100 |
Correct |
9 ms |
3688 KB |
Output is correct |
101 |
Correct |
9 ms |
3676 KB |
Output is correct |
102 |
Correct |
9 ms |
3668 KB |
Output is correct |
103 |
Correct |
12 ms |
3668 KB |
Output is correct |
104 |
Correct |
8 ms |
3684 KB |
Output is correct |
105 |
Correct |
39 ms |
7168 KB |
Output is correct |
106 |
Correct |
46 ms |
7104 KB |
Output is correct |
107 |
Correct |
35 ms |
7192 KB |
Output is correct |
108 |
Correct |
213 ms |
3720 KB |
Output is correct |
109 |
Correct |
199 ms |
3708 KB |
Output is correct |
110 |
Correct |
158 ms |
3648 KB |
Output is correct |
111 |
Correct |
171 ms |
3648 KB |
Output is correct |
112 |
Correct |
212 ms |
3704 KB |
Output is correct |
113 |
Correct |
164 ms |
3680 KB |
Output is correct |
114 |
Correct |
143 ms |
4860 KB |
Output is correct |
115 |
Correct |
144 ms |
4592 KB |
Output is correct |
116 |
Correct |
240 ms |
4840 KB |
Output is correct |
117 |
Correct |
163 ms |
4724 KB |
Output is correct |
118 |
Correct |
169 ms |
4936 KB |
Output is correct |
119 |
Correct |
164 ms |
4648 KB |
Output is correct |
120 |
Correct |
148 ms |
5936 KB |
Output is correct |
121 |
Correct |
151 ms |
4036 KB |
Output is correct |
122 |
Correct |
145 ms |
6116 KB |
Output is correct |
123 |
Correct |
109 ms |
3940 KB |
Output is correct |
124 |
Correct |
262 ms |
6632 KB |
Output is correct |
125 |
Correct |
212 ms |
4356 KB |
Output is correct |
126 |
Correct |
181 ms |
4284 KB |
Output is correct |
127 |
Correct |
184 ms |
4528 KB |
Output is correct |
128 |
Correct |
126 ms |
4312 KB |
Output is correct |
129 |
Correct |
138 ms |
4344 KB |
Output is correct |
130 |
Correct |
241 ms |
3624 KB |
Output is correct |
131 |
Correct |
249 ms |
3752 KB |
Output is correct |
132 |
Correct |
232 ms |
3756 KB |
Output is correct |
133 |
Correct |
264 ms |
3796 KB |
Output is correct |
134 |
Correct |
226 ms |
3796 KB |
Output is correct |
135 |
Correct |
243 ms |
3800 KB |
Output is correct |
136 |
Correct |
282 ms |
5092 KB |
Output is correct |
137 |
Correct |
203 ms |
5144 KB |
Output is correct |
138 |
Correct |
213 ms |
5220 KB |
Output is correct |
139 |
Correct |
226 ms |
5132 KB |
Output is correct |
140 |
Correct |
243 ms |
5136 KB |
Output is correct |
141 |
Correct |
211 ms |
5220 KB |
Output is correct |
142 |
Correct |
236 ms |
7608 KB |
Output is correct |
143 |
Correct |
197 ms |
4356 KB |
Output is correct |
144 |
Correct |
215 ms |
7540 KB |
Output is correct |
145 |
Correct |
207 ms |
4508 KB |
Output is correct |
146 |
Correct |
206 ms |
7540 KB |
Output is correct |
147 |
Correct |
206 ms |
4636 KB |
Output is correct |
148 |
Correct |
258 ms |
4740 KB |
Output is correct |
149 |
Correct |
208 ms |
4684 KB |
Output is correct |
150 |
Correct |
228 ms |
4812 KB |
Output is correct |
151 |
Correct |
195 ms |
4812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3412 KB |
Output is correct |
2 |
Correct |
2 ms |
3412 KB |
Output is correct |
3 |
Correct |
1 ms |
2644 KB |
Output is correct |
4 |
Correct |
2 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
2644 KB |
Output is correct |
6 |
Correct |
2 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3412 KB |
Output is correct |
8 |
Correct |
2 ms |
3412 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
3 ms |
2644 KB |
Output is correct |
11 |
Correct |
8 ms |
3444 KB |
Output is correct |
12 |
Correct |
9 ms |
3412 KB |
Output is correct |
13 |
Correct |
10 ms |
3412 KB |
Output is correct |
14 |
Correct |
9 ms |
3448 KB |
Output is correct |
15 |
Correct |
7 ms |
3416 KB |
Output is correct |
16 |
Correct |
7 ms |
3488 KB |
Output is correct |
17 |
Correct |
8 ms |
3412 KB |
Output is correct |
18 |
Correct |
8 ms |
3408 KB |
Output is correct |
19 |
Correct |
9 ms |
3484 KB |
Output is correct |
20 |
Correct |
8 ms |
3412 KB |
Output is correct |
21 |
Correct |
7 ms |
3412 KB |
Output is correct |
22 |
Correct |
8 ms |
3500 KB |
Output is correct |
23 |
Correct |
8 ms |
3412 KB |
Output is correct |
24 |
Correct |
31 ms |
7356 KB |
Output is correct |
25 |
Correct |
29 ms |
7304 KB |
Output is correct |
26 |
Correct |
31 ms |
7284 KB |
Output is correct |
27 |
Correct |
3 ms |
2772 KB |
Output is correct |
28 |
Correct |
4 ms |
2772 KB |
Output is correct |
29 |
Correct |
261 ms |
3724 KB |
Output is correct |
30 |
Correct |
232 ms |
3688 KB |
Output is correct |
31 |
Correct |
256 ms |
3712 KB |
Output is correct |
32 |
Correct |
276 ms |
3796 KB |
Output is correct |
33 |
Correct |
240 ms |
4640 KB |
Output is correct |
34 |
Correct |
259 ms |
4636 KB |
Output is correct |
35 |
Correct |
222 ms |
4592 KB |
Output is correct |
36 |
Correct |
253 ms |
4608 KB |
Output is correct |
37 |
Correct |
247 ms |
4628 KB |
Output is correct |
38 |
Correct |
289 ms |
4632 KB |
Output is correct |
39 |
Correct |
263 ms |
7740 KB |
Output is correct |
40 |
Correct |
258 ms |
7732 KB |
Output is correct |
41 |
Correct |
264 ms |
7736 KB |
Output is correct |
42 |
Correct |
8 ms |
3668 KB |
Output is correct |
43 |
Correct |
10 ms |
3284 KB |
Output is correct |
44 |
Correct |
1150 ms |
5100 KB |
Output is correct |
45 |
Correct |
716 ms |
4404 KB |
Output is correct |
46 |
Correct |
620 ms |
4300 KB |
Output is correct |
47 |
Correct |
1087 ms |
4848 KB |
Output is correct |
48 |
Correct |
935 ms |
12936 KB |
Output is correct |
49 |
Correct |
725 ms |
8820 KB |
Output is correct |
50 |
Correct |
686 ms |
11348 KB |
Output is correct |
51 |
Correct |
879 ms |
11380 KB |
Output is correct |
52 |
Correct |
752 ms |
11024 KB |
Output is correct |
53 |
Correct |
799 ms |
8828 KB |
Output is correct |
54 |
Correct |
12 ms |
3824 KB |
Output is correct |
55 |
Correct |
15 ms |
3844 KB |
Output is correct |
56 |
Correct |
1162 ms |
4912 KB |
Output is correct |
57 |
Correct |
1059 ms |
4924 KB |
Output is correct |
58 |
Correct |
1016 ms |
4884 KB |
Output is correct |
59 |
Correct |
1301 ms |
4868 KB |
Output is correct |
60 |
Correct |
1137 ms |
13724 KB |
Output is correct |
61 |
Correct |
1191 ms |
13760 KB |
Output is correct |
62 |
Correct |
1156 ms |
13804 KB |
Output is correct |
63 |
Correct |
1223 ms |
13784 KB |
Output is correct |
64 |
Correct |
1480 ms |
13748 KB |
Output is correct |
65 |
Correct |
1365 ms |
13860 KB |
Output is correct |
66 |
Correct |
1296 ms |
12824 KB |
Output is correct |
67 |
Correct |
1292 ms |
12732 KB |
Output is correct |
68 |
Correct |
1417 ms |
12824 KB |
Output is correct |
69 |
Correct |
2 ms |
3412 KB |
Output is correct |
70 |
Correct |
2 ms |
3412 KB |
Output is correct |
71 |
Correct |
3 ms |
3412 KB |
Output is correct |
72 |
Correct |
7 ms |
3412 KB |
Output is correct |
73 |
Correct |
7 ms |
3452 KB |
Output is correct |
74 |
Correct |
5 ms |
3412 KB |
Output is correct |
75 |
Correct |
7 ms |
3412 KB |
Output is correct |
76 |
Correct |
7 ms |
3444 KB |
Output is correct |
77 |
Correct |
8 ms |
3412 KB |
Output is correct |
78 |
Correct |
7 ms |
3412 KB |
Output is correct |
79 |
Correct |
9 ms |
3476 KB |
Output is correct |
80 |
Correct |
7 ms |
3412 KB |
Output is correct |
81 |
Correct |
8 ms |
3404 KB |
Output is correct |
82 |
Correct |
8 ms |
3472 KB |
Output is correct |
83 |
Correct |
5 ms |
3412 KB |
Output is correct |
84 |
Correct |
7 ms |
3412 KB |
Output is correct |
85 |
Correct |
6 ms |
3412 KB |
Output is correct |
86 |
Correct |
7 ms |
3468 KB |
Output is correct |
87 |
Correct |
7 ms |
3412 KB |
Output is correct |
88 |
Correct |
6 ms |
3456 KB |
Output is correct |
89 |
Correct |
10 ms |
3412 KB |
Output is correct |
90 |
Correct |
10 ms |
3412 KB |
Output is correct |
91 |
Correct |
9 ms |
3412 KB |
Output is correct |
92 |
Correct |
10 ms |
3412 KB |
Output is correct |
93 |
Correct |
10 ms |
3452 KB |
Output is correct |
94 |
Correct |
8 ms |
3460 KB |
Output is correct |
95 |
Correct |
10 ms |
3480 KB |
Output is correct |
96 |
Correct |
9 ms |
3412 KB |
Output is correct |
97 |
Correct |
10 ms |
3412 KB |
Output is correct |
98 |
Correct |
8 ms |
3488 KB |
Output is correct |
99 |
Correct |
7 ms |
3484 KB |
Output is correct |
100 |
Correct |
8 ms |
3412 KB |
Output is correct |
101 |
Correct |
9 ms |
3420 KB |
Output is correct |
102 |
Correct |
11 ms |
3480 KB |
Output is correct |
103 |
Correct |
9 ms |
3412 KB |
Output is correct |
104 |
Correct |
7 ms |
3412 KB |
Output is correct |
105 |
Correct |
10 ms |
3412 KB |
Output is correct |
106 |
Correct |
10 ms |
3480 KB |
Output is correct |
107 |
Correct |
7 ms |
3468 KB |
Output is correct |
108 |
Correct |
8 ms |
3412 KB |
Output is correct |
109 |
Correct |
7 ms |
3412 KB |
Output is correct |
110 |
Correct |
8 ms |
3412 KB |
Output is correct |
111 |
Correct |
7 ms |
3412 KB |
Output is correct |
112 |
Correct |
9 ms |
3624 KB |
Output is correct |
113 |
Correct |
8 ms |
3540 KB |
Output is correct |
114 |
Correct |
11 ms |
3628 KB |
Output is correct |
115 |
Correct |
7 ms |
3552 KB |
Output is correct |
116 |
Correct |
7 ms |
3644 KB |
Output is correct |
117 |
Correct |
7 ms |
3636 KB |
Output is correct |
118 |
Correct |
24 ms |
5988 KB |
Output is correct |
119 |
Correct |
24 ms |
6444 KB |
Output is correct |
120 |
Correct |
30 ms |
6912 KB |
Output is correct |
121 |
Correct |
7 ms |
3424 KB |
Output is correct |
122 |
Correct |
11 ms |
3472 KB |
Output is correct |
123 |
Correct |
9 ms |
3468 KB |
Output is correct |
124 |
Correct |
8 ms |
3412 KB |
Output is correct |
125 |
Correct |
7 ms |
3412 KB |
Output is correct |
126 |
Correct |
9 ms |
3684 KB |
Output is correct |
127 |
Correct |
9 ms |
3688 KB |
Output is correct |
128 |
Correct |
9 ms |
3676 KB |
Output is correct |
129 |
Correct |
9 ms |
3668 KB |
Output is correct |
130 |
Correct |
12 ms |
3668 KB |
Output is correct |
131 |
Correct |
8 ms |
3684 KB |
Output is correct |
132 |
Correct |
39 ms |
7168 KB |
Output is correct |
133 |
Correct |
46 ms |
7104 KB |
Output is correct |
134 |
Correct |
35 ms |
7192 KB |
Output is correct |
135 |
Correct |
213 ms |
3720 KB |
Output is correct |
136 |
Correct |
199 ms |
3708 KB |
Output is correct |
137 |
Correct |
158 ms |
3648 KB |
Output is correct |
138 |
Correct |
171 ms |
3648 KB |
Output is correct |
139 |
Correct |
212 ms |
3704 KB |
Output is correct |
140 |
Correct |
164 ms |
3680 KB |
Output is correct |
141 |
Correct |
143 ms |
4860 KB |
Output is correct |
142 |
Correct |
144 ms |
4592 KB |
Output is correct |
143 |
Correct |
240 ms |
4840 KB |
Output is correct |
144 |
Correct |
163 ms |
4724 KB |
Output is correct |
145 |
Correct |
169 ms |
4936 KB |
Output is correct |
146 |
Correct |
164 ms |
4648 KB |
Output is correct |
147 |
Correct |
148 ms |
5936 KB |
Output is correct |
148 |
Correct |
151 ms |
4036 KB |
Output is correct |
149 |
Correct |
145 ms |
6116 KB |
Output is correct |
150 |
Correct |
109 ms |
3940 KB |
Output is correct |
151 |
Correct |
262 ms |
6632 KB |
Output is correct |
152 |
Correct |
212 ms |
4356 KB |
Output is correct |
153 |
Correct |
181 ms |
4284 KB |
Output is correct |
154 |
Correct |
184 ms |
4528 KB |
Output is correct |
155 |
Correct |
126 ms |
4312 KB |
Output is correct |
156 |
Correct |
138 ms |
4344 KB |
Output is correct |
157 |
Correct |
241 ms |
3624 KB |
Output is correct |
158 |
Correct |
249 ms |
3752 KB |
Output is correct |
159 |
Correct |
232 ms |
3756 KB |
Output is correct |
160 |
Correct |
264 ms |
3796 KB |
Output is correct |
161 |
Correct |
226 ms |
3796 KB |
Output is correct |
162 |
Correct |
243 ms |
3800 KB |
Output is correct |
163 |
Correct |
282 ms |
5092 KB |
Output is correct |
164 |
Correct |
203 ms |
5144 KB |
Output is correct |
165 |
Correct |
213 ms |
5220 KB |
Output is correct |
166 |
Correct |
226 ms |
5132 KB |
Output is correct |
167 |
Correct |
243 ms |
5136 KB |
Output is correct |
168 |
Correct |
211 ms |
5220 KB |
Output is correct |
169 |
Correct |
236 ms |
7608 KB |
Output is correct |
170 |
Correct |
197 ms |
4356 KB |
Output is correct |
171 |
Correct |
215 ms |
7540 KB |
Output is correct |
172 |
Correct |
207 ms |
4508 KB |
Output is correct |
173 |
Correct |
206 ms |
7540 KB |
Output is correct |
174 |
Correct |
206 ms |
4636 KB |
Output is correct |
175 |
Correct |
258 ms |
4740 KB |
Output is correct |
176 |
Correct |
208 ms |
4684 KB |
Output is correct |
177 |
Correct |
228 ms |
4812 KB |
Output is correct |
178 |
Correct |
195 ms |
4812 KB |
Output is correct |
179 |
Correct |
666 ms |
4520 KB |
Output is correct |
180 |
Correct |
743 ms |
4420 KB |
Output is correct |
181 |
Correct |
940 ms |
4564 KB |
Output is correct |
182 |
Correct |
1185 ms |
4920 KB |
Output is correct |
183 |
Correct |
768 ms |
4480 KB |
Output is correct |
184 |
Correct |
743 ms |
4436 KB |
Output is correct |
185 |
Correct |
499 ms |
7968 KB |
Output is correct |
186 |
Correct |
641 ms |
9448 KB |
Output is correct |
187 |
Correct |
654 ms |
8836 KB |
Output is correct |
188 |
Correct |
986 ms |
8320 KB |
Output is correct |
189 |
Correct |
1051 ms |
8564 KB |
Output is correct |
190 |
Correct |
875 ms |
9360 KB |
Output is correct |
191 |
Correct |
757 ms |
9024 KB |
Output is correct |
192 |
Correct |
649 ms |
7488 KB |
Output is correct |
193 |
Correct |
720 ms |
7096 KB |
Output is correct |
194 |
Correct |
1038 ms |
5288 KB |
Output is correct |
195 |
Correct |
1418 ms |
5312 KB |
Output is correct |
196 |
Correct |
1366 ms |
4912 KB |
Output is correct |
197 |
Correct |
1376 ms |
4948 KB |
Output is correct |
198 |
Correct |
1385 ms |
4972 KB |
Output is correct |
199 |
Correct |
1291 ms |
4988 KB |
Output is correct |
200 |
Correct |
1127 ms |
15608 KB |
Output is correct |
201 |
Correct |
1018 ms |
15636 KB |
Output is correct |
202 |
Correct |
1091 ms |
15568 KB |
Output is correct |
203 |
Correct |
1096 ms |
15616 KB |
Output is correct |
204 |
Correct |
1090 ms |
15748 KB |
Output is correct |
205 |
Correct |
1156 ms |
15568 KB |
Output is correct |
206 |
Correct |
1059 ms |
14360 KB |
Output is correct |
207 |
Correct |
972 ms |
13896 KB |
Output is correct |
208 |
Correct |
1045 ms |
14364 KB |
Output is correct |
209 |
Correct |
1155 ms |
13968 KB |
Output is correct |
210 |
Correct |
1190 ms |
14356 KB |
Output is correct |
211 |
Correct |
1031 ms |
13848 KB |
Output is correct |
212 |
Correct |
1232 ms |
15136 KB |
Output is correct |
213 |
Correct |
1198 ms |
12164 KB |
Output is correct |
214 |
Correct |
1187 ms |
11720 KB |
Output is correct |
215 |
Correct |
1216 ms |
11568 KB |
Output is correct |