CT28616

Mira's Ledger of tickets

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Mira runs the brewery at the pine barrens of Needlepoint. Today the books show a list of tickets, and the numbers must be worked out before sundown. 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 <= 285; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 256 673550618 330072839 160126551 721505072 19844129 271697391 662161887 298569099 52341952 604328305 937031511 114124962 163008718 580141172 634999481 940780921 937904788 374607590 710182423 532992379 969288821 661316135 366761097 426076495 990764075 186605307 740337237 813171020 156015783 66521447 465453915 49269070 207850377 133674887 953530159 143333187 558582816 698242354 684490337 470594787 925063063 253114315 341383644 930684759 307179570 932455126 139227778 610955883 683115057 334982893 790148018 739019505 688355035 22428540 597608818 154454516 300570183 602799951 168695600 311881921 368285804 576962866 929184946 925145568 734947738 616575357 972571124 598037021 46772051 412738281 83548685 174709301 818401498 545041120 224795024 192594696 542190106 638909423 601109469 986642411 258…
Output: 256

Example 2:

Input: 240 764536419 492952885 897531909 479190772 58453755 696670069 41973748 230571438 636358276 562057534 283280702 231812080 750186095 452750342 306906558 42279172 399701343 54293667 384667481 124713870 298534781 899262136 175948733 467183411 432173379 253597446 49129470 537518748 675567972 555063065 938128544 635687472 224725673 374619260 108049559 812996395 966941482 158051019 135296294 204146514 318691993 644792531 369331155 477370050 119211181 173812304 234973351 722198741 930521219 312846270 248472276 602944555 233309092 896070131 658062531 325914790 118306613 643172137 462621642 290220110 364565354 33662065 826822793 503706278 318561581 136116156 969299728 945749914 524995497 166527945 101911775 239863878 807969828 170051343 71076396 382004412 770329922 323475344 379059856 800202813 675…
Output: 240

Example 3:

Input: 57 771506913 730025689 990865616 474927930 584838577 676778892 516746134 91678795 645175252 126272400 69892406 862316345 791067114 970052874 479861584 900278265 754606649 507949250 624212836 217506019 579604342 844061252 917014925 588365378 847939985 244935640 309702347 589032937 319534967 549933168 102782912 991661072 172364495 766333886 270860217 880838156 81352773 663093103 477477573 368306865 566268119 270667862 910160069 405350341 519767665 614408732 201867781 200472098 22788367 626593771 24339611 476565984 648853129 990684237 818971889 572137394 707927500
Output: 57

Constraints:

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

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