CT22551

Neel's Ledger of crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

In the pine barrens of Needlepoint, Neel the ledger master keeps careful count of the crates. Prepare the winter inventory, every figure matters. 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 <= 585; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 463 -68 -75 -31 -67 -69 -76 8 -76 -39 -1 3 -78 -25 -85 0 1 -17 -5 -47 -71 -98 -99 2 -97 -90 -8 -36 -63 -59 -11 -31 -20 6 -91 -30 -36 -55 1 0 -73 -14 -31 -48 -53 -98 -22 -26 -55 -46 -67 -16 -10 -35 -60 4 9 -55 -49 -40 -57 -75 -91 -97 -12 -90 -5 -19 -33 -87 -61 -69 -85 -1 -79 -11 -84 -60 1 -63 -53 -41 -42 -28 -13 -75 -39 -77 -65 6 -48 9 -5 -21 -50 -64 -57 -78 -5 -65 -2 -64 -60 -80 -71 -67 -97 -1 -72 -98 9 -91 -36 -73 -8 -30 -7 -38 -34 -69 2 -93 -68 -30 5 -49 -58 -100 -30 -80 -20 -18 -11 -21 -65 -86 -5 -8 -65 -47 -54 -81 -4 -74 -11 -96 -81 -62 -74 -73 -95 -85 -4 -59 -24 -5 -22 -38 5 -75 -44 -90 -82 5 -81 -98 -62 -68 -100 -54 -87 8 -64 -18 -22 -29 -62 -84 -26 -75 -47 -53 -25 -6 -72 -44 -39 -60 -4 -17 -10 -99 -66 -53 -99 -5 -81 -42 -1 -30 -54 -13 -33 -21 -35 -64 -91 -8 -100 -15 -30 9 -7 -95 -14…
Output: 39

Example 2:

Input: 231 4 -38 -94 -46 -31 -16 7 0 -11 -65 -79 8 0 -78 -71 -93 -46 -9 -21 1 -76 -66 -18 -53 -95 -12 -85 -8 1 -16 -99 -20 -86 -61 -75 -55 -50 -68 -80 -25 -98 -96 -60 -35 -77 -10 -42 -34 -58 -57 -10 -4 -13 -98 -27 -55 -73 -60 -26 -27 -70 -73 -84 7 -89 -40 -30 -100 -19 -26 -20 -1 -63 -19 -58 -56 -10 -39 -79 -35 -65 -78 -19 -20 -13 4 -78 -75 10 -75 -63 -71 -99 -58 -52 -41 -8 -47 -39 0 -37 -83 -63 10 -79 -49 -53 -98 -41 -43 -100 -23 -16 -73 -97 -49 -91 -28 -8 -83 -18 -77 -74 -37 -19 9 -17 1 -77 -1 -30 -46 -95 -80 -11 4 -52 -18 -61 -33 -78 9 -79 -26 -89 4 -51 -18 -70 -57 -59 -6 -34 -49 -66 -63 -91 -11 -76 -47 -79 -81 -81 -77 -26 -81 -49 -43 -39 -20 -25 -8 -6 -22 -75 -87 -38 -34 -44 2 7 -79 -74 -74 -23 -7 -91 -96 -69 -14 -82 -80 -48 -13 -14 -59 -52 -79 -9 -70 -91 -70 1 -61 -74 -27 -64 -31 -34 4 -79 -3…
Output: 20

Example 3:

Input: 237 -31 -12 -30 6 -2 -28 -25 -24 -10 -42 7 -38 4 -54 -97 -89 -93 -85 -19 -52 -60 -78 -86 -33 -83 -90 -78 -67 -20 -21 -29 9 -53 -93 3 -3 -81 -72 -99 -64 -53 -95 -29 -27 -34 -1 -25 -26 -4 -12 9 -48 -20 -79 -66 -28 6 9 -56 -89 -85 -10 -79 -1 -65 -31 -10 0 -44 -100 -73 -82 -48 -67 -40 -72 -17 -40 -61 -14 -48 -98 -84 -78 -74 -58 -45 -58 -37 -15 -33 -51 -70 -100 -96 9 -48 -86 -38 -23 -8 -71 -35 -8 -21 -23 -22 -17 -12 -58 -4 -54 -33 -37 -16 -100 -26 -4 -62 -12 -68 -44 -31 10 -40 -94 3 -88 4 -78 -52 -67 -61 -61 -41 -95 -48 -28 -66 -96 8 -43 10 -2 -91 -47 -75 -23 -39 -4 -12 -66 -31 -8 10 -95 -17 -67 -66 -53 -19 -73 -24 2 7 7 3 -8 -4 -29 -63 -82 -73 -85 6 -19 -45 -63 -64 -36 -44 -30 -99 -93 -71 -96 -70 -51 -13 4 -98 -42 -83 -65 -77 -82 -47 -22 -61 -15 -37 -43 -22 -44 3 -58 -47 -90 -66 -10 -65 -99 -4…
Output: 24

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Neel's Ledger of crates - EASY Coding Problem | CodeTikki