CT891

Koda and the Topaz readings

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Koda found an old ledger of readings in the observatory attic at the snowberry thicket of Winterholt. The margin notes pose a precise question. 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 <= 39; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 24 370613 916354 671039 288505 702210 706194 981998 21039 37670 543213 237169 832855 496242 930327 583889 270562 904626 10709 400709 489927 448142 338729 516087 929916
Output: 16

Example 2:

Input: 28 293515 525967 337898 556760 260442 946262 814371 919733 798217 859563 731872 489971 554811 688394 36520 363927 918250 705509 595388 105190 309400 592312 212013 652713 272686 723710 920954 379452
Output: 22

Example 3:

Input: 22 496192 766839 121761 958342 186658 228612 667902 582455 188250 855561 873164 674991 573074 659043 77747 329410 682930 331047 678014 774537 357794 65839
Output: 12

Constraints:

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

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