#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][50010];
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 |
2 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 |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
3028 KB |
Output is correct |
6 |
Correct |
2 ms |
3028 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
4 ms |
3028 KB |
Output is correct |
10 |
Correct |
4 ms |
3028 KB |
Output is correct |
11 |
Correct |
5 ms |
3028 KB |
Output is correct |
12 |
Correct |
5 ms |
3008 KB |
Output is correct |
13 |
Correct |
5 ms |
3028 KB |
Output is correct |
14 |
Correct |
6 ms |
3088 KB |
Output is correct |
15 |
Correct |
5 ms |
3060 KB |
Output is correct |
16 |
Correct |
5 ms |
3028 KB |
Output is correct |
17 |
Correct |
7 ms |
3028 KB |
Output is correct |
18 |
Correct |
5 ms |
3096 KB |
Output is correct |
19 |
Correct |
8 ms |
3028 KB |
Output is correct |
20 |
Correct |
7 ms |
3104 KB |
Output is correct |
21 |
Correct |
4 ms |
3028 KB |
Output is correct |
22 |
Correct |
20 ms |
6860 KB |
Output is correct |
23 |
Correct |
19 ms |
6980 KB |
Output is correct |
24 |
Correct |
21 ms |
6880 KB |
Output is correct |
25 |
Correct |
3 ms |
2824 KB |
Output is correct |
26 |
Correct |
3 ms |
2772 KB |
Output is correct |
27 |
Correct |
105 ms |
3300 KB |
Output is correct |
28 |
Correct |
180 ms |
3288 KB |
Output is correct |
29 |
Correct |
93 ms |
3288 KB |
Output is correct |
30 |
Correct |
93 ms |
3280 KB |
Output is correct |
31 |
Correct |
114 ms |
4212 KB |
Output is correct |
32 |
Correct |
137 ms |
4204 KB |
Output is correct |
33 |
Correct |
108 ms |
4360 KB |
Output is correct |
34 |
Correct |
103 ms |
4204 KB |
Output is correct |
35 |
Correct |
128 ms |
4216 KB |
Output is correct |
36 |
Correct |
127 ms |
4240 KB |
Output is correct |
37 |
Correct |
131 ms |
7344 KB |
Output is correct |
38 |
Correct |
115 ms |
7252 KB |
Output is correct |
39 |
Correct |
121 ms |
7340 KB |
Output is correct |
40 |
Correct |
8 ms |
3668 KB |
Output is correct |
41 |
Correct |
6 ms |
3276 KB |
Output is correct |
42 |
Correct |
481 ms |
4612 KB |
Output is correct |
43 |
Correct |
334 ms |
4124 KB |
Output is correct |
44 |
Correct |
278 ms |
3972 KB |
Output is correct |
45 |
Correct |
490 ms |
4480 KB |
Output is correct |
46 |
Correct |
483 ms |
12628 KB |
Output is correct |
47 |
Correct |
280 ms |
8292 KB |
Output is correct |
48 |
Correct |
281 ms |
10816 KB |
Output is correct |
49 |
Correct |
324 ms |
10984 KB |
Output is correct |
50 |
Correct |
359 ms |
10628 KB |
Output is correct |
51 |
Correct |
422 ms |
8448 KB |
Output is correct |
52 |
Correct |
8 ms |
3796 KB |
Output is correct |
53 |
Correct |
9 ms |
3824 KB |
Output is correct |
54 |
Correct |
449 ms |
4608 KB |
Output is correct |
55 |
Correct |
471 ms |
4808 KB |
Output is correct |
56 |
Correct |
512 ms |
4604 KB |
Output is correct |
57 |
Correct |
456 ms |
4492 KB |
Output is correct |
58 |
Correct |
495 ms |
13368 KB |
Output is correct |
59 |
Correct |
525 ms |
13404 KB |
Output is correct |
60 |
Correct |
491 ms |
13340 KB |
Output is correct |
61 |
Correct |
496 ms |
13372 KB |
Output is correct |
62 |
Correct |
498 ms |
13548 KB |
Output is correct |
63 |
Correct |
583 ms |
13392 KB |
Output is correct |
64 |
Correct |
521 ms |
12368 KB |
Output is correct |
65 |
Correct |
499 ms |
12436 KB |
Output is correct |
66 |
Correct |
505 ms |
12432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 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 |
1 ms |
2644 KB |
Output is correct |
5 |
Correct |
2 ms |
3028 KB |
Output is correct |
6 |
Correct |
2 ms |
3028 KB |
Output is correct |
7 |
Correct |
2 ms |
2644 KB |
Output is correct |
8 |
Correct |
1 ms |
2644 KB |
Output is correct |
9 |
Correct |
4 ms |
3028 KB |
Output is correct |
10 |
Correct |
4 ms |
3028 KB |
Output is correct |
11 |
Correct |
5 ms |
3028 KB |
Output is correct |
12 |
Correct |
5 ms |
3008 KB |
Output is correct |
13 |
Correct |
5 ms |
3028 KB |
Output is correct |
14 |
Correct |
6 ms |
3088 KB |
Output is correct |
15 |
Correct |
5 ms |
3060 KB |
Output is correct |
16 |
Correct |
5 ms |
3028 KB |
Output is correct |
17 |
Correct |
7 ms |
3028 KB |
Output is correct |
18 |
Correct |
5 ms |
3096 KB |
Output is correct |
19 |
Correct |
8 ms |
3028 KB |
Output is correct |
20 |
Correct |
7 ms |
3104 KB |
Output is correct |
21 |
Correct |
4 ms |
3028 KB |
Output is correct |
22 |
Correct |
2 ms |
3028 KB |
Output is correct |
23 |
Correct |
2 ms |
3028 KB |
Output is correct |
24 |
Correct |
2 ms |
3028 KB |
Output is correct |
25 |
Correct |
2 ms |
2976 KB |
Output is correct |
26 |
Correct |
2 ms |
3028 KB |
Output is correct |
27 |
Correct |
3 ms |
3028 KB |
Output is correct |
28 |
Correct |
4 ms |
3028 KB |
Output is correct |
29 |
Correct |
3 ms |
3028 KB |
Output is correct |
30 |
Correct |
5 ms |
3028 KB |
Output is correct |
31 |
Correct |
4 ms |
3028 KB |
Output is correct |
32 |
Correct |
3 ms |
3028 KB |
Output is correct |
33 |
Correct |
4 ms |
3080 KB |
Output is correct |
34 |
Correct |
4 ms |
3080 KB |
Output is correct |
35 |
Correct |
3 ms |
3028 KB |
Output is correct |
36 |
Correct |
4 ms |
3084 KB |
Output is correct |
37 |
Correct |
3 ms |
3028 KB |
Output is correct |
38 |
Correct |
3 ms |
3084 KB |
Output is correct |
39 |
Correct |
3 ms |
3028 KB |
Output is correct |
40 |
Correct |
4 ms |
2996 KB |
Output is correct |
41 |
Correct |
4 ms |
3028 KB |
Output is correct |
42 |
Correct |
4 ms |
3028 KB |
Output is correct |
43 |
Correct |
4 ms |
3028 KB |
Output is correct |
44 |
Correct |
4 ms |
3028 KB |
Output is correct |
45 |
Correct |
4 ms |
3028 KB |
Output is correct |
46 |
Correct |
4 ms |
3028 KB |
Output is correct |
47 |
Correct |
4 ms |
3028 KB |
Output is correct |
48 |
Correct |
4 ms |
3028 KB |
Output is correct |
49 |
Correct |
4 ms |
3028 KB |
Output is correct |
50 |
Correct |
5 ms |
3028 KB |
Output is correct |
51 |
Correct |
4 ms |
3028 KB |
Output is correct |
52 |
Correct |
4 ms |
3028 KB |
Output is correct |
53 |
Correct |
4 ms |
3088 KB |
Output is correct |
54 |
Correct |
4 ms |
3028 KB |
Output is correct |
55 |
Correct |
4 ms |
3028 KB |
Output is correct |
56 |
Correct |
5 ms |
3028 KB |
Output is correct |
57 |
Correct |
5 ms |
3028 KB |
Output is correct |
58 |
Correct |
5 ms |
3028 KB |
Output is correct |
59 |
Correct |
6 ms |
3028 KB |
Output is correct |
60 |
Correct |
4 ms |
3112 KB |
Output is correct |
61 |
Correct |
4 ms |
3028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3028 KB |
Output is correct |
2 |
Correct |
2 ms |
3028 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 |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3028 KB |
Output is correct |
8 |
Correct |
2 ms |
3028 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
11 |
Correct |
4 ms |
3028 KB |
Output is correct |
12 |
Correct |
4 ms |
3028 KB |
Output is correct |
13 |
Correct |
5 ms |
3028 KB |
Output is correct |
14 |
Correct |
5 ms |
3008 KB |
Output is correct |
15 |
Correct |
5 ms |
3028 KB |
Output is correct |
16 |
Correct |
6 ms |
3088 KB |
Output is correct |
17 |
Correct |
5 ms |
3060 KB |
Output is correct |
18 |
Correct |
5 ms |
3028 KB |
Output is correct |
19 |
Correct |
7 ms |
3028 KB |
Output is correct |
20 |
Correct |
5 ms |
3096 KB |
Output is correct |
21 |
Correct |
8 ms |
3028 KB |
Output is correct |
22 |
Correct |
7 ms |
3104 KB |
Output is correct |
23 |
Correct |
4 ms |
3028 KB |
Output is correct |
24 |
Correct |
20 ms |
6860 KB |
Output is correct |
25 |
Correct |
19 ms |
6980 KB |
Output is correct |
26 |
Correct |
21 ms |
6880 KB |
Output is correct |
27 |
Correct |
2 ms |
3028 KB |
Output is correct |
28 |
Correct |
2 ms |
2976 KB |
Output is correct |
29 |
Correct |
2 ms |
3028 KB |
Output is correct |
30 |
Correct |
3 ms |
3028 KB |
Output is correct |
31 |
Correct |
4 ms |
3028 KB |
Output is correct |
32 |
Correct |
3 ms |
3028 KB |
Output is correct |
33 |
Correct |
5 ms |
3028 KB |
Output is correct |
34 |
Correct |
4 ms |
3028 KB |
Output is correct |
35 |
Correct |
3 ms |
3028 KB |
Output is correct |
36 |
Correct |
4 ms |
3080 KB |
Output is correct |
37 |
Correct |
4 ms |
3080 KB |
Output is correct |
38 |
Correct |
3 ms |
3028 KB |
Output is correct |
39 |
Correct |
4 ms |
3084 KB |
Output is correct |
40 |
Correct |
3 ms |
3028 KB |
Output is correct |
41 |
Correct |
3 ms |
3084 KB |
Output is correct |
42 |
Correct |
3 ms |
3028 KB |
Output is correct |
43 |
Correct |
4 ms |
2996 KB |
Output is correct |
44 |
Correct |
4 ms |
3028 KB |
Output is correct |
45 |
Correct |
4 ms |
3028 KB |
Output is correct |
46 |
Correct |
4 ms |
3028 KB |
Output is correct |
47 |
Correct |
4 ms |
3028 KB |
Output is correct |
48 |
Correct |
4 ms |
3028 KB |
Output is correct |
49 |
Correct |
4 ms |
3028 KB |
Output is correct |
50 |
Correct |
4 ms |
3028 KB |
Output is correct |
51 |
Correct |
4 ms |
3028 KB |
Output is correct |
52 |
Correct |
4 ms |
3028 KB |
Output is correct |
53 |
Correct |
5 ms |
3028 KB |
Output is correct |
54 |
Correct |
4 ms |
3028 KB |
Output is correct |
55 |
Correct |
4 ms |
3028 KB |
Output is correct |
56 |
Correct |
4 ms |
3088 KB |
Output is correct |
57 |
Correct |
4 ms |
3028 KB |
Output is correct |
58 |
Correct |
4 ms |
3028 KB |
Output is correct |
59 |
Correct |
5 ms |
3028 KB |
Output is correct |
60 |
Correct |
5 ms |
3028 KB |
Output is correct |
61 |
Correct |
5 ms |
3028 KB |
Output is correct |
62 |
Correct |
6 ms |
3028 KB |
Output is correct |
63 |
Correct |
4 ms |
3112 KB |
Output is correct |
64 |
Correct |
4 ms |
3028 KB |
Output is correct |
65 |
Correct |
3 ms |
3028 KB |
Output is correct |
66 |
Correct |
4 ms |
3028 KB |
Output is correct |
67 |
Correct |
5 ms |
3028 KB |
Output is correct |
68 |
Correct |
5 ms |
3028 KB |
Output is correct |
69 |
Correct |
4 ms |
3028 KB |
Output is correct |
70 |
Correct |
7 ms |
3156 KB |
Output is correct |
71 |
Correct |
5 ms |
3156 KB |
Output is correct |
72 |
Correct |
5 ms |
3156 KB |
Output is correct |
73 |
Correct |
4 ms |
3156 KB |
Output is correct |
74 |
Correct |
7 ms |
3156 KB |
Output is correct |
75 |
Correct |
5 ms |
3224 KB |
Output is correct |
76 |
Correct |
20 ms |
5588 KB |
Output is correct |
77 |
Correct |
19 ms |
6100 KB |
Output is correct |
78 |
Correct |
22 ms |
6472 KB |
Output is correct |
79 |
Correct |
5 ms |
3028 KB |
Output is correct |
80 |
Correct |
4 ms |
3028 KB |
Output is correct |
81 |
Correct |
4 ms |
3028 KB |
Output is correct |
82 |
Correct |
5 ms |
3028 KB |
Output is correct |
83 |
Correct |
5 ms |
3028 KB |
Output is correct |
84 |
Correct |
6 ms |
3284 KB |
Output is correct |
85 |
Correct |
6 ms |
3284 KB |
Output is correct |
86 |
Correct |
5 ms |
3280 KB |
Output is correct |
87 |
Correct |
5 ms |
3284 KB |
Output is correct |
88 |
Correct |
6 ms |
3284 KB |
Output is correct |
89 |
Correct |
5 ms |
3284 KB |
Output is correct |
90 |
Correct |
30 ms |
6672 KB |
Output is correct |
91 |
Correct |
25 ms |
6684 KB |
Output is correct |
92 |
Correct |
27 ms |
6764 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3028 KB |
Output is correct |
2 |
Correct |
2 ms |
3028 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 |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3028 KB |
Output is correct |
8 |
Correct |
2 ms |
3028 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
11 |
Correct |
4 ms |
3028 KB |
Output is correct |
12 |
Correct |
4 ms |
3028 KB |
Output is correct |
13 |
Correct |
5 ms |
3028 KB |
Output is correct |
14 |
Correct |
5 ms |
3008 KB |
Output is correct |
15 |
Correct |
5 ms |
3028 KB |
Output is correct |
16 |
Correct |
6 ms |
3088 KB |
Output is correct |
17 |
Correct |
5 ms |
3060 KB |
Output is correct |
18 |
Correct |
5 ms |
3028 KB |
Output is correct |
19 |
Correct |
7 ms |
3028 KB |
Output is correct |
20 |
Correct |
5 ms |
3096 KB |
Output is correct |
21 |
Correct |
8 ms |
3028 KB |
Output is correct |
22 |
Correct |
7 ms |
3104 KB |
Output is correct |
23 |
Correct |
4 ms |
3028 KB |
Output is correct |
24 |
Correct |
20 ms |
6860 KB |
Output is correct |
25 |
Correct |
19 ms |
6980 KB |
Output is correct |
26 |
Correct |
21 ms |
6880 KB |
Output is correct |
27 |
Correct |
3 ms |
2824 KB |
Output is correct |
28 |
Correct |
3 ms |
2772 KB |
Output is correct |
29 |
Correct |
105 ms |
3300 KB |
Output is correct |
30 |
Correct |
180 ms |
3288 KB |
Output is correct |
31 |
Correct |
93 ms |
3288 KB |
Output is correct |
32 |
Correct |
93 ms |
3280 KB |
Output is correct |
33 |
Correct |
114 ms |
4212 KB |
Output is correct |
34 |
Correct |
137 ms |
4204 KB |
Output is correct |
35 |
Correct |
108 ms |
4360 KB |
Output is correct |
36 |
Correct |
103 ms |
4204 KB |
Output is correct |
37 |
Correct |
128 ms |
4216 KB |
Output is correct |
38 |
Correct |
127 ms |
4240 KB |
Output is correct |
39 |
Correct |
131 ms |
7344 KB |
Output is correct |
40 |
Correct |
115 ms |
7252 KB |
Output is correct |
41 |
Correct |
121 ms |
7340 KB |
Output is correct |
42 |
Correct |
2 ms |
3028 KB |
Output is correct |
43 |
Correct |
2 ms |
2976 KB |
Output is correct |
44 |
Correct |
2 ms |
3028 KB |
Output is correct |
45 |
Correct |
3 ms |
3028 KB |
Output is correct |
46 |
Correct |
4 ms |
3028 KB |
Output is correct |
47 |
Correct |
3 ms |
3028 KB |
Output is correct |
48 |
Correct |
5 ms |
3028 KB |
Output is correct |
49 |
Correct |
4 ms |
3028 KB |
Output is correct |
50 |
Correct |
3 ms |
3028 KB |
Output is correct |
51 |
Correct |
4 ms |
3080 KB |
Output is correct |
52 |
Correct |
4 ms |
3080 KB |
Output is correct |
53 |
Correct |
3 ms |
3028 KB |
Output is correct |
54 |
Correct |
4 ms |
3084 KB |
Output is correct |
55 |
Correct |
3 ms |
3028 KB |
Output is correct |
56 |
Correct |
3 ms |
3084 KB |
Output is correct |
57 |
Correct |
3 ms |
3028 KB |
Output is correct |
58 |
Correct |
4 ms |
2996 KB |
Output is correct |
59 |
Correct |
4 ms |
3028 KB |
Output is correct |
60 |
Correct |
4 ms |
3028 KB |
Output is correct |
61 |
Correct |
4 ms |
3028 KB |
Output is correct |
62 |
Correct |
4 ms |
3028 KB |
Output is correct |
63 |
Correct |
4 ms |
3028 KB |
Output is correct |
64 |
Correct |
4 ms |
3028 KB |
Output is correct |
65 |
Correct |
4 ms |
3028 KB |
Output is correct |
66 |
Correct |
4 ms |
3028 KB |
Output is correct |
67 |
Correct |
4 ms |
3028 KB |
Output is correct |
68 |
Correct |
5 ms |
3028 KB |
Output is correct |
69 |
Correct |
4 ms |
3028 KB |
Output is correct |
70 |
Correct |
4 ms |
3028 KB |
Output is correct |
71 |
Correct |
4 ms |
3088 KB |
Output is correct |
72 |
Correct |
4 ms |
3028 KB |
Output is correct |
73 |
Correct |
4 ms |
3028 KB |
Output is correct |
74 |
Correct |
5 ms |
3028 KB |
Output is correct |
75 |
Correct |
5 ms |
3028 KB |
Output is correct |
76 |
Correct |
5 ms |
3028 KB |
Output is correct |
77 |
Correct |
6 ms |
3028 KB |
Output is correct |
78 |
Correct |
4 ms |
3112 KB |
Output is correct |
79 |
Correct |
4 ms |
3028 KB |
Output is correct |
80 |
Correct |
3 ms |
3028 KB |
Output is correct |
81 |
Correct |
4 ms |
3028 KB |
Output is correct |
82 |
Correct |
5 ms |
3028 KB |
Output is correct |
83 |
Correct |
5 ms |
3028 KB |
Output is correct |
84 |
Correct |
4 ms |
3028 KB |
Output is correct |
85 |
Correct |
7 ms |
3156 KB |
Output is correct |
86 |
Correct |
5 ms |
3156 KB |
Output is correct |
87 |
Correct |
5 ms |
3156 KB |
Output is correct |
88 |
Correct |
4 ms |
3156 KB |
Output is correct |
89 |
Correct |
7 ms |
3156 KB |
Output is correct |
90 |
Correct |
5 ms |
3224 KB |
Output is correct |
91 |
Correct |
20 ms |
5588 KB |
Output is correct |
92 |
Correct |
19 ms |
6100 KB |
Output is correct |
93 |
Correct |
22 ms |
6472 KB |
Output is correct |
94 |
Correct |
5 ms |
3028 KB |
Output is correct |
95 |
Correct |
4 ms |
3028 KB |
Output is correct |
96 |
Correct |
4 ms |
3028 KB |
Output is correct |
97 |
Correct |
5 ms |
3028 KB |
Output is correct |
98 |
Correct |
5 ms |
3028 KB |
Output is correct |
99 |
Correct |
6 ms |
3284 KB |
Output is correct |
100 |
Correct |
6 ms |
3284 KB |
Output is correct |
101 |
Correct |
5 ms |
3280 KB |
Output is correct |
102 |
Correct |
5 ms |
3284 KB |
Output is correct |
103 |
Correct |
6 ms |
3284 KB |
Output is correct |
104 |
Correct |
5 ms |
3284 KB |
Output is correct |
105 |
Correct |
30 ms |
6672 KB |
Output is correct |
106 |
Correct |
25 ms |
6684 KB |
Output is correct |
107 |
Correct |
27 ms |
6764 KB |
Output is correct |
108 |
Correct |
100 ms |
3284 KB |
Output is correct |
109 |
Correct |
125 ms |
3564 KB |
Output is correct |
110 |
Correct |
84 ms |
3256 KB |
Output is correct |
111 |
Correct |
77 ms |
3156 KB |
Output is correct |
112 |
Correct |
94 ms |
3312 KB |
Output is correct |
113 |
Correct |
67 ms |
3284 KB |
Output is correct |
114 |
Correct |
62 ms |
4372 KB |
Output is correct |
115 |
Correct |
57 ms |
4300 KB |
Output is correct |
116 |
Correct |
96 ms |
4464 KB |
Output is correct |
117 |
Correct |
73 ms |
4312 KB |
Output is correct |
118 |
Correct |
68 ms |
4428 KB |
Output is correct |
119 |
Correct |
75 ms |
4124 KB |
Output is correct |
120 |
Correct |
91 ms |
5544 KB |
Output is correct |
121 |
Correct |
60 ms |
3664 KB |
Output is correct |
122 |
Correct |
74 ms |
5716 KB |
Output is correct |
123 |
Correct |
55 ms |
3552 KB |
Output is correct |
124 |
Correct |
110 ms |
6252 KB |
Output is correct |
125 |
Correct |
92 ms |
3796 KB |
Output is correct |
126 |
Correct |
88 ms |
3892 KB |
Output is correct |
127 |
Correct |
119 ms |
4152 KB |
Output is correct |
128 |
Correct |
68 ms |
3824 KB |
Output is correct |
129 |
Correct |
72 ms |
3964 KB |
Output is correct |
130 |
Correct |
105 ms |
3452 KB |
Output is correct |
131 |
Correct |
167 ms |
3404 KB |
Output is correct |
132 |
Correct |
150 ms |
3360 KB |
Output is correct |
133 |
Correct |
142 ms |
3284 KB |
Output is correct |
134 |
Correct |
132 ms |
3412 KB |
Output is correct |
135 |
Correct |
128 ms |
3412 KB |
Output is correct |
136 |
Correct |
110 ms |
4872 KB |
Output is correct |
137 |
Correct |
115 ms |
4712 KB |
Output is correct |
138 |
Correct |
121 ms |
4676 KB |
Output is correct |
139 |
Correct |
106 ms |
4716 KB |
Output is correct |
140 |
Correct |
115 ms |
4832 KB |
Output is correct |
141 |
Correct |
137 ms |
4704 KB |
Output is correct |
142 |
Correct |
118 ms |
7168 KB |
Output is correct |
143 |
Correct |
95 ms |
4012 KB |
Output is correct |
144 |
Correct |
116 ms |
7144 KB |
Output is correct |
145 |
Correct |
102 ms |
3988 KB |
Output is correct |
146 |
Correct |
121 ms |
7148 KB |
Output is correct |
147 |
Correct |
100 ms |
4112 KB |
Output is correct |
148 |
Correct |
103 ms |
4340 KB |
Output is correct |
149 |
Correct |
109 ms |
4380 KB |
Output is correct |
150 |
Correct |
97 ms |
4224 KB |
Output is correct |
151 |
Correct |
100 ms |
4180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3028 KB |
Output is correct |
2 |
Correct |
2 ms |
3028 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 |
2644 KB |
Output is correct |
6 |
Correct |
1 ms |
2644 KB |
Output is correct |
7 |
Correct |
2 ms |
3028 KB |
Output is correct |
8 |
Correct |
2 ms |
3028 KB |
Output is correct |
9 |
Correct |
2 ms |
2644 KB |
Output is correct |
10 |
Correct |
1 ms |
2644 KB |
Output is correct |
11 |
Correct |
4 ms |
3028 KB |
Output is correct |
12 |
Correct |
4 ms |
3028 KB |
Output is correct |
13 |
Correct |
5 ms |
3028 KB |
Output is correct |
14 |
Correct |
5 ms |
3008 KB |
Output is correct |
15 |
Correct |
5 ms |
3028 KB |
Output is correct |
16 |
Correct |
6 ms |
3088 KB |
Output is correct |
17 |
Correct |
5 ms |
3060 KB |
Output is correct |
18 |
Correct |
5 ms |
3028 KB |
Output is correct |
19 |
Correct |
7 ms |
3028 KB |
Output is correct |
20 |
Correct |
5 ms |
3096 KB |
Output is correct |
21 |
Correct |
8 ms |
3028 KB |
Output is correct |
22 |
Correct |
7 ms |
3104 KB |
Output is correct |
23 |
Correct |
4 ms |
3028 KB |
Output is correct |
24 |
Correct |
20 ms |
6860 KB |
Output is correct |
25 |
Correct |
19 ms |
6980 KB |
Output is correct |
26 |
Correct |
21 ms |
6880 KB |
Output is correct |
27 |
Correct |
3 ms |
2824 KB |
Output is correct |
28 |
Correct |
3 ms |
2772 KB |
Output is correct |
29 |
Correct |
105 ms |
3300 KB |
Output is correct |
30 |
Correct |
180 ms |
3288 KB |
Output is correct |
31 |
Correct |
93 ms |
3288 KB |
Output is correct |
32 |
Correct |
93 ms |
3280 KB |
Output is correct |
33 |
Correct |
114 ms |
4212 KB |
Output is correct |
34 |
Correct |
137 ms |
4204 KB |
Output is correct |
35 |
Correct |
108 ms |
4360 KB |
Output is correct |
36 |
Correct |
103 ms |
4204 KB |
Output is correct |
37 |
Correct |
128 ms |
4216 KB |
Output is correct |
38 |
Correct |
127 ms |
4240 KB |
Output is correct |
39 |
Correct |
131 ms |
7344 KB |
Output is correct |
40 |
Correct |
115 ms |
7252 KB |
Output is correct |
41 |
Correct |
121 ms |
7340 KB |
Output is correct |
42 |
Correct |
8 ms |
3668 KB |
Output is correct |
43 |
Correct |
6 ms |
3276 KB |
Output is correct |
44 |
Correct |
481 ms |
4612 KB |
Output is correct |
45 |
Correct |
334 ms |
4124 KB |
Output is correct |
46 |
Correct |
278 ms |
3972 KB |
Output is correct |
47 |
Correct |
490 ms |
4480 KB |
Output is correct |
48 |
Correct |
483 ms |
12628 KB |
Output is correct |
49 |
Correct |
280 ms |
8292 KB |
Output is correct |
50 |
Correct |
281 ms |
10816 KB |
Output is correct |
51 |
Correct |
324 ms |
10984 KB |
Output is correct |
52 |
Correct |
359 ms |
10628 KB |
Output is correct |
53 |
Correct |
422 ms |
8448 KB |
Output is correct |
54 |
Correct |
8 ms |
3796 KB |
Output is correct |
55 |
Correct |
9 ms |
3824 KB |
Output is correct |
56 |
Correct |
449 ms |
4608 KB |
Output is correct |
57 |
Correct |
471 ms |
4808 KB |
Output is correct |
58 |
Correct |
512 ms |
4604 KB |
Output is correct |
59 |
Correct |
456 ms |
4492 KB |
Output is correct |
60 |
Correct |
495 ms |
13368 KB |
Output is correct |
61 |
Correct |
525 ms |
13404 KB |
Output is correct |
62 |
Correct |
491 ms |
13340 KB |
Output is correct |
63 |
Correct |
496 ms |
13372 KB |
Output is correct |
64 |
Correct |
498 ms |
13548 KB |
Output is correct |
65 |
Correct |
583 ms |
13392 KB |
Output is correct |
66 |
Correct |
521 ms |
12368 KB |
Output is correct |
67 |
Correct |
499 ms |
12436 KB |
Output is correct |
68 |
Correct |
505 ms |
12432 KB |
Output is correct |
69 |
Correct |
2 ms |
3028 KB |
Output is correct |
70 |
Correct |
2 ms |
2976 KB |
Output is correct |
71 |
Correct |
2 ms |
3028 KB |
Output is correct |
72 |
Correct |
3 ms |
3028 KB |
Output is correct |
73 |
Correct |
4 ms |
3028 KB |
Output is correct |
74 |
Correct |
3 ms |
3028 KB |
Output is correct |
75 |
Correct |
5 ms |
3028 KB |
Output is correct |
76 |
Correct |
4 ms |
3028 KB |
Output is correct |
77 |
Correct |
3 ms |
3028 KB |
Output is correct |
78 |
Correct |
4 ms |
3080 KB |
Output is correct |
79 |
Correct |
4 ms |
3080 KB |
Output is correct |
80 |
Correct |
3 ms |
3028 KB |
Output is correct |
81 |
Correct |
4 ms |
3084 KB |
Output is correct |
82 |
Correct |
3 ms |
3028 KB |
Output is correct |
83 |
Correct |
3 ms |
3084 KB |
Output is correct |
84 |
Correct |
3 ms |
3028 KB |
Output is correct |
85 |
Correct |
4 ms |
2996 KB |
Output is correct |
86 |
Correct |
4 ms |
3028 KB |
Output is correct |
87 |
Correct |
4 ms |
3028 KB |
Output is correct |
88 |
Correct |
4 ms |
3028 KB |
Output is correct |
89 |
Correct |
4 ms |
3028 KB |
Output is correct |
90 |
Correct |
4 ms |
3028 KB |
Output is correct |
91 |
Correct |
4 ms |
3028 KB |
Output is correct |
92 |
Correct |
4 ms |
3028 KB |
Output is correct |
93 |
Correct |
4 ms |
3028 KB |
Output is correct |
94 |
Correct |
4 ms |
3028 KB |
Output is correct |
95 |
Correct |
5 ms |
3028 KB |
Output is correct |
96 |
Correct |
4 ms |
3028 KB |
Output is correct |
97 |
Correct |
4 ms |
3028 KB |
Output is correct |
98 |
Correct |
4 ms |
3088 KB |
Output is correct |
99 |
Correct |
4 ms |
3028 KB |
Output is correct |
100 |
Correct |
4 ms |
3028 KB |
Output is correct |
101 |
Correct |
5 ms |
3028 KB |
Output is correct |
102 |
Correct |
5 ms |
3028 KB |
Output is correct |
103 |
Correct |
5 ms |
3028 KB |
Output is correct |
104 |
Correct |
6 ms |
3028 KB |
Output is correct |
105 |
Correct |
4 ms |
3112 KB |
Output is correct |
106 |
Correct |
4 ms |
3028 KB |
Output is correct |
107 |
Correct |
3 ms |
3028 KB |
Output is correct |
108 |
Correct |
4 ms |
3028 KB |
Output is correct |
109 |
Correct |
5 ms |
3028 KB |
Output is correct |
110 |
Correct |
5 ms |
3028 KB |
Output is correct |
111 |
Correct |
4 ms |
3028 KB |
Output is correct |
112 |
Correct |
7 ms |
3156 KB |
Output is correct |
113 |
Correct |
5 ms |
3156 KB |
Output is correct |
114 |
Correct |
5 ms |
3156 KB |
Output is correct |
115 |
Correct |
4 ms |
3156 KB |
Output is correct |
116 |
Correct |
7 ms |
3156 KB |
Output is correct |
117 |
Correct |
5 ms |
3224 KB |
Output is correct |
118 |
Correct |
20 ms |
5588 KB |
Output is correct |
119 |
Correct |
19 ms |
6100 KB |
Output is correct |
120 |
Correct |
22 ms |
6472 KB |
Output is correct |
121 |
Correct |
5 ms |
3028 KB |
Output is correct |
122 |
Correct |
4 ms |
3028 KB |
Output is correct |
123 |
Correct |
4 ms |
3028 KB |
Output is correct |
124 |
Correct |
5 ms |
3028 KB |
Output is correct |
125 |
Correct |
5 ms |
3028 KB |
Output is correct |
126 |
Correct |
6 ms |
3284 KB |
Output is correct |
127 |
Correct |
6 ms |
3284 KB |
Output is correct |
128 |
Correct |
5 ms |
3280 KB |
Output is correct |
129 |
Correct |
5 ms |
3284 KB |
Output is correct |
130 |
Correct |
6 ms |
3284 KB |
Output is correct |
131 |
Correct |
5 ms |
3284 KB |
Output is correct |
132 |
Correct |
30 ms |
6672 KB |
Output is correct |
133 |
Correct |
25 ms |
6684 KB |
Output is correct |
134 |
Correct |
27 ms |
6764 KB |
Output is correct |
135 |
Correct |
100 ms |
3284 KB |
Output is correct |
136 |
Correct |
125 ms |
3564 KB |
Output is correct |
137 |
Correct |
84 ms |
3256 KB |
Output is correct |
138 |
Correct |
77 ms |
3156 KB |
Output is correct |
139 |
Correct |
94 ms |
3312 KB |
Output is correct |
140 |
Correct |
67 ms |
3284 KB |
Output is correct |
141 |
Correct |
62 ms |
4372 KB |
Output is correct |
142 |
Correct |
57 ms |
4300 KB |
Output is correct |
143 |
Correct |
96 ms |
4464 KB |
Output is correct |
144 |
Correct |
73 ms |
4312 KB |
Output is correct |
145 |
Correct |
68 ms |
4428 KB |
Output is correct |
146 |
Correct |
75 ms |
4124 KB |
Output is correct |
147 |
Correct |
91 ms |
5544 KB |
Output is correct |
148 |
Correct |
60 ms |
3664 KB |
Output is correct |
149 |
Correct |
74 ms |
5716 KB |
Output is correct |
150 |
Correct |
55 ms |
3552 KB |
Output is correct |
151 |
Correct |
110 ms |
6252 KB |
Output is correct |
152 |
Correct |
92 ms |
3796 KB |
Output is correct |
153 |
Correct |
88 ms |
3892 KB |
Output is correct |
154 |
Correct |
119 ms |
4152 KB |
Output is correct |
155 |
Correct |
68 ms |
3824 KB |
Output is correct |
156 |
Correct |
72 ms |
3964 KB |
Output is correct |
157 |
Correct |
105 ms |
3452 KB |
Output is correct |
158 |
Correct |
167 ms |
3404 KB |
Output is correct |
159 |
Correct |
150 ms |
3360 KB |
Output is correct |
160 |
Correct |
142 ms |
3284 KB |
Output is correct |
161 |
Correct |
132 ms |
3412 KB |
Output is correct |
162 |
Correct |
128 ms |
3412 KB |
Output is correct |
163 |
Correct |
110 ms |
4872 KB |
Output is correct |
164 |
Correct |
115 ms |
4712 KB |
Output is correct |
165 |
Correct |
121 ms |
4676 KB |
Output is correct |
166 |
Correct |
106 ms |
4716 KB |
Output is correct |
167 |
Correct |
115 ms |
4832 KB |
Output is correct |
168 |
Correct |
137 ms |
4704 KB |
Output is correct |
169 |
Correct |
118 ms |
7168 KB |
Output is correct |
170 |
Correct |
95 ms |
4012 KB |
Output is correct |
171 |
Correct |
116 ms |
7144 KB |
Output is correct |
172 |
Correct |
102 ms |
3988 KB |
Output is correct |
173 |
Correct |
121 ms |
7148 KB |
Output is correct |
174 |
Correct |
100 ms |
4112 KB |
Output is correct |
175 |
Correct |
103 ms |
4340 KB |
Output is correct |
176 |
Correct |
109 ms |
4380 KB |
Output is correct |
177 |
Correct |
97 ms |
4224 KB |
Output is correct |
178 |
Correct |
100 ms |
4180 KB |
Output is correct |
179 |
Correct |
295 ms |
4212 KB |
Output is correct |
180 |
Correct |
386 ms |
3852 KB |
Output is correct |
181 |
Correct |
530 ms |
4016 KB |
Output is correct |
182 |
Correct |
692 ms |
4316 KB |
Output is correct |
183 |
Correct |
514 ms |
4044 KB |
Output is correct |
184 |
Correct |
377 ms |
3924 KB |
Output is correct |
185 |
Correct |
255 ms |
6672 KB |
Output is correct |
186 |
Correct |
356 ms |
8456 KB |
Output is correct |
187 |
Correct |
304 ms |
7388 KB |
Output is correct |
188 |
Correct |
516 ms |
6828 KB |
Output is correct |
189 |
Correct |
434 ms |
7200 KB |
Output is correct |
190 |
Correct |
377 ms |
7836 KB |
Output is correct |
191 |
Correct |
377 ms |
7868 KB |
Output is correct |
192 |
Correct |
353 ms |
6196 KB |
Output is correct |
193 |
Correct |
378 ms |
6064 KB |
Output is correct |
194 |
Correct |
480 ms |
4580 KB |
Output is correct |
195 |
Correct |
812 ms |
4708 KB |
Output is correct |
196 |
Correct |
744 ms |
4428 KB |
Output is correct |
197 |
Correct |
693 ms |
4352 KB |
Output is correct |
198 |
Correct |
811 ms |
4500 KB |
Output is correct |
199 |
Correct |
748 ms |
4392 KB |
Output is correct |
200 |
Correct |
517 ms |
13404 KB |
Output is correct |
201 |
Correct |
566 ms |
13408 KB |
Output is correct |
202 |
Correct |
535 ms |
13428 KB |
Output is correct |
203 |
Correct |
534 ms |
13404 KB |
Output is correct |
204 |
Correct |
553 ms |
13464 KB |
Output is correct |
205 |
Correct |
527 ms |
13360 KB |
Output is correct |
206 |
Correct |
507 ms |
12400 KB |
Output is correct |
207 |
Correct |
526 ms |
12376 KB |
Output is correct |
208 |
Correct |
518 ms |
12400 KB |
Output is correct |
209 |
Correct |
536 ms |
12160 KB |
Output is correct |
210 |
Correct |
616 ms |
12408 KB |
Output is correct |
211 |
Correct |
509 ms |
12328 KB |
Output is correct |
212 |
Correct |
506 ms |
13216 KB |
Output is correct |
213 |
Correct |
501 ms |
10412 KB |
Output is correct |
214 |
Correct |
485 ms |
9960 KB |
Output is correct |
215 |
Correct |
501 ms |
9596 KB |
Output is correct |