CT2278

Harish's lanterns Reckoning

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

In the honeycomb cliffs of Beeswick, Harish the reckoner keeps careful count of the lanterns. Schedule the next expedition, every figure matters. 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 <= 23; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 13 833594564 428352020 517806015 874033296 649289542 275052322 101361589 278081467 109125572 651476851 573643480 979832447 118407278
Output: 2

Example 2:

Input: 7 787224015 457269471 612551986 689915456 155207467 838227612 325713879
Output: 1

Example 3:

Input: 9 738274982 857568871 502841515 408444215 212498984 946361385 317337475 252792708 637741272
Output: 2

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Harish's lanterns Reckoning - EASY Coding Problem | CodeTikki