QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#527982#6983. ExamTAhmed33#65 51ms102324kbC++201.1kb2024-08-23 01:18:482024-08-23 01:18:48

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 14
Accepted

Test #1:

score: 14
Accepted
time: 0ms
memory: 3708kb

input:

2
2 1
1 2

output:

1

result:

ok single line: '1'

Test #2:

score: 14
Accepted
time: 0ms
memory: 3628kb

input:

4
2 2 3 2
2 2 1 1

output:

2

result:

ok single line: '2'

Test #3:

score: 14
Accepted
time: 0ms
memory: 3716kb

input:

7
8 1 8 4 4 2 2
3 3 4 5 3 8 3

output:

1

result:

ok single line: '1'

Test #4:

score: 14
Accepted
time: 0ms
memory: 3728kb

input:

10
1 2 1 1 1 1 2 2 2 2
1 3 3 1 1 1 2 3 3 3

output:

5

result:

ok single line: '5'

Test #5:

score: 14
Accepted
time: 0ms
memory: 3600kb

input:

10
1 1 1 3 2 3 4 2 1 4
2 3 1 4 3 3 1 4 2 4

output:

6

result:

ok single line: '6'

Test #6:

score: 14
Accepted
time: 0ms
memory: 3736kb

input:

10
10 9 8 7 6 5 4 3 2 1
4 5 7 3 3 6 10 2 9 9

output:

3

result:

ok single line: '3'

Subtask #2:

score: 0
Runtime Error

Test #7:

score: 12
Accepted
time: 0ms
memory: 22740kb

input:

1000
893776344 787725810 291017493 647342304 137945499 287626579 723898844 756587043 756587043 676427946 309067318 911812899 477531059 528842104 14133487 333005260 20588011 101004400 821063755 20588011 309067318 98607630 581609603 275810952 400342723 477531059 342507300 511996437 417465600 528842104...

output:

105

result:

ok single line: '105'

Test #8:

score: 0
Runtime Error

input:

20000
967568274 906912781 374963231 967568274 36544566 147240358 791028002 967568274 147240358 384205945 374963231 147240358 91008401 36544566 36544566 967568274 791028002 677262194 36544566 906912781 36544566 147240358 36544566 906912781 967568274 147240358 91008401 791028002 791028002 147240358 67...

output:


result:


Subtask #3:

score: 13
Accepted

Test #15:

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

input:

11
3041944 61317685 78688333 81175303 130536594 292412314 325285502 343151428 424440052 673288413 953725903
673288413 3041944 292412314 81175303 424440052 673288413 78688333 61317685 61317685 81175303 3041944

output:

3

result:

ok single line: '3'

Test #16:

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

input:

500
3668668 4325921 4509621 5944055 8575750 10759033 11078400 11246529 12143181 12548421 13391180 20345732 23537463 26347810 26479209 27810637 30271108 31518852 32395198 38637058 39168160 40222408 41153959 41349508 41740790 42603425 43947200 44478678 51967341 54776367 55167907 56662618 58196672 5898...

output:

36

result:

ok single line: '36'

Test #17:

score: 13
Accepted
time: 8ms
memory: 43684kb

input:

2000
63102 1484106 2564192 3036059 3961510 4063868 6332689 7533917 7815974 7912528 8388316 8427766 8537700 8733490 9030041 9529616 9585265 9745669 9886090 11132856 11588369 12535400 13080618 13082266 14035610 14368522 14847595 15408981 17015895 17106980 17161884 17345258 18302332 18507341 19166840 1...

output:

83

result:

ok single line: '83'

Test #18:

score: 13
Accepted
time: 20ms
memory: 99360kb

input:

4800
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 101...

output:

253

result:

ok single line: '253'

Test #19:

score: 13
Accepted
time: 27ms
memory: 101900kb

input:

5000
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 101...

output:

136

result:

ok single line: '136'

Test #20:

score: 13
Accepted
time: 20ms
memory: 101900kb

input:

5000
34859 270054 298207 494295 681159 793401 873269 975177 999475 1214819 1381745 1526808 1594852 1674575 1802030 1955792 2077512 2311706 2314033 2338479 2684149 2689243 2708833 2734451 2910437 2944595 2958628 3114420 3204876 3365527 3395504 3426475 3728421 4420003 4558076 4635625 4637884 4674359 4...

output:

129

result:

ok single line: '129'

Subtask #4:

score: 0
Runtime Error

Test #21:

score: 23
Accepted
time: 12ms
memory: 101920kb

input:

5001
800050172 780027702 124135194 387853104 977824384 320789670 21443908 977782080 529322873 249594077 502660735 275232530 66657127 693254070 715334742 931851416 21491162 761549796 391880875 711351444 507438497 638887208 163721472 144212397 276855401 39234094 357488574 127062198 920707960 77974348 ...

output:

12

result:

ok single line: '12'

Test #22:

score: 0
Runtime Error

input:

40000
275867217 889462518 357575715 37771705 471086633 271112163 1453570 232014946 871875695 385622264 275479180 743970548 753190427 196599899 186139123 821229114 762380074 554490919 816664496 43911911 424267407 589740246 714092725 954750466 995074662 485623719 668771270 858324934 600264300 29016606...

output:


result:


Subtask #5:

score: 16
Accepted

Dependency #1:

100%
Accepted

Test #31:

score: 16
Accepted
time: 0ms
memory: 3660kb

input:

11
957465832 86046008 585749322 392102859 828774852 957465832 305868549 284132339 284132339 392102859 86046008
957465832 284132339 305868549 284132339 614919933 828774852 614919933 828774852 828774852 392102859 451902542

output:

2

result:

ok single line: '2'

Test #32:

score: 16
Accepted
time: 0ms
memory: 5868kb

input:

40
768720049 192121352 192121352 192121352 768720049 768720049 768720049 768720049 192121352 192121352 192121352 192121352 192121352 768720049 192121352 768720049 768720049 192121352 768720049 768720049 192121352 192121352 768720049 192121352 192121352 192121352 768720049 768720049 768720049 7687200...

output:

30

result:

ok single line: '30'

Test #33:

score: 16
Accepted
time: 1ms
memory: 6072kb

input:

100
723080542 723080542 31510193 723080542 723080542 548920890 548920890 922636730 548920890 922636730 31510193 31510193 31510193 548920890 922636730 548920890 922636730 922636730 548920890 723080542 31510193 922636730 922636730 31510193 31510193 31510193 922636730 723080542 31510193 922636730 72308...

output:

52

result:

ok single line: '52'

Test #34:

score: 16
Accepted
time: 0ms
memory: 7912kb

input:

200
158075678 797263276 672708071 672708071 793712511 345945728 345945728 797263276 136816898 797263276 797263276 404679282 130731803 130731803 672708071 158075678 130731803 797263276 456646622 793712511 158075678 136816898 158075678 456646622 404679282 456646622 902143499 345945728 793712511 130731...

output:

58

result:

ok single line: '58'

Test #35:

score: 16
Accepted
time: 1ms
memory: 9844kb

input:

200
87 67 99 96 36 71 21 41 24 66 66 21 85 23 63 92 100 68 6 39 35 4 93 84 31 20 94 12 50 64 85 88 83 36 83 18 58 55 10 81 73 27 53 9 49 67 100 49 35 57 39 21 61 31 5 91 3 98 55 4 14 39 91 48 26 73 17 83 27 78 15 99 4 67 8 53 34 59 53 20 68 43 40 80 25 96 70 79 94 76 82 59 67 72 6 92 96 22 75 75 51 ...

output:

16

result:

ok single line: '16'

Test #36:

score: 16
Accepted
time: 1ms
memory: 7964kb

input:

200
791177414 387959752 438828510 239974764 95436664 584187329 973752883 306995704 306995704 438828510 57604161 143140399 603550158 584187329 239955780 208727395 520097082 801618740 498305259 791177414 700767685 673879197 673879197 143140399 256580072 673879197 256580072 142716669 291891314 13086575...

output:

9

result:

ok single line: '9'

Test #37:

score: 16
Accepted
time: 1ms
memory: 8232kb

input:

200
174644619 316841029 291545434 291545434 307994781 656305717 913284657 436473031 20588011 405780287 339281300 647342304 21690698 165867916 410660107 405780287 807696335 76201901 763025789 405780287 511996437 918381770 125175827 656305717 1816497 756587043 174809530 262236048 343525090 647342304 9...

output:

8

result:

ok single line: '8'

Test #38:

score: 16
Accepted
time: 1ms
memory: 8196kb

input:

200
199 198 197 195 193 193 191 191 190 190 189 186 183 181 181 180 180 179 178 177 176 173 172 169 166 160 159 159 159 158 156 155 155 155 154 153 153 151 150 150 149 148 147 146 145 144 135 134 132 132 130 129 128 127 126 126 126 126 125 123 123 122 121 121 120 120 119 118 118 116 115 113 112 111 ...

output:

34

result:

ok single line: '34'

Subtask #6:

score: 22
Accepted

Dependency #3:

100%
Accepted

Dependency #5:

100%
Accepted

Test #39:

score: 22
Accepted
time: 0ms
memory: 8236kb

input:

201
161 128 84 125 44 179 103 1 44 135 45 110 162 10 42 201 198 127 174 199 7 196 175 147 21 64 181 91 71 195 195 30 121 77 154 164 4 6 114 47 140 158 106 50 118 98 201 114 23 123 61 30 67 185 176 87 48 106 128 118 99 121 97 169 147 50 131 101 55 194 147 144 100 2 143 16 99 142 79 71 63 139 100 79 1...

output:

5

result:

ok single line: '5'

Test #40:

score: 22
Accepted
time: 0ms
memory: 24232kb

input:

1001
227 87 952 174 992 353 210 788 741 541 674 521 424 189 210 768 956 206 429 128 113 190 845 492 849 743 71 680 478 433 723 394 209 674 567 200 716 776 987 455 6 349 665 119 227 874 887 181 79 314 1000 882 193 843 372 40 274 133 410 751 565 131 144 773 494 400 662 208 866 648 662 871 996 15 679 2...

output:

8

result:

ok single line: '8'

Test #41:

score: 22
Accepted
time: 51ms
memory: 101920kb

input:

5000
343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 343884162 34388...

output:

5000

result:

ok single line: '5000'

Test #42:

score: 22
Accepted
time: 19ms
memory: 102188kb

input:

5000
866569676 602526089 602526089 602526089 602526089 866569676 602526089 8845266 8845266 602526089 602526089 8845266 866569676 8845266 866569676 602526089 8845266 866569676 8845266 866569676 8845266 602526089 602526089 866569676 866569676 602526089 602526089 8845266 602526089 866569676 602526089 6...

output:

2916

result:

ok single line: '2916'

Test #43:

score: 22
Accepted
time: 21ms
memory: 101904kb

input:

5000
379095267 430825181 727653595 458394833 247289947 59135189 101494535 379095267 247289947 546647039 65379384 65379384 120739390 137201728 120739390 101494535 120739390 379095267 120739390 65379384 128036009 458394833 272476213 120739390 835262445 272476213 379095267 430825181 647324875 647324875...

output:

891

result:

ok single line: '891'

Test #44:

score: 22
Accepted
time: 3ms
memory: 101848kb

input:

5000
72 195 15 156 105 42 80 199 25 59 65 63 77 122 190 137 68 154 120 6 29 7 148 13 51 94 27 32 102 167 12 125 113 27 80 169 20 111 167 45 169 32 59 45 153 49 181 172 2 101 177 182 59 76 146 109 169 125 140 71 91 103 195 4 81 27 172 101 137 139 97 106 122 155 102 74 155 83 197 109 135 173 42 193 49...

output:

166

result:

ok single line: '166'

Test #45:

score: 22
Accepted
time: 4ms
memory: 101924kb

input:

5000
17 1 2 5 1 16 3 2 1 3 3 15 5 5 4 15 18 5 1 1 1 2 7 3 3 5 1 19 4 5 17 14 13 1 12 23 13 21 4 1 2 22 9 16 6 6 12 6 2 12 6 1 4 6 6 3 5 2 2 1 5 23 6 2 4 8 13 1 20 8 20 8 4 2 15 9 20 3 1 23 2 12 4 4 13 4 2 5 1 2 16 1 9 1 8 8 18 3 3 10 2 14 15 18 11 8 4 7 13 4 12 8 1 1 4 16 3 8 6 16 11 1 17 12 4 5 7 2...

output:

1329

result:

ok single line: '1329'

Test #46:

score: 22
Accepted
time: 24ms
memory: 101928kb

input:

5000
770102500 938475311 345466769 100320284 80053413 80708368 490838070 822063045 394072823 238323271 494328418 323955770 852972280 505993661 782353473 738986800 999243450 97790263 867279165 450117055 7681717 389276573 518112243 996728106 342566111 528340371 703456206 758401654 258375871 722869867 ...

output:

8

result:

ok single line: '8'

Test #47:

score: 22
Accepted
time: 27ms
memory: 101840kb

input:

5000
1 1 3 3 3 4 6 7 8 8 9 10 10 11 13 13 14 14 14 15 16 16 17 17 19 19 20 21 21 21 22 23 24 24 24 24 28 30 30 30 31 32 33 33 34 35 35 37 37 40 40 40 41 42 45 45 46 46 47 47 48 48 48 50 51 55 55 56 57 57 59 67 67 69 69 72 72 74 78 79 80 81 81 82 82 84 85 85 87 88 88 88 89 91 95 96 97 97 99 99 101 10...

output:

193

result:

ok single line: '193'

Test #48:

score: 22
Accepted
time: 27ms
memory: 101904kb

input:

5000
999895453 999895453 999829759 999829759 999608016 999608016 999530873 999477827 999108497 999055049 999055049 998975441 998863914 998863914 998516645 997846551 997846551 997846551 997836375 997836375 997267043 997267043 997267043 996220605 996117065 996117065 995752827 995752827 995752827 99575...

output:

198

result:

ok single line: '198'

Test #49:

score: 22
Accepted
time: 22ms
memory: 101960kb

input:

5000
4999 4997 4983 4982 4979 4977 4976 4975 4973 4971 4969 4967 4964 4963 4963 4961 4948 4948 4947 4945 4944 4943 4939 4937 4937 4937 4937 4934 4933 4932 4932 4929 4929 4929 4927 4926 4926 4922 4920 4919 4919 4918 4916 4916 4909 4909 4908 4903 4902 4900 4897 4896 4896 4894 4893 4892 4889 4886 4886 ...

output:

213

result:

ok single line: '213'

Test #50:

score: 22
Accepted
time: 16ms
memory: 102324kb

input:

5000
243421 377659 575597 578083 578083 690719 801672 801672 999316 1394378 1453570 1453570 1533335 2469734 2516731 2689667 2689667 3211401 3238504 3238504 3474543 3689433 4074020 4265951 4307532 4772526 4772526 5036170 5439179 5721813 5854754 5854754 6624673 7215621 7475851 8069876 8148782 8285036 ...

output:

215

result:

ok single line: '215'