CT22769

Elowen's Timeworn readings

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the frontier camp of Duskwood opens only for a perfect tally of readings. Elowen means to find out. 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 <= 444; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 125 503544176 942908952 797020937 142730471 22728598 446644092 677357011 381087582 671096738 246518595 310807009 745374655 901040998 498551056 392379494 179656937 443464541 775292853 446797984 358066347 669636091 575011399 496498655 857499756 238896703 103858380 938065853 69618493 546407613 560044877 750593793 508695678 240227052 426478776 4049262 839874534 867970150 151206594 206643572 958149212 786400077 113969200 475684660 952785453 231003192 799642483 96450581 270733866 944555916 717684850 478855000 806864237 454448051 626314968 437663778 554700936 594855366 364481262 842451690 421039312 670462910 545422568 295964785 502962793 382664965 449846006 472562214 93982355 621043425 320196795 568921278 110133562 457899745 774193511 66203240 951861808 472269656 292346845 503443946 121722018 391…
Output: 125

Example 2:

Input: 301 49733851 171648519 831425147 490641574 866136008 839304819 128540092 217560344 111020133 928206520 202659186 198980660 247851243 333363792 454667508 94478985 209357778 145162964 63768634 482827568 511994241 589751768 319293637 552078142 520352647 504117782 904325905 430433969 336745353 928661709 380258091 168202223 237428527 112110453 807726614 568454715 297252697 672635649 522457622 898110858 838631143 183257839 817157622 496321073 681238770 48803619 201147392 870950330 599061019 833320179 261168595 558685235 253906957 45416213 95275550 454836882 482250496 883227872 195634423 249787556 931967136 203564941 613230336 451088305 973212139 459516293 124037208 401039499 522851843 757891719 762719653 652867304 521974471 907374934 902076465 357766960 37263668 924031619 294034210 5228420 37771…
Output: 301

Example 3:

Input: 408 665453916 684554376 39997615 543906331 543769693 392511476 873750098 489493974 587280398 820664788 914510007 248698886 254193662 409834380 171972738 606044482 440149911 986275463 864145772 982942763 753566195 828946473 265501305 572286025 241114498 541237920 834192332 288945307 405957000 698387310 825883680 720064749 635816277 305824248 221084457 417857825 609354159 248431586 405423331 185833706 712075044 181250296 762734784 641404717 756006931 96357537 848653434 301943242 2721005 181608441 353137873 244888113 482636748 378931529 604970173 861276472 232673805 477335241 501803489 707059863 425252581 942494849 21925139 271788105 538277592 392680014 210752730 172029986 852397398 997099709 252122540 971610678 344633828 386826330 594882670 279084606 955617330 367836088 256710724 213302678 5…
Output: 408

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Elowen's Timeworn readings - EASY Coding Problem | CodeTikki