CT21831

Lakshya's Positive Count Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

In the mining town of Ironvein, Lakshya the measurer keeps careful count of the scrolls. outscore the rival chapter, every figure matters. 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 <= 650; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 591 271 160 573 671 509 689 5 803 452 187 951 608 445 629 564 114 122 320 218 537 408 923 271 999 266 991 564 767 90 64 483 638 424 551 572 908 644 999 100 256 532 1000 183 664 814 422 254 293 437 613 629 89 228 154 465 233 390 618 730 875 784 300 663 350 590 455 526 510 723 556 144 438 80 882 642 484 154 407 697 425 332 941 565 855 249 156 985 912 942 128 786 908 706 934 597 367 929 251 885 147 887 637 512 333 755 991 899 490 100 125 328 974 236 839 477 591 875 427 523 177 788 392 816 208 617 209 198 2 374 517 670 173 68 968 457 558 611 836 820 513 126 507 421 528 183 437 577 483 374 891 152 818 518 601 32 144 447 300 172 2 237 199 643 819 745 113 710 338 7 635 754 539 669 216 272 758 169 778 859 437 305 311 77 972 816 651 230 709 823 783 972 272 347 93 315 289 770 579 36 688 865 556 330 …
Output: 590

Example 2:

Input: 556 331 963 149 844 357 782 124 767 194 525 523 950 556 683 380 450 262 607 637 638 766 521 309 576 679 640 264 240 608 737 428 317 26 56 535 66 662 103 827 122 389 951 749 382 446 56 994 276 917 7 972 939 896 639 888 177 186 269 523 898 363 153 112 635 256 42 904 506 82 473 20 489 163 278 852 250 512 709 888 614 956 962 317 825 485 581 189 427 276 885 303 945 92 784 160 298 958 433 959 35 609 792 916 372 938 388 670 470 445 145 666 891 894 650 546 811 750 501 103 839 32 124 859 199 816 371 850 472 46 346 300 790 383 34 390 653 181 190 982 981 564 184 976 838 570 647 734 956 549 280 217 550 912 453 606 415 561 98 729 170 370 520 954 521 406 275 925 439 517 41 769 489 493 42 43 818 334 372 296 718 391 587 409 85 255 173 540 366 986 152 408 433 169 514 17 296 683 194 557 24 336 730 415 765 4…
Output: 556

Example 3:

Input: 273 300 222 692 296 918 238 276 669 223 888 128 866 539 98 804 995 258 224 203 679 66 699 477 905 330 687 335 871 219 809 481 716 410 226 178 492 536 620 317 845 175 551 404 401 212 89 470 690 571 521 666 722 944 874 713 135 504 311 187 968 890 47 271 158 963 312 544 991 467 492 184 422 916 52 924 844 205 326 130 621 565 360 718 79 86 646 877 83 239 713 335 153 954 211 731 789 692 144 400 444 722 743 141 671 104 674 181 113 560 794 382 124 954 620 473 629 457 277 509 361 692 711 908 422 979 137 819 522 0 89 420 50 400 813 217 389 275 174 642 996 576 558 473 554 322 568 235 888 437 405 997 884 437 731 971 174 538 682 440 477 265 548 685 505 552 783 834 659 994 299 109 938 380 946 474 418 690 104 974 94 188 479 627 27 975 182 570 481 237 875 131 735 873 220 15 731 633 558 307 298 629 969 803…
Output: 272

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Lakshya's Positive Count Ledger - EASY Coding Problem | CodeTikki