Submission #2230162
Source Code Expand
def combination(total, selected): foo = 1 for i in xrange(selected): foo *= total-i foo /= i+1 return foo def process(a, p): odds = 0 even = 0 for x in a: if (x%2)==0: even += 1 else: odds += 1 foo = 0 for i in xrange(p, odds+1, 2): foo += combination(odds, i) foo *= 1<<even return foo def main(): n, p = [int(x) for x in raw_input().strip().split()] a = [int(x) for x in raw_input().strip().split()] print process(a, p) if __name__ == '__main__': main()
Submission Info
Submission Time | |
---|---|
Task | A - Biscuits |
User | jki14 |
Language | Python (2.7.6) |
Score | 200 |
Code Size | 605 Byte |
Status | AC |
Exec Time | 11 ms |
Memory | 2692 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 | 10 ms | 2692 KB |
in2.txt | AC | 11 ms | 2692 KB |
in3.txt | AC | 10 ms | 2568 KB |
in4.txt | AC | 11 ms | 2692 KB |
in5.txt | AC | 10 ms | 2692 KB |
in6.txt | AC | 11 ms | 2692 KB |
in7.txt | AC | 10 ms | 2568 KB |
in8.txt | AC | 10 ms | 2692 KB |
sample1.txt | AC | 11 ms | 2692 KB |
sample2.txt | AC | 11 ms | 2692 KB |
sample3.txt | AC | 10 ms | 2568 KB |
sample4.txt | AC | 10 ms | 2692 KB |