QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#317012#6337. Mizuyokan 2bobcheeseburger15 2956ms995096kbC++236.1kb2024-01-28 11:45:212024-01-28 11:45:21

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 1ms
memory: 4500kb

input:

170
581553716 290776853 145388421 581553716 168947671 936760822 849346471 126291564 133104657 125887494 136786623 123143788 137803872 129733949 849346471 880499329 202732710 611312524 152828126 305656257 611312524 121295297 6875889 74507235 419967909 333601507 281557968 740824934 370412466 185206229...

output:

59
56
61
61
56
37
42
46

result:

ok 8 numbers

Test #2:

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

input:

200
517847507 258923750 129461870 517847507 106915073 712580593 512811829 12657894 12715954 12534704 12759073 12554236 12685369 12563357 12817887 12534566 12752501 12518874 12746471 12524663 12730053 12586182 12803851 12628464 12778716 12645600 12701929 12550298 12754947 12548765 12765210 12592487 1...

output:

118
162
114
113
143
105
109
165
139
152

result:

ok 10 numbers

Test #3:

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

input:

156
689580506 344790254 172395128 689580506 344790254 689580506 344790252 172395125 86197561 86197567 86197565 86197566 43098784 86197566 86197565 86197567 86197561 172395125 344790252 689580506 344790254 689580506 172395128 344790254 689580506 3985467 453082635 861305238 430652620 215326311 8613052...

output:

19
26
27
21
15
11

result:

ok 6 numbers

Test #4:

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

input:

200
545371756 272685879 136342940 545371756 272685879 545371756 272685877 136342937 68171467 68171474 68171472 68171473 34085737 68171473 68171472 68171474 68171467 136342937 272685877 545371756 272685879 545371756 136342940 272685879 545371756 327464463 455363267 859187150 429593576 214796789 85918...

output:

27
36
25
26
16
11
15
21
19
22

result:

ok 10 numbers

Test #5:

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

input:

200
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 863735928 433494437 165580141 632459...

output:

5
13
5
5
8
5
13
5
5
6

result:

ok 10 numbers

Test #6:

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

input:

187
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 868260277 433494437 165580141 632459...

output:

4
36
18
10
19
11
3
29

result:

ok 8 numbers

Test #7:

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

input:

200
942616273 418940008 209470430 104734784 104734784 104735481 523675545 247785 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 92274...

output:

5
21
8
5
9
8
20
17
5
5

result:

ok 10 numbers

Test #8:

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

input:

200
641304094 22086510 5470810 2634455 1317187 658631 329083 126285 49415 22321 11410 5273 359 133 50 20 9 3 3 3 9 30 79 220 585 1226 2467 4851 27355 76469 202803 2836339 8307675 16614893 38701275 77401954 154804637 309608784 619217509 353775485 433494437 165580141 63245986 24157817 9227465 3524578 ...

output:

5
13
9
9
9
4
12
12
11
5

result:

ok 10 numbers

Test #9:

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

input:

200
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 693739790 701408733 267914296 102334...

output:

5
5
5
4
5
3
9
19
9
16

result:

ok 10 numbers

Test #10:

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

input:

200
811426933 198737194 91129973 45564654 22782332 6305563 3152428 1219185 505660 252621 43570 21857 11092 2766 1419 327 118 44 15 3 1 1 3 6 14 31 76 196 509 1034 4036 8138 52164 104730 208684 713957 1933360 8238658 16477615 107607533 306345216 612690552 5165 701408733 267914296 102334155 39088169 1...

output:

5
5
5
5
4
3
17
22
11
22

result:

ok 10 numbers

Test #11:

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

input:

170
81553716 641270070 76671075 423535716 81513969 349346472 918947671 643372070 434082866 664656456 639157656 473824723 263466558 960408345 313957771 754077653 952732710 111312524 68261315 315588907 511788074 951463287 402771182 51452283 4352857 86643186 343917032 740824934 31237226 361281509 99056...

output:

60
20
67
55
72
66
47
18

result:

ok 8 numbers

Test #12:

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

input:

200
517847507 845063523 900782365 733754788 868260277 512811830 106915073 2556529 228137609 242594414 695501734 1446343 933668801 559293539 298824117 637105802 625215851 312386451 100447359 186927021 376963403 300653848 857052812 501599341 349295044 922104431 840182910 996573394 684887153 779348052 ...

output:

74
97
31
53
14
45
2
64
10
10

result:

ok 10 numbers

Test #13:

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

input:

200
207011 5261 1269645 3 96 1 4 756365306 891 2889 217238 15 4594 1 3 2 549508340 1 1 136 1461 302855 31140693 1185 5912463 27 9682000 9146 17 29626226 67558 219081 1 1 59 554 8 19 6460 712 1679713 276643 180049 1692 165 4841589 687013 268 8364 3911918 39604 6 1 5 1 3809 1 15127 316 256 1 7976975 3...

output:

34
65
53
10
122
46
52
17
22
85

result:

ok 10 numbers

Test #14:

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

input:

200
1666954 16680286 22901801 24466766 25555269 26161708 27126835 29636964 31147832 33483487 33499511 41450462 45371756 45456600 46543021 56856009 57776244 71330394 73522260 75003115 75139522 87658971 89596930 90333745 96481088 104215633 105317004 107865475 109822289 113787517 119366225 126358977 13...

output:

38
33
29
26
85
58
22
2
2
26

result:

ok 10 numbers

Test #15:

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

input:

200
1 1 1 2 3 3 13 35 59 77 94 184 512 17627 21953 72401 106196 287525 4542970 7279146 18367441 51140154 158988562 398832640 755575138 427135579 227921831 113319106 26153265 20515329 4485571 210791 163801 111341 72315 49834 27931 18398 5104 2849 2092 1486 435 433 331 12 10 4 1 1 1 1 1 1 3 14 39 69 2...

output:

32
30
33
49
42
49
2
24
71
30

result:

ok 10 numbers

Test #16:

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

input:

200
9090695 11261989 37978393 39759789 40717103 59342651 63521565 64602365 72486441 81550503 84429832 87685388 93947754 116330271 118375950 126832034 129591929 130580129 133304510 135979600 147563274 149207928 159091959 161016266 162216627 170224776 170937882 171692206 173801085 191657773 198611062 ...

output:

20
65
120
25
107
16
61
31
38
15

result:

ok 10 numbers

Test #17:

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

input:

200
1 1 4 74 102 849 1698 3260 9919 12317 43630 49428 107277 226806 397526 699137 1279153 3198955 3772748 5013933 13296103 24002309 50457720 61144874 228889568 370255655 602076780 1 32368 8634 332 116286 7577464 86346 27 1 25330811 56141 32 5 28466 6483802 774045913 5163615 6 21131 22 3346 2793 3237...

output:

8
20
43
27
52
79
31
22
27
81

result:

ok 10 numbers

Test #18:

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

input:

200
956397794 956397794 606227355 606227355 434852959 434852959 754338473 754338473 989995218 989995218 858627911 858627911 852085951 852085951 280865784 280865784 63369558 63369558 388670577 388670577 563870055 563870055 264046824 264046824 313555037 313555037 112186895 112186895 368002737 36800273...

output:

1
2
2
2
21
1
2
1
2
2

result:

ok 10 numbers

Test #19:

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

input:

200
230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892545 230892...

output:

21
6
4
48
13
9
1
8
30
11

result:

ok 10 numbers

Subtask #2:

score: 9
Accepted

Dependency #1:

100%
Accepted

Test #20:

score: 9
Accepted
time: 2ms
memory: 9896kb

input:

1390
996792497 498396246 249198120 996792497 101363119 781865047 656947559 62304094 63915157 60229970 63729625 60093777 62748259 59920613 65063372 62398031 63528129 62704442 656947559 986967949 160849742 814718671 203679663 407359330 814718671 79887087 315091213 118024524 386675019 314722420 8678924...

output:

57
59
46
57
51
55
52
44
19
56

result:

ok 10 numbers

Test #21:

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

input:

2000
580952848 290476421 145238205 580952848 133999450 897045688 878958110 25245628 25527409 25321336 25536117 25394894 25548273 25435009 25779437 25120869 25551736 25144084 25528034 25456720 25740644 25265090 25649682 25144462 25752439 25403599 25738908 25286578 25507889 25395653 25588875 25376462 ...

output:

111
115
49
38
109
99
109
36
187
195

result:

ok 10 numbers

Test #22:

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

input:

1504
692018472 346009237 173004619 692018472 346009237 692018472 346009235 173004616 86502307 86502313 86502311 86502312 43251157 86502312 86502311 86502313 86502307 173004616 346009235 692018472 346009237 692018472 173004619 346009237 692018472 259957166 181889194 802616914 401308458 200654230 8026...

output:

37
254
43
20
30
11
45
77
161
27

result:

ok 10 numbers

Test #23:

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

input:

2000
956397794 478198898 239099450 956397794 478198898 956397794 478198896 239099447 119549722 119549728 119549726 119549727 59774864 119549727 119549726 119549728 119549722 239099447 478198896 956397794 478198898 956397794 239099450 478198898 956397794 467208990 129369883 754338473 377169237 188584...

output:

267
20
41
24
21
11
362
622
25
25

result:

ok 10 numbers

Test #24:

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

input:

2000
433494437 165580141 63245986 24157817 9227465 3524578 1346269 514229 196418 75025 28657 10946 4181 1597 610 233 89 34 13 5 2 1 1 1 3 8 21 55 144 377 987 2584 6765 17711 46368 121393 317811 832040 2178309 5702887 14930352 39088169 102334155 267914296 701408733 93833055 433494437 165580141 632459...

output:

5
159
21
47
29
112
123
56
5
96

result:

ok 10 numbers

Test #25:

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

input:

1722
754338473 754338473 754339407 63369558 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465 24157817 63245986 165580141 433494...

output:

5
713
148
326
620
279
5
9
365
167

result:

ok 10 numbers

Test #26:

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

input:

2000
415015995 166006357 83002832 83002832 83003332 249009517 664025736 153704 701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465...

output:

5
293
169
21
166
57
175
201
41
28

result:

ok 10 numbers

Test #27:

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

input:

2000
541640634 227677457 113838488 27552705 11962631 5981484 2353883 1079432 539877 269728 74447 37305 14337 4892 1099 395 149 40 20 8 4 3 3 10 51 107 267 725 1815 3876 8780 23215 97614 194948 1273756 3627591 15590091 43142892 86286368 313963957 855604521 7128360 701408733 267914296 102334155 390881...

output:

5
183
29
73
95
99
5
31
45
95

result:

ok 10 numbers

Test #28:

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

input:

2000
701408733 267914296 102334155 39088169 14930352 5702887 2178309 832040 317811 121393 46368 17711 6765 2584 987 377 144 55 21 8 3 1 1 1 2 5 13 34 89 233 610 1597 4181 10946 28657 75025 196418 514229 1346269 3524578 9227465 24157817 63245986 165580141 433494437 249719958 701408733 267914296 10233...

output:

5
77
13
12
57
3
45
103
115
100

result:

ok 10 numbers

Test #29:

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

input:

2000
525118691 262559536 131279565 49989124 18687350 6072791 3036355 1518317 759200 379732 145483 57921 27740 13555 6756 3366 713 82 20 9 9 10 31 62 147 291 599 1356 2740 29963 88206 233945 6307382 12614557 31301742 81291216 606410513 5067 433494437 165580141 63245986 24157817 9227465 3524578 134626...

output:

5
89
5
16
4
3
45
95
150
135

result:

ok 10 numbers

Test #30:

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

input:

1668
217293251 574495359 729601546 128636814 423402116 191384362 465885935 305072385 998508356 721707739 866260660 281956127 414665737 112383114 269031157 800229309 424389057 193910387 918741076 709526872 414643171 607956241 620304219 202887734 600466865 54238223 201638382 890620143 459509407 360504...

output:

280
897
934
224
654
30
489
432

result:

ok 8 numbers

Test #31:

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

input:

2000
982720651 249719958 660714565 704915981 910551148 255022894 580815100 88103482 314031045 574906362 356705440 112397772 5328098 382196455 120869541 13141457 913068523 445851404 80206732 613413589 553711700 957318472 561816410 981311072 531335031 967466215 879234870 279208179 97183925 324336471 6...

output:

262
156
841
43
160
306
587
115
276
987

result:

ok 10 numbers

Test #32:

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

input:

2000
13360776 38 98434 6323439 12 9 2205 7026517 362 327 908 103 46411985 13 2526055 177 55028 232 6 728 1639 1504 38520123 3 5702664 1 439183 320049350 72777301 17267 536 477151 5 66762357 39 24464527 29662 1 269916 14174296 194 2366 54 163449 5138460 3 1 812712 64497 3974902 29742 1 60304785 1 1 1...

output:

1086
720
121
195
482
612
460
287
703
249

result:

ok 10 numbers

Test #33:

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

input:

2000
172550 1248879 1452843 1460111 1600241 1657069 1798356 2006947 2076559 3151101 4026059 4889143 5206363 5764087 5998198 6165818 6282160 7140612 7297494 7400031 7597773 7926237 7930924 8110990 8403118 8925365 10824822 11391524 11499299 11622321 12565571 12593884 13023901 13481626 13704491 1392571...

output:

526
1096
367
252
154
324
680
1044
491
5

result:

ok 10 numbers

Test #34:

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

input:

2000
1 1 1 2 4 18 21 34 48 54 69 199 3337 8515 218573 227707 511976 1592673 4310118 4522394 11957337 21257931 48488851 54445733 162395054 138728546 112924359 18052347 3231655 2663832 2070981 1705741 484022 221122 72576 60838 24561 6431 2306 891 609 607 406 230 216 74 24 2 1 1 1 1 1 1 1 3 14 64 102 2...

output:

315
237
8
206
89
550
192
5
184
441

result:

ok 10 numbers

Test #35:

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

input:

2000
9213 177930 703789 958369 1201269 1298952 1993372 2508676 2718980 4059394 4389149 5525621 6380223 6846073 7277800 8061246 8308264 9044302 9520883 9721664 9753674 11531372 12477763 12753886 13152864 13462493 13491349 13735471 13800542 14415002 14680672 14734632 15113340 15569086 16373139 1637823...

output:

942
669
102
37
1024
72
348
1247
2
403

result:

ok 10 numbers

Test #36:

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

input:

2000
4 4 22 24 51 170 360 653 1901 2597 2628 7525 9990 13925 16685 19166 23995 365075 863461 1205148 8402387 25990332 416385061 433543645 634519206 25 163 1775 11065 186 245 62392 514750 3925772 874252 10411580 6 21314493 3034351 202 454466964 1381 1446973 281 231910317 40345471 57766273 50200 15239...

output:

117
8
591
415
124
99
68
608
118
270

result:

ok 10 numbers

Test #37:

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

input:

2000
976592750 976592750 443806454 443806454 330548791 330548791 158104030 158104030 799802425 799802425 159913320 159913320 264226708 264226708 61997750 61997750 184368415 184368415 216965005 216965005 643188919 643188919 425939825 425939825 338802124 338802124 308108992 308108992 517631876 5176318...

output:

1
2
2
2
210
1
1
1
2
55

result:

ok 10 numbers

Test #38:

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

input:

2000
666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 666388374 66638...

output:

1
33
11
251
119
142
55
384
98
3

result:

ok 10 numbers

Subtask #3:

score: 0
Memory Limit Exceeded

Dependency #2:

100%
Accepted

Test #39:

score: 13
Accepted
time: 256ms
memory: 995096kb

input:

215185
731444655 365722322 182861160 731444655 230452612 901361503 888862425 127134176 147422580 127064966 137825941 132256594 145230572 128763293 888862425 900760719 157529805 829596989 810539286 74329096 77743469 74087434 80604844 76880592 80492666 74803264 80805087 76028874 78398637 74990491 8105...

output:

69
32
61
80
52
43
28
52
27

result:

ok 9 numbers

Test #40:

score: -13
Memory Limit Exceeded

input:

250000
757125540 378562767 189281382 757125540 173402116 791046775 628636813 9159495 9196244 9164521 9220238 9148765 9244306 9142560 9190643 9154123 9195488 9166610 9200416 9172839 9229221 9144196 9201270 9123189 9211323 9139654 9238212 9123461 9212792 9164589 9224449 9114795 9206356 9132652 9220184...

output:

111
205
198
328
222
359
91
121
358
362

result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #59:

score: 32
Accepted
time: 2956ms
memory: 856624kb

input:

185137
895278847 447639418 223819705 895278847 25847602 892542542 725274571 68345857 72124244 67050536 71135605 66549838 72378749 66083078 72261084 67667076 70423484 68942136 725274571 798132375 68764887 958288578 703862250 55104628 58120315 54690522 57110282 54279470 56516680 54581941 58474132 5445...

output:

59
26
80
55
43
41
79
37
57
79
69
29
31
25
26
76
32
25
27
36
34
39
67
40
67
71
45
40
49
52
64
61
29
40
39
34
41
19
28
51
31
43
62
23
31
26
73
39
63
36
53
27
46
56
30
67
60
37
71
22
42
59
67
87
16
27
20
38
14
64
20
19
41
34
55
53
15
51
43
29
71
60
49
9
76
18
86
29
73
61
38
46
21
62
20
20
67
71
83
82
5...

result:

ok 46660 numbers

Test #60:

score: -32
Time Limit Exceeded

input:

250000
667582288 333791140 166895569 667582288 99573823 970008947 834597000 12471817 12607290 12487687 12576099 12465363 12618633 12513272 12580300 12472038 12635499 12521112 12568109 12475947 12596996 12534373 12566264 12457253 12610586 12463726 12606038 12490882 12599220 12538123 12628955 12536981...

output:

479
432
209
299
73
389
201
103
301
236
132
294
176
319
309
76
223
90
292
372
428
240
403
469
459
298
330
139
178
264
119
140
215
116
231
90
412
284
131
272
101
103
400
413
410
403
94
165
115
157
134
443
128
125
239
297
140
283
111
409
430
224
112
194
279
224
410
414
275
110
282
285
168
146
216
318
2...

result:


Subtask #5:

score: 0
Memory Limit Exceeded

Test #76:

score: 0
Memory Limit Exceeded

input:

235469
96936 48463 24226 96936 25951 73765 63933 7121 7884 7166 7731 7464 7559 7300 7767 7314 63933 88750 6093 115886 111307 16371 17529 15944 17376 16099 18186 15910 111307 116042 13997 111982 95565 10713 11748 10849 11375 11093 11406 10874 11810 11197 95565 98914 1302 65917 16473 32953 65917 15943...

output:

34
56
73
61
41
13
74
46
33
33
14
53
36
46
18
63
65
79
72
15
20
57
66
83
19
46
62
58
44
76
76
68
41
56
9
29
59
73
64
21
63
33
29
62
27
36
20
65
54
71
29
47
13
32
48
74
64
75
79
17
24
49
20
41
57
17
23
67
67
18
19
54
63
74
72
45
61
30
27
60
33
36
49
49
24
56
42
60
20
53
32
75
44
57
17
34
71
45
25
39
2...

result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%