CT26874

Botanist and the Frosted lanterns

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Botanist found an old ledger of lanterns in the bakery attic at the coastal hub of Tidewater. 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 <= 526; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 114 -331471 -912185 -439833 -883410 -416062 -690690 -998417 -764428 -98264 -381110 -368041 -746016 -666302 -571337 -673381 -536865 -286178 -457828 -422480 -955125 -366529 -860355 -715600 -331858 -920456 -868412 -884958 -956643 -142995 -318867 -213208 -861722 -715693 -243542 -280573 -84530 -421344 -653053 -374192 -363751 -208474 -72603 -334144 -223665 -829513 -655489 -399540 -74366 -567231 -277693 -260343 -46493 -508243 -1671 -195230 -907890 -843952 -800619 -341317 -166613 -302171 -100123 -367781 -862729 -524049 -585450 -722584 -546441 -401081 -481346 -465838 -343777 -365242 -984561 -818552 -15030 -747287 -437104 -785998 -83023 -330625 -696707 -378972 -585230 -583674 -945478 -206304 -948143 -150353 -717927 -525826 -820099 -985390 -391331 -378038 -921014 -173718 -865919 -100193 -757535 -6018…
Output: 0

Example 2:

Input: 433 -950474 -933795 -509824 -835088 -837304 -160315 -980988 -267135 -298145 -329007 -30639 -849097 -331934 -372768 -173983 -537057 -628269 -586659 -993249 -842325 -160132 -233109 -439407 -218769 -35619 -390262 -460029 -321702 -651842 -588738 -956431 -890942 -307897 -563568 -175037 -985860 -987027 -117845 -98703 -329982 -943237 -754152 -649626 -282515 -415402 -878937 -420743 -767241 -30983 -772390 -154172 -769333 -467577 -239812 -960198 -443486 -196156 -994633 -6133 -152287 -619221 -980875 -134160 -162375 -122877 -464828 -97693 -461423 -233607 -95789 -246047 -754 -419033 -580250 -931737 -127987 -377508 -431380 -402783 -302130 -308943 -749779 -486901 -140789 -669025 -720993 -468263 -457415 -913637 -539938 -804462 -619437 -18469 -443236 -405514 -454802 -196738 -312753 -973555 -495382 -726824 …
Output: 0

Example 3:

Input: 50 -78084 -349916 -473655 -179490 -615149 -690389 -949665 -855161 -547288 -295737 -407318 -295543 -793224 -421056 -130188 -574644 -351032 -71643 -651586 -21458 -743514 -915303 -806250 -35899 -867697 -265963 -897617 -405428 -154461 -80340 -403856 -970581 -115249 -999045 -363610 -286144 -397491 -877575 -978126 -813068 -117426 -628475 -888749 -160127 -651239 -435776 -437737 -700814 -323993 -795185
Output: 0

Constraints:

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

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