CT27313

The Ruby crates of Botanist

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the wren hedges of Thimblewick. Botanist spreads the crates records across the table and picks up a sharp pencil. 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 <= 534; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 474 -44786 -7042 -975306 -353460 -901017 -887152 -207156 -846430 -94161 -632785 -558484 -177268 -273850 -918787 -232549 -860491 -222206 -95632 -448447 -466748 -30896 -568270 -644371 -439777 -716550 -311766 -958143 -708922 -717056 -567627 -193 -654537 -224868 -425427 -931166 -543984 -949841 -103853 -822749 -402239 -839797 -386956 -477757 -98510 -652993 -126849 -663702 -686812 -990671 -973897 -71455 -531827 -635076 -409760 -383596 -590701 -811583 -229612 -579522 -639666 -666670 -251871 -70679 -477687 -717896 -678862 -973552 -813477 -842289 -428033 -805580 -62556 -993999 -935428 -989065 -723771 -633088 -141639 -506935 -363051 -669932 -922969 -147032 -392189 -81587 -639488 -924630 -882148 -209223 -232923 -216731 -117305 -562111 -273590 -397441 -428580 -796122 -670042 -917947 -323497 -835890 -3…
Output: 1

Example 2:

Input: 90 -446741 -280731 -508659 -414051 -710957 -689275 -537537 -262917 -605199 -354005 -135612 -209000 -391824 -379283 -17819 -592919 -518018 -11806 -638998 -106973 -972982 -230717 -337513 -259258 -464328 -531389 -44102 -944773 -325468 -408030 -379359 -738171 -87703 -273918 -306546 -532990 -356002 -969644 -295558 -789821 -467285 -192759 -468057 -994178 -890347 -85357 -590195 -824107 -251973 -444405 -245166 -932862 -210388 -137713 -881667 -572197 -178122 -228988 -364920 -865131 -42164 -70379 -79166 -609938 -534111 -468776 -486282 -62480 -771427 -567222 -166782 -141041 -877654 -729902 -409823 -17844 -885535 -352452 -719139 -522554 -693855 -759251 -296414 -728679 -4264 -362466 -306419 -190658 -56371 -82803
Output: 0

Example 3:

Input: 224 -874263 -763441 -190038 -190276 -93292 -452289 -912860 -949798 -1340 -619454 -962675 -249157 -129068 -414935 -76876 -918186 -333132 -70742 -410246 -8024 -171414 -876536 -973508 -228905 -51758 -20905 -304915 -198130 -60259 -302847 -523612 -703972 -270989 -30092 -409692 -995846 -393253 -9872 -258752 -429017 -87801 -241621 -938808 -115723 -649321 -548516 -186127 -410333 -249882 -804920 -930571 -983559 -897141 -628575 -166906 -938700 -751532 -680852 -79307 -690914 -401491 -707558 -849399 -777032 -105137 -122437 -868026 -348015 -102683 -960551 -143945 -597457 -502746 -734550 -923296 -931692 -115657 -387108 -426840 -67041 -329279 -616878 -896490 -796411 -230190 -984663 -255416 -674703 -50240 -455461 -699801 -269077 -463692 -576859 -363773 -921000 -368123 -674601 -873533 -85893 -117709 -42834…
Output: 0

Constraints:

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

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