CT927

The Verdant Positive Count

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the lotus ponds of Tranquil Basin, Tailor records each tickets in a worn leather ledger. The guild wants answers, not guesses. 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 <= 53; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 42 -349903 -453092 -622015 -868940 -611940 -409993 -866137 -842963 -17328 -79794 -54328 -716239 -815581 -544120 -936634 -214837 -840845 -417386 -997006 -213454 -69655 -412122 -89817 -461375 -793294 -833144 -711667 -630678 -443586 -679077 -674616 -986017 -61747 -540070 -494357 -32695 -673385 -217259 -291903 -362562 -116930 -147610
Output: 0

Example 2:

Input: 24 -220486 -853456 -669118 -276298 -124446 -544584 -940376 -480096 -395830 -594032 -25396 -716806 -754788 -307703 -149528 -897838 -311039 -759514 -486128 -949983 -203749 -915402 -431502 -465724
Output: 0

Example 3:

Input: 27 -585744 -898177 -32065 -970292 -458400 -120047 -689317 -418149 -658502 -100461 -418091 -54756 -136187 -494945 -900352 -713670 -570279 -881930 -943594 -772554 -544286 -132429 -563390 -871286 -19086 -998596 -95580
Output: 0

Constraints:

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

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