QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#553211#9240. MosaicJohnAlfnov#20 749ms42532kbC++144.2kb2024-09-08 10:43:422024-09-08 10:43:43

Judging History

你现在查看的是最新测评结果

  • [2024-09-08 10:43:43]
  • 评测
  • 测评结果:20
  • 用时:749ms
  • 内存:42532kb
  • [2024-09-08 10:43:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int X0[200005],X1[200005];
int Y0[200005],Y1[200005];
int X2[200005],Y2[200005];
int Y3[200005],S[200005];
int SX0[200005],SY0[200005];
int SX1[200005],SY1[200005];
struct apple{
	int x,y,wz;
	apple(int x=0,int y=0,int wz=0):x(x),y(y),wz(wz){}
}e[800005];
inline int suan(int A,int B,int x,int y){
	int r=min(x-A,y-B);
	if(r<0)return 0;
	if((B+y)%2==0)return r/2+1;
	return (r+1)/2;
}
struct pear{
	int k,A[200005],B[200005],q[200005];
	void init(){
		
	}
	long long query(int x,int y){
		if(!k)return 0;
		int t=suan(A[1],B[1],x,y);
		if(!t)return 0;
		int L=1,R=k;
		while(L<=R){
			int mid=(L+R)>>1;
			if(suan(A[mid],B[mid],x,y)==0)R=mid-1;
			else L=mid+1;
		}
		int a=L-1;
		if(!a)return 0;
		L=2,R=a;
		while(L<=R){
			int mid=(L+R)>>1;
			if(suan(A[mid],B[mid],x,y)<suan(A[mid-1],B[mid-1],x,y)){
				R=mid-1;
			}else L=mid+1;
		}
		long long ans=0;
		/*
		for(int i=1;i<=R;++i)ans+=t*q[i];
		for(int i=R+1;i<=a;++i){
			ans+=(t-i+R)*q[i];
		}
		*/
		for(int i=1;i<=k;++i)ans+=suan(A[i],B[i],x,y)*q[i];
		return 0;
	}
}a23,a24,a33,a43;
vector<long long>mosaic(vector<int>X,vector<int>Y,vector<int>T,vector<int>B,vector<int>L,vector<int>R){
	int n=X.size(),m=T.size();
	for(int i=0;i<n;++i){
		X0[i]=X[i];Y0[i]=Y[i];
	}
	X1[0]=Y0[1];Y1[0]=X0[1];
	for(int i=1;i<n;++i){
		if(X1[i-1]==0&&X0[i]==0)X1[i]=1;
		else X1[i]=0;
	}
	for(int i=1;i<n;++i){
		if(Y1[i-1]==0&&Y0[i]==0)Y1[i]=1;
		else Y1[i]=0;
	}
	X2[1]=Y1[2];Y2[1]=X1[2];
	for(int i=2;i<n;++i){
		if(X2[i-1]==0&&X1[i]==0)X2[i]=1;
		else X2[i]=0;
	}
	for(int i=2;i<n;++i){
		if(Y2[i-1]==0&&Y1[i]==0)Y2[i]=1;
		else Y2[i]=0;
	}
	Y3[2]=X2[3];
	for(int i=3;i<n;++i){
		if(Y3[i-1]==0&&Y2[i]==0)Y3[i]=1;
		else Y3[i]=0;
	}
	for(int i=2;i<n;++i){
		if(Y2[i-1]==0&&Y1[i]==0)Y2[i]=1;
		else Y2[i]=0;
	}
	SX0[0]=X0[0];
	for(int i=1;i<n;++i)SX0[i]=SX0[i-1]+X0[i];
	SY0[0]=Y0[0];
	for(int i=1;i<n;++i)SY0[i]=SY0[i-1]+Y0[i];
	SX1[0]=X1[0];
	for(int i=1;i<n;++i)SX1[i]=SX1[i-1]+X1[i];
	SY1[0]=Y1[0];
	for(int i=1;i<n;++i)SY1[i]=SY1[i-1]+Y1[i];
	vector<long long>ans(m,0);
	int tt=0;
	for(int i=0;i<m;++i){
		int l=T[i],r=B[i];
		int ll=L[i],rr=R[i];
		if(l==0){
			ans[i]+=SX0[rr]-(ll==0?0:SX0[ll-1]);
			++l;
		}
		if(l>r)continue;
		if(l==1){
			ans[i]+=SX1[rr]-(ll==0?0:SX1[ll-1]);
			++l;
		}
		if(l>r)continue;
		if(ll==0){
			ans[i]+=SY0[r]-SY0[l-1];
			++ll;
		}
		if(ll>rr)continue;
		if(ll==1){
			ans[i]+=SY1[r]-SY1[l-1];
			++ll;
		}
		if(ll>rr)continue;
		e[++tt]=apple(r,rr,i+1);
		if(ll>2)e[++tt]=apple(r,ll-1,-i-1);
		if(l>2)e[++tt]=apple(l-1,rr,-i-1);
		if(l>2&&ll>2)e[++tt]=apple(l-1,ll-1,i+1);
	}
	S[1]=0;
	for(int i=2;i<n;++i)S[i]=S[i-1]+Y2[i];
	for(int i=1;i<=tt;++i){
		int x=e[i].x,y=e[i].y;
		long long z=1ll*S[x]*(y/2)+1ll*(x-1-S[x])*((y-1)/2);
		if(e[i].wz>0)ans[e[i].wz-1]+=z;
		else ans[-e[i].wz-1]-=z;
	}
	a23.k=a24.k=a33.k=a43.k=0;
	for(int i=3;i<n;i+=2){
		int k=++a23.k;
		a23.A[k]=2,a23.B[k]=i;
		if(X2[i-1]==0&&X2[i]==0)a23.q[k]=1;
		else a23.q[k]=0;
	}
	for(int i=4;i<n;i+=2){
		int k=++a24.k;
		a24.A[k]=2,a24.B[k]=i;
		if(X2[i-1]==0&&X2[i]==0)a24.q[k]=1;
		else a24.q[k]=0;
	}
	a23.init();a24.init();
	for(int j=1;j<=tt;++j){
		int x=e[j].x,y=e[j].y;
		long long z=a23.query(x,y)+a24.query(x,y);
		if(e[j].wz>0)ans[e[j].wz-1]-=z;
		else ans[-e[j].wz-1]+=z;
	}
	for(int i=3;i<n;i+=2){
		int k=++a33.k;
		a33.A[k]=i,a33.B[k]=3;
		if(Y2[i]==0&&Y3[i]==0)a33.q[k]=1;
		else a33.q[k]=0;
	}
	for(int i=4;i<n;i+=2){
		int k=++a43.k;
		a43.A[k]=i,a43.B[k]=3;
		if(Y2[i]==0&&Y3[i]==0)a43.q[k]=1;
		else a43.q[k]=0;
	}
	a33.init();a43.init();
	for(int j=1;j<=tt;++j){
		int x=e[j].x,y=e[j].y;
		long long z=a33.query(x,y)+a43.query(x,y);
		if(e[j].wz>0)ans[e[j].wz-1]-=z;
		else ans[-e[j].wz-1]+=z;
	}
	return ans;
}
#ifndef ONLINE_JUDGE
int main(){
	int n=7;mt19937 mt(1377);
	vector<int>X={0,0,0,1,0,0,0},Y={0,1,1,1,1,1,0};
	vector<int>T,B,L,R;
	int Q=30;
	while(Q--){
		int l=mt()%n,r=mt()%n,ll=mt()%n,rr=mt()%n;
		if(l>r)swap(l,r);
		if(ll>rr)swap(ll,rr);
		T.emplace_back(l);B.emplace_back(r);
		L.emplace_back(ll);R.emplace_back(rr);
	}
	auto ans=mosaic(X,Y, T,B,L,R);
	for(auto cu:ans)printf("%lld\n",cu);
	return 0;
}
#endif

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 0ms
memory: 28376kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
0
0
10
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
0
0
0
0
0
0
0
0
0

result:

ok 

Test #2:

score: 5
Accepted
time: 0ms
memory: 28404kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
1
1
10
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
1
1
1
1
1
1
1
1
1

result:

ok 

Test #3:

score: 5
Accepted
time: 0ms
memory: 28376kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 0
10
1 1 0 1
1 1 0 1
0 0 0 0
0 1 0 1
0 1 0 1
1 1 0 0
0 1 0 1
0 1 1 1
1 1 0 1
0 0 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
1
1
2
2
0
2
1
1
1

result:

ok 

Test #4:

score: 5
Accepted
time: 5ms
memory: 28428kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 0
10
0 1 1 1
0 1 0 1
0 1 0 0
1 1 0 1
0 1 0 1
0 1 0 0
1 1 1 1
0 0 0 1
0 1 0 0
1 1 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
2
1
1
2
1
1
1
1
0

result:

ok 

Test #5:

score: 5
Accepted
time: 3ms
memory: 28632kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 1
0 0
10
0 1 0 0
0 0 0 1
0 1 0 0
0 0 0 0
1 1 1 1
0 1 0 0
0 0 0 1
0 1 0 1
0 1 0 1
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
0
0
0
0
1
1
1
1

result:

ok 

Test #6:

score: 5
Accepted
time: 0ms
memory: 28356kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 1
1 0
10
0 0 0 1
0 0 0 1
1 1 0 1
0 1 0 1
0 1 0 0
0 1 1 1
1 1 0 1
0 0 1 1
0 1 0 0
0 1 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
0
2
1
1
0
1
1
1

result:

ok 

Test #7:

score: 5
Accepted
time: 0ms
memory: 28384kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 0
0 1
10
0 0 0 0
0 1 0 1
0 1 0 1
0 1 0 1
0 1 1 1
0 0 1 1
0 0 0 1
0 1 0 0
1 1 0 1
1 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
1
1
0
0
0
1
1
1

result:

ok 

Test #8:

score: 5
Accepted
time: 0ms
memory: 28652kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 1
10
0 1 0 0
1 1 0 1
0 0 0 1
1 1 1 1
1 1 0 0
0 1 1 1
0 1 0 0
0 0 1 1
1 1 0 1
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
1
1
0
1
0
2
0
1
2

result:

ok 

Test #9:

score: 5
Accepted
time: 0ms
memory: 28348kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 1
0 1
10
0 1 0 1
0 1 0 1
1 1 1 1
0 1 0 1
0 0 1 1
0 1 0 1
0 1 1 1
0 0 0 0
0 1 0 0
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
0
2
1
2
1
0
1
2

result:

ok 

Test #10:

score: 5
Accepted
time: 5ms
memory: 28420kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 1
1 1
10
0 0 0 1
0 1 0 0
0 1 0 0
0 1 0 1
0 0 0 0
0 1 0 1
0 1 0 1
0 1 1 1
0 1 0 1
1 1 1 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
2
3
1
3
3
1
3
0

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #11:

score: 0
Wrong Answer
time: 3ms
memory: 30408kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199
0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 0 1...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1241
5813
1036
486
11935
1457
2002
4967
798
2134
40
494
808
6516
6087
713
45
12
219
473
3526
106
4695
52
1578
1400
96
1645
1244
5842
6410
3093
67
2907
1269
67
4248
2323
380
3192
497
1792
655
1911
880
6048
2214
2223
296
4059
2336
5010
1068
1728
2320
2058
87
11313
1...

result:

wrong answer 3rd lines differ - on the 1st token, expected: '1078', found: '1241'

Subtask #3:

score: 7
Accepted

Test #18:

score: 7
Accepted
time: 53ms
memory: 41368kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1314
79312
13238
63518
27135
86532
21129
53105
14461
13920
65981
66950
13385
23885
37091
56646
69855
64947
74166
41759
50738
1366
65318
58452
24337
58380
29379
59258
39016
4990
60529
23351
60370
12835
25686
8151
17007
56172
10913
7224
30221
73673
55593
33643
44070...

result:

ok 

Test #19:

score: 7
Accepted
time: 56ms
memory: 41464kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
97288
84412
98958
98546
95894
91536
99791
94852
96879
98784
94005
99030
95916
90829
96593
96545
90518
95251
93882
95122
94925
96009
98788
98866
95996
97263
95422
95733
96576
97730
98106
96939
94030
94576
94019
92982
96921
95715
96639
93579
97372
97983
95123
95211
...

result:

ok 

Test #20:

score: 7
Accepted
time: 68ms
memory: 42324kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
1 0 0 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
63186
59869
80378
71302
94439
63006
84372
99459
21243
54879
86436
65742
94261
35276
55849
93734
72881
49090
34951
93280
90257
58145
84070
58055
95069
56733
82475
51301
59357
39555
95572
87255
37523
68017
80309
52815
95469
29140
85700
46052
56013
71305
90947
7434
6...

result:

ok 

Test #21:

score: 7
Accepted
time: 51ms
memory: 41660kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
1 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 1 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
99156
96398
98499
93058
98359
93547
93120
98997
99065
97926
99050
95046
96687
98137
97249
97530
96983
98126
89892
94397
98111
96471
95754
99320
97511
95029
96780
93937
97095
97566
97024
99338
97729
99722
97152
98216
95895
97942
98980
99845
96992
97397
99255
97894
...

result:

ok 

Test #22:

score: 7
Accepted
time: 50ms
memory: 39940kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
100000
0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
34862
31357
15637
16893
7670
123
17919
20936
7467
18723
34082
1835
18668
23866
630
26206
40304
6217
25617
18490
11507
39163
5570
16345
4695
30449
15992
13307
5315
5393
8864
29876
34139
3227
28910
11628
2250
38538
12586
299
1066
8238
40627
7418
7600
3123
18111
9012...

result:

ok 

Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 8
Accepted

Test #31:

score: 8
Accepted
time: 72ms
memory: 37696kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
10
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
200000
1 7 0 4
3 4 3 4
3 6 2 5
4 5 6 7
5 7 2 8
0 6 4 7
0 5 6 7
1 3 9 9
6 9 1 7
2 9 4 6
4 4 6 7
0 1 8 8
7 7 0 3
0 4 1 7
2 2 0 9
3 9 4 6
3 9 0 9
1 8 4 6
4 5 5 7
0 6 2 3
2 3 0 6
1 9 8 8
2 4 3 4
3 6 2 9
3 9 2 7
1 3 0 3
0 8 2 4
3...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
14
2
8
2
10
12
5
2
14
12
1
0
2
14
4
10
32
12
3
6
6
4
3
16
21
5
12
6
7
11
12
3
7
3
6
15
6
4
6
8
15
24
2
5
11
8
16
3
4
12
4
9
23
1
2
5
6
4
1
4
4
3
6
4
18
32
10
2
7
7
5
12
11
7
4
4
10
6
4
16
8
13
8
3
3
8
21
1
2
3
6
14
21
14
9
2
3
2
4
16
20
7
3
5
3
15
16
8
36
7
6
7
9
...

result:

ok 

Test #32:

score: 8
Accepted
time: 749ms
memory: 41872kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
8120124544
2752273618
652362120
3572900496
7229702005
8480641653
6918084280
1267958106
904477638
1997350413
7012230475
1362860576
163899948
797037988
656632144
5591112615
3071773904
8768430125
4850111320
8165741606
1554651170
1797902728
374751575
9903806946
519998...

result:

ok 

Test #33:

score: 8
Accepted
time: 576ms
memory: 42060kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
3570040188
3318070798
8631503328
6373540329
560572082
812170996
10132940228
7734369045
4291788438
3990792526
1508274527
7435250506
2410810420
3929002587
42412734
6175343964
6651965200
2985906307
6315888787
2227135547
1138686010
1352599425
9555034480
3719516836
628...

result:

ok 

Test #34:

score: 8
Accepted
time: 578ms
memory: 42200kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
8939395244
5011877325
5286271590
3547238661
1654885646
6828788960
7469464650
9466465932
2748117410
4821162993
4386747068
4915799951
6338256240
7006606360
926836202
4330330051
10546142155
1947719980
7361580008
8746762352
5915138727
3714331376
5484402315
994826472
3...

result:

ok 

Test #35:

score: 8
Accepted
time: 601ms
memory: 41552kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
17867548576
18831450652
18568769765
18418076073
18083693541
18642130474
19355431583
19687992009
19238003647
17914499413
19139947528
17637142200
18884367608
18644294448
17842030367
18917685664
19248869678
19036530786
19767756709
17491804815
18904101040
19707370743
...

result:

ok 

Test #36:

score: 8
Accepted
time: 687ms
memory: 42532kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
54437
85099
9025
478
80531
40258
44834
52441
16506
17580
4212
21659
15640
60835
54010
13898
19813
62442
60518
48299
30311
33628
14703
81460
47178
77318
79090
65157
29874
20280
1180
32387
46550
10247
1394
53896
32646
18652
20801
60481
26878
22939
43360
12518
79936
...

result:

ok 

Test #37:

score: 8
Accepted
time: 688ms
memory: 42124kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
56771
25325
7855
21931
24973
59779
33690
25827
2776
20450
35766
9160
11668
19064
11173
18942
12789
21937
21038
34391
7307
41750
38340
1093
46005
8066
64096
10836
68912
80515
66710
36919
19763
48176
26284
57483
32392
2767
44232
26264
21828
6813
4790
9045
3159
59984...

result:

ok 

Test #38:

score: 8
Accepted
time: 629ms
memory: 41360kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
0
0
1
0
0
1
1
1
0
1
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
0
0
0
0
0
0
1
1
0
1
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
0
0
0
0
1
0
0
1
1
1
1
1
0
0
0
1
0
0
0
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
1
1
0
0
1
1
1
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
1
1
1
1
0
1
0
1
0
0
1
0
1
0
1
0
1
0
1
...

result:

ok 

Test #39:

score: 8
Accepted
time: 596ms
memory: 38700kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
98765
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
195956880
1830794238
1889160424
1032014556
478191700
450315684
1043245247
954601965
68607854
603979719
1490902898
349128672
205584813
116639600
11407164
1901396104
120888461
405500
899118801
174394653
330868120
9886483
2821124
3339594272
1134585185
1258395206
1355...

result:

ok 

Test #40:

score: 8
Accepted
time: 550ms
memory: 39764kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
98766
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
6440
2345
4590
20700
10149
11283
8424
30492
6389
780
497
18532
12369
7957
3170
22342
1661
16938
12367
17157
6023
15490
4532
36620
2828
36537
17
13999
34684
5578
2607
30996
37713
14449
35052
5018
25651
920
33278
1828
670
1869
31741
3808
15194
16928
24243
20543
4674...

result:

ok 

Test #41:

score: 8
Accepted
time: 557ms
memory: 40008kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
98767
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
6498
40272
36086
28355
8581
10712
1320
892
44484
30974
18413
4468
7242
6865
34674
10610
30880
25271
15473
32318
2661
4696
40933
184
30368
859
17757
9642
7022
8828
8238
43635
4288
45250
18534
45379
38408
3516
30831
23813
5954
39034
4063
27599
7650
11519
9806
24529
...

result:

ok 

Subtask #6:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 636ms
memory: 41836kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
0
0
1
0
0
1
0
1
0
1
1
0
0
1
1
1
1
1
0
0
0
0
0
0
0
1
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
0
1
1
1
0
0
1
0
0
0
0
0
1
1
0
0
0
0
0
1
1
0
1
0
1
0
1
0
1
1
1
0
1
1
0
0
0
0
0
0
1
1
0
1
0
0
1
0
0
0
0
0
1
1
0
1
1
1
0
0
1
1
1
0
0
1
1
1
0
1
1
1
0
1
0
0
1
0
0
1
0
1
1
1
0
1
0
...

result:

wrong answer 6th lines differ - on the 1st token, expected: '1', found: '0'

Subtask #7:

score: 0
Skipped

Dependency #3:

100%
Accepted

Dependency #6:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%