QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#113070#3884. It's Time for a Montagelmq26052003AC ✓2ms7916kbC++20894b2023-06-16 09:49:052023-06-16 09:49:09

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 7712kb

input:

4
5 3 1 1
8 6 9 1

output:

4

result:

ok single line: '4'

Test #2:

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

input:

1
2
1

output:

0

result:

ok single line: '0'

Test #3:

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

input:

2
4 2
7 5

output:

3

result:

ok single line: '3'

Test #4:

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

input:

3
5 55 6
5 55 6

output:

0

result:

ok single line: '0'

Test #5:

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

input:

3
1 1 1
1 9 9

output:

1

result:

ok single line: '1'

Test #6:

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

input:

4
2 2 2 2
3 3 1 1

output:

1

result:

ok single line: '1'

Test #7:

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

input:

1
1
1000

output:

999

result:

ok single line: '999'

Test #8:

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

input:

5
1 2 3 4 5
5 5 5 5 5

output:

4

result:

ok single line: '4'

Test #9:

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

input:

5
5 5 5 5 5
9 8 7 6 5

output:

4

result:

ok single line: '4'

Test #10:

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

input:

911
396 655 290 118 174 787 441 598 117 375 128 827 153 765 524 6 388 843 130 699 559 933 32 505 575 934 615 296 529 715 769 1000 896 861 802 357 73 902 334 766 798 611 486 208 481 582 672 432 937 621 881 127 781 571 949 51 63 188 596 77 832 352 753 99 591 943 696 937 613 619 871 821 359 996 917 544...

output:

0

result:

ok single line: '0'

Test #11:

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

input:

956
504 568 591 447 985 986 648 577 186 289 850 173 469 454 953 482 830 139 967 193 754 850 508 469 804 463 321 766 36 373 556 474 417 319 712 849 718 866 638 433 606 637 558 258 135 97 484 104 696 312 961 386 372 417 614 479 772 688 517 924 576 370 618 503 409 748 975 48 927 870 828 787 977 444 935...

output:

0

result:

ok single line: '0'

Test #12:

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

input:

970
323 126 326 454 10 163 50 418 747 865 559 156 680 631 72 615 938 55 440 689 883 58 885 15 888 499 485 596 215 660 487 710 529 716 815 931 283 629 6 312 37 854 463 229 704 506 677 128 7 203 761 32 665 724 818 77 360 404 894 42 35 817 276 460 302 132 824 134 824 672 922 9 193 131 73 199 720 848 47...

output:

0

result:

ok single line: '0'

Test #13:

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

input:

902
847 595 77 11 356 284 12 413 975 815 31 689 303 657 564 565 249 216 10 266 447 470 789 901 757 966 179 708 907 88 472 908 840 561 378 729 404 797 80 470 441 167 631 614 268 36 869 975 95 72 389 811 512 499 819 971 431 392 41 627 736 76 120 341 613 716 726 821 648 372 315 240 509 835 181 886 125 ...

output:

1

result:

ok single line: '1'

Test #14:

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

input:

973
116 582 634 414 96 692 623 110 338 240 618 346 236 974 918 689 393 244 433 484 479 939 838 429 533 753 438 622 4 26 67 982 13 513 397 487 686 5 988 212 101 700 576 240 432 42 7 472 277 979 495 63 405 732 499 941 420 167 476 602 699 406 696 239 404 646 196 107 289 507 294 416 87 709 16 984 983 93...

output:

0

result:

ok single line: '0'

Test #15:

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

input:

961
314 445 746 108 170 890 125 687 635 182 238 367 488 279 473 638 41 461 241 794 725 296 377 114 142 990 792 791 399 663 716 173 924 56 229 89 560 832 395 461 269 944 321 854 318 106 845 304 940 447 236 636 948 246 441 393 186 283 100 741 681 965 153 322 141 260 331 686 391 649 666 54 407 357 502 ...

output:

0

result:

ok single line: '0'

Test #16:

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

input:

1000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

999

result:

ok single line: '999'

Test #17:

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

input:

1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...

output:

1

result:

ok single line: '1'

Test #18:

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

input:

983
693 637 517 203 369 521 90 6 596 22 514 635 134 899 177 378 576 595 777 269 907 498 337 622 354 234 172 118 696 394 613 948 211 141 481 67 571 561 229 347 109 121 699 255 277 29 49 364 519 123 193 538 470 166 442 325 323 149 317 154 902 277 662 367 232 323 119 3 236 671 44 260 299 296 618 269 30...

output:

238

result:

ok single line: '238'

Test #19:

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

input:

990
687 875 560 51 15 303 233 477 123 109 190 333 468 249 77 637 669 591 232 150 565 94 500 209 109 135 52 78 274 64 252 101 583 559 67 17 217 282 122 64 417 42 153 127 104 617 364 149 172 177 180 116 155 605 163 299 9 8 141 508 126 5 630 287 664 711 165 149 444 674 556 84 103 133 273 191 71 439 561...

output:

81

result:

ok single line: '81'

Test #20:

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

input:

946
148 225 861 615 90 469 77 98 724 269 564 346 238 867 80 482 201 314 518 443 312 413 581 41 41 374 550 52 60 546 547 332 955 28 181 41 543 12 84 38 512 190 331 106 404 251 374 557 14 359 139 360 4 299 697 201 148 846 821 101 587 637 273 415 400 649 209 583 900 527 74 34 472 875 382 76 416 38 194 ...

output:

12

result:

ok single line: '12'

Test #21:

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

input:

901
623 166 441 132 32 539 145 110 301 83 311 197 99 339 365 356 288 514 265 577 82 822 50 591 87 651 65 184 677 47 74 9 416 5 591 208 25 72 322 261 322 456 290 285 36 336 398 53 291 223 515 282 119 26 47 252 198 797 308 669 92 282 710 29 390 116 179 314 178 175 165 107 559 226 307 616 75 25 59 336 ...

output:

103

result:

ok single line: '103'

Test #22:

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

input:

975
789 36 662 106 192 282 278 873 259 360 619 253 595 296 642 17 8 83 231 30 47 220 167 116 39 387 200 339 112 209 287 55 113 822 226 625 710 265 398 175 416 121 529 486 109 58 86 261 697 431 136 12 38 76 227 445 800 160 138 26 98 58 38 244 347 19 405 118 669 335 682 421 210 339 723 369 117 311 645...

output:

138

result:

ok single line: '138'

Test #23:

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

input:

941
402 456 288 54 360 263 467 287 135 112 302 63 114 788 239 234 91 161 418 369 41 123 268 670 413 117 55 599 6 311 710 424 869 140 138 114 162 257 223 480 162 144 53 275 115 736 29 14 43 702 722 441 504 493 182 316 186 686 480 126 432 651 765 216 130 48 38 462 442 265 19 106 866 77 80 555 539 342 ...

output:

587

result:

ok single line: '587'

Test #24:

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

input:

977
580 86 575 616 54 793 536 146 413 33 145 494 464 148 325 132 328 345 379 258 306 608 656 152 449 905 601 124 387 338 57 593 337 765 523 443 22 225 489 515 222 133 57 585 331 834 112 882 45 343 50 590 310 115 3 546 292 587 426 54 574 397 15 171 186 688 123 173 35 92 407 249 90 481 158 240 7 171 7...

output:

389

result:

ok single line: '389'

Test #25:

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

input:

996
247 248 113 613 503 481 337 466 906 261 261 56 193 231 599 840 36 485 419 31 489 499 122 828 133 327 117 57 569 780 192 108 97 108 701 354 352 621 350 82 88 443 590 9 307 67 705 813 723 314 259 924 383 482 374 104 181 456 674 22 775 236 49 507 116 317 3 133 39 822 242 371 340 111 377 250 308 283...

output:

384

result:

ok single line: '384'

Test #26:

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

input:

915
198 100 222 127 373 366 578 657 715 198 308 306 59 829 197 75 42 837 511 238 711 450 387 219 526 145 343 729 265 238 414 234 454 384 529 60 132 608 354 280 522 566 124 147 94 120 181 506 245 119 133 528 547 94 96 103 467 2 287 558 597 356 86 446 35 171 333 304 319 40 792 407 100 181 415 536 175 ...

output:

668

result:

ok single line: '668'

Test #27:

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

input:

995
129 789 405 163 365 295 629 458 283 577 591 335 151 170 88 327 93 66 241 235 99 598 111 84 441 436 350 958 222 167 103 360 410 119 37 496 369 507 718 147 578 404 84 40 46 151 69 67 142 436 127 201 33 6 747 860 643 828 901 830 381 81 205 449 279 482 87 329 632 392 388 51 813 396 131 301 969 95 73...

output:

834

result:

ok single line: '834'

Test #28:

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

input:

923
250 704 75 674 579 716 932 342 190 652 529 311 428 691 652 261 8 730 849 409 860 125 505 957 823 84 252 4 603 807 213 671 64 850 837 338 900 37 961 131 118 652 156 598 349 530 988 329 118 479 954 199 311 290 745 88 666 265 910 97 300 851 343 370 874 446 696 196 880 311 422 4 653 942 163 336 181 ...

output:

400

result:

ok single line: '400'

Test #29:

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

input:

960
216 316 222 702 235 196 913 253 984 305 738 69 32 620 240 555 748 985 601 975 651 150 239 221 354 59 738 653 609 49 473 337 990 221 525 943 883 738 526 859 517 970 562 56 411 52 741 135 226 353 551 924 419 70 654 823 879 457 447 643 134 772 598 122 777 89 802 309 708 165 823 563 813 658 532 149 ...

output:

60

result:

ok single line: '60'

Test #30:

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

input:

990
562 449 641 297 856 624 243 639 382 851 236 681 368 724 791 368 78 733 728 375 720 219 364 141 68 707 584 301 927 652 371 102 384 166 379 695 54 576 286 164 742 173 292 826 13 452 528 348 419 24 86 928 663 558 253 334 624 868 496 133 686 408 170 642 301 902 415 527 849 541 838 128 898 893 204 93...

output:

0

result:

ok single line: '0'

Test #31:

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

input:

983
530 725 921 363 695 812 803 425 101 505 269 968 620 189 456 742 948 341 325 439 958 735 453 518 560 434 667 54 323 563 387 797 287 202 357 148 923 108 591 961 681 495 312 149 823 962 565 543 412 980 418 115 42 748 880 298 136 424 373 630 833 437 865 250 757 45 872 545 898 62 517 854 668 131 882 ...

output:

0

result:

ok single line: '0'

Test #32:

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

input:

993
722 223 440 228 208 292 84 716 506 45 27 726 600 771 137 259 196 349 755 418 139 57 611 484 152 384 733 311 951 15 668 979 272 532 936 21 175 812 366 419 339 213 428 921 121 498 725 684 352 55 680 877 153 157 500 69 411 427 321 734 799 263 257 36 710 411 682 761 493 386 10 864 768 776 154 563 28...

output:

0

result:

ok single line: '0'

Test #33:

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

input:

944
466 795 485 439 572 268 99 478 580 135 935 273 289 352 896 276 932 783 446 676 461 310 997 429 308 701 696 751 263 498 134 552 361 515 72 339 166 640 951 256 148 532 446 859 416 415 130 648 333 813 384 452 315 229 676 556 957 183 886 660 914 884 73 567 726 326 46 659 386 659 889 918 302 281 174 ...

output:

0

result:

ok single line: '0'

Test #34:

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

input:

965
515 983 689 670 956 355 456 485 965 806 155 617 319 407 600 260 932 773 623 140 943 236 35 403 994 723 353 330 47 469 94 276 487 162 524 720 312 899 708 378 542 883 989 599 465 714 312 615 71 941 110 94 648 800 843 572 827 312 667 368 493 722 587 153 630 284 785 192 919 303 202 662 846 845 398 6...

output:

464

result:

ok single line: '464'

Test #35:

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

input:

998
980 434 523 34 896 733 935 841 674 689 940 172 378 135 243 975 599 887 416 983 5 185 566 514 353 358 117 544 811 826 498 307 242 735 629 484 466 89 693 304 320 371 707 931 593 86 589 704 101 520 188 880 672 717 86 926 715 357 211 455 77 926 965 528 582 312 51 939 192 603 192 714 342 845 391 387 ...

output:

0

result:

ok single line: '0'

Test #36:

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

input:

949
838 653 809 66 283 641 523 50 220 733 235 451 222 800 337 46 670 296 57 958 966 81 934 694 826 713 82 64 752 948 934 777 208 114 467 636 702 954 880 305 74 314 697 8 756 568 466 326 934 453 544 866 354 397 466 971 752 728 694 413 208 172 325 863 453 692 953 757 893 55 887 415 342 603 394 1 995 7...

output:

80

result:

ok single line: '80'