CT25419

Lata and the Quiet coins

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the mulberry rows of Silkmead. Lata spreads the coins records across the table and picks up a sharp pencil. Task: Read n integers and print how many are strictly positive. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of positive values. Constraints: 1 <= n <= 646; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 191 6 0 0 10 3 1 4 8 7 2 3 4 8 4 5 8 7 2 7 2 10 7 4 0 10 2 3 5 9 5 7 7 3 7 8 8 8 2 4 0 4 10 2 7 1 10 5 2 9 2 2 10 9 6 3 8 6 4 6 0 4 5 7 1 7 6 9 0 9 1 4 10 8 4 4 6 6 10 5 5 6 10 10 1 8 10 5 5 9 10 5 5 4 10 1 3 3 6 3 1 0 7 6 0 5 0 5 7 3 0 1 1 1 10 4 0 3 1 9 8 7 2 8 3 1 8 2 2 4 5 10 7 5 4 3 0 7 8 1 1 8 10 4 2 10 10 4 0 3 8 2 0 6 7 7 3 4 1 0 5 7 5 5 7 3 6 8 5 5 9 6 4 9 0 10 8 9 1 6 1 7 0 2 0 9 2 10 2 7 4 8
Output: 173

Example 2:

Input: 386 1 4 10 0 10 0 6 6 9 5 8 0 1 6 8 7 6 9 4 4 6 10 9 9 0 4 7 10 9 7 2 9 6 7 6 7 9 4 0 7 0 5 10 6 3 0 0 3 1 7 3 9 1 8 8 10 6 2 3 9 0 10 10 2 5 10 9 5 10 6 9 6 8 5 4 9 7 9 5 9 2 10 3 8 8 9 3 5 0 4 6 10 6 8 7 8 7 9 10 7 5 2 6 3 4 3 9 4 1 0 10 9 7 9 7 0 8 6 10 8 6 8 6 9 8 5 2 4 7 10 8 6 7 6 3 3 3 3 7 5 4 8 5 0 10 4 0 7 8 5 2 4 0 5 8 9 3 10 4 7 7 4 7 2 3 2 9 2 3 8 5 4 7 7 6 3 4 2 9 4 10 8 9 5 2 8 9 8 9 5 2 5 0 9 5 6 4 8 4 9 2 8 1 10 5 3 0 5 9 7 2 3 7 9 6 3 4 8 2 2 1 7 6 10 8 9 8 2 10 7 9 0 2 0 6 0 8 10 2 7 1 10 7 7 5 10 9 2 9 9 5 6 8 1 3 10 7 6 7 2 5 10 2 3 9 8 6 0 4 8 7 6 1 2 0 2 8 3 10 9 4 8 2 4 5 3 9 10 5 8 3 9 10 4 6 10 0 8 1 6 2 10 2 5 9 2 9 5 1 9 5 0 9 2 2 7 8 8 1 4 2 10 9 3 0 0 6 4 10 1 8 8 1 2 9 2 5 1 3 7 10 7 7 2 4 6 5 9 3 9 6 10 5 2 1 2 3 9 9 7 7 5 1 10 6 0 3 10 9 2 3 7 4 8 5 9 7 6 5 …
Output: 358

Example 3:

Input: 179 0 7 0 0 7 10 10 6 3 2 5 10 1 1 5 5 7 3 8 10 6 9 6 4 3 0 2 6 0 4 6 9 2 4 4 8 1 7 3 3 2 9 3 1 9 3 5 4 6 2 7 8 0 5 0 3 0 5 1 10 0 6 6 4 3 1 10 2 4 0 8 8 8 5 0 3 8 5 8 6 2 4 0 5 6 9 3 4 5 9 9 2 4 4 1 3 0 4 9 10 10 4 1 0 7 2 7 9 5 8 4 5 9 0 0 9 1 2 0 8 10 0 7 9 4 2 7 4 8 4 4 7 2 3 6 4 7 9 6 6 5 8 10 4 3 3 1 7 0 3 0 7 2 4 5 3 10 5 6 7 4 9 10 6 2 1 8 8 0 7 7 0 9 4 0 4 3 7 0
Output: 155

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Lata and the Quiet coins - EASY Coding Problem | CodeTikki