Submission #5000610


Source Code Expand

N, P = map(int, input().split())
A = list(map(int, input().split()))
odd = 0
even = 0
for i in range(N):
  if A[i] %2 == 0:
    even += 1
  else:
    odd += 1
if P == 0:
  if even == N:
    print(2**N)
  else:
    print(2**(N-1))
    
else:
  if even == N:
    print(0)
  else:
    print(2**(N-1))

Submission Info

Submission Time
Task A - Biscuits
User macaroni
Language Python (3.4.3)
Score 200
Code Size 316 Byte
Status AC
Exec Time 17 ms
Memory 3060 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 16
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt
Case Name Status Exec Time Memory
in1.txt AC 17 ms 2940 KB
in2.txt AC 17 ms 3060 KB
in3.txt AC 17 ms 2940 KB
in4.txt AC 17 ms 3060 KB
in5.txt AC 17 ms 2940 KB
in6.txt AC 17 ms 3060 KB
in7.txt AC 17 ms 3060 KB
in8.txt AC 17 ms 3060 KB
sample1.txt AC 17 ms 3060 KB
sample2.txt AC 17 ms 2940 KB
sample3.txt AC 17 ms 3060 KB
sample4.txt AC 17 ms 2940 KB