CT27099

Xanthe's crates Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the ivy courts of Vineward pays by the answer, and Xanthe intends to earn it. First: the full register of crates. 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 <= 229; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 138 472006 141107 273368 786122 536170 897363 178542 646099 251804 162089 622532 541962 689327 412295 721491 152725 929370 699454 934931 901689 105731 921946 180132 962957 539061 424365 881419 429250 836792 650855 965514 403506 548538 423740 449747 941093 354604 235898 639839 318674 616436 899909 349231 294692 626382 954907 392133 621355 177335 283951 34376 6067 956931 251788 319196 697227 979837 586959 268415 407689 466029 118144 616959 810568 599546 625832 433861 216120 730360 715122 74608 781342 666418 184018 920062 65939 891094 343540 463801 380085 63927 258281 151285 63756 784894 129999 403622 746649 587854 33888 990407 220569 809053 644267 885544 342679 520323 99195 633283 746523 413775 578540 909475 689642 493179 826643 495331 24171 797944 186784 484445 890638 944388 522471 213698 3…
Output: 138

Example 2:

Input: 61 891902 660113 908891 689174 644076 123296 940071 985416 703355 284017 805994 267933 486650 16550 853915 599163 34148 932620 176281 719056 604726 61605 189756 425872 650812 222083 115529 382060 569454 952591 666254 594759 550189 39840 487744 971571 875599 645475 68027 769601 77031 789249 292507 253359 236762 496695 962873 132560 520729 990018 191862 912279 707443 167169 416415 904951 888246 895256 716557 348959 430548
Output: 61

Example 3:

Input: 108 321993 203135 536918 92802 868051 148696 533100 18500 561671 346790 68652 215343 917863 996394 210024 290069 330910 86183 335024 16629 133941 581398 991465 970666 886121 637056 773342 913352 379223 206956 998450 295535 824923 842036 234718 986613 864683 685044 337102 380347 559164 688913 321281 580729 823965 689655 469058 459058 480401 479858 235755 68519 460290 168530 831507 319111 961699 672072 853385 114028 250341 301294 685625 469002 176040 840950 198341 786333 406578 330251 669553 82731 185290 403726 118793 883754 409222 314212 173800 350158 350526 683311 395747 796332 906210 511116 512180 507471 431420 244713 896121 523992 891523 671518 146843 210585 492499 558457 453229 438456 458966 251247 173253 187221 418139 113214 700276 173033
Output: 108

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Xanthe's crates Reckoning - EASY Coding Problem | CodeTikki