CT27909

Garnet ingots Positive Count

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The log keeper Mason has been asked to schedule the next expedition. On the desk lies a long table of ingots readings. 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 <= 702; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 617 366206 168766 467417 858986 636678 584079 529541 251855 463798 719333 559769 513934 551088 503390 480368 686739 468895 308694 394386 643780 329243 555468 691441 949313 347656 90848 966438 135417 573291 306810 609492 505920 769776 977443 694278 933115 712313 248142 893743 278204 493417 810648 26382 506799 246016 320364 446400 869268 525295 866374 298898 592888 163112 47299 546149 149236 10722 563095 406012 205684 264410 734872 987236 868572 115711 416039 813441 560453 444966 267133 914756 449818 466698 142835 408249 344569 743498 184111 894108 467268 419161 935887 947804 888869 379483 465400 767481 151084 949680 581293 943633 268933 624006 274745 831251 49574 842725 154729 373989 706963 356144 367970 934682 828492 885997 686957 136647 215209 541325 785249 467532 811081 864214 149647 865…
Output: 617

Example 2:

Input: 310 134650 303559 934987 916862 860092 630229 605201 741313 321248 139754 930140 431763 362722 774197 955680 448129 906210 505023 929331 747037 757005 869286 755366 776329 216803 65679 462688 86321 871239 860169 185408 805871 57125 292983 494402 183477 113060 101873 16141 200269 662839 906473 543831 160867 912784 977421 548882 368401 343415 133156 663428 397686 15590 352275 784843 831238 394539 877133 70828 224570 16413 178735 580808 604597 339924 43768 691856 531508 548823 620471 874222 933973 345 938378 244728 737692 149623 619699 529554 904249 781508 181455 281762 197154 560517 292421 568911 421678 976215 912171 822865 182498 951189 654815 876669 30851 68794 636609 950674 231936 240395 535301 189074 417594 979789 512385 926612 198969 286318 579370 436216 328787 868763 564081 818778 6510…
Output: 310

Example 3:

Input: 152 860996 6624 680515 598140 778470 845069 924411 241105 822363 508636 130225 950027 770291 777320 302208 85101 26658 374396 628484 916764 383094 25867 155168 430626 95510 637289 519355 416009 248442 494064 328966 322723 963695 646654 408976 406165 928677 585102 799517 775448 871656 858459 542131 124456 241335 642790 834687 834969 663937 27449 697007 919824 895736 117916 449092 910107 282355 503893 479533 428951 844544 560480 584767 176515 157739 164249 571926 551403 150867 196222 510508 680715 660943 595682 985079 964232 765707 621668 970747 505340 758198 14950 493157 500346 755223 136265 934935 78447 871593 558181 212178 291637 909047 543110 26894 173307 779116 85555 24096 693709 72551 634890 998004 848696 905411 373973 602054 573319 586208 29798 941098 228884 697532 142398 426458 99510…
Output: 152

Constraints:

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

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