CT21849

The parcels Positive Count Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the mountain city of Highreach as Harish unrolls the day's manifest of parcels. The tally will decide the next shipment. 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 <= 583; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 474 -137961 -190170 -632116 -31678 -755574 -808951 -924041 -150369 -7923 -171387 -223290 -2540 -775434 -965867 -887114 -681526 -849461 -449766 -587881 -323613 -654771 -329996 -218415 -525269 -418854 -490909 -421025 -907740 -371784 -42490 -6111 -476520 -585444 -276187 -53321 -334438 -408609 -930694 -844365 -215411 -557311 -835143 -582397 -783813 -687258 -768458 -103584 -325076 -104659 -656456 -168909 -366816 -134836 -434551 -507811 -888792 -107672 -180459 -847218 -934531 -194297 -73719 -82417 -865005 -760280 -99075 -657701 -651447 -615567 -262353 -311036 -42999 -538034 -296978 -122068 -304172 -193396 -516191 -463692 -1195 -59644 -792079 -958062 -984523 -51758 -312825 -679901 -361623 -595360 -192761 -949171 -949044 -74734 -702522 -790125 -547664 -598313 -537887 -529178 -328619 -124347 -47744…
Output: 0

Example 2:

Input: 372 -954701 -838295 -526494 -398541 -370149 -589007 -960148 -295846 -127461 -896979 -821819 -366513 -809441 -533953 -346913 -685806 -885165 -706482 -111020 -283757 -134403 -211738 -11883 -255322 -132766 -303266 -963059 -975491 -801546 -584316 -521508 -215617 -100931 -257203 -947961 -51812 -381599 -60967 -837185 -510484 -426897 -597701 -292416 -591931 -171063 -984981 -437779 -71075 -703083 -666599 -300877 -568139 -579371 -188723 -18125 -107323 -379587 -82317 -843965 -205346 -535420 -535328 -746119 -480910 -645422 -373806 -541069 -978207 -240093 -951872 -781472 -821876 -316382 -377509 -473298 -517465 -212981 -940370 -940695 -210113 -755272 -601148 -583222 -252168 -612421 -123082 -897672 -120678 -557750 -321354 -430580 -763339 -976066 -333783 -850267 -396843 -697842 -757596 -642364 -472369 -2…
Output: 0

Example 3:

Input: 200 -587084 -62796 -548151 -781046 -941258 -932449 -170721 -944819 -771956 -937578 -492408 -441787 -479134 -229562 -695224 -850410 -231796 -313851 -971846 -917120 -888108 -146573 -335666 -564020 -41702 -139641 -814155 -816631 -963195 -487886 -37552 -101020 -705868 -3341 -713547 -802570 -521147 -451942 -921470 -577008 -646675 -42676 -17387 -634566 -904952 -729724 -634666 -853503 -949089 -488218 -571312 -812802 -828960 -985922 -31332 -576745 -826444 -696275 -363149 -85395 -981194 -99891 -501528 -969395 -841038 -453666 -934135 -142152 -157154 -953351 -360995 -942687 -79811 -609249 -399770 -590177 -880191 -451902 -924712 -688879 -594556 -118372 -932952 -778074 -32704 -403311 -88197 -835790 -778408 -497342 -767853 -525643 -554175 -82167 -210759 -92011 -433488 -652163 -244591 -655068 -230626 -81…
Output: 0

Constraints:

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

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