QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#748322#2600. MismatchWorld_CreaterAC ✓602ms47240kbC++175.8kb2024-11-14 20:02:182024-11-14 20:02:19

Judging History

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

  • [2024-11-14 20:02:19]
  • 评测
  • 测评结果:AC
  • 用时:602ms
  • 内存:47240kb
  • [2024-11-14 20:02:18]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
namespace polynomial{
	const int MOD=998244353,G=3,IG=(MOD+1)/G,I2=(MOD+1)/2;
	typedef std::vector<int> poly;
	std::ostream &operator<<(std::ostream &str,poly a)
	{
		for(auto i:a) str<<i<<" ";
		return str;
	}
	int qpow(int a,int b) {if(b==0)return 1;int g=qpow(a,b/2);g=1ll*g*g%MOD;if(b&1)g=1ll*g*a%MOD;return g;}
	inline poly operator +(const poly &a,const poly &b) 
	{
		poly c(std::max(a.size(),b.size()));
		for(int i=0;i<(int)std::max(a.size(),b.size());i++)
		{
			int t=0;
			if(i<(int)a.size()) t+=a[i];
			if(i<(int)b.size()) t+=b[i];
			if(t>=MOD) t-=MOD;
			c[i]=t;
		}
		return c;
	}
	inline poly &operator +=(poly &a,const poly &b){return a=a+b;}
	inline poly operator +(poly a,int b)
	{
		a[0]=((a[0]+b)%MOD+MOD)%MOD;
		return a;
	}
	inline poly &operator +=(poly &a,const int &b){return a=a+b;}
	inline poly operator -(const poly &a,const poly &b)
	{
		poly c(std::max(a.size(),b.size()));
		for(int i=0;i<(int)std::max(a.size(),b.size());i++)
		{
			int t=0;
			if(i<(int)a.size()) t+=a[i];
			if(i<(int)b.size()) t-=b[i];
			if(t>=MOD) t-=MOD;
			if(t<0) t+=MOD;
			c[i]=t;
		}
		return c;
	}
	inline poly &operator -=(poly &a,const poly &b){return a=a-b;}
	inline poly operator -(poly a)
	{
		for(auto &i:a) i=MOD-i;
		return a;
	}
	inline poly operator -(const poly &a,int b)
	{
		return a+-b;
	}
	inline poly &operator -=(poly &a,int b) {return a=a-b;}
	inline poly operator -(int a,const poly &b) {return (-b)+a;}
	inline void ntt(poly &a,const std::vector<int> &rev,int lim,const int &iv)
	{
		for(int i=0;i<lim;i++)
		{
			if(i<rev[i]) std::swap(a[i],a[rev[i]]);
		}
		int in=qpow(lim,MOD-2);
		for(int len=1;len<lim;len<<=1)
		{
			int w=qpow(iv==1?IG:G,(MOD-1)/(len<<1));
			for(int i=0;i<lim;i+=len<<1)
			{		
				int pw=1;
				for(int j=0;j<len;j++)
				{
					int x=a[i+j],y=1ll*pw*a[i+j+len]%MOD;
					a[i+j]=x+y;
					if(a[i+j]>=MOD) a[i+j]-=MOD;
					a[i+j+len]=x-y;
					if(a[i+j+len]>=MOD) a[i+j+len]-=MOD;
					if(a[i+j+len]<0) a[i+j+len]+=MOD;
					pw=1ll*pw*w%MOD;
				}
			}
		}
		if(iv==-1)
		{
			for(int i=0;i<=lim;i++)
			{
				a[i]=1ll*a[i]*in%MOD;
			}
		}
	}
	inline poly operator *(poly a,poly b)
	{
		int n=a.size(),m=b.size(),lim=1;
		while(lim<=n+m) lim<<=1;
		a.resize(lim+1);
		b.resize(lim+1);
		std::vector<int> rev(lim+1);
		for(int i=1;i<=lim;i++)
		{
			rev[i]=rev[i>>1]>>1|((i&1)?(lim>>1):0);
		}
		ntt(a,rev,lim,1);
		ntt(b,rev,lim,1);
		for(int i=0;i<=lim;i++) a[i]=1ll*a[i]*b[i]%MOD;
		ntt(a,rev,lim,-1);
		a.resize(n+m-1);
		return a;
	}
	inline poly &operator *=(poly &a,const poly &b){return a=a*b;}
	inline poly operator *(poly a,int b)
	{
		for(auto &i:a) i=1ll*i*b%MOD;
		return a;
	}
	inline poly operator *(int a,poly b)
	{
		return b*a;
	}
	inline poly &operator *=(poly &a,int b){return a=a*b;}
	inline poly Inv(poly a,int b=-1)	
	{
		if(b==-1) b=a.size();
		if(b==1) return poly({qpow(a[0],MOD-2)});
		poly f0=Inv(a,(b+1)>>1);
		poly c=a;
		c.resize(b+1);
		int lim=1;
		while(lim<=b*2) lim<<=1;
		std::vector<int> rev(lim+1);
		c.resize(lim+1);
		f0.resize(lim+1);
		for(int i=1;i<=lim;i++)
		{
			rev[i]=rev[i>>1]>>1|((i&1)?(lim>>1):0);
		}
		ntt(c,rev,lim,1);
		ntt(f0,rev,lim,1);
		for(int i=0;i<=lim;i++) c[i]=((f0[i]*2%MOD-1ll*c[i]*f0[i]%MOD*f0[i]%MOD)%MOD+MOD)%MOD;
		ntt(c,rev,lim,-1);
		c.resize(b);
		return c;
	}
	inline poly Sqrt(poly a,int b=-1)
	{
		if(b==-1) b=a.size();
		if(b==1) return poly({1});
		poly c=a;
		c.resize(b);
		poly f0=Sqrt(a,(b+1)>>1);
		poly g=Inv(f0,b);
		poly res=(c+f0*f0)*g*I2;
		res.resize(b);
		return res;
	}
	inline poly Dt(poly a)
	{
		for(int i=0;i<(int)a.size();i++)
		{
			a[i]=1ll*(i+1)*a[i+1]%MOD;
		}
		a.pop_back();
		return a;
	}
	inline poly Int(poly a)
	{
		a.emplace_back();
		for(int i=(int)a.size()-2;i>=0;i--)
		{
			a[i+1]=1ll*a[i]*qpow(i+1,MOD-2)%MOD;
		}
		a[0]=0;
		return a;
	}
	inline poly Ln(poly a)
	{
		poly res=Int(Dt(a)*Inv(a));
		res.resize((int)a.size());
		return res;
	}
	inline poly Exp(poly a,int b=-1)
	{
		if(b==-1) b=a.size();
		if(b==1) return poly({1});
		poly c=a;
		c.resize(b);
		poly f0=Exp(a,(b+1)>>1);
		poly res=(c-Ln(f0)+1)*f0;
		if(b!=(int)a.size()) res.resize(b<<1);
		else res.resize(b);
		return res;
	}
	inline poly Qpow_E(poly a,int b)
	{
		return Exp(Ln(a)*b);
	}
	inline poly Sub_mul(poly a,poly b)
	{
		poly f(a.size());
		std::reverse(b.begin(),b.end());
		f=a*b;
		for(int i=0;i<(int)a.size();i++)
		{
			f[i]=f[i+(int)b.size()-1];
		}
		f.resize(a.size());
		return f;
	}
}
using namespace polynomial;
const int mod=998244353;
int n,a[1000005],f[1000005],ad=(1<<29)-1,Or;
int fac[1000005],inv[1000005];
poly g,h;
int C(int n,int m)
{
	return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		ad&=a[i];
		Or|=a[i];
		f[a[i]]++;
	}
	fac[0]=inv[0]=1;
	for(int i=1;i<=n;i++)
	{
		fac[i]=1ll*fac[i-1]*i%mod;
		inv[i]=qpow(fac[i],mod-2)%mod;
	}
	if(ad!=0)
	{
		for(int i=1;i<=n;i++)
		{
			cout<<0<<" ";
		}
		return 0;
	}
	for(int i=0;i<19;i++)
	{
		for(int j=0;j<(1<<19);j++)
		{
			if(!(j>>i&1)) f[j]+=f[j^(1<<i)];
		}
	}
	g.resize(n+1),h.resize(n+1);
	for(int i=0;i<(1<<19);i++)
	{
		if((Or&i)!=i) continue ;
		int ni=i;
		if(__builtin_parity(i)) g[n-f[ni]]--;
		else g[n-f[ni]]++;
	}
	for(int i=0;i<=n;i++)
	{
		if(g[i]<0) g[i]+=mod;
		g[i]=1ll*g[i]*fac[n-i]%mod;
		h[i]=inv[i];
	}
	h=h*g;
	for(int i=0;i<=n;i++)
	{
		h[i]=1ll*h[i]*inv[n-i]%mod;
	}
	// for(int i=0;i<=n;i++)
	// {
	// 	for(int j=0;j<=i;j++)
	// 	{
	// 		h[i]+=1ll*g[j]*C(n-j,i-j)%mod;
	// 		if(h[i]>=mod) h[i]-=mod;
	// 	}
	// }

	for(int i=n-1;i>=0;i--) cout<<h[i]<<" ";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 11304kb

input:

3
0 1 2

output:

1 3 1 

result:

ok 3 number(s): "1 3 1"

Test #2:

score: 0
Accepted
time: 10ms
memory: 11708kb

input:

6
1 2 2 7 6 7

output:

0 3 9 10 5 1 

result:

ok 6 numbers

Test #3:

score: 0
Accepted
time: 9ms
memory: 11616kb

input:

1
0

output:

1 

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 1ms
memory: 11812kb

input:

1
524287

output:

0 

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 4ms
memory: 10160kb

input:

2
0 0

output:

2 1 

result:

ok 2 number(s): "2 1"

Test #6:

score: 0
Accepted
time: 4ms
memory: 11812kb

input:

2
2 262144

output:

0 1 

result:

ok 2 number(s): "0 1"

Test #7:

score: 0
Accepted
time: 0ms
memory: 9800kb

input:

3
5 6 7

output:

0 0 0 

result:

ok 3 number(s): "0 0 0"

Test #8:

score: 0
Accepted
time: 2ms
memory: 11988kb

input:

8
262136 262136 262136 262136 262136 262136 262136 262136

output:

0 0 0 0 0 0 0 0 

result:

ok 8 numbers

Test #9:

score: 0
Accepted
time: 8ms
memory: 10472kb

input:

9
0 0 0 0 0 0 0 0 0

output:

9 36 84 126 126 84 36 9 1 

result:

ok 9 numbers

Test #10:

score: 0
Accepted
time: 6ms
memory: 11332kb

input:

16
7 4 5 6 8 9 0 1 2 3 15 13 11 10 12 14

output:

1 40 360 1546 4144 7896 11408 12866 11440 8008 4368 1820 560 120 16 1 

result:

ok 16 numbers

Test #11:

score: 0
Accepted
time: 587ms
memory: 46036kb

input:

524288
323049 327819 57429 412259 374361 54485 317667 114566 430606 273922 384418 433429 444663 353620 383084 13069 231609 484186 231139 469585 32430 456221 209359 347360 82941 508142 280704 425269 12267 364319 383903 132816 81258 114782 82902 281651 254335 83584 243303 245998 461366 78417 160748 16...

output:

1 581130733 553220056 627493872 712168680 206795138 371006912 423940663 741766878 840274089 736109900 678910858 283562354 525351535 356510946 492165288 500512555 36421036 843462462 271864283 486310027 68637182 470593315 868899536 107522857 294651544 581819549 779721546 991685161 225311648 247715674 ...

result:

ok 524288 numbers

Test #12:

score: 0
Accepted
time: 363ms
memory: 33404kb

input:

524286
517268 464491 210969 65695 458261 206249 251280 339230 285690 136120 168178 157609 151012 130095 10891 35976 286701 105650 191115 255207 459632 292115 307198 232840 299365 175735 513621 477077 522162 132994 289903 187288 277207 368771 101680 212533 67734 478669 327981 489176 253044 190008 519...

output:

0 580606446 292167283 285725292 700315390 897088522 38257843 501751951 208545152 858060922 833712403 619878115 350510856 506597239 80780624 954673325 792091521 245291294 774002854 823309775 475615994 871095872 758568849 947311207 261855077 18691953 353280759 722255520 432829474 910963543 670398588 6...

result:

ok 524286 numbers

Test #13:

score: 0
Accepted
time: 130ms
memory: 18952kb

input:

131073
131363 231197 176370 261594 143294 246437 229488 145512 221987 233887 144806 199228 228576 170865 169780 160042 189441 240398 155458 241916 144676 246986 181573 203877 205269 171144 132035 192416 160316 163721 224647 187009 176033 234539 131336 200503 197900 161662 142297 180964 261382 249987...

output:

0 131072 603914232 416301937 809244683 923218780 720220404 203315233 670934491 445116674 691612126 134974246 247184046 531137794 628491091 509121044 326067900 18261128 855226733 315487714 215987385 397433549 756219176 209113208 843237654 397555687 349674246 147979208 215356325 956516949 209594316 90...

result:

ok 131073 numbers

Test #14:

score: 0
Accepted
time: 152ms
memory: 17292kb

input:

524288
278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314 278314...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 524288 numbers

Test #15:

score: 0
Accepted
time: 153ms
memory: 16764kb

input:

524288
311737 69103 69103 69103 69103 69103 311737 311737 311737 69103 311737 311737 311737 311737 69103 311737 311737 311737 69103 311737 69103 311737 69103 311737 311737 69103 311737 69103 311737 69103 69103 311737 69103 69103 69103 311737 69103 311737 69103 311737 311737 69103 69103 69103 69103 6...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 524288 numbers

Test #16:

score: 0
Accepted
time: 153ms
memory: 19112kb

input:

524288
200169 200169 200169 221031 449837 221031 221031 449837 200169 221031 200169 449837 449837 200169 200169 221031 449837 200169 221031 221031 449837 221031 449837 200169 449837 449837 221031 200169 200169 200169 200169 221031 221031 200169 449837 200169 200169 221031 449837 221031 200169 449837...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 524288 numbers

Test #17:

score: 0
Accepted
time: 589ms
memory: 46924kb

input:

524288
66753 52743 255371 496207 266361 327320 52743 66753 496207 255371 52743 435228 215012 266361 496207 255371 266361 496207 255371 52743 215012 492740 435228 215012 435228 496207 435228 496207 255371 266361 327320 496207 435228 496207 496207 303657 496207 255371 303657 435228 435228 66753 327320...

output:

0 0 778326923 185498819 335773640 715877771 88692004 633585068 393406712 125900618 931286440 860414395 466230638 665731658 285093350 488026812 857145430 252907115 663317862 651511371 991296680 547856764 918475810 881947254 167425719 490723117 911292461 22370528 683645161 636550130 5370500 434721500 ...

result:

ok 524288 numbers

Test #18:

score: 0
Accepted
time: 577ms
memory: 47076kb

input:

524288
381825 208134 403382 342393 79968 265551 342393 323827 459141 345353 208134 410127 37457 244795 509908 411625 56184 265551 411625 276557 483281 85888 145166 173833 436374 37457 436374 509908 464724 464724 37457 483281 265551 464724 517367 381825 436374 37457 276557 265551 145166 85888 37457 4...

output:

0 747775324 124632747 883048631 859122323 287594088 743784345 739536316 226438537 841340127 568440606 624427168 186461453 454609355 127445232 253423025 766616139 360969578 108203129 987272682 970606809 948967274 789325807 723961017 478287824 915445393 337909791 408441374 415158468 957238696 61632531...

result:

ok 524288 numbers

Test #19:

score: 0
Accepted
time: 588ms
memory: 45712kb

input:

524288
130823 204434 351919 514396 383830 447929 71477 69270 424280 6099 410069 207748 38523 82723 75949 170631 294482 296229 422072 160790 509281 499973 179109 278919 338453 380699 414235 313689 103229 393525 295748 121009 289436 469256 342942 490177 308466 448287 88640 367938 103333 393828 416224 ...

output:

0 582596002 759643733 191862496 973250793 757189491 998023489 672208004 875607844 918924482 308390450 404084067 942256294 107030742 735523950 946610516 782957810 445752925 862691450 87381082 444242788 679861935 237421495 698134560 204556797 440349620 71075131 790864269 76572640 409785533 148274185 7...

result:

ok 524288 numbers

Test #20:

score: 0
Accepted
time: 598ms
memory: 47240kb

input:

524288
409820 77612 245313 220953 91237 248421 262580 407071 38798 289841 317332 414180 68893 337261 294232 265938 332279 40495 25893 370558 379053 257883 101057 215032 69229 312122 5583 54569 133222 432024 239077 262179 193947 464039 25299 48884 377555 260787 498309 142578 400033 294053 320384 4133...

output:

1 578435998 911503524 734412904 977863155 187295552 490351869 284549277 13023321 366821174 11322821 173824989 351389410 492014943 945079599 897926336 644288420 918956769 174213776 715695752 666580018 130544507 462555473 88825121 311811755 582328676 935917735 448795593 911846917 41649159 517470499 21...

result:

ok 524288 numbers

Test #21:

score: 0
Accepted
time: 598ms
memory: 46820kb

input:

524288
388919 154619 204432 495089 204432 474065 204432 204432 204432 63301 204432 204432 199771 204432 204432 56004 204432 246085 96329 2174 392564 114758 70354 165586 204432 204432 204432 204432 204432 286874 298722 204432 100885 204432 204432 13961 204432 478875 204432 204432 109901 204432 299246...

output:

0 415433494 789679935 112733054 68182667 892612868 953290734 445966098 104185541 259314189 464620151 555022031 161960437 182596546 83827886 3415990 444686634 869527872 369167635 101448974 362488449 148694240 759686293 223067928 714203786 877038037 990807604 912226656 398485415 808613906 698771551 35...

result:

ok 524288 numbers

Test #22:

score: 0
Accepted
time: 588ms
memory: 46784kb

input:

524288
81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483 81483...

output:

0 0 4194232 437779177 665508608 59223197 518454261 322646712 245932207 477037131 223819356 103758836 607297006 475040839 334058824 342039961 347571575 403778539 686094156 121437651 963107097 486795517 830204850 737014353 201972425 30422437 239212542 309583488 480565146 954516497 107298492 667074337 ...

result:

ok 524288 numbers

Test #23:

score: 0
Accepted
time: 580ms
memory: 46608kb

input:

524288
431945 341160 429559 430519 466389 259202 74539 317334 36052 399673 16172 453454 249708 381387 365688 449046 293126 328777 360817 488665 493121 295248 231848 340746 88583 19443 416504 129885 159479 131258 344503 34484 491671 376763 280176 339890 515752 82473 48918 357285 224571 281926 250943 ...

output:

1 583038535 74915842 794506444 63685481 977071939 529367146 431494869 31477959 845638621 231085405 550894231 568183979 253417894 257889937 31392392 458683717 551153049 782254463 92930847 245424231 804187691 774056110 252921533 831805585 916685760 19011612 140458126 778863570 725327179 573592594 4051...

result:

ok 524288 numbers

Test #24:

score: 0
Accepted
time: 582ms
memory: 45496kb

input:

524288
447319 277065 409295 501871 463526 447319 258435 161219 105331 447319 447319 470424 447319 160796 447319 33054 447319 447319 447319 192028 447319 447319 470424 20889 245020 95199 447319 353642 470424 163340 508150 104923 447319 346193 447319 470424 447319 364263 470424 447319 447319 447319 47...

output:

0 179863623 966772217 411059379 640430611 382474524 91616391 323704411 345198873 533881656 887253161 677670921 949724356 860090583 145804261 159587706 515021642 414753037 809122397 169944460 412402092 457822840 719190639 101818830 138331271 954816852 542834209 697207878 927340833 93093623 287111729 ...

result:

ok 524288 numbers

Test #25:

score: 0
Accepted
time: 574ms
memory: 45492kb

input:

524288
199141 199141 497062 199141 497062 199141 199141 497062 199141 199141 497062 199141 497062 199141 497062 497062 199141 199141 497062 199141 497062 497062 497062 497062 497062 199141 199141 199141 199141 497062 199141 199141 199141 497062 199141 497062 497062 199141 199141 497062 497062 497062...

output:

0 0 262125 103677322 911427072 754816109 138329780 797949509 64234693 212082131 813816071 745045732 44355340 418686145 91528568 80616572 877487134 208741957 689177757 416910794 62149221 236194341 366175304 65105424 938000387 565846808 112346865 53443155 919414647 485111477 12068832 978047464 5499075...

result:

ok 524288 numbers

Test #26:

score: 0
Accepted
time: 594ms
memory: 45832kb

input:

524288
252056 389831 18435 212442 84500 270050 115876 484947 65732 49249 69848 399606 227610 336059 493324 434954 309787 366356 92218 66512 15000 514541 208319 313827 7622 456431 152486 25276 282821 503575 331899 446459 84198 148021 178654 203354 152112 84119 423471 162287 443843 11360 111071 396312...

output:

0 582099766 888315567 806127571 160329813 784509944 78100993 526512468 770376671 478062812 5595408 382542985 462051364 799636028 891577796 124170095 960168905 728607715 522986172 568917021 327779017 880285705 945343647 6993001 874668750 620501150 315329035 694262758 775996640 363753287 764886839 359...

result:

ok 524288 numbers

Test #27:

score: 0
Accepted
time: 587ms
memory: 46904kb

input:

524288
460437 259342 82560 333719 460437 259342 285135 73053 200342 223161 282575 259342 460437 407194 301202 206420 344919 333719 285135 285135 259342 353231 460437 80450 512281 333719 230274 460437 471362 200342 149845 397732 450917 333719 460437 436207 200342 164250 333719 333719 83451 29795 4604...

output:

0 219131356 33452540 977198400 591251215 779190871 519204601 185915312 85894293 435488389 277731457 14055868 165209473 457467821 183631677 566045827 423381684 350465036 285712361 835817408 790576927 732755571 9321787 295572103 400832355 538378795 478203105 307818086 165332452 889843411 682733108 410...

result:

ok 524288 numbers

Test #28:

score: 0
Accepted
time: 585ms
memory: 46620kb

input:

524288
160534 160534 17715 463009 17715 463009 507229 317714 160534 317714 160534 317714 463009 507229 160534 317714 463009 507229 317714 507229 463009 160534 507229 507229 17715 160534 463009 463009 317714 160534 317714 317714 507229 463009 463009 17715 317714 317714 17715 317714 17715 17715 463009...

output:

0 104971 307824852 546018244 67737557 563310703 988631284 570225377 895023595 244716463 183835696 654371650 706948325 3104090 211357888 940171466 40956849 836501525 363033270 461868436 338322180 618649145 377403589 544126182 537790302 661160798 665370761 833445088 73847656 198264587 462586830 995063...

result:

ok 524288 numbers

Test #29:

score: 0
Accepted
time: 586ms
memory: 45808kb

input:

524288
134186 161520 460813 244681 299160 120427 449246 314452 404033 447928 120250 114753 305880 179570 179049 302017 504297 27529 305097 65586 403576 261995 56028 132472 294753 219895 481679 333301 431333 311905 163193 511441 106299 339625 398067 433308 370392 263322 290833 217294 490477 479725 10...

output:

2 582719705 416400285 594835117 439773457 907422766 519873841 765791213 703139426 532102874 886060002 866362091 887744718 367320662 883773687 909901774 67678741 109609111 586578388 697382464 301634943 620600333 948360564 624429700 801393398 827703997 15263804 445962481 801670828 286308796 64384736 9...

result:

ok 524288 numbers

Test #30:

score: 0
Accepted
time: 579ms
memory: 46596kb

input:

524288
408146 352616 364294 446495 227296 122468 144676 130214 144833 87639 431200 264778 379023 420869 195375 78075 228347 368152 519972 77106 342928 127996 523455 181714 335909 415418 441666 329287 125246 24873 363794 166362 278896 37531 64852 169553 406946 133674 121577 452048 117946 150115 37179...

output:

0 618389021 701484103 70364156 331655036 883940572 139380240 268602163 590162337 361406204 471213740 420649363 657020133 898611893 644507872 171675708 177996913 443213348 666699017 466056588 717697459 874548966 903254227 434656291 29793336 571356983 44861659 646460843 705596663 794941469 551763117 1...

result:

ok 524288 numbers

Test #31:

score: 0
Accepted
time: 589ms
memory: 45560kb

input:

524288
428465 336561 318226 283674 413694 144724 98051 408560 429789 68093 409211 33112 75969 61211 257640 430848 497033 448031 124674 226627 122336 263359 80964 314632 321498 123439 8219 476395 483092 135098 230558 302778 220153 124674 462960 267287 458510 211670 457745 89582 39667 169762 170556 43...

output:

0 535510973 8569493 574907273 903501621 231617088 218502326 516174936 934893159 361674218 987241421 234957773 571088747 163273875 177145386 890293357 387431713 891699013 168326525 267582641 174162839 634532401 357981921 387276714 820766114 865674517 233456272 272631176 300896412 421172015 357769066 ...

result:

ok 524288 numbers

Test #32:

score: 0
Accepted
time: 600ms
memory: 46200kb

input:

524288
515120 5887 433789 374296 353913 172249 198958 398356 206093 13522 121395 109593 331957 203575 204102 440325 387546 316485 130678 279526 64482 26692 134003 339527 144736 278345 100698 447328 151141 59892 250273 504374 139806 453353 449566 230104 205588 48223 31251 24523 250516 237340 128626 3...

output:

0 579690939 754052406 964760915 502433562 155976428 592092235 942046496 437218381 731074771 925289878 721914891 365473376 86143299 965702568 98545113 8686055 357859203 78884190 540504652 705384306 565073915 368128304 303985431 66856402 735734229 693266256 572087113 215380049 683471698 439108627 8957...

result:

ok 524288 numbers

Test #33:

score: 0
Accepted
time: 602ms
memory: 46512kb

input:

524288
379563 320253 224530 394953 133216 330353 228964 320337 482867 186710 16411 198823 294382 343641 229828 400421 228769 54358 87194 385255 164628 505918 116111 399545 78497 45027 345989 78370 197567 369385 402163 123219 272468 268274 9005 373818 478576 55821 403396 233078 186431 188084 356838 1...

output:

2 582183957 933160897 831941658 537647309 945432105 308465731 777075228 511001924 210677465 687607700 73528993 208067481 14446528 669129964 376379894 961911605 712819174 51231112 816913119 798545493 981361611 209971370 68727784 357423919 776375718 724172913 605284917 870337406 871045104 914386070 96...

result:

ok 524288 numbers

Test #34:

score: 0
Accepted
time: 592ms
memory: 46868kb

input:

524288
115592 99552 419170 120796 104968 130894 393388 240212 296930 45704 145048 443791 490101 415330 209461 486060 513831 244247 394778 224911 402401 221936 511472 197815 64401 179104 211256 21274 20181 12187 503362 500373 148188 204973 31587 248172 323223 442649 407452 3033 465142 249773 419183 4...

output:

0 591084543 562801343 295077426 133942317 216294394 219074036 287225886 957092341 28642942 426630254 906548667 163654667 670137218 713287171 607038501 745433505 930224257 777552969 918201932 498613158 323525172 167263741 870997371 408815083 157049168 943408724 96099027 28215487 291216564 475629307 1...

result:

ok 524288 numbers

Test #35:

score: 0
Accepted
time: 587ms
memory: 46044kb

input:

524288
45637 340788 389689 279566 10262 371312 88026 29882 269358 150328 400859 465105 25071 227185 187146 343461 523903 80998 38513 465423 476726 360505 152596 395940 443630 238074 488202 87821 195017 145784 159538 218645 45694 193864 285794 140585 91297 389414 269485 93141 457802 273250 243352 201...

output:

0 579613804 351986693 232449817 734430881 927820297 798000680 183274699 28472690 623266774 180216887 170199204 592290114 699075105 372580348 808684739 531715599 147023774 833740536 30789804 284824828 555546927 544678547 745416166 520034946 868789564 157882815 772494578 771922613 173619278 503140181 ...

result:

ok 524288 numbers

Test #36:

score: 0
Accepted
time: 590ms
memory: 45740kb

input:

524288
385065 410325 72845 212135 414937 252613 502538 28592 399182 23486 486135 184802 502331 136819 485162 102343 236914 136481 484742 517498 387262 199837 460853 300947 321701 444817 6782 56227 372389 300579 127146 327867 430029 236929 10961 145825 214281 45467 462439 177196 21793 104704 447422 4...

output:

0 578314204 572737910 544835840 717770384 910739014 823773399 994992770 447383404 466084935 864973730 925759188 63344799 60116210 353253685 375656389 994637633 379871791 170058237 990261312 59949920 138779966 883122565 976458589 967041823 892491577 656967269 905287855 988068136 727497207 264202497 8...

result:

ok 524288 numbers

Test #37:

score: 0
Accepted
time: 588ms
memory: 46300kb

input:

524288
165821 6797 353374 261542 363146 358958 198124 397185 457505 487063 149091 501685 477909 437618 37442 318936 171961 9381 377590 143505 194376 515039 5717 464026 110511 172089 43533 9647 396157 156148 420038 6007 520956 492619 247139 137468 72405 130410 2862 509910 125861 140884 116752 358262 ...

output:

2 577820199 904975469 518477575 739241203 914784178 295644466 922727732 308985187 488135323 12611879 909630608 728006530 127575797 281168140 749556089 94825391 678483672 308779395 131972342 589719634 475617584 75125159 764178276 552586322 96005745 512842424 330287143 613475623 97687576 53962052 6777...

result:

ok 524288 numbers

Test #38:

score: 0
Accepted
time: 598ms
memory: 47068kb

input:

524288
353330 400207 407763 285220 192838 461281 126642 380360 29884 133306 47433 425186 234520 298371 228540 142262 433922 211816 235554 409002 232862 207366 239139 13251 521345 239917 80211 298418 464917 198449 101029 179478 367868 399445 41482 351748 187174 346609 117970 250634 491545 369667 5160...

output:

0 579980369 873164607 871247995 4481250 284558301 485195600 414663445 10411677 96531590 867610923 523306754 172472674 614608630 955980587 328952105 402877603 821130736 45511136 704654602 84559912 630159566 12381664 966743633 494405181 167106297 666216524 401653540 343397890 310077254 713144886 93013...

result:

ok 524288 numbers

Test #39:

score: 0
Accepted
time: 2ms
memory: 12016kb

input:

10
502692 360308 237257 376061 158505 3532 474760 232292 519799 44203

output:

0 0 0 0 0 0 0 0 0 0 

result:

ok 10 numbers

Test #40:

score: 0
Accepted
time: 11ms
memory: 11748kb

input:

20
188844 429616 515686 419356 171163 44785 212066 283918 101524 273476 436164 205913 115296 126156 158217 114919 287973 274382 357831 17675

output:

0 0 100 1487 8374 27489 63345 111441 155804 176539 163555 124147 76960 38640 15488 4844 1140 190 20 1 

result:

ok 20 numbers

Test #41:

score: 0
Accepted
time: 6ms
memory: 9972kb

input:

21
485189 259125 121881 372006 495030 17810 287992 185259 194591 446551 511151 478277 498629 379735 504067 342977 316011 415982 233829 500202 146545

output:

0 0 48 1151 8849 35546 94173 183896 280688 345881 350055 293172 203341 116262 54263 20349 5985 1330 210 21 1 

result:

ok 21 numbers

Test #42:

score: 0
Accepted
time: 10ms
memory: 11752kb

input:

19
58824 499919 493783 71631 224742 311362 270393 199954 107437 50732 253526 434288 126687 444131 125200 307444 217394 22384 51072

output:

0 1 131 1603 7876 22894 46880 73387 91335 92010 75491 50374 27131 11628 3876 969 171 19 1 

result:

ok 19 numbers

Test #43:

score: 0
Accepted
time: 6ms
memory: 12064kb

input:

19
359461 521428 293381 40266 491772 457688 301643 130817 467828 403119 53851 247453 207081 317472 303940 263685 173634 492958 135971

output:

0 0 99 1503 7812 23045 47253 73817 91657 92174 75546 50385 27132 11628 3876 969 171 19 1 

result:

ok 19 numbers

Test #44:

score: 0
Accepted
time: 6ms
memory: 9708kb

input:

23
385440 141913 179939 344081 11311 496938 249740 151687 179894 497294 94818 275928 334734 322424 481444 354711 199999 325799 100269 235464 126437 57901 275366

output:

0 0 150 2814 20003 80283 222499 471482 805065 1137995 1349742 1351408 1143931 817173 490313 245157 100947 33649 8855 1771 253 23 1 

result:

ok 23 numbers

Test #45:

score: 0
Accepted
time: 6ms
memory: 11820kb

input:

15
489025 343439 28545 256511 474401 347132 403318 74348 329095 489916 363135 482179 208762 258016 411249

output:

0 0 3 117 866 2672 4714 5544 4679 2921 1352 454 105 15 1 

result:

ok 15 numbers

Test #46:

score: 0
Accepted
time: 9ms
memory: 11820kb

input:

16
402692 199477 317317 452643 158458 502492 362320 100813 201805 141107 140860 518290 326633 132976 241768 124247

output:

0 0 44 650 2885 6814 10778 12611 11370 7996 4367 1820 560 120 16 1 

result:

ok 16 numbers

Test #47:

score: 0
Accepted
time: 9ms
memory: 11816kb

input:

20
505867 273306 29173 401974 66489 288487 471139 274265 319283 236415 62409 161544 264520 65288 390246 221533 76536 207681 240716 78523

output:

0 0 46 962 6663 24592 60169 108975 154412 175976 163400 124121 76958 38640 15488 4844 1140 190 20 1 

result:

ok 20 numbers

Test #48:

score: 0
Accepted
time: 590ms
memory: 45768kb

input:

524288
509 263 185 116 404 357 302 48 341 110 166 60 326 84 80 452 177 321 469 223 277 317 46 479 215 463 237 458 238 37 124 104 446 50 191 188 444 412 121 28 434 140 134 331 58 242 85 27 16 343 425 362 62 276 312 266 487 26 248 492 474 58 248 470 91 364 147 51 7 161 448 236 486 410 478 204 329 288 ...

output:

1043 368919882 252170007 64571944 177045610 220546876 246338829 861972672 806031334 948610943 578232633 323078860 232562044 169873992 935786530 789801702 136726292 535717349 466261702 883272 280652241 627827351 172289072 765481262 766384321 473892988 885982370 45543097 228520036 541212661 381678295 ...

result:

ok 524288 numbers

Test #49:

score: 0
Accepted
time: 587ms
memory: 45576kb

input:

524288
104448 33792 195584 62976 44032 31744 199168 130048 69632 186880 190464 227840 77312 112128 174592 104448 81920 143872 242176 70144 105472 16384 182784 166912 101888 39424 199680 218112 152576 203264 181760 512 187904 66560 93696 121856 15360 144384 225792 150528 141824 255488 71680 185344 16...

output:

1004 318438355 984103378 217526300 36211977 814947872 356368618 916717798 392333779 196387495 731429781 724213702 503710916 335841864 53809457 215743168 921295823 253623927 766257478 805561117 119059864 731893599 55107736 928863354 566570257 178493789 320971802 514085364 646493178 765111170 46962593...

result:

ok 524288 numbers

Test #50:

score: 0
Accepted
time: 573ms
memory: 45756kb

input:

524288
512 512 0 512 0 0 0 512 0 0 0 512 0 0 0 0 512 0 0 0 512 0 512 512 512 512 512 512 512 0 512 0 512 0 0 512 512 0 0 0 512 0 512 0 0 512 512 512 512 512 0 0 0 0 512 512 0 512 512 0 512 0 0 0 512 512 0 0 0 512 512 512 0 512 0 0 512 0 0 512 512 512 0 512 0 0 0 0 0 0 512 0 512 0 0 0 512 512 0 0 0 0...

output:

316089 967283032 524277381 343449305 200980927 538591297 246421216 154058658 563346337 720279300 464524490 263451566 85963869 981413284 598768843 929476837 678107150 281214341 40795804 554849655 906467648 635751458 593612834 315561793 526792961 261090271 428598775 780242591 226599088 297051985 30860...

result:

ok 524288 numbers

Test #51:

score: 0
Accepted
time: 588ms
memory: 45676kb

input:

524288
8192 0 0 0 0 8200 8200 0 8 8192 0 0 8 0 8200 8200 8192 8192 8192 8192 8200 8200 8192 8200 8 8 8200 8192 0 8200 8192 8200 8192 0 8192 8192 8200 0 8192 8192 0 8192 0 8192 8192 8192 8192 8200 8200 8 8 8192 0 8192 8192 8200 8192 8200 8192 0 8192 8192 8192 8200 8192 8200 0 8 8200 0 8192 8192 0 819...

output:

111271 962526401 804406647 488708876 22356441 68020554 269120819 678707234 483618008 597550855 639078403 413132191 591918359 701488417 311671710 601583269 200147650 708032952 975978571 510373221 637171830 899394702 573049077 765452741 321893400 360691118 759054675 479207701 558885717 838379227 40360...

result:

ok 524288 numbers

Test #52:

score: 0
Accepted
time: 599ms
memory: 45684kb

input:

524288
256 256 0 320 64 64 0 64 65600 64 0 64 0 0 0 0 0 320 64 256 64 64 65856 64 320 64 64 64 64 0 64 64 0 320 64 64 64 0 0 320 64 64 65600 65856 0 0 0 320 64 64 64 64 0 64 64 0 320 64 0 64 65600 320 256 0 64 256 64 64 64 64 320 64 64 64 64 0 64 64 0 0 64 0 320 64 64 320 64 64 320 64 64 320 320 64 ...

output:

101143 981875849 305602966 173895969 602137935 30884591 955092291 492797451 709153329 829469083 36349959 111176223 474628339 905987125 424184730 837530145 330036828 634853686 450956533 92332077 544069297 365400454 206743705 179073807 342500803 737291640 184320909 411230161 660946346 594366638 622672...

result:

ok 524288 numbers

Test #53:

score: 0
Accepted
time: 578ms
memory: 45760kb

input:

524288
65570 98339 32770 98339 98338 65570 32770 98306 2 32770 65538 98336 32768 32770 65539 32770 98306 98306 32770 98306 98307 32800 32769 32803 98339 32802 32802 98306 98307 98338 98307 32771 32770 32770 98306 32802 98339 32771 32800 34 98306 32802 32 34 32770 32800 32802 32769 32802 32771 32770 ...

output:

3725 272640666 721985398 763820578 408772311 266489387 846540335 572851288 55763627 182112711 723920075 234117816 486413927 81697237 406323224 254731996 796385448 55882198 374956282 980146423 724869076 117271255 927121222 829723980 811779561 458688042 284520112 983860010 664562756 103462834 43528013...

result:

ok 524288 numbers

Test #54:

score: 0
Accepted
time: 588ms
memory: 45648kb

input:

524288
196640 201008 135200 196656 196642 69680 69922 65824 197152 196866 196896 32 196898 200992 4642 69634 65826 802 65824 4352 201010 65808 200722 65824 196642 131360 65824 69632 200722 66064 65586 546 200754 196914 65570 65824 200992 200754 200992 69938 200976 131362 131074 65842 65586 4352 2007...

output:

2184 323770639 628223907 637362533 477746840 832360861 151536466 429852673 539038918 477728603 676140578 489082660 967028150 748421581 884736054 521505056 563294848 553968090 337959193 378324816 984865530 224128537 538587875 925895122 897482514 389298655 401378804 782791402 124725172 392709103 66538...

result:

ok 524288 numbers

Test #55:

score: 0
Accepted
time: 591ms
memory: 45748kb

input:

524288
139273 139273 196616 155681 155649 90115 1 225289 155657 139273 155649 212993 131072 204809 131083 204800 73729 73730 143401 204809 212993 131104 4097 155656 4099 155657 143368 131073 147467 151553 157739 77833 131105 131073 155648 204801 81929 139273 65537 147457 139273 155649 131072 196617 ...

output:

2050 510893438 51899973 861259916 311616432 390197808 997550397 217422562 484364047 141989669 369924607 320872928 973995273 892538050 920297444 89638214 633027078 524302475 59774793 594912149 244783124 477912513 185499064 178843083 562865740 185127104 234261541 87420794 830767549 703703975 58801879 ...

result:

ok 524288 numbers

Test #56:

score: 0
Accepted
time: 577ms
memory: 46640kb

input:

524288
26114 209475 24579 205378 217099 4611 66179 197123 95811 227843 77835 578 70147 156163 29379 80450 78403 70211 8835 4683 197187 66051 29186 78411 17987 68099 86019 70275 209475 5698 90626 94787 70147 29251 26179 8899 26307 78339 13955 70155 16899 12802 147976 70147 4611 1539 203267 94795 2135...

output:

9 176322766 550953455 616821257 858381234 219483779 687587016 677870162 284134879 203219457 832273880 702988539 105209501 635068127 150263777 961001955 744017588 584176351 98531348 718374682 179878083 262606898 986443274 753562485 141009683 114534621 137309658 65301995 801977030 234432352 496212737 ...

result:

ok 524288 numbers

Test #57:

score: 0
Accepted
time: 598ms
memory: 45668kb

input:

524288
23396 6760 4712 6513 55909 78436 55368 4192 23121 54380 18796 6240 45156 252776 137572 22628 170092 2408 80509 4704 39016 61544 236780 12385 2933 88164 186376 40045 153956 162916 30821 39413 38500 55404 24160 71784 37500 55405 79204 3436 31525 28940 23396 40044 78180 23532 145249 18469 153700...

output:

2 80616507 995004991 664137823 9976953 366298158 355245365 468403034 216273082 260717161 832787691 775688691 617620391 693043642 484068636 380882030 942812494 645535338 719233709 486494797 810281331 899614692 704199518 679041774 572996927 401956988 803197786 255457413 345239768 108506505 426793114 3...

result:

ok 524288 numbers

Test #58:

score: 0
Accepted
time: 149ms
memory: 16820kb

input:

524288
93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268 93268...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 524288 numbers

Test #59:

score: 0
Accepted
time: 590ms
memory: 46436kb

input:

524288
153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663 153663...

output:

0 0 0 0 0 0 0 0 0 362231294 21845841 410141954 156146198 907621447 140324431 644286853 997704161 487225980 31640871 749102293 402793920 711642190 1239278 788639158 131349216 863301019 193659182 692058462 839825165 638355660 870770542 720474905 331740416 670109137 496299243 187918973 581117186 357384...

result:

ok 524288 numbers

Test #60:

score: 0
Accepted
time: 596ms
memory: 46576kb

input:

524288
248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248500 248756 248500 248500 248500 248500 248500 248500 248500...

output:

0 0 0 0 2072 923256215 88820829 235277671 285519694 707612367 782727700 425865963 172392000 104719606 437950146 339822259 685679194 234730237 656625680 960750513 776317160 319670136 898328829 666504245 8646521 866714183 794111848 961774008 213565891 237796200 227042879 155683385 438268429 907777171 ...

result:

ok 524288 numbers

Test #61:

score: 0
Accepted
time: 595ms
memory: 45428kb

input:

524288
144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 143770 209690 144154 144146 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154 144154...

output:

0 0 768 196557321 117614570 304283384 964044601 545305653 97898296 676846844 128508167 257515273 213512039 789907259 195098520 43515471 884327451 203565302 139312470 108305877 568232863 876331497 826266355 814950561 373777654 763922343 469056076 93544140 664471806 872656618 71298144 433600079 876548...

result:

ok 524288 numbers

Test #62:

score: 0
Accepted
time: 599ms
memory: 45504kb

input:

524288
418420 484976 451188 452212 452212 456308 452212 190068 452220 452212 321404 452212 456244 452214 419412 452196 521776 452192 452337 452180 452214 452276 452405 456246 452212 444020 456564 452148 452340 451188 452212 419444 452148 452181 452180 452212 454449 189040 435828 442996 452212 452208...

output:

0 1 5050479 907629659 967358598 656341375 609497608 18437281 97314621 174653405 553144841 147391031 281929894 40057279 470730285 318444123 481712513 465720468 633272844 766362145 700822952 371472196 663327777 719407760 358414732 944015815 969503291 748842918 556897450 838811023 708896313 307315393 8...

result:

ok 524288 numbers

Test #63:

score: 0
Accepted
time: 574ms
memory: 47200kb

input:

524288
268175 17329 266216 56245 364449 165489 270292 5669 20965 65190 316981 262887 286596 167871 48444 296629 280510 307187 378045 38693 272053 7820 282625 71437 40861 316975 266038 262528 290701 443141 56973 46993 40509 333635 429731 7737 299940 55028 7557 344941 7587 270257 3076 21764 4005 28056...

output:

0 99945666 362191721 905834625 803645740 497961089 886178015 16198217 136885748 757464304 554034251 748628895 107684833 908116177 218891827 984109037 26540835 479427756 427795685 520643891 547714331 863674186 166868029 124845873 712860066 665647266 495220895 700815138 325166928 124585896 275592001 5...

result:

ok 524288 numbers

Test #64:

score: 0
Accepted
time: 589ms
memory: 46820kb

input:

524288
361339 508777 297809 336701 3962 480985 52763 459377 268842 300927 331641 338515 472870 9161 263785 397863 197145 351103 328313 75859 399230 382627 271922 328539 274419 461371 87595 334456 280949 414282 430693 415243 328672 68146 393787 462907 333419 228970 149073 343611 223089 262750 21777 3...

output:

0 133176744 641598639 920417841 698650606 547970161 300215463 833391488 938695731 619836629 309905625 619734293 992573161 583936219 32157329 983156803 804021070 656100970 94044234 467996561 246490296 103611587 704381346 637338441 589894377 643770718 432181595 891746740 517371203 896684920 970723908 ...

result:

ok 524288 numbers

Test #65:

score: 0
Accepted
time: 598ms
memory: 47112kb

input:

524287
275805 361409 209446 387672 173996 475396 318701 95445 298048 353725 427706 151896 92280 411115 502922 112077 3319 184079 161397 339481 34482 455144 159250 92429 239083 504793 92472 267635 473250 187034 292335 336088 422349 322477 32671 130959 114705 11150 80403 420621 267088 481540 122444 10...

output:

1 585342304 638310542 30873914 438874489 476993800 41106637 797269444 103323194 461399893 90789432 252426276 514007705 706135247 473029464 213313564 66077027 727306575 685757824 808943984 660447381 812551856 911210907 686102923 939766138 984045605 413015662 704845920 266633383 837416612 734867132 14...

result:

ok 524287 numbers

Test #66:

score: 0
Accepted
time: 287ms
memory: 26764kb

input:

262144
154046 266568 330953 343578 266504 390918 105975 310918 65770 305198 105934 24565 396968 119157 285697 5070 11855 506164 353995 174358 46365 503161 262810 511349 486831 457819 375888 213855 385014 136336 76041 256835 467860 344391 199659 39137 68212 346464 235368 263727 343753 28054 291370 27...

output:

0 145501947 116321065 420121009 526765614 324036886 144821076 366079276 186490975 696550761 957244082 763534820 211816212 598632757 308919541 171591249 731071734 994147900 621298129 156215461 979148437 591548956 634213490 809016578 608354633 382914741 631281772 17638177 256053186 933331680 886872895...

result:

ok 262144 numbers

Test #67:

score: 0
Accepted
time: 282ms
memory: 31844kb

input:

262143
270532 65789 51096 113598 77299 310432 445059 449850 221544 263680 237088 339093 210083 209896 126402 135293 86058 272778 174239 240076 292634 10318 206437 292491 16590 436429 483311 331876 483109 32574 238669 468295 141541 396052 215629 454217 242120 29988 392151 493068 373110 192856 414983 ...

output:

0 147663423 310910423 199667103 745797369 166516180 175581658 370748329 705575120 87868823 20473149 446747583 295100654 820723015 819831649 353497209 279717144 973636359 325765682 712738921 251248375 313686813 501301863 897331534 519220129 514070652 767541959 689218830 861276139 250765648 578662913 ...

result:

ok 262143 numbers

Test #68:

score: 0
Accepted
time: 285ms
memory: 28704kb

input:

262145
126801 22407 161528 20504 450233 321717 258492 21576 344994 227873 450329 512108 346038 427814 292170 11136 382518 464084 209308 426218 87952 156139 332266 87645 47357 296099 7032 287898 196835 389645 240624 51445 472249 200874 358898 264208 344987 375756 391673 434860 252397 369929 163914 54...

output:

0 144603617 488439689 862804070 895173530 760570288 640166756 274572094 246308367 921979189 188896341 608323439 911495355 802250741 231084844 968260328 544488032 196594834 89600160 129967322 741256686 327710659 614769509 407562409 607109796 642150936 678993929 661941624 205643248 56731967 215059630 ...

result:

ok 262145 numbers

Test #69:

score: 0
Accepted
time: 316ms
memory: 33028kb

input:

349985
73527 516189 59935 27141 326465 234272 210564 211671 74419 492214 123981 26642 507931 125462 376158 403030 310855 218884 130164 367720 351736 200840 406625 105085 7845 172947 422788 300083 208171 72729 301688 398079 309934 187797 341497 327075 114411 510602 97274 33359 414293 334117 5293 5072...

output:

1 260658083 260262950 918592205 527519592 599160882 499854266 346007972 389195621 736812747 4819772 507009761 457865284 115762571 619218622 466529129 393077699 440695700 135142147 406497810 973959454 676698978 209238589 748242050 53896077 203573381 226524178 173623290 878325905 493755603 985083494 4...

result:

ok 349985 numbers

Test #70:

score: 0
Accepted
time: 6ms
memory: 11800kb

input:

892
273287 235762 353918 463680 91949 392689 509963 269815 332009 326738 134394 68824 424169 272307 126396 321774 77874 102908 80285 54360 180349 391538 403328 194268 231197 440741 13529 505014 386424 130065 242588 518184 151472 502712 439319 40324 432469 440156 52959 86672 39196 248921 254786 24079...

output:

0 2096 10256524 90230471 307143414 827288061 584046205 855829637 357943060 129235864 778536801 554615993 780241127 351232323 342687987 839650143 147453149 525613733 802581230 849732476 577968368 885031903 530517846 284660080 623218211 696742838 663496788 581319414 215503893 691363617 171568569 28933...

result:

ok 892 numbers