#include "paint.h"
#include <bits/stdc++.h>
#pragma optimize("Ofast")
#pragma target("avx2")
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define mem(a,i) memset(a,i,sizeof(a))
#define sz(s) (int)s.size()
#define y1 yy
#define ppb pop_back
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b) __gcd(a,b)
#define in insert
// #define int ll
const int MAX=1e5+15;
const int B=300;
const int N=104;
const int block=400;
const int maxB=MAX/B+10;
const ll inf=2e9;
const int mod=998244353;
const int mod1=1e9+9;
const ld eps=1e-9;
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,-1,1,-1};
int binpow(int a,int n){
if(!n)return 1;
if(n%2==1)return a*binpow(a,n-1)%mod;
int k=binpow(a,n/2);
return k*k%mod;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int good[MAX];
int cnt[MAX];
int n,m;
vector<int> c;
vector<int> g[MAX],G[MAX];
int f;
void add(int i){
for(int x:g[i]){
cnt[x]++;
if(cnt[x]==m)f++;
// cout<<i<<" "<<x<<"\n";
}
}
void del(int i){
for(int x:g[i]){
if(cnt[x]==m)f--;
cnt[x]--;
}
}
int dp[MAX];
struct segtree{
int t[4*MAX];
void build(int v,int tl,int tr){
t[v]=inf;
if(tl==tr){
return;
}
int tm=(tl+tr)/2;
build(2*v,tl,tm);
build(2*v+1,tm+1,tr);
}
void update(int v,int tl,int tr,int pos,int x){
if(tl==tr){
t[v]=x;
return;
}
int tm=(tl+tr)/2;
if(pos<=tm)update(2*v,tl,tm,pos,x);
else update(2*v+1,tm+1,tr,pos,x);
t[v]=min(t[2*v],t[2*v+1]);
}
int get(int v,int tl,int tr,int l,int r){
if(l>r||tl>r||l>tr)return inf;
if(l<=tl&&tr<=r)return t[v];
int tm=(tl+tr)/2;
return min(get(2*v,tl,tm,l,r),get(2*v+1,tm+1,tr,l,r));
}
}t;
int minimumInstructions(int N, int M, int K, vector<int> C,vector<int> A, vector<vector<int>> B) {
n=N;
m=M;
c=C;
// cerr<<"OK\n";
for(int i=0;i<M;i++){
for(int x:B[i]){
G[x].pb(i);
}
}
for(int i=0;i<N;i++){
g[i]=G[C[i]];
for(int j=0;j<sz(g[i]);j++){
g[i][j]-=i;
while(g[i][j]<0)g[i][j]=(g[i][j]+M*1ll*N)%M;
}
}
for(int i=0;i<M;i++)add(i);
if(f)good[M-1]=1;
// cout<<good[M-1]<<"\n";
// return -1;
for(int i=M;i<N;i++){
del(i-M);
add(i);
if(f)good[i]=1;
// cout<<i<<" "<<good[i]<<"\n";
}
if(!good[M-1])return -1;
t.build(1,0,N-1);
// for(int i=0;i<N;i++){
// cout<<t.get(1,0,N-1,i,i)<<"\n";
// }
t.update(1,0,N-1,M-1,1);
for(int i=M;i<N;i++){
if(good[i]){
t.update(1,0,N-1,i,t.get(1,0,N-1,i-M,i-1)+1);
}
}
return (t.get(1,0,N-1,N-1,N-1)==inf?-1:t.get(1,0,N-1,N-1,N-1));
}
Compilation message
paint.cpp:4: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
4 | #pragma optimize("Ofast")
|
paint.cpp:5: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
5 | #pragma target("avx2")
|
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6748 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
2 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6744 KB |
Output is correct |
6 |
Correct |
1 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6916 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6744 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6748 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
2 ms |
6744 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
16 ms |
10752 KB |
Output is correct |
23 |
Correct |
17 ms |
10716 KB |
Output is correct |
24 |
Correct |
16 ms |
10768 KB |
Output is correct |
25 |
Correct |
7 ms |
8028 KB |
Output is correct |
26 |
Correct |
7 ms |
8028 KB |
Output is correct |
27 |
Correct |
4 ms |
7772 KB |
Output is correct |
28 |
Correct |
4 ms |
7768 KB |
Output is correct |
29 |
Correct |
4 ms |
7772 KB |
Output is correct |
30 |
Correct |
4 ms |
7768 KB |
Output is correct |
31 |
Correct |
12 ms |
8920 KB |
Output is correct |
32 |
Correct |
12 ms |
8796 KB |
Output is correct |
33 |
Correct |
11 ms |
8792 KB |
Output is correct |
34 |
Correct |
12 ms |
8964 KB |
Output is correct |
35 |
Correct |
11 ms |
8796 KB |
Output is correct |
36 |
Correct |
12 ms |
8960 KB |
Output is correct |
37 |
Correct |
20 ms |
11872 KB |
Output is correct |
38 |
Correct |
21 ms |
11868 KB |
Output is correct |
39 |
Correct |
19 ms |
11872 KB |
Output is correct |
40 |
Correct |
27 ms |
11336 KB |
Output is correct |
41 |
Correct |
18 ms |
9568 KB |
Output is correct |
42 |
Correct |
22 ms |
11624 KB |
Output is correct |
43 |
Correct |
9 ms |
9828 KB |
Output is correct |
44 |
Correct |
8 ms |
9576 KB |
Output is correct |
45 |
Correct |
14 ms |
11432 KB |
Output is correct |
46 |
Correct |
49 ms |
19388 KB |
Output is correct |
47 |
Correct |
30 ms |
14172 KB |
Output is correct |
48 |
Correct |
28 ms |
16476 KB |
Output is correct |
49 |
Correct |
31 ms |
16732 KB |
Output is correct |
50 |
Correct |
33 ms |
16752 KB |
Output is correct |
51 |
Correct |
28 ms |
14520 KB |
Output is correct |
52 |
Correct |
29 ms |
11684 KB |
Output is correct |
53 |
Correct |
29 ms |
11608 KB |
Output is correct |
54 |
Correct |
32 ms |
11608 KB |
Output is correct |
55 |
Correct |
18 ms |
11612 KB |
Output is correct |
56 |
Correct |
13 ms |
11612 KB |
Output is correct |
57 |
Correct |
13 ms |
11428 KB |
Output is correct |
58 |
Correct |
72 ms |
20604 KB |
Output is correct |
59 |
Correct |
57 ms |
20452 KB |
Output is correct |
60 |
Correct |
49 ms |
20564 KB |
Output is correct |
61 |
Correct |
50 ms |
20596 KB |
Output is correct |
62 |
Correct |
50 ms |
20560 KB |
Output is correct |
63 |
Correct |
50 ms |
20564 KB |
Output is correct |
64 |
Correct |
39 ms |
19536 KB |
Output is correct |
65 |
Correct |
39 ms |
19540 KB |
Output is correct |
66 |
Correct |
38 ms |
19548 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
6748 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
2 ms |
6748 KB |
Output is correct |
4 |
Correct |
2 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6744 KB |
Output is correct |
6 |
Correct |
1 ms |
6748 KB |
Output is correct |
7 |
Correct |
1 ms |
6748 KB |
Output is correct |
8 |
Correct |
2 ms |
6748 KB |
Output is correct |
9 |
Correct |
2 ms |
6916 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6744 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6748 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
2 ms |
6744 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
2 ms |
6744 KB |
Output is correct |
23 |
Correct |
1 ms |
6748 KB |
Output is correct |
24 |
Correct |
2 ms |
6748 KB |
Output is correct |
25 |
Correct |
1 ms |
6748 KB |
Output is correct |
26 |
Correct |
2 ms |
6744 KB |
Output is correct |
27 |
Correct |
1 ms |
6748 KB |
Output is correct |
28 |
Correct |
1 ms |
6748 KB |
Output is correct |
29 |
Correct |
1 ms |
6748 KB |
Output is correct |
30 |
Correct |
2 ms |
6748 KB |
Output is correct |
31 |
Correct |
2 ms |
6744 KB |
Output is correct |
32 |
Correct |
1 ms |
6836 KB |
Output is correct |
33 |
Correct |
2 ms |
6828 KB |
Output is correct |
34 |
Correct |
2 ms |
6748 KB |
Output is correct |
35 |
Correct |
2 ms |
6748 KB |
Output is correct |
36 |
Correct |
2 ms |
6748 KB |
Output is correct |
37 |
Correct |
2 ms |
6748 KB |
Output is correct |
38 |
Correct |
2 ms |
6748 KB |
Output is correct |
39 |
Correct |
1 ms |
6748 KB |
Output is correct |
40 |
Correct |
2 ms |
6748 KB |
Output is correct |
41 |
Correct |
2 ms |
6744 KB |
Output is correct |
42 |
Correct |
1 ms |
6744 KB |
Output is correct |
43 |
Correct |
2 ms |
6936 KB |
Output is correct |
44 |
Correct |
2 ms |
6748 KB |
Output is correct |
45 |
Correct |
2 ms |
7004 KB |
Output is correct |
46 |
Correct |
2 ms |
6748 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
2 ms |
6748 KB |
Output is correct |
49 |
Correct |
2 ms |
6748 KB |
Output is correct |
50 |
Correct |
2 ms |
6748 KB |
Output is correct |
51 |
Correct |
2 ms |
6748 KB |
Output is correct |
52 |
Correct |
2 ms |
6748 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
6744 KB |
Output is correct |
55 |
Correct |
2 ms |
6748 KB |
Output is correct |
56 |
Correct |
2 ms |
6748 KB |
Output is correct |
57 |
Correct |
2 ms |
6748 KB |
Output is correct |
58 |
Correct |
2 ms |
6748 KB |
Output is correct |
59 |
Correct |
2 ms |
6748 KB |
Output is correct |
60 |
Correct |
2 ms |
6748 KB |
Output is correct |
61 |
Correct |
2 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6744 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
1 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6744 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6916 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6744 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
2 ms |
6748 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
2 ms |
6744 KB |
Output is correct |
23 |
Correct |
2 ms |
6748 KB |
Output is correct |
24 |
Correct |
16 ms |
10752 KB |
Output is correct |
25 |
Correct |
17 ms |
10716 KB |
Output is correct |
26 |
Correct |
16 ms |
10768 KB |
Output is correct |
27 |
Correct |
2 ms |
6748 KB |
Output is correct |
28 |
Correct |
1 ms |
6748 KB |
Output is correct |
29 |
Correct |
2 ms |
6744 KB |
Output is correct |
30 |
Correct |
1 ms |
6748 KB |
Output is correct |
31 |
Correct |
1 ms |
6748 KB |
Output is correct |
32 |
Correct |
1 ms |
6748 KB |
Output is correct |
33 |
Correct |
2 ms |
6748 KB |
Output is correct |
34 |
Correct |
2 ms |
6744 KB |
Output is correct |
35 |
Correct |
1 ms |
6836 KB |
Output is correct |
36 |
Correct |
2 ms |
6828 KB |
Output is correct |
37 |
Correct |
2 ms |
6748 KB |
Output is correct |
38 |
Correct |
2 ms |
6748 KB |
Output is correct |
39 |
Correct |
2 ms |
6748 KB |
Output is correct |
40 |
Correct |
2 ms |
6748 KB |
Output is correct |
41 |
Correct |
2 ms |
6748 KB |
Output is correct |
42 |
Correct |
1 ms |
6748 KB |
Output is correct |
43 |
Correct |
2 ms |
6748 KB |
Output is correct |
44 |
Correct |
2 ms |
6744 KB |
Output is correct |
45 |
Correct |
1 ms |
6744 KB |
Output is correct |
46 |
Correct |
2 ms |
6936 KB |
Output is correct |
47 |
Correct |
2 ms |
6748 KB |
Output is correct |
48 |
Correct |
2 ms |
7004 KB |
Output is correct |
49 |
Correct |
2 ms |
6748 KB |
Output is correct |
50 |
Correct |
2 ms |
6748 KB |
Output is correct |
51 |
Correct |
2 ms |
6748 KB |
Output is correct |
52 |
Correct |
2 ms |
6748 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
6748 KB |
Output is correct |
55 |
Correct |
2 ms |
6748 KB |
Output is correct |
56 |
Correct |
2 ms |
6748 KB |
Output is correct |
57 |
Correct |
2 ms |
6744 KB |
Output is correct |
58 |
Correct |
2 ms |
6748 KB |
Output is correct |
59 |
Correct |
2 ms |
6748 KB |
Output is correct |
60 |
Correct |
2 ms |
6748 KB |
Output is correct |
61 |
Correct |
2 ms |
6748 KB |
Output is correct |
62 |
Correct |
2 ms |
6748 KB |
Output is correct |
63 |
Correct |
2 ms |
6748 KB |
Output is correct |
64 |
Correct |
2 ms |
6748 KB |
Output is correct |
65 |
Correct |
2 ms |
7004 KB |
Output is correct |
66 |
Correct |
2 ms |
7004 KB |
Output is correct |
67 |
Correct |
2 ms |
7004 KB |
Output is correct |
68 |
Correct |
2 ms |
7004 KB |
Output is correct |
69 |
Correct |
2 ms |
7004 KB |
Output is correct |
70 |
Correct |
3 ms |
7004 KB |
Output is correct |
71 |
Correct |
3 ms |
7004 KB |
Output is correct |
72 |
Correct |
3 ms |
7004 KB |
Output is correct |
73 |
Correct |
2 ms |
7004 KB |
Output is correct |
74 |
Correct |
3 ms |
7000 KB |
Output is correct |
75 |
Correct |
2 ms |
7004 KB |
Output is correct |
76 |
Correct |
15 ms |
9564 KB |
Output is correct |
77 |
Correct |
14 ms |
9820 KB |
Output is correct |
78 |
Correct |
19 ms |
10332 KB |
Output is correct |
79 |
Correct |
2 ms |
7260 KB |
Output is correct |
80 |
Correct |
3 ms |
7212 KB |
Output is correct |
81 |
Correct |
2 ms |
7256 KB |
Output is correct |
82 |
Correct |
3 ms |
7260 KB |
Output is correct |
83 |
Correct |
3 ms |
7260 KB |
Output is correct |
84 |
Correct |
3 ms |
7004 KB |
Output is correct |
85 |
Correct |
3 ms |
7004 KB |
Output is correct |
86 |
Correct |
3 ms |
7000 KB |
Output is correct |
87 |
Correct |
3 ms |
7004 KB |
Output is correct |
88 |
Correct |
3 ms |
7040 KB |
Output is correct |
89 |
Correct |
3 ms |
7004 KB |
Output is correct |
90 |
Correct |
20 ms |
10588 KB |
Output is correct |
91 |
Correct |
19 ms |
10548 KB |
Output is correct |
92 |
Correct |
20 ms |
10456 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6744 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
1 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6744 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6916 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6744 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
2 ms |
6748 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
2 ms |
6744 KB |
Output is correct |
23 |
Correct |
2 ms |
6748 KB |
Output is correct |
24 |
Correct |
16 ms |
10752 KB |
Output is correct |
25 |
Correct |
17 ms |
10716 KB |
Output is correct |
26 |
Correct |
16 ms |
10768 KB |
Output is correct |
27 |
Correct |
7 ms |
8028 KB |
Output is correct |
28 |
Correct |
7 ms |
8028 KB |
Output is correct |
29 |
Correct |
4 ms |
7772 KB |
Output is correct |
30 |
Correct |
4 ms |
7768 KB |
Output is correct |
31 |
Correct |
4 ms |
7772 KB |
Output is correct |
32 |
Correct |
4 ms |
7768 KB |
Output is correct |
33 |
Correct |
12 ms |
8920 KB |
Output is correct |
34 |
Correct |
12 ms |
8796 KB |
Output is correct |
35 |
Correct |
11 ms |
8792 KB |
Output is correct |
36 |
Correct |
12 ms |
8964 KB |
Output is correct |
37 |
Correct |
11 ms |
8796 KB |
Output is correct |
38 |
Correct |
12 ms |
8960 KB |
Output is correct |
39 |
Correct |
20 ms |
11872 KB |
Output is correct |
40 |
Correct |
21 ms |
11868 KB |
Output is correct |
41 |
Correct |
19 ms |
11872 KB |
Output is correct |
42 |
Correct |
2 ms |
6748 KB |
Output is correct |
43 |
Correct |
1 ms |
6748 KB |
Output is correct |
44 |
Correct |
2 ms |
6744 KB |
Output is correct |
45 |
Correct |
1 ms |
6748 KB |
Output is correct |
46 |
Correct |
1 ms |
6748 KB |
Output is correct |
47 |
Correct |
1 ms |
6748 KB |
Output is correct |
48 |
Correct |
2 ms |
6748 KB |
Output is correct |
49 |
Correct |
2 ms |
6744 KB |
Output is correct |
50 |
Correct |
1 ms |
6836 KB |
Output is correct |
51 |
Correct |
2 ms |
6828 KB |
Output is correct |
52 |
Correct |
2 ms |
6748 KB |
Output is correct |
53 |
Correct |
2 ms |
6748 KB |
Output is correct |
54 |
Correct |
2 ms |
6748 KB |
Output is correct |
55 |
Correct |
2 ms |
6748 KB |
Output is correct |
56 |
Correct |
2 ms |
6748 KB |
Output is correct |
57 |
Correct |
1 ms |
6748 KB |
Output is correct |
58 |
Correct |
2 ms |
6748 KB |
Output is correct |
59 |
Correct |
2 ms |
6744 KB |
Output is correct |
60 |
Correct |
1 ms |
6744 KB |
Output is correct |
61 |
Correct |
2 ms |
6936 KB |
Output is correct |
62 |
Correct |
2 ms |
6748 KB |
Output is correct |
63 |
Correct |
2 ms |
7004 KB |
Output is correct |
64 |
Correct |
2 ms |
6748 KB |
Output is correct |
65 |
Correct |
2 ms |
6748 KB |
Output is correct |
66 |
Correct |
2 ms |
6748 KB |
Output is correct |
67 |
Correct |
2 ms |
6748 KB |
Output is correct |
68 |
Correct |
2 ms |
6748 KB |
Output is correct |
69 |
Correct |
2 ms |
6748 KB |
Output is correct |
70 |
Correct |
2 ms |
6748 KB |
Output is correct |
71 |
Correct |
2 ms |
6748 KB |
Output is correct |
72 |
Correct |
2 ms |
6744 KB |
Output is correct |
73 |
Correct |
2 ms |
6748 KB |
Output is correct |
74 |
Correct |
2 ms |
6748 KB |
Output is correct |
75 |
Correct |
2 ms |
6748 KB |
Output is correct |
76 |
Correct |
2 ms |
6748 KB |
Output is correct |
77 |
Correct |
2 ms |
6748 KB |
Output is correct |
78 |
Correct |
2 ms |
6748 KB |
Output is correct |
79 |
Correct |
2 ms |
6748 KB |
Output is correct |
80 |
Correct |
2 ms |
7004 KB |
Output is correct |
81 |
Correct |
2 ms |
7004 KB |
Output is correct |
82 |
Correct |
2 ms |
7004 KB |
Output is correct |
83 |
Correct |
2 ms |
7004 KB |
Output is correct |
84 |
Correct |
2 ms |
7004 KB |
Output is correct |
85 |
Correct |
3 ms |
7004 KB |
Output is correct |
86 |
Correct |
3 ms |
7004 KB |
Output is correct |
87 |
Correct |
3 ms |
7004 KB |
Output is correct |
88 |
Correct |
2 ms |
7004 KB |
Output is correct |
89 |
Correct |
3 ms |
7000 KB |
Output is correct |
90 |
Correct |
2 ms |
7004 KB |
Output is correct |
91 |
Correct |
15 ms |
9564 KB |
Output is correct |
92 |
Correct |
14 ms |
9820 KB |
Output is correct |
93 |
Correct |
19 ms |
10332 KB |
Output is correct |
94 |
Correct |
2 ms |
7260 KB |
Output is correct |
95 |
Correct |
3 ms |
7212 KB |
Output is correct |
96 |
Correct |
2 ms |
7256 KB |
Output is correct |
97 |
Correct |
3 ms |
7260 KB |
Output is correct |
98 |
Correct |
3 ms |
7260 KB |
Output is correct |
99 |
Correct |
3 ms |
7004 KB |
Output is correct |
100 |
Correct |
3 ms |
7004 KB |
Output is correct |
101 |
Correct |
3 ms |
7000 KB |
Output is correct |
102 |
Correct |
3 ms |
7004 KB |
Output is correct |
103 |
Correct |
3 ms |
7040 KB |
Output is correct |
104 |
Correct |
3 ms |
7004 KB |
Output is correct |
105 |
Correct |
20 ms |
10588 KB |
Output is correct |
106 |
Correct |
19 ms |
10548 KB |
Output is correct |
107 |
Correct |
20 ms |
10456 KB |
Output is correct |
108 |
Correct |
7 ms |
8028 KB |
Output is correct |
109 |
Correct |
142 ms |
42464 KB |
Output is correct |
110 |
Correct |
70 ms |
26272 KB |
Output is correct |
111 |
Correct |
48 ms |
21084 KB |
Output is correct |
112 |
Correct |
63 ms |
23504 KB |
Output is correct |
113 |
Correct |
29 ms |
17988 KB |
Output is correct |
114 |
Correct |
12 ms |
8540 KB |
Output is correct |
115 |
Correct |
12 ms |
8516 KB |
Output is correct |
116 |
Correct |
16 ms |
9052 KB |
Output is correct |
117 |
Correct |
12 ms |
8508 KB |
Output is correct |
118 |
Correct |
14 ms |
9024 KB |
Output is correct |
119 |
Correct |
12 ms |
8540 KB |
Output is correct |
120 |
Correct |
15 ms |
9564 KB |
Output is correct |
121 |
Correct |
7 ms |
7832 KB |
Output is correct |
122 |
Correct |
18 ms |
9816 KB |
Output is correct |
123 |
Correct |
7 ms |
7772 KB |
Output is correct |
124 |
Correct |
20 ms |
10584 KB |
Output is correct |
125 |
Correct |
10 ms |
8280 KB |
Output is correct |
126 |
Correct |
7 ms |
8404 KB |
Output is correct |
127 |
Correct |
8 ms |
8792 KB |
Output is correct |
128 |
Correct |
8 ms |
8536 KB |
Output is correct |
129 |
Correct |
6 ms |
8284 KB |
Output is correct |
130 |
Correct |
7 ms |
8028 KB |
Output is correct |
131 |
Correct |
198 ms |
57028 KB |
Output is correct |
132 |
Correct |
132 ms |
42400 KB |
Output is correct |
133 |
Correct |
96 ms |
35920 KB |
Output is correct |
134 |
Correct |
84 ms |
32168 KB |
Output is correct |
135 |
Correct |
68 ms |
29524 KB |
Output is correct |
136 |
Correct |
17 ms |
9308 KB |
Output is correct |
137 |
Correct |
18 ms |
9308 KB |
Output is correct |
138 |
Correct |
17 ms |
9308 KB |
Output is correct |
139 |
Correct |
20 ms |
9348 KB |
Output is correct |
140 |
Correct |
17 ms |
9308 KB |
Output is correct |
141 |
Correct |
17 ms |
9268 KB |
Output is correct |
142 |
Correct |
24 ms |
11356 KB |
Output is correct |
143 |
Correct |
11 ms |
8540 KB |
Output is correct |
144 |
Correct |
25 ms |
11328 KB |
Output is correct |
145 |
Correct |
11 ms |
8540 KB |
Output is correct |
146 |
Correct |
25 ms |
11344 KB |
Output is correct |
147 |
Correct |
14 ms |
8536 KB |
Output is correct |
148 |
Correct |
8 ms |
9052 KB |
Output is correct |
149 |
Correct |
9 ms |
8964 KB |
Output is correct |
150 |
Correct |
9 ms |
8796 KB |
Output is correct |
151 |
Correct |
8 ms |
8796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
6744 KB |
Output is correct |
2 |
Correct |
1 ms |
6748 KB |
Output is correct |
3 |
Correct |
1 ms |
6748 KB |
Output is correct |
4 |
Correct |
1 ms |
6748 KB |
Output is correct |
5 |
Correct |
2 ms |
6748 KB |
Output is correct |
6 |
Correct |
2 ms |
6748 KB |
Output is correct |
7 |
Correct |
2 ms |
6744 KB |
Output is correct |
8 |
Correct |
1 ms |
6748 KB |
Output is correct |
9 |
Correct |
1 ms |
6748 KB |
Output is correct |
10 |
Correct |
2 ms |
6748 KB |
Output is correct |
11 |
Correct |
2 ms |
6916 KB |
Output is correct |
12 |
Correct |
2 ms |
6748 KB |
Output is correct |
13 |
Correct |
2 ms |
6744 KB |
Output is correct |
14 |
Correct |
2 ms |
6748 KB |
Output is correct |
15 |
Correct |
2 ms |
6748 KB |
Output is correct |
16 |
Correct |
2 ms |
6748 KB |
Output is correct |
17 |
Correct |
2 ms |
6748 KB |
Output is correct |
18 |
Correct |
2 ms |
6748 KB |
Output is correct |
19 |
Correct |
2 ms |
6748 KB |
Output is correct |
20 |
Correct |
2 ms |
6748 KB |
Output is correct |
21 |
Correct |
2 ms |
6748 KB |
Output is correct |
22 |
Correct |
2 ms |
6744 KB |
Output is correct |
23 |
Correct |
2 ms |
6748 KB |
Output is correct |
24 |
Correct |
16 ms |
10752 KB |
Output is correct |
25 |
Correct |
17 ms |
10716 KB |
Output is correct |
26 |
Correct |
16 ms |
10768 KB |
Output is correct |
27 |
Correct |
7 ms |
8028 KB |
Output is correct |
28 |
Correct |
7 ms |
8028 KB |
Output is correct |
29 |
Correct |
4 ms |
7772 KB |
Output is correct |
30 |
Correct |
4 ms |
7768 KB |
Output is correct |
31 |
Correct |
4 ms |
7772 KB |
Output is correct |
32 |
Correct |
4 ms |
7768 KB |
Output is correct |
33 |
Correct |
12 ms |
8920 KB |
Output is correct |
34 |
Correct |
12 ms |
8796 KB |
Output is correct |
35 |
Correct |
11 ms |
8792 KB |
Output is correct |
36 |
Correct |
12 ms |
8964 KB |
Output is correct |
37 |
Correct |
11 ms |
8796 KB |
Output is correct |
38 |
Correct |
12 ms |
8960 KB |
Output is correct |
39 |
Correct |
20 ms |
11872 KB |
Output is correct |
40 |
Correct |
21 ms |
11868 KB |
Output is correct |
41 |
Correct |
19 ms |
11872 KB |
Output is correct |
42 |
Correct |
27 ms |
11336 KB |
Output is correct |
43 |
Correct |
18 ms |
9568 KB |
Output is correct |
44 |
Correct |
22 ms |
11624 KB |
Output is correct |
45 |
Correct |
9 ms |
9828 KB |
Output is correct |
46 |
Correct |
8 ms |
9576 KB |
Output is correct |
47 |
Correct |
14 ms |
11432 KB |
Output is correct |
48 |
Correct |
49 ms |
19388 KB |
Output is correct |
49 |
Correct |
30 ms |
14172 KB |
Output is correct |
50 |
Correct |
28 ms |
16476 KB |
Output is correct |
51 |
Correct |
31 ms |
16732 KB |
Output is correct |
52 |
Correct |
33 ms |
16752 KB |
Output is correct |
53 |
Correct |
28 ms |
14520 KB |
Output is correct |
54 |
Correct |
29 ms |
11684 KB |
Output is correct |
55 |
Correct |
29 ms |
11608 KB |
Output is correct |
56 |
Correct |
32 ms |
11608 KB |
Output is correct |
57 |
Correct |
18 ms |
11612 KB |
Output is correct |
58 |
Correct |
13 ms |
11612 KB |
Output is correct |
59 |
Correct |
13 ms |
11428 KB |
Output is correct |
60 |
Correct |
72 ms |
20604 KB |
Output is correct |
61 |
Correct |
57 ms |
20452 KB |
Output is correct |
62 |
Correct |
49 ms |
20564 KB |
Output is correct |
63 |
Correct |
50 ms |
20596 KB |
Output is correct |
64 |
Correct |
50 ms |
20560 KB |
Output is correct |
65 |
Correct |
50 ms |
20564 KB |
Output is correct |
66 |
Correct |
39 ms |
19536 KB |
Output is correct |
67 |
Correct |
39 ms |
19540 KB |
Output is correct |
68 |
Correct |
38 ms |
19548 KB |
Output is correct |
69 |
Correct |
2 ms |
6748 KB |
Output is correct |
70 |
Correct |
1 ms |
6748 KB |
Output is correct |
71 |
Correct |
2 ms |
6744 KB |
Output is correct |
72 |
Correct |
1 ms |
6748 KB |
Output is correct |
73 |
Correct |
1 ms |
6748 KB |
Output is correct |
74 |
Correct |
1 ms |
6748 KB |
Output is correct |
75 |
Correct |
2 ms |
6748 KB |
Output is correct |
76 |
Correct |
2 ms |
6744 KB |
Output is correct |
77 |
Correct |
1 ms |
6836 KB |
Output is correct |
78 |
Correct |
2 ms |
6828 KB |
Output is correct |
79 |
Correct |
2 ms |
6748 KB |
Output is correct |
80 |
Correct |
2 ms |
6748 KB |
Output is correct |
81 |
Correct |
2 ms |
6748 KB |
Output is correct |
82 |
Correct |
2 ms |
6748 KB |
Output is correct |
83 |
Correct |
2 ms |
6748 KB |
Output is correct |
84 |
Correct |
1 ms |
6748 KB |
Output is correct |
85 |
Correct |
2 ms |
6748 KB |
Output is correct |
86 |
Correct |
2 ms |
6744 KB |
Output is correct |
87 |
Correct |
1 ms |
6744 KB |
Output is correct |
88 |
Correct |
2 ms |
6936 KB |
Output is correct |
89 |
Correct |
2 ms |
6748 KB |
Output is correct |
90 |
Correct |
2 ms |
7004 KB |
Output is correct |
91 |
Correct |
2 ms |
6748 KB |
Output is correct |
92 |
Correct |
2 ms |
6748 KB |
Output is correct |
93 |
Correct |
2 ms |
6748 KB |
Output is correct |
94 |
Correct |
2 ms |
6748 KB |
Output is correct |
95 |
Correct |
2 ms |
6748 KB |
Output is correct |
96 |
Correct |
2 ms |
6748 KB |
Output is correct |
97 |
Correct |
2 ms |
6748 KB |
Output is correct |
98 |
Correct |
2 ms |
6748 KB |
Output is correct |
99 |
Correct |
2 ms |
6744 KB |
Output is correct |
100 |
Correct |
2 ms |
6748 KB |
Output is correct |
101 |
Correct |
2 ms |
6748 KB |
Output is correct |
102 |
Correct |
2 ms |
6748 KB |
Output is correct |
103 |
Correct |
2 ms |
6748 KB |
Output is correct |
104 |
Correct |
2 ms |
6748 KB |
Output is correct |
105 |
Correct |
2 ms |
6748 KB |
Output is correct |
106 |
Correct |
2 ms |
6748 KB |
Output is correct |
107 |
Correct |
2 ms |
7004 KB |
Output is correct |
108 |
Correct |
2 ms |
7004 KB |
Output is correct |
109 |
Correct |
2 ms |
7004 KB |
Output is correct |
110 |
Correct |
2 ms |
7004 KB |
Output is correct |
111 |
Correct |
2 ms |
7004 KB |
Output is correct |
112 |
Correct |
3 ms |
7004 KB |
Output is correct |
113 |
Correct |
3 ms |
7004 KB |
Output is correct |
114 |
Correct |
3 ms |
7004 KB |
Output is correct |
115 |
Correct |
2 ms |
7004 KB |
Output is correct |
116 |
Correct |
3 ms |
7000 KB |
Output is correct |
117 |
Correct |
2 ms |
7004 KB |
Output is correct |
118 |
Correct |
15 ms |
9564 KB |
Output is correct |
119 |
Correct |
14 ms |
9820 KB |
Output is correct |
120 |
Correct |
19 ms |
10332 KB |
Output is correct |
121 |
Correct |
2 ms |
7260 KB |
Output is correct |
122 |
Correct |
3 ms |
7212 KB |
Output is correct |
123 |
Correct |
2 ms |
7256 KB |
Output is correct |
124 |
Correct |
3 ms |
7260 KB |
Output is correct |
125 |
Correct |
3 ms |
7260 KB |
Output is correct |
126 |
Correct |
3 ms |
7004 KB |
Output is correct |
127 |
Correct |
3 ms |
7004 KB |
Output is correct |
128 |
Correct |
3 ms |
7000 KB |
Output is correct |
129 |
Correct |
3 ms |
7004 KB |
Output is correct |
130 |
Correct |
3 ms |
7040 KB |
Output is correct |
131 |
Correct |
3 ms |
7004 KB |
Output is correct |
132 |
Correct |
20 ms |
10588 KB |
Output is correct |
133 |
Correct |
19 ms |
10548 KB |
Output is correct |
134 |
Correct |
20 ms |
10456 KB |
Output is correct |
135 |
Correct |
7 ms |
8028 KB |
Output is correct |
136 |
Correct |
142 ms |
42464 KB |
Output is correct |
137 |
Correct |
70 ms |
26272 KB |
Output is correct |
138 |
Correct |
48 ms |
21084 KB |
Output is correct |
139 |
Correct |
63 ms |
23504 KB |
Output is correct |
140 |
Correct |
29 ms |
17988 KB |
Output is correct |
141 |
Correct |
12 ms |
8540 KB |
Output is correct |
142 |
Correct |
12 ms |
8516 KB |
Output is correct |
143 |
Correct |
16 ms |
9052 KB |
Output is correct |
144 |
Correct |
12 ms |
8508 KB |
Output is correct |
145 |
Correct |
14 ms |
9024 KB |
Output is correct |
146 |
Correct |
12 ms |
8540 KB |
Output is correct |
147 |
Correct |
15 ms |
9564 KB |
Output is correct |
148 |
Correct |
7 ms |
7832 KB |
Output is correct |
149 |
Correct |
18 ms |
9816 KB |
Output is correct |
150 |
Correct |
7 ms |
7772 KB |
Output is correct |
151 |
Correct |
20 ms |
10584 KB |
Output is correct |
152 |
Correct |
10 ms |
8280 KB |
Output is correct |
153 |
Correct |
7 ms |
8404 KB |
Output is correct |
154 |
Correct |
8 ms |
8792 KB |
Output is correct |
155 |
Correct |
8 ms |
8536 KB |
Output is correct |
156 |
Correct |
6 ms |
8284 KB |
Output is correct |
157 |
Correct |
7 ms |
8028 KB |
Output is correct |
158 |
Correct |
198 ms |
57028 KB |
Output is correct |
159 |
Correct |
132 ms |
42400 KB |
Output is correct |
160 |
Correct |
96 ms |
35920 KB |
Output is correct |
161 |
Correct |
84 ms |
32168 KB |
Output is correct |
162 |
Correct |
68 ms |
29524 KB |
Output is correct |
163 |
Correct |
17 ms |
9308 KB |
Output is correct |
164 |
Correct |
18 ms |
9308 KB |
Output is correct |
165 |
Correct |
17 ms |
9308 KB |
Output is correct |
166 |
Correct |
20 ms |
9348 KB |
Output is correct |
167 |
Correct |
17 ms |
9308 KB |
Output is correct |
168 |
Correct |
17 ms |
9268 KB |
Output is correct |
169 |
Correct |
24 ms |
11356 KB |
Output is correct |
170 |
Correct |
11 ms |
8540 KB |
Output is correct |
171 |
Correct |
25 ms |
11328 KB |
Output is correct |
172 |
Correct |
11 ms |
8540 KB |
Output is correct |
173 |
Correct |
25 ms |
11344 KB |
Output is correct |
174 |
Correct |
14 ms |
8536 KB |
Output is correct |
175 |
Correct |
8 ms |
9052 KB |
Output is correct |
176 |
Correct |
9 ms |
8964 KB |
Output is correct |
177 |
Correct |
9 ms |
8796 KB |
Output is correct |
178 |
Correct |
8 ms |
8796 KB |
Output is correct |
179 |
Correct |
20 ms |
10076 KB |
Output is correct |
180 |
Correct |
338 ms |
107236 KB |
Output is correct |
181 |
Correct |
297 ms |
119120 KB |
Output is correct |
182 |
Correct |
374 ms |
147280 KB |
Output is correct |
183 |
Correct |
189 ms |
77484 KB |
Output is correct |
184 |
Correct |
167 ms |
65200 KB |
Output is correct |
185 |
Correct |
31 ms |
13136 KB |
Output is correct |
186 |
Correct |
32 ms |
14940 KB |
Output is correct |
187 |
Correct |
38 ms |
14416 KB |
Output is correct |
188 |
Correct |
27 ms |
13912 KB |
Output is correct |
189 |
Correct |
46 ms |
14668 KB |
Output is correct |
190 |
Correct |
31 ms |
14928 KB |
Output is correct |
191 |
Correct |
41 ms |
15188 KB |
Output is correct |
192 |
Correct |
22 ms |
12380 KB |
Output is correct |
193 |
Correct |
35 ms |
12816 KB |
Output is correct |
194 |
Correct |
29 ms |
11868 KB |
Output is correct |
195 |
Correct |
829 ms |
257828 KB |
Output is correct |
196 |
Correct |
480 ms |
184404 KB |
Output is correct |
197 |
Correct |
383 ms |
152216 KB |
Output is correct |
198 |
Correct |
338 ms |
133516 KB |
Output is correct |
199 |
Correct |
300 ms |
119960 KB |
Output is correct |
200 |
Correct |
62 ms |
22356 KB |
Output is correct |
201 |
Correct |
62 ms |
22208 KB |
Output is correct |
202 |
Correct |
67 ms |
22612 KB |
Output is correct |
203 |
Correct |
62 ms |
22412 KB |
Output is correct |
204 |
Correct |
62 ms |
22352 KB |
Output is correct |
205 |
Correct |
62 ms |
22356 KB |
Output is correct |
206 |
Correct |
46 ms |
20432 KB |
Output is correct |
207 |
Correct |
53 ms |
20820 KB |
Output is correct |
208 |
Correct |
48 ms |
20316 KB |
Output is correct |
209 |
Correct |
53 ms |
20940 KB |
Output is correct |
210 |
Correct |
50 ms |
20308 KB |
Output is correct |
211 |
Correct |
53 ms |
20816 KB |
Output is correct |
212 |
Correct |
45 ms |
21844 KB |
Output is correct |
213 |
Correct |
43 ms |
19252 KB |
Output is correct |
214 |
Correct |
38 ms |
18516 KB |
Output is correct |
215 |
Correct |
39 ms |
18268 KB |
Output is correct |