CT1562

The Windward lanterns of Curator

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Curator runs the depot at the tundra station of Whitesnow. Today the books show a list of lanterns, and the numbers must be worked out before sundown. 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 <= 35; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 2 519186672 731191452
Output: 1

Example 2:

Input: 2 673574503 922007254
Output: 1

Example 3:

Input: 33 122800192 309266428 474197821 904470940 619916455 813197728 793027922 436893559 950338506 414812173 781579350 115571791 918250184 100177309 2151562 415182368 687598304 52231627 136268880 484977227 84029967 160973116 776850561 207268211 761070477 533176335 717677648 594185601 34200201 813286618 467581725 522645306 371041213
Output: 26

Constraints:

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

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