結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー shobonvipshobonvip
提出日時 2022-11-26 04:41:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,632 KB
実行使用メモリ 82,972 KB
最終ジャッジ日時 2024-04-16 12:51:57
合計ジャッジ時間 3,231 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 338 ms
82,972 KB
testcase_02 AC 325 ms
82,956 KB
testcase_03 AC 35 ms
52,352 KB
testcase_04 AC 69 ms
75,392 KB
testcase_05 AC 40 ms
52,096 KB
testcase_06 AC 80 ms
76,244 KB
testcase_07 AC 79 ms
76,288 KB
testcase_08 AC 36 ms
52,352 KB
testcase_09 AC 36 ms
51,968 KB
testcase_10 AC 140 ms
77,696 KB
testcase_11 AC 141 ms
77,440 KB
testcase_12 AC 166 ms
77,808 KB
testcase_13 AC 226 ms
79,044 KB
testcase_14 AC 80 ms
76,672 KB
testcase_15 AC 83 ms
76,544 KB
testcase_16 AC 80 ms
76,852 KB
testcase_17 AC 37 ms
51,840 KB
testcase_18 AC 37 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
mask = (1<<n) - 1
v = [mask] * n
for i in range(m):
	l = list(map(int,input().split()))
	a = 0
	w = [0] * n
	for j in range(1, l[0] + 1):
		a ^= 1 << (l[j]-1)
		w[l[j]-1] += 1
	b = mask ^ a
	for j in range(n):
		if w[j] == 1:
			v[j] &= a
		else:
			v[j] &= b

print(pow(2,len(set(v)),998244353))
0