結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー titiatitia
提出日時 2022-12-11 01:26:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 477 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 77,056 KB
最終ジャッジ日時 2024-04-23 02:05:18
合計ジャッジ時間 4,221 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 475 ms
77,056 KB
testcase_02 AC 477 ms
76,928 KB
testcase_03 AC 40 ms
51,712 KB
testcase_04 AC 96 ms
75,648 KB
testcase_05 AC 38 ms
52,352 KB
testcase_06 AC 100 ms
76,524 KB
testcase_07 AC 105 ms
76,032 KB
testcase_08 AC 36 ms
51,840 KB
testcase_09 AC 35 ms
52,224 KB
testcase_10 AC 301 ms
76,672 KB
testcase_11 AC 315 ms
76,508 KB
testcase_12 AC 332 ms
76,544 KB
testcase_13 AC 367 ms
76,800 KB
testcase_14 AC 114 ms
76,288 KB
testcase_15 AC 105 ms
76,544 KB
testcase_16 AC 95 ms
76,300 KB
testcase_17 AC 36 ms
51,840 KB
testcase_18 AC 38 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0