CT1859

The Alabast Dominant Values

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

In the ivory gates of Alabast, Omkar the dispatch writer keeps careful count of the barrels. Compute the guild dues owed, 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 <= 88; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 78 -42 -42 -98 -55 -28 -87 -53 -18 -83 -4 -56 -52 -45 -42 -42 -16 3 -53 -67 3 -26 -47 1 -84 -59 2 -19 -16 -11 5 -100 -32 0 -77 -90 -42 -10 -96 -24 -64 -17 -37 -56 1 -37 -83 -76 -89 -10 -100 -82 -7 -7 -79 -89 -24 -5 -83 -17 -9 -77 -59 -16 -64 -18 -64 6 -93 -75 -91 -46 -67 -86 -26 -44 -2 -43 -6
Output: 34

Example 2:

Input: 10 -42 -44 -17 1 -89 3 -39 -38 -38 -23
Output: 7

Example 3:

Input: 11 -83 -77 -45 -29 -1 1 -94 -28 -86 -28 -1
Output: 8

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Alabast Dominant Values - EASY Coding Problem | CodeTikki