結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー ああいいああいい
提出日時 2022-11-29 13:09:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 77,400 KB
最終ジャッジ日時 2024-04-16 12:52:57
合計ジャッジ時間 3,255 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,344 KB
testcase_01 AC 255 ms
77,196 KB
testcase_02 AC 263 ms
77,400 KB
testcase_03 AC 38 ms
52,064 KB
testcase_04 AC 56 ms
71,776 KB
testcase_05 AC 37 ms
52,572 KB
testcase_06 AC 65 ms
75,752 KB
testcase_07 AC 66 ms
75,832 KB
testcase_08 AC 38 ms
53,348 KB
testcase_09 AC 38 ms
52,992 KB
testcase_10 AC 200 ms
76,748 KB
testcase_11 AC 201 ms
76,760 KB
testcase_12 AC 219 ms
76,588 KB
testcase_13 AC 249 ms
77,100 KB
testcase_14 AC 95 ms
76,828 KB
testcase_15 AC 96 ms
76,588 KB
testcase_16 AC 90 ms
76,792 KB
testcase_17 AC 37 ms
52,204 KB
testcase_18 AC 36 ms
52,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
bit = []
inv = []
S = (1 << N) - 1
for _ in range(M):
    l,*a = map(int,input().split())
    tmp = 0
    for k in a:
        tmp |= 1 << (k - 1)
    bit.append(tmp)
    inv.append(S ^ tmp)
count = 0
now = 0
for i in range(N):
    if now >> i & 1 == 0:
        count += 1
        tmp = S
        for j in range(M):
            if bit[j] >> i & 1:
                tmp &= bit[j]
            else:
                tmp &= inv[j]
        now |= tmp
print(pow(2,count,998244353))
0