結果
問題 |
No.2134 $\sigma$-algebra over Finite Set
|
ユーザー |
![]() |
提出日時 | 2022-12-11 01:26:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 476 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 591 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 77,312 KB |
最終ジャッジ日時 | 2024-10-15 01:23:25 |
合計ジャッジ時間 | 4,440 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
import sys input = sys.stdin.readline N,M=map(int,input().split()) mod=998244353 LIST=[] ALL=(1<<N)-1 for i in range(M): A=list(map(int,input().split())) x=0 for a in A[1:]: x|=1<<(a-1) y=ALL^x LIST.append(x) LIST.append(y) BASE=[] for i in range(N): k=ALL for l in LIST: if l & (1<<i) != 0: k=k&l BASE.append(k) BASE=set(BASE) print(pow(2,len(BASE),mod))