Submission #1409066


Source Code Expand

from collections import Counter

n, p = map(int, raw_input().rstrip().split(' '))
a = map(int,raw_input().rstrip().split(' '))
ct = Counter(ai%2 for ai in a)
even, odd = ct[0], ct[1]
c_even = 2**even
nCk = 1
n = odd
k = 0
d = n
c_odd = 0
while k <= n:
    if k % 2 == p:
        c_odd += nCk
    k += 1
    nCk = nCk * d / k
    d -= 1
print c_even * c_odd

Submission Info

Submission Time
Task A - Biscuits
User naoya_t
Language Python (2.7.6)
Score 200
Code Size 376 Byte
Status AC
Exec Time 14 ms
Memory 2812 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 14 ms 2812 KB
in2.txt AC 11 ms 2808 KB
in3.txt AC 11 ms 2808 KB
in4.txt AC 11 ms 2808 KB
in5.txt AC 11 ms 2808 KB
in6.txt AC 11 ms 2808 KB
in7.txt AC 11 ms 2808 KB
in8.txt AC 11 ms 2808 KB
sample1.txt AC 11 ms 2808 KB
sample2.txt AC 11 ms 2808 KB
sample3.txt AC 11 ms 2808 KB
sample4.txt AC 11 ms 2808 KB