結果
問題 | No.1689 Set Cards |
ユーザー | titia |
提出日時 | 2021-09-24 23:21:24 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 372 bytes |
コンパイル時間 | 521 ms |
コンパイル使用メモリ | 87,384 KB |
実行使用メモリ | 79,700 KB |
最終ジャッジ日時 | 2023-09-18 22:23:02 |
合計ジャッジ時間 | 5,161 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,088 KB |
testcase_01 | AC | 72 ms
71,192 KB |
testcase_02 | RE | - |
testcase_03 | AC | 106 ms
78,452 KB |
testcase_04 | AC | 105 ms
78,144 KB |
testcase_05 | AC | 107 ms
78,408 KB |
testcase_06 | AC | 109 ms
78,252 KB |
testcase_07 | WA | - |
testcase_08 | AC | 75 ms
71,328 KB |
testcase_09 | AC | 73 ms
71,248 KB |
testcase_10 | AC | 78 ms
76,492 KB |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
ソースコード
import sys input = sys.stdin.readline N=int(input()) mod=998244353 S=[list(map(int,input().split()))[1:] for i in range(N)] DP=[0]*(1<<N) DP[0]=1 for i in range(N): s=S[i] ax=0 for j in range(N): if j+1 in s: continue ax+=(1<<j) for k in range((1<<N)-1,-1,-1): DP[ax|k]+=DP[k] DP[ax|k]%=mod print(DP[-1])