CT389

The Even Count of Verdigris

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Envoy inherited the apiary at the copper works of Verdigris 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 <= 70; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 49 -304404 -983326 -161846 -114901 -985382 -771290 -943772 -231119 -500065 -825501 -209319 -462462 -604535 -479948 -415525 -258086 -219301 -982112 -358581 -284055 -863649 -62936 -119768 -446316 -870034 -604855 -381505 -52029 -921503 -727977 -994547 -664966 -214634 -40418 -485042 -589199 -978237 -330782 -817296 -140484 -533646 -809339 -869428 -521054 -413332 -227809 -806894 -109180 -206786
Output: 28

Example 2:

Input: 48 -596653 -790194 -26394 -278526 -423232 -347797 -358809 -465562 -356171 -340486 -178222 -798409 -602692 -787356 -149943 -618851 -724116 -299139 -953670 -107194 -188871 -78035 -909405 -836988 -47492 -106352 -674947 -93541 -318328 -726628 -764238 -107384 -277364 -344147 -463269 -18803 -412859 -264831 -927511 -151010 -586584 -96626 -447535 -782133 -386768 -332134 -252544 -328274
Output: 27

Example 3:

Input: 61 -677876 -888426 -61526 -285388 -341402 -346989 -271813 -202049 -299474 -478087 -926273 -88784 -922377 -393329 -682139 -288708 -262262 -705358 -271822 -927343 -500558 -932311 -981785 -724981 -924759 -148421 -719766 -95079 -63421 -430090 -655494 -50570 -474104 -864714 -697623 -639967 -596778 -492337 -297991 -652573 -22712 -576120 -997658 -372163 -505958 -557174 -486469 -750336 -75433 -745720 -987679 -684585 -350014 -788068 -606085 -92160 -698354 -897758 -314752 -180882 -27252
Output: 34

Constraints:

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

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