結果
| 問題 |
No.2134 $\sigma$-algebra over Finite Set
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-12-11 01:01:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 602 bytes |
| コンパイル時間 | 1,898 ms |
| コンパイル使用メモリ | 81,948 KB |
| 実行使用メモリ | 77,056 KB |
| 最終ジャッジ日時 | 2024-10-15 01:08:04 |
| 合計ジャッジ時間 | 3,397 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 8 |
ソースコード
import sys
input = sys.stdin.readline
N,M=map(int,input().split())
mod=998244353
BASE=[]
def sweep(x):
for b in BASE:
if b^x<x:
x=b^x
return x
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)
k=sweep(x)
if k!=0: # 掃き出した値が0でないなら基底に入れる。
BASE.append(k)
x=ALL^x
k=sweep(x)
if k!=0: # 掃き出した値が0でないなら基底に入れる。
BASE.append(k)
if len(BASE)==0:
print(2)
else:
print(pow(2,len(BASE),mod))
titia