QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#503825#3879. Down the Pyramidxiaowuc1AC ✓62ms19332kbC++171.5kb2024-08-04 01:32:092024-08-04 01:32:10

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6
12 5 7 7 8 4

output:

2

result:

ok single line: '2'

Test #2:

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

input:

3
10 1000 100

output:

0

result:

ok single line: '0'

Test #3:

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

input:

1
0

output:

1

result:

ok single line: '1'

Test #4:

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

input:

1
1

output:

2

result:

ok single line: '2'

Test #5:

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

input:

1
100000000

output:

100000001

result:

ok single line: '100000001'

Test #6:

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

input:

2
0 0

output:

1

result:

ok single line: '1'

Test #7:

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

input:

7
5 6 7 7 10 9 10

output:

6

result:

ok single line: '6'

Test #8:

score: 0
Accepted
time: 43ms
memory: 19244kb

input:

1000000
100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 100000000 0 1000...

output:

0

result:

ok single line: '0'

Test #9:

score: 0
Accepted
time: 59ms
memory: 19272kb

input:

1000000
100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 10...

output:

0

result:

ok single line: '0'

Test #10:

score: 0
Accepted
time: 59ms
memory: 19200kb

input:

1000000
100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 10...

output:

100000001

result:

ok single line: '100000001'

Test #11:

score: 0
Accepted
time: 15ms
memory: 9984kb

input:

200003
100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100...

output:

1

result:

ok single line: '1'

Test #12:

score: 0
Accepted
time: 50ms
memory: 19240kb

input:

1000000
2473480 74149519 73189691 18031588 56510103 21322964 60454287 35663543 87377454 40736700 18476136 60050072 61091420 42837492 21749894 54022358 18846579 82913333 17962414 29684685 2769927 60681737 11784005 2286972 84912255 2369090 79402711 53924919 67507705 79060650 60708139 69981185 5726541 ...

output:

0

result:

ok single line: '0'

Test #13:

score: 0
Accepted
time: 59ms
memory: 19216kb

input:

996834
48489898 98880704 86065711 17877971 74694490 26610426 85666766 93521604 38938841 31570389 42076492 25802366 73688874 7303341 44511564 35330799 41054184 42493839 45305608 33969229 87299471 58560364 33291852 24989660 7972194 91905590 25684372 35270889 80235565 68356605 60384079 81241836 1975368...

output:

0

result:

ok single line: '0'

Test #14:

score: 0
Accepted
time: 52ms
memory: 19060kb

input:

981503
97838688 15069414 65656978 26207243 58731120 98736576 30413249 68677590 40893359 54384069 65798754 7774553 43065271 37806418 57054124 17312278 2619983 5587489 49264711 85779179 53874732 11766181 21936678 2809016 42023207 15418275 25460329 43066567 48433348 14095671 33448059 98788410 81681459 ...

output:

0

result:

ok single line: '0'

Test #15:

score: 0
Accepted
time: 49ms
memory: 19084kb

input:

977903
99999421 99999033 99999681 180 99999733 99999715 99999231 382 82 302 228 99999095 644 99999373 890 514 140 99999537 99999061 99999805 190 99999189 99999559 99999809 858 99999841 188 99999221 99999893 332 34 38 99999349 99999647 218 99999729 99999009 988 99999347 99999927 290 99999119 99999021...

output:

0

result:

ok single line: '0'

Test #16:

score: 0
Accepted
time: 54ms
memory: 19156kb

input:

1000000
99999341 99999607 766 464 462 99999739 56 74 99999463 20 612 140 836 188 99999159 868 822 99999537 686 48 99999247 99999681 20 99999447 99999979 516 26 99999623 99999491 99999365 99999033 168 380 86 632 842 99999653 40 268 236 60 99999767 376 896 99999579 570 116 99999757 99999967 99999845 6...

output:

0

result:

ok single line: '0'

Test #17:

score: 0
Accepted
time: 51ms
memory: 19332kb

input:

999889
50000009 50000007 50000049 50000024 50000067 50000110 50000124 50000100 50000120 50000169 50000189 50000181 50000214 50000221 50000189 50000233 50000226 50000191 50000186 50000226 50000273 50000239 50000211 50000165 50000186 50000225 50000196 50000181 50000216 50000235 50000236 50000244 50000...

output:

49973342

result:

ok single line: '49973342'

Test #18:

score: 0
Accepted
time: 51ms
memory: 19332kb

input:

999952
50000017 49999969 49999941 49999953 49999931 49999929 49999933 49999884 49999906 49999888 49999848 49999846 49999885 49999888 49999843 49999827 49999826 49999816 49999810 49999849 49999883 49999864 49999894 49999854 49999838 49999799 49999844 49999801 49999769 49999768 49999804 49999846 49999...

output:

49971044

result:

ok single line: '49971044'

Test #19:

score: 0
Accepted
time: 59ms
memory: 19260kb

input:

999821
45218176 45240813 45242785 45230350 45266018 45240777 45309574 45369713 45352203 45376049 45375853 45353185 45351982 45310476 45310791 45247602 45247288 45230252 45201398 45210965 45174115 45083024 45081920 45003004 45047914 45031098 45053085 45138231 45123395 45081680 45015030 44947050 44954...

output:

1803449

result:

ok single line: '1803449'

Test #20:

score: 0
Accepted
time: 28ms
memory: 16112kb

input:

598499
42083130 42093589 42098338 42156951 42150040 42142903 42179908 42171510 42176025 42189362 42185798 42167143 42120831 42122992 42122839 42128393 42114031 42088950 42073576 42045871 41958400 41968894 41957082 41988037 41993944 42004076 42005439 42035272 41989427 42008840 41999840 41982562 42005...

output:

9162144

result:

ok single line: '9162144'

Test #21:

score: 0
Accepted
time: 30ms
memory: 16116kb

input:

562787
58077800 58025777 58038223 58033301 58029368 57998610 57944018 57999526 57925926 57943138 57837110 57858507 57838158 57908786 57949716 57960290 57899794 57866525 57909571 57910888 57841295 57881837 57962323 57958381 58003245 58003337 58003667 58021261 58032174 58039253 58039243 58107956 58176...

output:

4070024

result:

ok single line: '4070024'

Test #22:

score: 0
Accepted
time: 31ms
memory: 15036kb

input:

577210
84796200 84796888 84798631 84772725 84785930 84885433 84891392 84890446 84905792 85050306 85035331 85017315 85050528 84969161 84982568 85092466 85113059 85134289 85133857 85324242 85306249 85271584 85239096 85269073 85140992 85017455 84866553 84826481 84860723 85019080 85139841 85150294 85083...

output:

30668979

result:

ok single line: '30668979'

Test #23:

score: 0
Accepted
time: 54ms
memory: 18800kb

input:

922045
99955440 99977160 99913903 99919955 99970845 99920121 99921115 99912739 99924185 99905242 99999588 99992973 99919002 99941095 99907096 99984118 99925149 99934828 99946748 99900235 99964400 99927374 99920500 99995285 99969970 99936213 99987583 99970128 99928638 99982139 99917594 99984078 99997...

output:

61731620

result:

ok single line: '61731620'

Test #24:

score: 0
Accepted
time: 51ms
memory: 18712kb

input:

932445
99879255 99968572 99849205 99744154 99806172 99929836 99842752 99752450 99897832 99799716 99786895 99983709 99788998 99957102 99879681 99919085 99984439 99777004 99760228 99774352 99895668 99982760 99986424 99862636 99936295 99835882 99885552 99911121 99961788 99900345 99843809 99841042 99868...

output:

7751077

result:

ok single line: '7751077'

Test #25:

score: 0
Accepted
time: 53ms
memory: 18924kb

input:

956785
99773157 99703287 99939444 99704787 99815274 99700687 99897218 99944697 99984407 99997054 99682040 99892699 99688849 99731848 99753719 99798927 99945112 99719935 99806515 99821271 99685419 99727810 99779801 99659487 99993142 99896605 99883923 99659988 99788801 99795147 99748199 99921958 99780...

output:

2909589

result:

ok single line: '2909589'

Test #26:

score: 0
Accepted
time: 46ms
memory: 19308kb

input:

999328
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...

output:

1

result:

ok single line: '1'

Test #27:

score: 0
Accepted
time: 55ms
memory: 19232kb

input:

999502
99999501 99999500 99999499 99999498 99999497 99999496 99999495 99999494 99999493 99999492 99999491 99999490 99999489 99999488 99999487 99999486 99999485 99999484 99999483 99999482 99999481 99999480 99999479 99999478 99999477 99999476 99999475 99999474 99999473 99999472 99999471 99999470 99999...

output:

99000001

result:

ok single line: '99000001'

Test #28:

score: 0
Accepted
time: 13ms
memory: 10712kb

input:

190304
33599119 33599158 33599215 33599096 33599230 33599058 33599388 33599288 33599009 33599300 33599232 33599061 33599357 33599420 33599295 33599378 33599311 33599027 33599433 33599301 33599067 33599418 33599082 33599175 33599132 33599296 33599073 33599121 33599379 33599346 33599359 33599371 33599...

output:

33565437

result:

ok single line: '33565437'

Test #29:

score: 0
Accepted
time: 40ms
memory: 19100kb

input:

750000
67348999 67348998 67348997 67348996 67348995 67348994 67348993 67348992 67348991 67348990 67348989 67348988 67348987 67348986 67348985 67348984 67348983 67348982 67348981 67348980 67348979 67348978 67348977 67348118 67348287 67348926 67348414 67348637 67348725 67348774 67348342 67348277 67348...

output:

66460557

result:

ok single line: '66460557'

Test #30:

score: 0
Accepted
time: 17ms
memory: 12344kb

input:

344125
95750737 95612296 95515169 95659864 95691590 95543308 95721281 95665513 95829669 95641512 95623051 95572494 95675799 95510896 95834478 95776494 95696178 95532046 95588753 95791335 95680278 95641084 95665097 95648317 95520826 95526440 95775229 95541735 95639629 95683260 95560349 95766619 95676...

output:

36586678

result:

ok single line: '36586678'

Test #31:

score: 0
Accepted
time: 47ms
memory: 18764kb

input:

792315
12531064 12474065 12399306 12888605 12963556 12979157 12627510 12302344 12825426 12296377 12702898 12658631 12543957 12348210 12619119 12696633 12902163 12962928 12357268 12510347 12613257 12440250 12835758 12373614 12337307 12874288 12422392 12992345 12241801 12553940 12688831 13026257 12878...

output:

0

result:

ok single line: '0'

Test #32:

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

input:

171
53260572 53260713 53260734 53260601 53260594 53260663 53260714 53260585 53260689 53260581 53260595 53260705 53260633 53260697 53260623 53260645 53260568 53260702 53260688 53260720 53260639 53260700 53260573 53260678 53260707 53260690 53260676 53260661 53260677 53260569 53260662 53260725 53260682...

output:

53258841

result:

ok single line: '53258841'

Test #33:

score: 0
Accepted
time: 59ms
memory: 19332kb

input:

1000000
16306663 16306861 16306625 16307100 16306939 16306705 16307229 16306718 16307224 16307027 16307012 16306641 16307311 16306591 16306913 16306597 16306488 16307337 16306443 16306817 16307227 16307186 16307238 16307197 16307414 16306859 16307004 16307183 16306981 16307309 16307262 16306495 1630...

output:

15925886

result:

ok single line: '15925886'

Test #34:

score: 0
Accepted
time: 59ms
memory: 19252kb

input:

1000000
52692401 52693300 52692819 52693141 52692566 52692572 52693023 52692707 52692521 52692527 52692544 52693212 52692891 52692785 52692980 52693153 52692566 52692853 52692446 52692781 52692933 52692959 52693224 52692708 52692676 52692528 52692384 52693291 52692916 52692480 52692754 52693086 5269...

output:

52222570

result:

ok single line: '52222570'

Test #35:

score: 0
Accepted
time: 54ms
memory: 19280kb

input:

994107
95159276 95159276 95159276 95159277 95159276 95159277 95159276 95159276 95159277 95159276 95159277 95159277 95159276 95159276 95159277 95159277 95159276 95159277 95159277 95159277 95159276 95159277 95159277 95159276 95159276 95159276 95159277 95159277 95159277 95159276 95159277 95159277 95159...

output:

95158450

result:

ok single line: '95158450'

Test #36:

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

input:

983379
92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322302 92322300 92322301 92322...

output:

92322300

result:

ok single line: '92322300'

Test #37:

score: 0
Accepted
time: 50ms
memory: 19064kb

input:

985132
95184762 95184764 95184771 95184764 95184768 95184771 95184767 95184766 95184767 95184769 95184762 95184762 95184767 95184769 95184767 95184764 95184764 95184767 95184765 95184766 95184763 95184762 95184767 95184766 95184767 95184765 95184768 95184767 95184771 95184770 95184771 95184763 95184...

output:

95182153

result:

ok single line: '95182153'

Test #38:

score: 0
Accepted
time: 52ms
memory: 19180kb

input:

999478
97382388 98430943 98430942 98430943 98430939 98430943 98430942 98430943 98430932 98430943 98430942 98430943 98430939 98430943 98430942 98430943 98430917 98430943 98430942 98430943 98430939 98430943 98430942 98430943 98430932 98430943 98430942 98430943 98430939 98430943 98430942 98430943 98430...

output:

80195385

result:

ok single line: '80195385'

Test #39:

score: 0
Accepted
time: 60ms
memory: 19264kb

input:

999885
99999995 99999992 99999998 99999996 99999997 99999991 99999998 99999994 99999999 99999993 99999996 99999999 99999991 99999999 99999991 99999992 99999994 99999994 99999993 99999994 99999991 99999992 99999993 99999991 99999993 99999996 99999992 99999997 99999999 99999997 99999992 99999991 99999...

output:

94506

result:

ok single line: '94506'

Test #40:

score: 0
Accepted
time: 53ms
memory: 19248kb

input:

999185
99999997 99999993 99999997 99999993 99999992 99999997 99999998 99999995 99999992 99999996 99999999 99999998 99999999 99999993 99999992 100000000 99999999 99999996 100000000 99999993 99999994 100000000 99999999 99999991 99999995 99999993 99999993 99999998 99999998 99999996 99999991 99999995 99...

output:

97390

result:

ok single line: '97390'

Test #41:

score: 0
Accepted
time: 53ms
memory: 19252kb

input:

999903
100000000 99999997 100000000 100000000 99999999 99999998 99999997 99999994 99999997 99999994 99999991 99999997 99999995 99999994 99999991 99999998 99999992 99999993 99999997 99999995 99999996 99999994 99999994 99999991 99999993 99999996 99999991 99999993 99999995 99999998 99999997 99999995 99...

output:

97649

result:

ok single line: '97649'

Test #42:

score: 0
Accepted
time: 55ms
memory: 19244kb

input:

999613
78713921 95707450 95707448 95707450 95207638 95707450 95707446 95707450 94457922 95707450 95707444 95707450 95207632 95707450 95707442 95707450 93583250 95707450 95707440 95707450 95207626 95707450 95707438 95707450 94457908 95707450 95707436 95707450 95207620 95707450 95707434 95707450 92646...

output:

0

result:

ok single line: '0'

Test #43:

score: 0
Accepted
time: 60ms
memory: 19240kb

input:

999962
93965020 93965210 93965209 93965210 93965207 93965210 93965209 93965210 93965204 93965210 93965209 93965210 93965207 93965210 93965209 93965210 93965200 93965210 93965209 93965210 93965207 93965210 93965209 93965210 93965204 93965210 93965209 93965210 93965207 93965210 93965209 93965210 93965...

output:

91965217

result:

ok single line: '91965217'

Test #44:

score: 0
Accepted
time: 55ms
memory: 19260kb

input:

999400
99999998 100000000 99999998 99999999 99999997 99999997 99999996 99999996 99999997 99999998 99999997 99999998 100000000 100000000 99999999 99999997 99999999 100000000 99999996 100000000 100000000 99999999 99999996 100000000 99999996 99999996 100000000 99999997 99999998 99999996 100000000 10000...

output:

43433041

result:

ok single line: '43433041'

Test #45:

score: 0
Accepted
time: 47ms
memory: 19264kb

input:

999921
95872034 95872053 95872052 95872053 95872051 95872053 95872052 95872053 95872050 95872053 95872052 95872053 95872051 95872053 95872052 95872053 95872049 95872053 95872052 95872053 95872051 95872053 95872052 95872053 95872050 95872053 95872052 95872053 95872051 95872053 95872052 95872053 95872...

output:

94872125

result:

ok single line: '94872125'

Test #46:

score: 0
Accepted
time: 51ms
memory: 19244kb

input:

999889
50005542 49997139 49996413 49998039 50018705 50002916 50000640 49993603 50011159 50008058 49996320 50017756 49996109 49995821 49986287 50002307 50014068 50003280 49994403 50004890 50022254 49999844 50003092 50022368 50016971 49990746 50008150 50007594 49996855 50000957 50015989 49991016 49992...

output:

27590099

result:

ok single line: '27590099'

Test #47:

score: 0
Accepted
time: 59ms
memory: 19252kb

input:

999889
50024513 49995426 50001634 49994020 49992344 49999031 50018366 49993971 49993421 50015587 50001208 49997667 49991456 50016407 50014263 49995357 49994129 50015714 49996043 50020651 49998898 50018093 50012518 49992667 50011112 49992966 49999842 50021203 50014661 49997558 49997180 50015274 50021...

output:

31205815

result:

ok single line: '31205815'

Test #48:

score: 0
Accepted
time: 56ms
memory: 19172kb

input:

999889
50000496 49994806 50011875 50001347 49985281 49997378 50004421 50008922 50000220 49997348 50020954 49998064 49992526 49995726 50002560 50001244 50005464 49998357 50019462 50016942 50008313 49999666 50002498 49994175 50002991 50014570 50000464 50007251 49994735 50012303 50023488 50009932 50016...

output:

27526685

result:

ok single line: '27526685'

Test #49:

score: 0
Accepted
time: 58ms
memory: 19256kb

input:

999715
99999999 100000000 99999996 99999996 99999997 99999999 99999998 99999999 99999997 99999999 99999999 99999996 99999997 99999996 99999998 99999997 99999997 99999999 99999999 99999998 99999999 99999999 99999999 99999997 99999997 99999997 100000000 99999999 99999996 100000000 99999998 99999998 99...

output:

52023124

result:

ok single line: '52023124'

Test #50:

score: 0
Accepted
time: 62ms
memory: 19200kb

input:

999401
100000000 99999996 100000000 99999998 99999998 99999998 99999996 99999998 99999998 99999999 99999998 100000000 100000000 99999997 99999996 99999999 99999997 99999996 100000000 99999996 100000000 99999996 99999999 99999996 99999999 99999999 99999998 99999996 100000000 99999996 99999998 9999999...

output:

38564907

result:

ok single line: '38564907'

Test #51:

score: 0
Accepted
time: 55ms
memory: 19164kb

input:

999150
90000000 90000001 90000002 90000003 90000004 90000005 90000006 90000007 90000008 90000009 90000010 90000011 90000012 90000013 90000014 90000015 90000016 90000017 90000018 90000019 90000020 90000021 90000022 90000023 90000024 90000025 90000026 90000027 90000028 90000029 90000030 90000031 90000...

output:

90000001

result:

ok single line: '90000001'

Test #52:

score: 0
Accepted
time: 59ms
memory: 19264kb

input:

999094
90999094 90999093 90999092 90999091 90999090 90999089 90999088 90999087 90999086 90999085 90999084 90999083 90999082 90999081 90999080 90999079 90999078 90999077 90999076 90999075 90999074 90999073 90999072 90999071 90999070 90999069 90999068 90999067 90999066 90999065 90999064 90999063 90999...

output:

90000002

result:

ok single line: '90000002'

Test #53:

score: 0
Accepted
time: 52ms
memory: 19196kb

input:

999047
90499523 90499522 90499521 90499520 90499519 90499518 90499517 90499516 90499515 90499514 90499513 90499512 90499511 90499510 90499509 90499508 90499507 90499506 90499505 90499504 90499503 90499502 90499501 90499500 90499499 90499498 90499497 90499496 90499495 90499494 90499493 90499492 90499...

output:

90000001

result:

ok single line: '90000001'

Test #54:

score: 0
Accepted
time: 43ms
memory: 19304kb

input:

999248
89504376 89504377 89504378 89504379 89504380 89504381 89504382 89504383 89504384 89504385 89504386 89504387 89504388 89504389 89504390 89504391 89504392 89504393 89504394 89504395 89504396 89504397 89504398 89504399 89504400 89504401 89504402 89504403 89504404 89504405 89504406 89504407 89504...

output:

89504377

result:

ok single line: '89504377'

Test #55:

score: 0
Accepted
time: 51ms
memory: 19324kb

input:

999204
90004000 90004001 90004002 90004003 90004004 90004005 90004006 90004007 90004008 90004009 90004010 90004011 90004012 90004013 90004014 90004015 90004016 90004017 90004018 90004019 90004020 90004021 90004022 90004023 90004024 90004025 90004026 90004027 90004028 90004029 90004030 90004031 90004...

output:

89754200

result:

ok single line: '89754200'

Test #56:

score: 0
Accepted
time: 59ms
memory: 19176kb

input:

999879
90004000 90003999 90003998 90003997 90003996 90003995 90003994 90003993 90003992 90003991 90003990 90003989 90003988 90003987 90003986 90003985 90003984 90003983 90003982 90003981 90003980 90003979 90003978 90003977 90003976 90003975 90003974 90003973 90003972 90003971 90003970 90003969 90003...

output:

89254093

result:

ok single line: '89254093'