結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー 👑 rin204rin204
提出日時 2023-02-08 11:26:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 592 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 326 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 78,488 KB
最終ジャッジ日時 2023-09-20 04:16:24
合計ジャッジ時間 6,627 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,376 KB
testcase_01 AC 285 ms
78,240 KB
testcase_02 AC 288 ms
78,488 KB
testcase_03 AC 73 ms
71,408 KB
testcase_04 AC 93 ms
76,760 KB
testcase_05 AC 72 ms
71,148 KB
testcase_06 AC 167 ms
77,412 KB
testcase_07 AC 191 ms
77,224 KB
testcase_08 AC 74 ms
71,512 KB
testcase_09 AC 73 ms
71,096 KB
testcase_10 AC 524 ms
78,056 KB
testcase_11 AC 475 ms
78,088 KB
testcase_12 AC 592 ms
78,296 KB
testcase_13 AC 236 ms
78,196 KB
testcase_14 AC 174 ms
77,644 KB
testcase_15 AC 158 ms
77,480 KB
testcase_16 AC 158 ms
77,696 KB
testcase_17 AC 75 ms
71,160 KB
testcase_18 AC 74 ms
71,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

n, m = map(int, input().split())
X = [(1 << n) - 1]
for _ in range(m):
    l, *A = map(int, input().split())
    x = 0
    for a in A:
        x |= 1 << a - 1
    X.append(x)

base = []
while X:
    x = X.pop()
    for b in base:
        x = min(x, x ^ b)
    if x != 0:
        for b in base:
            if x & b != 0:
                X.append(x | b)
        base.append(x)
print(pow(2, len(base), MOD))
0