QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#43531#4239. MSTZhangYiDeAC ✓527ms106376kbC++237.1kb2022-08-09 17:32:192022-08-09 17:32:20

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5776kb

input:

2
5
1 2 3 4 5
3
10 45 10

output:

4
-35

result:

ok 2 number(s): "4 -35"

Test #2:

score: 0
Accepted
time: 26ms
memory: 6700kb

input:

300000
1
-167586
1
45048
1
-218274
1
-39107
1
-15880
1
33014
1
217559
1
-208936
1
-260570
1
-83353
1
-39868
1
-253159
1
-26640
1
-114610
1
-244464
1
-7217
1
-196817
1
168691
1
146930
1
284612
1
-93130
1
-186071
1
-31746
1
37800
1
-255791
1
-237603
1
81359
1
201796
1
106965
1
-8371
1
-85871
1
-270622...

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 300000 numbers

Test #3:

score: 0
Accepted
time: 18ms
memory: 6536kb

input:

150000
2
-13258 -22375
2
-54993 -139278
2
-190454 190904
2
-167856 -255749
2
-4278 -217960
2
-267607 -152069
2
232717 199468
2
-154968 -171972
2
-166963 -274452
2
78459 -235523
2
-243695 163707
2
37498 -80301
2
196137 -251909
2
-77332 -82651
2
236076 250081
2
-139194 8035
2
256129 185906
2
72175 -17...

output:

-9117
-84285
381358
-87893
-213682
115538
-33249
-17004
-107489
-313982
407402
-117799
-448046
-5319
14005
147229
-70223
-242776
531933
251314
-377509
-258596
-210071
480133
-27044
110616
213370
6298
-370703
-118888
-103653
-346212
54848
-39115
-22654
-90525
-90204
345598
-96264
854
-433346
-187189
...

result:

ok 150000 numbers

Test #4:

score: 0
Accepted
time: 26ms
memory: 6468kb

input:

100000
3
99677 -229948 68140
3
-54211 -95409 260502
3
151289 -78245 141319
3
44080 -120949 108082
3
-146874 -144493 251966
3
198672 5102 103967
3
165781 237071 101294
3
-236562 72879 -77125
3
233711 286742 253192
3
15202 98416 187853
3
-12416 -267937 -283250
3
-137083 -73845 139482
3
260645 202901 -...

output:

-361162
273515
-239504
-101027
398840
-288275
-200264
9433
-14069
172651
-526355
276565
-538432
76522
348200
-788400
-362322
-1000601
-30025
-892127
-281085
-99512
-13346
-78679
-306280
-837781
-490044
-506530
-193674
321809
-11225
-436944
-718672
-538331
-279352
-595584
-709202
-390572
84683
-30428...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 39ms
memory: 6704kb

input:

30000
10
-74325 266684 -279788 109467 225321 169570 213034 -278478 -243351 -202901
10
106422 -19496 -145263 -278344 183459 212003 264371 -267695 201093 239470
10
-216261 -203734 -129177 75781 137334 -272383 -182861 278026 64019 240839
10
281057 -213075 -7684 -280036 -209516 112973 203601 -123747 164...

output:

-4108021
-2820513
-1670562
-3521422
-3680058
-2784301
-2670694
-2490272
-1233312
-2491022
-3851769
-1712837
-2789496
-1915062
-3387530
-3594879
-3621655
-3284253
-2233585
-2032862
-3448914
-1945524
-2983363
-2934619
-3797804
-2479325
-3422655
-2864459
-3854356
-2252827
-2396111
-3525448
-3557218
-34...

result:

ok 30000 numbers

Test #6:

score: 0
Accepted
time: 36ms
memory: 6792kb

input:

30000
10
-294059 -275940 -146174 -129736 -175984 -156178 -1483 -234569 159624 -55561
10
-250472 -190213 -121117 -101405 -191341 -43146 -244321 -285813 115587 -150784
10
-276122 -190604 -247978 -169704 -281373 -278835 85055 170122 51311 -127292
10
-277532 -267286 -145802 -222618 -209816 -119034 40747...

output:

-773063
-1392368
-1020146
-628552
-204149
-1192205
-1713839
-469993
-447370
-614997
-692349
-766283
-888907
-1021360
-35627
-694370
-1013321
-294902
-512799
-515331
-1243061
-1783769
-449957
-33301
-167094
215600
-498292
-17383
-671921
-573697
-467229
-1281842
-1317503
-156647
-995781
79143
-1415713...

result:

ok 30000 numbers

Test #7:

score: 0
Accepted
time: 122ms
memory: 6936kb

input:

1000
300
-298324 -298368 -295147 -292979 -297030 -295945 -291530 -288923 -291568 -282979 -293863 -299657 -283661 -275930 -286682 -282513 -282990 -272891 -278479 -293938 -294165 -290000 -269899 -257140 -279717 -287140 -289681 -280387 -288383 -253377 -293732 -258976 -278418 -238440 -260281 -297204 -23...

output:

-60932580
-62451142
-59037248
-61162847
-59878971
-61462090
-64168295
-61257339
-62033551
-61922575
-61418155
-63257000
-60418722
-60615804
-60730475
-61504745
-62894182
-61959976
-61480355
-62017330
-61633567
-60988058
-61851195
-61287465
-61905560
-61053123
-61901968
-63671637
-61134133
-60870182
...

result:

ok 1000 numbers

Test #8:

score: 0
Accepted
time: 125ms
memory: 7960kb

input:

1000
300
-281562 -80897 -230829 -38580 57542 -6179 2198 119535 121318 -249831 -103928 107531 205435 27403 -172723 139238 -183468 -55795 22879 -154430 -128970 -273641 182243 -41835 -21141 -163311 38104 -187707 234225 5063 -254430 127544 117368 243243 143756 132550 101928 276620 101164 -141219 2419 -1...

output:

-124164638
-129845321
-133734931
-130923217
-128165915
-131563791
-130804812
-128688262
-132982929
-132762223
-128353110
-130586524
-131729927
-131231179
-129419428
-130060194
-132118814
-125448958
-131501926
-129151023
-133021772
-130299008
-129191508
-127174401
-131100635
-129770915
-131376463
-13...

result:

ok 1000 numbers

Test #9:

score: 0
Accepted
time: 114ms
memory: 6796kb

input:

1000
300
-298679 -297238 -295803 -292198 -290682 -288720 -286938 -284571 -283686 -281511 -279436 -276112 -275603 -273870 -271489 -268411 -267447 -264313 -263819 -261945 -258935 -256919 -254642 -253744 -251046 -249329 -246645 -244195 -243777 -241361 -238881 -237779 -235806 -233816 -231751 -228938 -22...

output:

597034
598479
596477
597276
598671
598188
597232
598590
598218
597984
597052
598445
597646
598723
598121
598367
598594
597762
599359
597670
598303
597378
597330
597837
599300
597130
597331
598751
598475
598474
599506
599482
599438
597233
596817
596350
598614
597595
596646
598364
599193
598803
596179...

result:

ok 1000 numbers

Test #10:

score: 0
Accepted
time: 218ms
memory: 8424kb

input:

100
3000
-218872 -72347 82437 263879 -168795 -144066 71193 -830 105633 -222236 -60196 134867 283859 -268841 -139501 198636 -230542 87249 -206127 32111 229491 89557 -116400 -179835 44932 40130 183412 -10485 -16212 -150111 -194436 -190696 112569 -8072 -99091 -219928 216824 257656 -230568 277715 117655...

output:

-1343155197
-1340060470
-1342410075
-1342637183
-1350211153
-1349664189
-1343221971
-1345793165
-1352170113
-1342518149
-1346038789
-1339901921
-1339192532
-1343976537
-1346638552
-1344487277
-1348616260
-1347357613
-1347488960
-1346681985
-1348365345
-1347227345
-1339469684
-1337559152
-1341504492
...

result:

ok 100 numbers

Test #11:

score: 0
Accepted
time: 228ms
memory: 6900kb

input:

100
3000
-299884 -299761 -299903 -299741 -299436 -299121 -298768 -298605 -298214 -298487 -299898 -297631 -299582 -298408 -298189 -297059 -297636 -299855 -297935 -298033 -299357 -298538 -297964 -298023 -296205 -296740 -295203 -297333 -298299 -298261 -298147 -298716 -297358 -293584 -299501 -293897 -29...

output:

-662927472
-658764054
-655519957
-663509116
-658220109
-663510359
-666386321
-654273493
-659694896
-658078076
-658805921
-659301005
-665644812
-657465661
-658551813
-663135044
-662487338
-661524234
-652708216
-657650192
-656870678
-662939233
-655688120
-657155708
-657674882
-656502543
-658554555
-66...

result:

ok 100 numbers

Test #12:

score: 0
Accepted
time: 174ms
memory: 8448kb

input:

100
3000
-299931 -299752 -299534 -299361 -299032 -298806 -298708 -298430 -298230 -298093 -297946 -297691 -297532 -297353 -297124 -296928 -296615 -296568 -296353 -296192 -295826 -295679 -295583 -295331 -295089 -294977 -294687 -294483 -294289 -294188 -293830 -293630 -293457 -293219 -293127 -292891 -29...

output:

599778
599671
599846
599915
599726
599823
599829
599848
599804
599785
599924
599834
599842
599871
599759
599855
599767
599868
599911
599673
599774
599822
599767
599704
599895
599704
599837
599931
599738
599732
599823
599949
599763
599763
599668
599825
599940
599826
599860
599833
599931
599708
599698...

result:

ok 100 numbers

Test #13:

score: 0
Accepted
time: 160ms
memory: 7288kb

input:

100
3000
299882 299631 299493 299229 299071 298927 298769 298563 298256 298185 297968 297630 297438 297387 297037 296871 296778 296533 296399 296170 295879 295780 295569 295326 295158 294860 294682 294522 294272 294036 293803 293729 293426 293399 293115 292900 292607 292523 292365 292037 291950 2917...

output:

-1349105664
-1349137811
-1348978968
-1349200997
-1349099511
-1349190726
-1349089805
-1348898211
-1348955602
-1348888100
-1349043735
-1349162266
-1349274497
-1349219323
-1349057902
-1349019228
-1348867893
-1349151507
-1349194545
-1349075129
-1349005545
-1349303718
-1349265509
-1349071622
-1349275479
...

result:

ok 100 numbers

Test #14:

score: 0
Accepted
time: 418ms
memory: 31564kb

input:

3
100000
-137244 -291292 282147 -137443 294466 44561 -230271 -35957 -215538 186454 56697 108312 -37787 32953 187529 123753 -40057 -205953 -98575 212101 -292813 -244361 -213595 -48966 56687 -124453 237859 185220 86136 -195128 1669 -40522 -164642 79781 111331 280525 -299128 139858 -87887 153980 83044 ...

output:

-44961063004
-44977168854
-45017060868

result:

ok 3 number(s): "-44961063004 -44977168854 -45017060868"

Test #15:

score: 0
Accepted
time: 275ms
memory: 9564kb

input:

30
10003
167259 148966 162306 248165 191988 -95817 -168785 8694 202887 -152475 -229361 160501 111086 -23161 -171480 -8627 -198670 234430 -15035 158501 -8856 92847 -95965 174571 39457 205569 -213277 -140721 184061 -137399 92523 227403 65790 -111940 -187328 78833 21975 -60472 -22381 275819 55744 54656...

output:

-4495767558
-4188577041
-4931408922
-4172214632
-4930478695
-4819616311
-4165690044
-4391825193
-4656831229
-4472796884
-4189896459
-4806582594
-4215538500
-4523796949
-4443053508
-4052816222
-4121759749
-4308344707
-4686696562
-4755568878
-4348106135
-4849972661
-4176893367
-4533547817
-4401897786
...

result:

ok 30 numbers

Test #16:

score: 0
Accepted
time: 261ms
memory: 10232kb

input:

30
9162
-299947 -299898 -299886 -299762 -299985 -299957 -299615 -299505 -299991 -299381 -299711 -299719 -299241 -299448 -299761 -299758 -299214 -299165 -299919 -299444 -299258 -298974 -299044 -299510 -299434 -299337 -299477 -299943 -298731 -298997 -298021 -298597 -299263 -298258 -298672 -298864 -298...

output:

-2029653123
-4278404701
-4138403797
-4270878104
-2070394580
-4660605732
-4399905326
-4561953314
-2040917112
-4924710233
-4224642602
-4222499392
-2061370973
-4259746289
-4047388234
-4903442906
-2163166199
-4570452999
-4706399032
-4125595208
-2015249020
-4306416210
-4101730333
-4345583924
-2231754665
...

result:

ok 30 numbers

Test #17:

score: 0
Accepted
time: 255ms
memory: 11572kb

input:

30
9283
-299950 -299909 -300000 -299832 -299786 -299773 -299990 -299841 -299842 -299788 -299473 -299421 -299578 -299910 -299285 -299239 -299076 -299766 -299624 -298815 -299155 -298788 -298616 -299052 -299570 -298559 -299823 -298497 -299006 -298247 -299664 -299700 -298652 -298421 -299492 -299059 -299...

output:

-2063615261
-4495168072
-4924725662
599903
-2434037160
-4930142481
-4511884010
-4312355423
-2393098681
-4629556059
-4492379730
599909
-2225332752
-4080721358
-4279523431
-4564361721
-2357534302
-4286484279
-4449822249
-4336204703
-2140190313
-4281304053
-4551655191
-4442390584
-2231861088
-406729240...

result:

ok 30 numbers

Test #18:

score: 0
Accepted
time: 501ms
memory: 106240kb

input:

1
300000
127326 -14635 -42375 177996 -120269 192010 233425 813 139641 59862 -26930 231110 -74925 28305 42655 -164243 -30994 74632 -117786 181891 183263 16230 -194881 66228 -35760 -216759 140778 216373 256198 282199 -154926 -135663 56242 204458 90341 32285 123633 -97701 247042 -148136 100012 74566 14...

output:

-134824305556

result:

ok 1 number(s): "-134824305556"

Test #19:

score: 0
Accepted
time: 515ms
memory: 106164kb

input:

1
300000
-238220 222874 146173 -265356 237921 -84225 -44219 148759 179781 192311 183641 -158763 41103 -235845 -151536 -195433 -3283 294879 278489 162276 154516 -178118 85381 32835 178719 -178318 167305 -7508 -6640 -227320 124042 16653 -93950 -158919 221512 -260825 -76950 56513 102596 -140840 -37032 ...

output:

-135048415732

result:

ok 1 number(s): "-135048415732"

Test #20:

score: 0
Accepted
time: 504ms
memory: 106152kb

input:

1
300000
172323 -169449 -121927 29495 93290 -104934 -212241 174361 -240609 264426 61989 -294745 -28367 -116404 36032 249021 246096 252943 280745 286109 -274269 18706 -157778 271236 -273300 -230252 176678 -209428 149130 -297209 -269528 -124404 -203482 -294192 -213061 -10896 -206379 -262117 -119652 47...

output:

-134938419071

result:

ok 1 number(s): "-134938419071"

Test #21:

score: 0
Accepted
time: 527ms
memory: 106176kb

input:

1
300000
59125 264858 -231137 -85264 -23369 263396 -262384 -178323 -184230 -115451 -128089 298173 249059 207422 -10454 -151464 -2713 -284353 -203470 226415 -37121 -120273 137492 -39273 38040 -268782 59062 189977 -126328 4966 -1153 140691 -90224 296015 105312 -44105 100529 68463 -2837 -42589 20316 -9...

output:

-135020380399

result:

ok 1 number(s): "-135020380399"

Test #22:

score: 0
Accepted
time: 518ms
memory: 106224kb

input:

1
300000
62972 -35201 230700 81055 272962 -29165 292614 -240411 -115815 199463 -69160 69971 -265902 -144474 15879 -45345 -83724 -160704 184135 -259901 293976 -253664 149256 259116 -119378 75891 9659 68818 -114327 181266 27371 20051 -245791 56462 -65959 183029 -194695 236469 10078 17259 290515 166866...

output:

-135055299764

result:

ok 1 number(s): "-135055299764"

Test #23:

score: 0
Accepted
time: 497ms
memory: 106168kb

input:

1
300000
-259234 229666 56386 -14307 209500 -22056 -21335 244093 -52648 -222346 -18098 80730 1220 -99508 -296616 -184895 -182915 -193437 183165 -93869 180532 58280 187274 243522 -104929 58202 232192 -79337 193294 -244905 -236918 -275706 20138 122738 -2204 -257366 -52833 -224681 -138579 -211243 44435...

output:

-134982757712

result:

ok 1 number(s): "-134982757712"

Test #24:

score: 0
Accepted
time: 510ms
memory: 106292kb

input:

1
300000
222716 154452 161728 71626 116693 -92141 107702 214793 -4421 158307 81921 -285910 64053 187813 -6244 -91636 -199633 133065 229112 -137024 -54806 -45871 158938 -281254 295068 143127 -41956 -256318 25672 -36448 -105938 223139 151949 203885 59314 -83915 -176601 -153222 -299310 162350 -278986 6...

output:

-134969002849

result:

ok 1 number(s): "-134969002849"

Test #25:

score: 0
Accepted
time: 486ms
memory: 106192kb

input:

1
300000
256193 -58770 -3677 -14332 62260 -122840 -34145 56718 272843 294980 186734 -77630 141631 -35565 -67788 191909 -257140 -69427 103805 -220961 286699 -259138 -9376 281289 86988 220565 -249107 -59887 -188527 256416 172455 58421 16661 -63461 133452 -298197 -13181 -204152 -240370 -70585 -263133 2...

output:

-135001069390

result:

ok 1 number(s): "-135001069390"

Test #26:

score: 0
Accepted
time: 498ms
memory: 106276kb

input:

1
300000
-299999 -299996 -299996 -299997 -299990 -299997 -299997 -300000 -299984 -299991 -299989 -300000 -299995 -299974 -299979 -299992 -299985 -299971 -299970 -299966 -300000 -299975 -299979 -299964 -299980 -299956 -299992 -299990 -299998 -299974 -299967 -299972 -299961 -299939 -299984 -299933 -29...

output:

-67356564230

result:

ok 1 number(s): "-67356564230"

Test #27:

score: 0
Accepted
time: 248ms
memory: 106244kb

input:

1
300000
-300000 -299996 -299996 -299993 -299990 -299989 -299988 -299984 -299982 -299981 -299978 -299977 -299974 -299973 -299972 -299969 -299966 -299965 -299964 -299960 -299960 -299957 -299955 -299953 -299951 -299949 -299947 -299944 -299944 -299942 -299939 -299938 -299936 -299932 -299932 -299930 -29...

output:

600000

result:

ok 1 number(s): "600000"

Test #28:

score: 0
Accepted
time: 249ms
memory: 106236kb

input:

1
300000
300000 299997 299996 299992 299990 299989 299987 299984 299983 299982 299980 299977 299975 299972 299971 299970 299968 299965 299963 299961 299960 299958 299956 299954 299950 299948 299946 299945 299944 299941 299940 299938 299936 299933 299930 299930 299927 299925 299924 299922 299919 2999...

output:

-134999250330

result:

ok 1 number(s): "-134999250330"

Test #29:

score: 0
Accepted
time: 171ms
memory: 106224kb

input:

1
300000
-300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -30...

output:

0

result:

ok 1 number(s): "0"

Test #30:

score: 0
Accepted
time: 170ms
memory: 106376kb

input:

1
300000
-300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 300...

output:

600000

result:

ok 1 number(s): "600000"

Test #31:

score: 0
Accepted
time: 169ms
memory: 106272kb

input:

1
300000
300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300000 -300...

output:

-179999400000

result:

ok 1 number(s): "-179999400000"