QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#69605#59. Determinant of A+Bzchenshi30 7ms4356kbC++2.1kb2022-12-28 22:19:592024-03-04 04:44:09

Judging History

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

  • [2024-05-05 11:54:08]
  • hack成功,自动添加数据
  • (/hack/617)
  • [2024-05-05 11:38:15]
  • hack成功,自动添加数据
  • (/hack/616)
  • [2024-03-04 04:44:09]
  • 管理员手动重测本题所有提交记录
  • 测评结果:30
  • 用时:7ms
  • 内存:4356kb
  • [2024-03-04 04:35:40]
  • hack成功,自动添加数据
  • (/hack/552)
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-28 22:20:02]
  • 评测
  • 测评结果:30
  • 用时:9ms
  • 内存:3968kb
  • [2022-12-28 22:19:59]
  • 提交

answer

//https://www.cnblogs.com/Y25t/p/15808634.html
#include<cstdio>
#include<iostream>
using namespace std;
const int o=310,MOD=998244353;
inline int qp(int b,int f){int res=1;for(;f;f>>=1,b=b*1ll*b%MOD) if(f&1) res=res*1ll*b%MOD;return res;}
int n,a[o][o],b[o][o],f[o][o],delt,coef=1;char s[o];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) scanf("%d",&a[i][j]);
	for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) scanf("%d",&b[i][j]);
	for(int i=1,j;i<=n;++i){
		for(j=i;j<=n;++j) if(b[j][i]) break;
		if(j<=n&&j>i){coef=MOD-coef;for(int k=1;k<=n;++k) swap(a[i][k],a[j][k]),swap(b[i][k],b[j][k]);}
		for(j=i;j<=n;++j) if(b[i][j]) break;
		if(j<=n&&j>i){coef=MOD-coef;for(int k=1;k<=n;++k) swap(a[k][i],a[k][j]),swap(b[k][i],b[k][j]);}
		for(;delt<=n&&!b[i][i];++delt){
			for(j=1;j<=n;++j) b[i][j]=a[i][j],a[i][j]=0;
			for(j=1;j<i;++j) for(int k=1,v=b[i][j]*1ll*qp(b[j][j],MOD-2)%MOD;k<=n;++k)
				a[i][k]=(a[i][k]+(MOD-v)*1ll*a[j][k])%MOD,b[i][k]=(b[i][k]+(MOD-v)*1ll*b[j][k])%MOD;
			for(j=i;j<=n;++j) if(b[i][j]) break;
			if(j<=n&&j>i){coef=MOD-coef;for(int k=1;k<=n;++k) swap(a[k][i],a[k][j]),swap(b[k][i],b[k][j]);}
		}
		for(j=1;j<=n;++j) if(j^i) for(int k=1,v=b[j][i]*1ll*qp(b[i][i],MOD-2)%MOD;k<=n;++k)
			a[j][k]=(a[j][k]+(MOD-v)*1ll*a[i][k])%MOD,b[j][k]=(b[j][k]+(MOD-v)*1ll*b[i][k])%MOD;
	}
	for(int i=1;i<=n;++i){
		coef=coef*1ll*b[i][i]%MOD;
		for(int j=1,v=qp(b[i][i],MOD-2);j<=n;++j) a[i][j]=a[i][j]*1ll*v%MOD;
	}
	for(int i=1,j,v;i<n;++i){
		for(j=i+1;j<=n;++j) if(a[j][i]) break;
		if(j>i+1&&j<=n){
			for(int k=1;k<=n;++k) swap(a[i+1][k],a[j][k]);
			for(int k=1;k<=n;++k) swap(a[k][i+1],a[k][j]);
		}
		for(j=i+2;j<=n;++j){
			v=a[j][i]*1ll*qp(a[i+1][i],MOD-2)%MOD;
			for(int k=1;k<=n;++k) a[j][k]=(a[j][k]+(MOD-v)*1ll*a[i+1][k])%MOD;
			for(int k=1;k<=n;++k) a[k][i+1]=(a[k][i+1]+v*1ll*a[k][j])%MOD;
		}
	}
	f[0][0]=coef;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j) f[i][j]=f[i-1][j-1];
		for(int j=i,v=1;j;v=MOD-a[j][j-1]*1ll*v%MOD,--j) for(int k=0;k<=n;++k) f[i][k]=(f[i][k]+a[j][i]*1ll*v%MOD*f[j-1][k])%MOD;
	}
	for(int i=0;i<=n;++i) printf("%d ",((i+delt)>n)?0:f[n][i+delt]);
	return 0;
}

詳細信息

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 2ms
memory: 4048kb

input:

50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 179093706 0 0 0 0 0 873235003 0 873022990 0 0 0 0 150372208 0 0 0 0 0 0 0 0
540031202 441544333 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 30490606 0 23238599 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0 436083536 175535903 554959884 223039496 58344364 587204040 55300817 397840744 155512976 415872342 477738866 352386530 53242600 485943331 139434001 914586784 544887336 464494428 399973492 144143987 524998117 938746522 91863621 401839366 833514493 170911469 632598634 939655150 515206919 825564296 65...

result:

ok 51 numbers

Test #2:

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

input:

50
0 0 0 0 0 0 865147437 0 0 0 0 0 0 0 0 0 0 0 0 0 892479829 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19576557 0 203729377 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 874545437 0 0 0 0 0 0 0 0 ...

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 

result:

ok 51 numbers

Test #3:

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

input:

50
666159473 440670429 510738291 504202619 0 350557853 590762418 810462395 181323356 0 457188244 491622090 347541380 751726940 231615249 726500956 954377758 617126798 391240582 467481921 418356623 149910257 146581619 315774821 236385812 117496640 634748946 315228151 853935226 0 437123244 978656468 0...

output:

39398860 926439968 438765155 724976248 594213695 167425923 587528267 284768667 73653406 259805677 82462983 83407685 573878321 72264113 545576724 360658776 119045660 422987649 743658284 583131760 441616546 970274465 724248398 797307152 690695173 36182380 685387007 25419367 914743956 46860078 34161074...

result:

ok 51 numbers

Test #4:

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

input:

50
0 234506790 0 715154759 99115010 231025742 755030988 0 0 0 146417655 0 915617978 0 0 691020395 173510973 456428247 0 394265079 0 0 0 953534270 0 874971542 898266718 0 948375902 0 0 0 0 0 0 0 0 0 252854252 0 0 0 768939131 0 0 694491359 0 0 0 796110525
216175608 0 0 0 0 0 776824419 0 0 0 357690362 ...

output:

141015794 599342787 680312504 471591675 511065406 380019480 980173887 270063339 145784225 19477689 272449207 44932257 678205945 917259961 409809006 853493157 888639735 174617060 845340173 711609565 679190927 330758264 923635224 552477622 768958302 787141361 9445917 85097768 377489202 136240899 51315...

result:

ok 51 numbers

Test #5:

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

input:

50
750536234 0 423676829 156973666 342391475 0 269587546 0 701752131 0 899144010 0 924599123 262658456 856118037 0 524095212 0 0 0 774140585 687450839 790346327 0 407213499 0 114640383 315078797 0 0 484458308 211129135 0 0 0 480554292 0 874606521 0 611141255 0 921918077 246086190 303213450 0 2924878...

output:

155382429 300500458 304766564 977267809 594424161 900971743 44146589 250595784 101389855 972453646 884960270 7931762 86956582 540581970 858382127 905566730 611945476 873806623 10039781 119616718 609682806 574528865 847145348 563674497 740042325 849319090 706797348 196452175 207228386 266078263 39163...

result:

ok 51 numbers

Test #6:

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

input:

50
951551567 37325813 0 79423443 2068034 885871026 775224147 766930667 258343511 0 777151789 616527418 839682916 396041163 192573703 229048803 949340586 713895147 489792300 801462648 511168369 532394611 578197063 0 46862575 0 91404922 5829914 885897421 602414159 537885052 632019550 478337906 5808696...

output:

172239906 397628189 65902517 739611316 606825620 317141817 898397451 332318466 785876316 141064857 923661827 968467916 274852115 805878656 303903040 838001254 985212733 520145210 60645158 573733802 545172206 666691725 828173167 502849531 428149875 699142908 118642244 957305916 406881362 562364767 17...

result:

ok 51 numbers

Test #7:

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

input:

50
309662455 925260045 380458486 843640570 965373173 650915700 138051394 119077249 295978183 909543019 511188539 348716022 622002079 19527119 85705277 7249996 79416775 806285823 95669866 224916201 135747133 521008347 424739729 486738258 0 369962069 13717241 561591243 604129407 145237193 480525322 75...

output:

825688824 540628594 439887429 685373725 936186060 957959036 921337616 356646111 941433456 866832138 92318348 117189572 917417557 69389825 46502857 801017869 403881868 261681551 94260642 399097582 602397903 412668467 173331089 487315640 770492173 128054143 896637397 836755572 488248033 794745384 9337...

result:

ok 51 numbers

Test #8:

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

input:

50
0 0 0 0 383027169 0 0 208745194 0 0 0 0 789827586 0 0 0 0 0 0 957781870 0 376819021 0 0 0 0 0 0 0 32762228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 685108828 0 0 0 31162248 0 0 0 0 0 0 0 0 0 0 0 0 287855447 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 428557577 0 936324734 0 0 0
0 0 0 0 0 0...

output:

775672102 899406105 138974825 284554021 439791308 679440971 56702915 375692313 254494551 575509916 698159258 568976457 459285971 550889826 310494448 696598077 711659911 687912159 946546315 418932057 78733833 533431077 442596236 608325577 157268402 533785766 787543359 698758806 104403620 662063171 88...

result:

ok 51 numbers

Test #9:

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

input:

50
364748839 262117607 229058772 39217561 836544708 680427904 0 167060375 0 0 0 325438302 680857978 795124158 794384489 0 0 507003998 0 38838073 592621708 0 333857788 0 525278280 471076164 0 0 12016187 871658269 535394530 0 0 0 205105629 0 24024226 26471712 0 667726596 668881591 0 748795155 24862755...

output:

19315775 912843787 52761420 26875862 170766436 456152379 818800455 954588564 575129864 687470630 882985676 247888802 157345617 292048118 711964963 563600686 383928804 658358185 517437405 281816603 166685835 731719637 517569287 799739471 47888845 913373011 486096310 548828883 227591739 311720874 9009...

result:

ok 51 numbers

Test #10:

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

input:

50
613159520 120230035 0 0 0 107985603 473752771 563716516 511053599 0 238148580 381267084 508973915 630544517 0 683351340 688345418 714423495 0 0 299406852 0 168512896 105972039 172382433 0 0 0 0 838501389 0 0 291120745 0 297721353 96576710 0 0 0 228631559 667457592 0 206646684 0 19768735 169168361...

output:

463624995 439862174 479380459 229452974 435054695 422090445 963750343 436659964 938434610 841526809 844957371 55885658 946912074 407254481 167883846 89420404 721282411 955425050 954583434 682905399 433742387 953303584 455057117 559633338 55246999 503504963 671369161 142065745 723354271 27670570 1057...

result:

ok 51 numbers

Test #11:

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

input:

50
0 553073844 0 0 185474714 0 0 165131165 0 0 0 0 471868746 0 225330982 243602709 464651512 0 0 0 694758665 0 0 0 3356517 0 719284954 0 432203775 701293785 619218464 459628715 0 0 905423662 0 704913997 0 0 0 0 0 0 0 307765491 0 0 0 368396500 0
0 758743838 737470744 0 411526935 942384883 0 0 3970849...

output:

190390624 278098951 970368470 554798908 929972629 2064694 835880388 783564820 110425758 187144546 642839161 169225450 909221534 347359128 13825966 770209532 692807943 644879599 337044720 38521070 874900945 607898468 175185261 218774843 912519161 7634914 710990592 612214049 666855766 759436403 548984...

result:

ok 51 numbers

Test #12:

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

input:

50
0 935132232 922479325 829628501 0 0 122620498 0 2125127 0 0 0 0 0 291521697 0 0 191823577 0 305867399 670295514 788712071 0 0 0 814117690 746769765 0 990259627 293346449 757274779 225597030 825653984 696961412 440829479 0 0 347083760 293376060 0 578066628 356394960 245673957 593965820 70929583 95...

output:

365276356 346433201 659925285 379736722 585351978 182847082 809826239 894265514 691197399 960770297 958338379 161323498 265833112 355548531 849789491 917747682 181904683 793390971 610294685 448292125 145277673 790555407 678908869 745458180 217585495 597248433 322696478 127248297 57412372 326437577 4...

result:

ok 51 numbers

Test #13:

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

input:

50
0 0 0 0 0 0 0 653268736 0 0 0 0 923400103 0 0 0 0 0 0 51950688 0 824969388 0 460444975 702445148 978015637 0 0 0 0 0 489824231 0 0 0 0 0 449386884 115289049 0 0 0 94109678 190707537 0 0 0 411511570 725349198 0
569112969 0 278750645 0 0 0 0 0 0 0 0 0 898212643 0 0 0 0 0 976396348 0 0 0 113455683 8...

output:

912781524 197004987 137167756 957392362 387778118 864497427 119285409 684960451 444790098 469780596 66969634 320879723 343586163 981156433 819814952 781189325 333824820 348180934 991783170 725011288 948964346 183733191 106697480 201527162 365200012 411520363 684954456 750874130 580893772 797116812 9...

result:

ok 51 numbers

Test #14:

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

input:

50
565507246 314920979 617400579 0 347909100 482965068 0 943592379 426613146 689661661 693209941 0 309698521 525971242 713008253 248403259 761703141 114146900 672280131 329245982 568497403 663964541 0 0 266815209 271495850 610215970 879120790 22892118 0 983172469 747657846 0 729004601 738351762 3570...

output:

752051056 893203475 298293881 770108696 912187958 230358498 172303922 982771058 990264844 357890956 184147644 213424789 106419075 209352933 197010773 247534867 752661578 729514702 363083607 684664711 396779377 336124979 101061626 990495304 862347524 967418807 608267243 714855227 732538495 633196960 ...

result:

ok 51 numbers

Test #15:

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

input:

50
153402384 249536261 391968390 71764933 929070196 0 769106166 854490361 43220499 537021205 158958303 560200888 554198327 824491228 0 892500839 982549276 421593995 972245922 0 640799234 102571123 57137283 49862521 307213248 631517677 204583661 732871349 70649187 142829407 0 0 957530813 243527838 13...

output:

66098008 154772819 526070139 874583106 685024473 551304193 882675354 27993655 282996049 559498732 147513688 532084460 22648946 729803353 356215069 939422585 983732667 956052842 370905684 954815664 920305433 69821426 523816008 728065520 545821324 170960952 778590994 89054687 400829185 837618219 29635...

result:

ok 51 numbers

Test #16:

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

input:

50
0 0 195075377 313282836 0 829094024 0 0 0 54414629 0 0 0 0 0 0 0 0 0 0 101107810 824286656 731820848 0 17806992 55371469 0 0 0 0 0 0 0 0 0 546403652 0 0 539260707 0 0 570409177 0 238303240 0 0 0 279250353 253126978 0
518609079 0 124172658 463020205 729228591 0 0 0 0 0 0 0 0 217844798 810689787 20...

output:

832794440 122877402 598800756 434449399 604397104 570192167 920581352 225746237 692185559 9560091 741128506 267227537 868652148 840577421 222141931 59490027 728018399 843392605 477943481 905583651 299291827 453071758 685001395 603398138 321740146 625817983 289126980 191607783 34501032 517344371 5341...

result:

ok 51 numbers

Test #17:

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

input:

50
252699781 433731989 973415787 937044456 126494791 127875432 175959404 871925417 601947342 231477675 929706115 462495346 665152898 805248457 922983563 743451142 836069610 471997478 422341511 508926818 492030319 594432817 171025600 903298550 359364450 330216316 168546322 597294633 409021432 0 41816...

output:

215774306 942678020 317271254 479824180 689956688 956892095 247785951 811616468 106285022 881787148 232797221 515429441 8434216 66814440 371784316 687936395 823502426 882068341 965046427 17128268 110007714 563528635 85000796 377853394 309810368 48611668 799225675 965577923 306355762 254883342 985779...

result:

ok 51 numbers

Test #18:

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

input:

50
461838459 275829920 954593080 0 624989534 556119036 188579239 325686460 694571121 205355227 898677549 972101731 51526755 300733424 219591369 577992545 952062600 434299822 143352606 631047945 149239856 704676819 506035511 342554423 991163503 386829779 368675497 631050836 57118656 624456974 8192145...

output:

7364242 170202398 301843684 405651428 241658075 633429920 58938105 673086903 913416929 569840719 60036938 557835895 382586742 672591117 111574317 327071930 558815689 612571299 839354556 868339596 403314453 683346076 232190059 466794268 997513702 536853076 780332009 48300560 260469358 128613281 25392...

result:

ok 51 numbers

Test #19:

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

input:

50
144242090 138663925 0 145186490 0 640074989 0 0 300457549 0 472263692 0 0 0 0 0 585155750 232082021 0 0 181657415 284623532 0 0 0 885011257 218200942 0 0 493724919 260508642 601031081 521394894 0 0 0 0 293071670 23169998 0 564635899 0 0 700329397 658187184 0 601980192 345094044 318750511 66766512...

output:

737466238 704584659 151413207 288903107 363358549 1603135 908134201 701649008 389986949 247188836 286941145 82615549 410088043 90364163 964713338 132235675 867254207 969737988 548935144 33923167 71371717 317736991 378682062 692720944 506750847 649486611 150937174 287075748 799431512 458752720 983352...

result:

ok 51 numbers

Test #20:

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

input:

50
0 0 0 0 780480540 0 941930735 826515896 0 509875568 0 282124617 0 0 0 956594381 802617022 36623875 0 0 0 0 0 0 0 0 521781355 0 0 0 0 0 0 0 0 0 221542610 0 0 0 0 0 0 0 0 587835158 0 0 583116443 0
0 254091883 0 474215030 0 0 0 0 0 233535840 0 433855722 134241275 0 0 0 0 0 0 928246801 0 934579772 0 ...

output:

199906886 851988332 227125027 867744692 626456346 271359598 202755979 563079864 288107368 503303186 76230331 61995098 506706276 557815621 261146206 879287998 477229011 710896135 456863251 207463965 36314074 597707644 647309697 505515390 217305462 542011205 990325021 578313117 184372154 854354735 175...

result:

ok 51 numbers

Test #21:

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

input:

50
580958337 176371734 0 720498387 429565693 0 0 0 0 813185961 0 0 590639586 0 0 0 466058970 0 0 0 0 0 34118042 0 0 0 941684815 0 0 931295469 0 0 761159288 212378517 0 0 97884667 523804181 0 157318882 0 0 0 0 0 912910904 80441399 0 0 186057985
0 0 853601800 0 645071101 0 984183588 869289238 0 610940...

output:

182764951 78733283 398437658 878057646 830383448 915566273 668063585 33469544 105078494 483510288 868259640 452100549 402366751 700145793 87065057 837135736 310082310 177103642 581263041 246754059 332051339 897534302 226423068 801107657 50898535 455387807 947181772 758690582 482252094 257980373 9806...

result:

ok 51 numbers

Test #22:

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

input:

50
973633416 358566416 786185376 157734393 438478029 29985902 331805787 711234169 956524645 16588983 42651256 422865668 185815660 406927090 670638144 521229356 336968140 541209329 311156769 2303577 741735410 0 46453618 46775471 714418528 463456399 733269805 931768939 13899083 490409023 264174174 780...

output:

148093849 139340817 636228737 947216605 693770665 640020550 272839607 37406693 62431091 880784586 529461199 430478686 406825117 496163791 145802755 927818526 811971500 237280380 549276825 270452488 379141730 501678062 135917090 419909998 688360586 574755000 461643611 813107740 157918840 458974474 73...

result:

ok 51 numbers

Test #23:

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

input:

50
25979735 966393775 0 928472968 609658850 0 0 156012657 0 0 0 0 176310681 0 664235468 319366529 267745019 833526960 0 60960328 251788868 582082036 0 0 393114935 234233477 0 0 0 0 422930401 0 123167393 0 0 0 0 0 280529030 0 270528492 0 0 918904565 0 0 0 819771321 0 802058899
862165864 110010699 0 9...

output:

694007200 247877628 985150828 29493693 37996907 396838081 136113985 372717512 879881531 698462413 627190516 793346986 492356791 38418730 98776553 358339839 812257649 627436444 583014284 905212662 260422728 733429872 799579644 444744984 859926658 802860101 64911523 434961497 991333105 104839961 48771...

result:

ok 51 numbers

Test #24:

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

input:

50
497581250 0 504368585 0 960260382 0 778968898 98975462 0 0 0 588853415 0 0 0 0 127906591 0 0 598867689 0 117295897 0 616066957 0 0 0 0 0 0 0 0 610324869 32451029 120273935 898495494 0 0 612353683 648712135 228572602 0 0 0 0 0 0 0 559350233 0
882423251 0 545955511 0 845035306 0 0 557625815 0 0 0 4...

output:

404031134 59625346 103018326 685578699 87306405 789794370 932998433 580510452 700472477 504829476 427291573 410471355 858483956 982867575 619082197 959051394 543117033 975944901 107111191 873888801 333647267 141708224 36806304 149507046 846902762 100947135 464662955 41610799 455686329 958413695 7969...

result:

ok 51 numbers

Test #25:

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

input:

50
0 489849162 0 832007017 0 903150757 334177710 0 0 823099289 475770048 374106207 884332221 0 655713834 0 0 469101146 0 362198020 460811536 0 0 0 0 0 0 0 205860360 490179634 753197728 0 0 0 663488105 0 0 0 0 0 264827825 0 841295233 0 92635241 0 71133821 903059607 0 53743065
0 567252111 0 127837041 ...

output:

85847274 709598539 296015064 529064132 166326971 838672251 71661204 457887229 647223450 438823110 747962485 386968640 706370298 330982458 318612108 6258716 850387234 392395955 251431238 697510029 91160506 298755065 893453796 20352717 382799719 3866949 565391361 95948153 16743891 128719606 334615341 ...

result:

ok 51 numbers

Test #26:

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

input:

50
0 0 0 0 713415496 0 0 0 0 0 0 0 0 0 0 0 0 0 96404132 0 0 0 697272728 0 0 972877878 0 0 250149006 0 0 137261492 0 0 0 0 0 0 0 0 0 0 0 328460566 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 881970998 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 163420028 0 0 0 0 0 0 0 0 672072432 0 0 0 0 0 0 790452908 0 0
0 0 925771...

output:

97357575 864787305 612932328 237843705 154211040 294748918 806939062 579819378 329847330 216803181 371467348 99227331 552223549 374066687 244677208 364931752 603694573 765521963 442656183 955102586 484704420 237717630 868133648 642424483 343293713 817985343 472416782 771420125 258313040 766666234 71...

result:

ok 51 numbers

Test #27:

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

input:

50
0 0 0 63247615 0 791076461 0 0 0 0 0 0 0 587371500 0 674661496 815544254 361375659 446621745 0 84767228 505913899 0 296491943 619036861 0 0 0 213947693 0 0 477003450 133177000 0 0 0 0 0 0 0 0 0 865889671 0 0 0 0 0 0 0
0 0 0 94158102 0 717440503 351881080 47408518 0 334587139 898597115 554196508 4...

output:

581345430 517272544 27424311 177987117 360750626 992415401 852308621 685010590 767412462 911289934 82632874 823104414 495165991 603362092 329947880 546915693 606192519 894875574 117328437 593182883 356248492 705868109 740046066 903693935 633908731 57555246 841433278 664653857 57003951 267587808 6848...

result:

ok 51 numbers

Test #28:

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

input:

50
498256497 572638536 547555552 558596365 0 170374319 945776750 109115745 899680609 287733871 605659413 454660021 979491474 554517679 209340002 857539943 88707985 847516124 11893592 851894836 217334719 95345308 578201122 590857399 422722795 96468920 907022866 835594790 460901630 490370579 130446989...

output:

285926032 806226889 271806820 460919109 815187481 729948370 928610112 692016758 656619963 724160494 52022224 121036944 72433641 66312299 386964036 954066486 564246907 508090523 13874624 382680865 688956522 495611396 520875596 412003224 988341366 152148134 220716020 2342792 242286157 590024029 266437...

result:

ok 51 numbers

Test #29:

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

input:

50
0 29598781 915598378 673859700 923225830 0 794314879 311128153 743126892 968414910 180626182 0 0 409916085 442492237 547276361 598588906 247154035 0 621616064 370562272 713869834 0 656987868 492847689 478264939 0 769414081 0 0 925189393 140269195 992737892 969701394 192341663 0 0 217282392 585645...

output:

45540938 196013144 508280975 746238134 40158821 261426345 928031034 706339153 693950812 393345583 319363717 996205530 48226765 599834058 399735294 667864750 857603756 8448720 512795237 655354651 830282365 21454267 25371740 703766982 750221051 329472918 210313069 171312495 383239000 654028336 8604671...

result:

ok 51 numbers

Test #30:

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

input:

50
0 0 0 0 806896459 178851573 0 0 0 0 0 0 0 0 0 599043664 0 0 0 0 0 549487629 93627576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 887716132 625632408 0 0 0 0 236156358 0 0 0 11187294 0 0
889604636 0 612734600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 341925621 0 0 0 951380590 585561852 0 0 0 0 0 0 0 0 0 0 0 0 0 0 623...

output:

142543483 862236128 93045642 467709387 939841554 248542887 207650437 712328858 389217012 120390497 20736181 173917445 880740963 671339911 757068330 203638185 782636829 477868926 15340737 268510264 849046033 909127661 190920536 402521186 580436351 233311368 927186296 715067990 1367065 581163913 98690...

result:

ok 51 numbers

Test #31:

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

input:

50
305014160 524382709 829941526 867540297 696553015 372724335 923147031 927887059 692347678 353161846 801931193 450058388 674050463 819839640 0 0 861292516 33837861 499813197 683767863 859840355 149657342 0 689351189 89154173 967748954 41641626 540976207 915663608 879204096 371498939 174257078 5519...

output:

157036115 56649934 942810863 711416759 721169155 968975774 299761915 24435827 580465286 40388399 559138132 76551404 528569577 933633188 850164729 767187716 590242225 757554243 347274597 261824939 825810159 464254161 720731024 550330762 265387290 830846453 891396266 881564150 747368494 832572540 2146...

result:

ok 51 numbers

Test #32:

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

input:

50
0 332805608 325297760 0 344420757 0 706065384 352055777 66248264 705470852 798882102 0 701575525 93780210 0 337137716 0 210440501 0 0 0 0 0 676149101 0 0 0 0 427965227 192501836 0 977879842 0 0 0 0 0 0 0 471451788 920212926 533522365 985961100 0 0 167343404 779631306 0 580523963 510745807
0 0 0 0...

output:

40647678 695167686 319899684 573020731 43008672 348043132 6361129 936377018 817838989 196660535 274771565 49330069 789735301 163430420 459304914 278623975 339678485 754436822 24918136 501929588 237948081 100389814 260627121 644465712 757872460 419123770 777728667 820109391 634956939 703872042 989546...

result:

ok 51 numbers

Test #33:

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

input:

50
774291169 0 859529726 0 493529599 730293941 0 927780780 0 90003560 906022607 188622688 0 898371072 93648392 447723197 527046109 335828481 0 372572473 413327975 975432600 489494224 0 0 874721427 809666984 792652457 19448597 332505912 0 387762529 644440178 511432771 0 590977110 373349689 0 0 642656...

output:

857701700 730527904 799500956 220566009 530145222 709230354 283218022 386878028 605175903 405290595 213117058 415037406 115843352 384868123 245556121 107558625 618546482 375296675 144125047 981827353 347528569 452270651 426237316 963797709 664820153 407752376 472188109 428141094 868678217 645521290 ...

result:

ok 51 numbers

Test #34:

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

input:

50
0 0 0 388106480 0 0 0 0 0 0 0 726735858 727629619 19530760 970102742 0 0 0 0 0 0 866697017 0 0 0 0 0 0 200676068 0 0 666563613 0 0 616589527 477640512 112623387 399842997 0 0 0 16498067 0 311785339 780951107 774214216 0 575187491 0 0
715827288 696421005 0 0 320186545 0 0 0 0 827655278 0 0 9434544...

output:

668790306 12695991 97695933 896758218 606343432 921354325 729411541 823528290 334057480 731305005 118127204 395854528 811854348 793655304 804004122 667019605 253542898 220907687 10771731 864845070 285347036 222123530 242578418 900932739 554322442 520438707 209680665 619543135 96694607 531574412 8034...

result:

ok 51 numbers

Test #35:

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

input:

50
548365635 0 0 628673659 24569340 350843588 686380951 0 362523323 569539717 0 0 816885391 842065384 285014910 207977595 0 401466283 0 865947035 719245735 0 0 853602543 0 424578774 0 0 0 510439500 393611031 113997285 159638737 0 0 0 0 51987534 66119512 0 390269973 349982174 0 71373464 0 340263199 8...

output:

166001607 108781528 916306867 116948543 573164607 313827725 805618172 795471778 216763439 605248199 15734873 634871377 554715379 48034611 770616013 794658570 824366068 204449306 994763732 581801775 856191415 69483590 525866154 691224679 563959625 33020205 802088912 930085697 561742832 323576256 4637...

result:

ok 51 numbers

Test #36:

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

input:

50
623854785 304005771 406290664 0 41564565 37069561 884658200 430602250 159970262 237962649 245537439 221834343 38391591 14380035 927743396 639313295 0 297541432 613208148 664515667 663767400 410333709 628103063 479882945 0 902566760 0 166216371 857382674 698130055 393879082 751793436 863883247 485...

output:

674806401 741682958 201555155 298756951 881362561 17857923 313761131 947193326 48766868 563376515 809889425 116461449 255078727 758797987 568706357 9675541 34447330 59549843 386422922 969909001 161875097 682935893 121459727 794541864 67711002 621382122 418319101 763366589 192393231 952181966 4410161...

result:

ok 51 numbers

Test #37:

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

input:

50
23953710 942062415 282414067 876526153 723678111 77639049 741112372 779115497 825632577 0 0 481623040 900669589 955495584 0 634137664 183523027 0 63347453 271594522 928157564 253523883 425731139 774311836 979137060 222464496 851811065 464511022 930926036 27023400 725831139 99540209 576617697 8032...

output:

793136815 299798696 776663738 472389824 585654543 24313117 544869420 810026620 739365151 201290348 653421767 745716909 627651545 68273786 984290642 322513051 549981241 209392201 163071781 233565458 578951148 845362391 521117267 247375312 187890661 293987020 538224479 163157434 512063476 927991598 10...

result:

ok 51 numbers

Test #38:

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

input:

50
0 330126912 761822894 0 0 0 158036589 0 737202818 480950783 0 392571500 0 0 865761847 0 0 875389691 0 65857494 0 0 0 879288950 0 0 160155808 0 694472534 0 0 456915740 820317828 344380651 0 0 78558584 971574124 260793266 0 545508978 0 0 608434855 0 0 0 0 0 516284419
0 266027892 0 154716877 4872361...

output:

907937858 333176009 504634006 435640307 906293664 146955027 292679278 620651151 216852333 802175508 468571925 602591501 415172154 946183935 437517972 590710777 783184568 8952977 893085490 670421550 665446930 435895703 405171450 311472370 724578617 862094824 106007853 512786305 846323966 582624060 98...

result:

ok 51 numbers

Test #39:

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

input:

50
0 818395784 0 0 0 0 0 0 0 0 0 162087450 0 0 0 0 0 0 0 0 0 0 374157100 92429455 0 974888260 0 0 0 0 0 950195440 0 0 0 654560385 0 0 0 0 495137499 0 0 0 0 0 0 396148535 0 0
0 0 0 746462155 0 0 0 0 0 0 0 273876984 0 0 0 0 0 0 0 0 0 0 839311055 0 0 0 0 0 0 0 0 860328282 0 0 0 0 0 0 0 0 0 0 441929136 ...

output:

311358073 585387891 655707376 299881307 81413627 170086102 202039793 317178981 714605563 641519333 172392992 627222152 41704735 655843865 717378299 811246403 915131946 65739475 372309952 701156810 462213071 631268661 805294374 678169240 480879721 588732879 567413885 52944438 52325943 779117868 24388...

result:

ok 51 numbers

Test #40:

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

input:

50
0 0 162410724 0 0 0 0 581795795 0 0 0 0 738157787 0 0 0 0 0 0 246549102 0 282166311 0 0 0 17344778 0 120161209 0 0 0 0 0 0 107669105 0 289985463 341458944 490099463 0 0 473993658 729296893 870911213 0 882949393 0 0 189912017 368781900
370822456 0 0 0 0 0 891536134 64391251 825229480 149703315 0 7...

output:

230790550 815392739 346301771 786807347 498679438 425772591 310259802 218834393 6376164 504816895 17381038 550276033 794640696 653968337 960367937 604641478 15654294 228422368 274721023 753297071 708562338 354858135 413945057 853277076 306531072 115366992 144466029 24982108 784723329 348221181 33346...

result:

ok 51 numbers

Test #41:

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

input:

50
0 748322581 0 976287797 570217711 0 658475738 0 0 0 0 994285744 0 747343903 585265190 993635615 410940776 0 870116631 0 428736943 536191999 0 0 67293026 0 0 0 0 0 424698450 753856593 688389327 0 440839962 0 0 0 228254935 303066230 0 472672358 0 0 959453769 0 0 746106330 0 24534893
893320752 48256...

output:

190746992 942275232 43420365 167054362 718277116 284380361 64475062 602001077 528221620 232725948 197034139 484651906 135631677 311691841 838614271 43203127 104343492 491335050 498844747 215116236 34736183 901969771 590617700 131435460 240609836 69126001 394238569 510905976 306795954 668162760 26757...

result:

ok 51 numbers

Test #42:

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

input:

50
659679211 887444054 950467016 669383168 0 380526526 0 58321598 904704388 928225642 0 0 660784175 637443014 0 14815691 348612461 548003585 127013126 865120620 504624975 0 0 961337996 0 478505318 761398957 331550134 671831036 0 627866955 0 0 0 192674192 0 64915241 283788264 467568874 994907561 3893...

output:

751170063 459380603 17428798 72181087 566770270 627669728 309020767 130524326 384944066 100742110 332720520 775976292 597968492 677194995 265955996 516915970 274485477 750096902 800139323 482514420 320967706 39768790 482252702 826013703 230523085 972122363 372606099 81087279 207957159 992735007 4133...

result:

ok 51 numbers

Test #43:

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

input:

50
0 0 445650594 0 0 0 90261759 0 756661699 0 0 39243289 0 503158511 284707284 159678952 0 0 113065249 0 0 414908158 0 0 95190501 0 864405077 0 356517212 0 832621711 516398645 0 0 0 6033557 729041165 696616797 878385991 162986376 702898357 0 208342518 912620651 291364335 0 0 28717209 0 750793339
0 5...

output:

868173945 157983621 411960143 845477560 454924703 200401939 349536211 559843199 790642175 102949575 194222699 62412692 21401601 895925385 367300651 510977538 595176837 591732551 966139431 716467690 819442346 351950542 545888665 740353796 524666863 655777604 963870825 747096076 376830784 646402574 36...

result:

ok 51 numbers

Test #44:

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

input:

50
516694033 0 0 389134662 790951478 994789894 307335177 0 107285834 41984540 638431227 350926190 773370377 43913898 163300629 336873818 249343051 289110448 567414091 750066195 0 0 550453260 0 77060010 0 880906451 568353025 572903557 283261505 691487704 744401814 0 640119991 686143439 0 723868840 18...

output:

710785408 258614471 280616050 809502839 167086833 549648741 814787119 746715907 340003078 651722997 501538991 939420447 883125492 493206125 432577427 214686049 427533966 475238700 991287603 760459589 25308190 99755810 72921439 983065457 124110840 686133262 490500910 261840713 353107010 41138380 7740...

result:

ok 51 numbers

Test #45:

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

input:

50
967566325 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 97025499 0 0 0 0 0 0 0 0 0 0 0 0 0 0 681962237 0 0 0 426401463 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2971894 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 760152446 0 0 0 0 0 0 0 0 0 ...

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 

result:

ok 51 numbers

Test #46:

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

input:

50
0 0 0 0 0 0 0 0 0 601994969 0 949624861 0 0 0 0 0 189909022 0 0 0 0 0 0 0 0 0 0 297373466 0 0 0 0 0 0 0 0 0 0 0 0 0 715226708 0 0 0 0 0 366584320 0
0 0 337509530 0 0 0 0 0 0 0 0 0 0 0 0 554921127 0 0 0 811072710 0 0 0 0 0 0 119012291 0 0 0 0 0 0 0 0 0 0 0 0 0 0 934514902 0 0 0 0 0 0 0 0
0 0 0 0 0...

output:

0 217935058 764758840 49084207 290314817 742663136 351538744 142490411 850650836 474509674 847788340 722649199 493724322 970206176 836431558 939804978 682935776 377495668 499529783 269616316 403674156 493556532 277806730 304416944 621120686 178047553 265029279 112831582 353139718 906574942 987577000...

result:

ok 51 numbers

Test #47:

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

input:

50
0 0 0 0 978575776 0 0 0 86576330 0 0 0 21112650 0 589780574 0 113027972 449001024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 907214561 0 0 0 0 0 148630535 0 0 218551611 0 0 0 0 0 0
0 0 0 0 854708917 910125062 0 670498988 0 0 103749096 0 0 0 0 672484046 0 0 304406519 924567163 0 0 0 0 0 0 560847641 0 0 0 0 0...

output:

743600900 349921176 100281389 274541791 811835898 395851426 821376811 406007819 695501413 407232025 947120169 294725381 739823567 446740301 551397440 589103790 112026739 552410832 961833290 337864780 512477874 184731855 382365383 731735043 651952793 254227655 649223336 768129149 174742116 55397990 1...

result:

ok 51 numbers

Test #48:

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

input:

50
0 132209594 716626774 535878994 0 160262728 364766293 682267638 851701097 324031828 667418164 0 821509027 701453824 618678041 207889615 0 140159194 551380978 437414515 0 403921269 61097152 928171091 824874864 146110298 124656797 709686966 460925048 687012606 462690046 221074109 474099944 0 663743...

output:

375620769 361745329 303846439 719665299 858315893 888263007 744539029 75978407 538848753 392032122 654018585 559061358 13741725 687312256 798113670 673724256 349754728 25239562 592317063 830523845 773082219 137861727 183890917 416775515 403029622 887934611 602015515 183084627 374924049 277426762 528...

result:

ok 51 numbers

Test #49:

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

input:

50
0 842271149 0 0 0 542036267 566777386 464376314 0 0 0 0 415683391 960406466 0 984451164 0 0 0 0 112722102 578354173 821083156 0 291859921 23249616 0 0 107927744 0 29834484 0 0 109248233 10860749 107681232 468397111 0 0 913282031 183507904 0 0 0 875911498 0 565836932 932849549 108546296 0
0 0 3414...

output:

815068959 850534887 586983298 341678914 924579734 763937634 691107205 590283061 58313875 494080799 146991347 616345215 72126158 742714811 423887684 135743179 608079299 575248548 738701435 86188739 564933507 293508025 690000887 321341189 734489786 17650832 500089213 544967507 885002444 43282933 89749...

result:

ok 51 numbers

Test #50:

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

input:

50
0 0 981287875 380457066 539174827 0 0 131639557 718287563 868503091 479238697 0 0 0 0 946816520 100258275 491661051 974526588 0 0 909987774 590027277 823384630 317597394 0 394786037 660346393 0 591703919 0 567715581 403015394 0 357383266 0 205377525 754891468 0 803135709 511012854 0 0 0 0 6624696...

output:

601560997 975123492 438446363 499705379 703636752 636894009 571169180 726358989 759845764 717489298 517706096 981990236 853265134 792072930 19655990 721995317 28876610 201362006 954514062 109269570 852813877 480808369 842634627 783036515 264423011 771083904 9536693 954783510 735514584 654772000 6671...

result:

ok 51 numbers

Subtask #2:

score: 0
Wrong Answer

Test #51:

score: 0
Wrong Answer
time: 7ms
memory: 4356kb

input:

500
0 0 0 0 0 482890969 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1077401 0 0 210804413 0 508044994 0 0 0 398405351 0 0 0 0 0 0 0 171917316 0 0 0 0 0 0 0 0 0 0 0 429230725 0 0 0 0 0 45665526 0 0 0 925078893 0 0 396149045 0 0 0 595858405 0 0 0 0 0 57208...

output:

1 

result:

wrong answer 1st numbers differ - expected: '197564738', found: '1'

Subtask #3:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%