CT22008

Last lanterns of Diya

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the trading post of Goldmeadow, someone must win the guild's seasonal contest. This year the task falls to Diya, armed only with the lanterns register. Task: Read n integers and print how many are even. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of even values. Constraints: 1 <= n <= 308; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 267 522448 590747 275315 698580 745164 740388 740424 36884 482671 437157 102928 953970 673981 41235 474122 380968 332537 501364 282170 405567 650477 614774 852970 292872 92120 709304 557724 311033 397272 554043 576624 636921 311431 85337 447215 39427 192173 141468 841743 809490 616412 110877 169368 806268 29344 837574 852990 378556 872628 176152 372033 398398 140848 621805 34842 744848 624685 585650 84574 683417 907055 684621 312479 263521 643092 126651 104167 100768 551041 787251 634782 317452 165366 681016 33958 995644 48551 915261 238368 630344 89811 696652 390644 130269 337708 495636 969875 310989 290643 937017 977356 718472 913978 875753 766712 482088 263127 977422 303263 647289 505117 117715 460091 479040 446417 183859 48989 230009 519830 5403 28063 959127 606232 243542 836957 558801 352947 823542 47714 922452 377210 597354 394328 976330 126675 806762 340695 987213 854981 107393 750733 349018 818402 22877 983957 66629 516119 340075 116172 42937 331215 14292 610495 480627 133045 13054 235403 156879 479166 712249 987784 856745 923743 223674 110005 850084 220486 397634 63302 78358 260566 482435 810848 975264 808581 86202 687015 90929 42333 354394 429925 224931 574325 762478 240112 28292 800601 826006 376218 848031 215617 283823 903518 43392 594628 996131 739909 287488 240948 97236 910027 131942 74182 6274 331172 115890 217758 634119 56088 198942 429681 418376 44882 89675 506437 144733 500887 880851 790174 705802 546830 298689 296112 451573 105798 676529 918844 667517 812438 821573 597827 794328 441374 911653 240295 89961 820155 109045 50974 263114 648534 696044 239331 84886 973960 212927 374784 280284 579186 325238 648240 883560 9973 990861 977606 270939 353564 714976 10899 43012 783174 414811 239817 971129 785599 624727 182682 551384 237081 722759 192929 371040 653907 783542 316801 721091 595411
Output: 138

Example 2:

Input: 76 215830 547176 427649 724077 206717 236033 867552 767687 931554 402188 591275 311592 625740 314683 682922 514029 791127 993643 151895 832945 572995 776893 563125 281884 304600 621458 704316 445999 819448 173645 215103 851892 449866 613138 654620 249994 913148 747268 990503 340690 958249 82792 662344 892232 752817 134727 292772 785951 464775 230323 854773 170450 242073 234645 828529 595801 224115 621468 109580 3383 449811 216822 762441 134695 284287 49412 834955 324880 894528 830562 645207 333583 517536 583718 392836 47627
Output: 36

Example 3:

Input: 273 66390 314865 569217 514091 848578 828706 960525 185367 804632 843940 156711 719049 800189 614805 303444 189086 345484 410882 554761 448017 337483 353224 182030 808248 203943 77150 571149 790893 348392 55484 938560 219005 310772 2101 238499 904366 661792 311136 690986 449933 745135 698699 693739 817728 324936 442930 191074 543445 36227 57106 328269 765199 788503 483425 399053 205891 162985 656857 375229 552700 396193 538968 812554 979585 227645 995757 686565 51959 425353 24370 734273 570584 146307 22610 711764 99125 71431 207865 380574 231359 849396 794466 107446 953011 659811 276572 96104 837134 81264 19728 324381 461037 260535 727455 175813 816995 370943 998249 578706 965440 414977 408934 802041 903973 141222 905483 960564 106557 792747 556991 279281 801889 378724 456664 717928 220062 345949 511762 723491 184464 842555 404780 128780 863932 757589 805876 286715 842140 229498 79015 383584 131851 569178 116985 441958 194600 909122 937651 290085 194988 264426 7803 257076 838850 830975 843767 595526 811416 647882 564818 579306 248917 939379 462574 61578 419161 802006 401738 423627 537486 229201 982469 230869 259912 464043 130464 865783 684165 696563 461082 451902 53792 794719 507012 878915 139 931136 85772 81473 281698 636208 62741 637060 199635 184584 810393 893939 410247 783803 518757 714783 146907 296455 568501 171946 126962 114264 874668 635151 189193 861336 41710 66735 459192 735575 213159 706869 38734 677397 539084 533935 692023 971678 897581 746924 220941 779528 378271 938655 324864 799475 260688 795868 248890 734902 860275 15973 216964 218493 560133 361300 924205 106389 605287 201888 955331 333718 559376 743180 766472 934143 630004 986440 635366 621222 614038 553050 665263 928010 970399 84220 923558 462230 543435 190195 637051 941294 244725 687006 789942 939529 10338 325801 234368 18259 930848 723845 892681 687242 981529 186863 442229 883129
Output: 131

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last lanterns of Diya - EASY Coding Problem | CodeTikki