Submission #3493516


Source Code Expand

Copy
import itertools
N, A = map(int, input().split())
x = sorted([int(i)-A for i in input().split()])
ans = x.count(0)

if N >= 2:
    for i in range(2, N+1):
        check = list(itertools.combinations(x,i))
        for i in check:
            if sum(i) == 0:
                ans += 1

print(ans)

Submission Info

Submission Time
Task C - 高橋君とカード / Tak and Cards
User yutala
Language Python3 (3.4.3)
Score 200
Code Size 305 Byte
Status

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_01.txt, example_02.txt, example_03.txt, example_04.txt
Subtask1 200 / 200 example_01.txt, example_02.txt, example_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt
All 0 / 100 example_01.txt, example_02.txt, example_03.txt, example_04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt
Case Name Status Exec Time Memory
example_01.txt 17 ms 3060 KB
example_02.txt 17 ms 3060 KB
example_03.txt 17 ms 3060 KB
example_04.txt
subtask1_01.txt 42 ms 6900 KB
subtask1_02.txt 47 ms 6900 KB
subtask1_03.txt 42 ms 6900 KB
subtask1_04.txt 43 ms 6900 KB
subtask1_05.txt 43 ms 6900 KB
subtask1_06.txt 17 ms 3060 KB
subtask1_07.txt 17 ms 3060 KB
subtask1_08.txt 42 ms 6900 KB
subtask1_09.txt 30 ms 5364 KB
subtask2_01.txt
subtask2_02.txt
subtask2_03.txt
subtask2_04.txt
subtask2_05.txt
subtask2_06.txt
subtask2_07.txt
subtask2_08.txt
subtask2_09.txt
subtask2_10.txt
subtask2_11.txt