CT1146

The parcels Even Count Puzzle

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Chavi inherited the depot at the otter slides of Sleekwater along with its curious bookkeeping system for parcels. Time to make sense of it. 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 <= 52; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 52 244136 782452 920229 377110 765536 936767 954308 188329 153465 332597 378366 32172 977388 49808 188295 697215 399356 940520 79364 284772 691242 444990 972070 882842 461588 879621 484038 423467 922022 751371 141644 195910 960731 121943 443072 107962 999554 61973 246564 111761 228048 657342 824174 466085 35933 442018 785635 593106 260373 424367 40781 978286
Output: 32

Example 2:

Input: 1 416203
Output: 0

Example 3:

Input: 50 970178 824821 736118 906841 771746 994116 485505 952566 814909 360421 729713 756162 276384 203322 314649 904557 834868 825359 252736 121844 844893 68228 207678 712130 478580 392241 876454 604132 464584 298870 181953 405637 290671 749624 50008 979672 159921 622698 363665 816077 995394 491901 528987 309084 779250 538507 219754 480818 326111 281290
Output: 29

Constraints:

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

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