Submission #22242618
Source Code Expand
N,M = map(int, input().split())
L = []
for i in range(M):
L.append(list(map(int, input().split()))[1:])
P = list(map(int, input().split()))
ans = 0
for i in range(2 ** N):
onoff = []
for j in range(N): # このループが一番のポイント
if ((i >> j) & 1): # 順に右にシフトさせ最下位bitのチェックを行う
onoff.append(0)
else:
onoff.append(1)
#計算
for j in range(M):
s=P[j]
for l in L[j]:
s += onoff[l-1]
if s%2==1:
break
else:
ans+=1
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Switches |
| User | H20 |
| Language | PyPy3 (7.3.0) |
| Score | 300 |
| Code Size | 619 Byte |
| Status | AC |
| Exec Time | 93 ms |
| Memory | 68284 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, s1.txt, s2.txt, s3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 93 ms | 67888 KiB |
| 02.txt | AC | 71 ms | 67984 KiB |
| 03.txt | AC | 70 ms | 67504 KiB |
| 04.txt | AC | 70 ms | 68136 KiB |
| 05.txt | AC | 70 ms | 67996 KiB |
| 06.txt | AC | 70 ms | 67800 KiB |
| 07.txt | AC | 70 ms | 67752 KiB |
| 08.txt | AC | 68 ms | 67872 KiB |
| 09.txt | AC | 70 ms | 67504 KiB |
| 10.txt | AC | 77 ms | 68284 KiB |
| 11.txt | AC | 70 ms | 67688 KiB |
| 12.txt | AC | 74 ms | 67812 KiB |
| 13.txt | AC | 68 ms | 68132 KiB |
| 14.txt | AC | 72 ms | 68052 KiB |
| 15.txt | AC | 69 ms | 68064 KiB |
| 16.txt | AC | 66 ms | 67512 KiB |
| 17.txt | AC | 69 ms | 67928 KiB |
| 18.txt | AC | 77 ms | 68180 KiB |
| 19.txt | AC | 72 ms | 67664 KiB |
| 20.txt | AC | 68 ms | 67780 KiB |
| 21.txt | AC | 71 ms | 68024 KiB |
| 22.txt | AC | 71 ms | 67968 KiB |
| 23.txt | AC | 68 ms | 67768 KiB |
| 24.txt | AC | 73 ms | 67856 KiB |
| 25.txt | AC | 77 ms | 68216 KiB |
| 26.txt | AC | 69 ms | 67544 KiB |
| 27.txt | AC | 72 ms | 67936 KiB |
| s1.txt | AC | 53 ms | 61540 KiB |
| s2.txt | AC | 54 ms | 61584 KiB |
| s3.txt | AC | 57 ms | 61628 KiB |