CT1383

Last crates of Tinker

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Every season at the salmon ladder of Rushing Falls, someone must reconcile two mismatched ledgers. This year the task falls to Tinker, armed only with the crates register. 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 <= 73; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 31 860994 141222 98237 64390 454456 342707 795265 511065 537340 432347 806048 44639 552917 801290 184108 567988 445732 646751 680650 933859 871696 35723 707428 584419 107934 370927 264449 878057 650767 692929 386231
Output: 3

Example 2:

Input: 57 299399 312597 838852 426135 249994 206757 536981 460248 335490 53671 671220 114098 821805 687145 269532 466874 834998 194018 750944 386247 351061 502097 404642 550633 940871 195905 162029 318484 960651 214694 182389 926109 105083 734240 91299 56876 224945 22691 347333 942710 33920 884183 589885 374780 935486 471361 125122 167321 387467 107915 117793 666461 860459 59948 297422 853976 962496
Output: 34

Example 3:

Input: 40 600850 402340 916664 174977 266399 766557 444799 608827 812492 241121 510532 208216 781379 955790 10413 898341 5551 512378 118964 245305 521454 52799 800152 935280 101944 975249 559935 291390 134767 465566 89871 393528 663619 167963 5781 882274 423681 752392 743517 684795
Output: 15

Constraints:

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

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