CT26569

Northern barrels Dominant Values

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Jace inherited the apothecary at the smokehouses of Brineport along with its curious bookkeeping system for barrels. Time to make sense of it. Task: Read n integers and print how many of the elements after the first are strictly greater than the first element. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of elements a[2..n] greater than a[1]. Constraints: 1 <= n <= 565; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 549 803 538 58 671 813 998 506 969 538 163 194 842 90 599 769 927 167 720 24 488 568 862 252 819 714 189 270 939 539 684 22 22 197 122 419 766 332 579 627 60 533 614 500 755 666 266 754 660 720 862 294 589 326 315 254 213 81 456 198 702 371 233 905 200 463 496 808 29 531 181 380 878 82 359 417 956 630 639 683 303 994 34 750 862 272 491 261 178 574 663 616 238 406 346 596 673 194 639 868 10 403 105 105 43 928 155 621 137 635 675 438 714 116 37 499 315 160 677 710 777 335 656 357 443 54 741 394 312 768 567 467 910 901 92 82 304 1 0 701 483 686 960 810 104 665 569 561 779 52 430 920 499 35 603 514 545 25 142 512 100 554 286 666 679 366 864 489 104 193 895 48 701 306 619 707 36 858 958 79 178 785 724 549 143 541 448 49 532 557 732 56 984 90 868 488 369 310 136 364 996 704 370 483 872 393 522 2…
Output: 104

Example 2:

Input: 552 620 300 501 654 490 790 196 878 441 34 23 560 941 461 672 834 747 397 940 306 915 36 61 104 429 652 418 548 804 503 698 230 447 362 489 758 705 543 720 898 614 751 297 362 290 863 803 701 537 43 289 311 656 19 827 147 228 265 789 893 492 650 236 48 349 408 539 980 316 299 113 796 912 869 822 549 525 966 722 843 869 840 356 677 961 974 688 463 966 576 697 364 642 415 400 717 176 434 768 341 736 797 775 447 78 228 123 361 954 486 668 714 609 303 200 630 831 356 575 145 859 402 958 339 251 11 256 283 443 693 43 213 127 107 559 122 705 675 881 710 258 845 939 832 2 678 684 33 1000 560 625 325 864 277 791 701 949 283 409 322 863 763 816 508 976 772 951 508 180 948 711 467 444 306 163 344 530 552 494 868 961 910 488 479 244 657 64 262 561 4 787 648 461 100 701 512 746 752 341 362 831 565 190…
Output: 209

Example 3:

Input: 19 165 297 305 283 368 780 248 404 570 713 198 331 237 971 817 355 360 517 696
Output: 18

Constraints:

1 <= n <= 565; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.