CT1910

Harish Counts the barrels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Harish found an old ledger of barrels in the cooperage attic at the sulphur springs of Brimstone. The margin notes pose a precise question. 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 <= 87; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 12 46026040 38595482 149054836 233975596 91333696 144278477 663441908 529704292 658876600 958276817 322720304 978161162
Output: 12

Example 2:

Input: 8 338307906 689264494 412946490 527486954 631919637 775554300 704287118 336983492
Output: 8

Example 3:

Input: 72 239202879 385602905 207601409 774529259 160224158 670364869 681975006 538337269 708725358 236504855 708441726 923956041 496053921 172250562 301572820 22444203 245975025 109394217 786913945 929527546 730998541 884913070 236038472 870995241 382886390 358385072 932957889 409703947 562483188 233875158 54101334 688791280 837772730 457832469 102630648 292878450 501659387 55603722 180370142 580624243 912735992 977714839 484781462 124738279 881796403 98643391 641896760 93972315 824126163 870472710 684284272 290711144 578092635 728022695 435552274 797183973 127810116 788966521 909991723 985925028 180902550 381320568 184801081 659766540 358644823 446381014 634687800 711109146 141533530 65501869 802886590 269429272
Output: 72

Constraints:

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

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