CT2048

Arjun's Dominant Values Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Arjun inherited the mint at the marble forum of Argentium along with its curious bookkeeping system for tickets. Time to make sense of it. 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 <= 42; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 38 -281494 -713425 -837960 -730353 -591227 -732556 36 -741142 -443651 -549617 -128445 -462984 -759308 -212038 -620333 -462122 -895237 -512694 -150037 -101339 -516356 -415535 -273968 -516842 -378379 -305746 -702010 -557797 -999394 -882637 -712801 -64967 -138055 -835969 -246321 -437062 -610109 -597804
Output: 9

Example 2:

Input: 4 -64262 -325801 -987111 -699751
Output: 0

Example 3:

Input: 14 -897130 -83661 -13276 -609431 -458066 -597909 -404568 -571113 -900222 -627521 -10263 -260745 -467714 -402333
Output: 12

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Arjun's Dominant Values Ledger - EASY Coding Problem | CodeTikki