結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-05-11 23:15:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 79,816 KB
最終ジャッジ日時 2023-08-18 13:34:27
合計ジャッジ時間 3,825 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
72,096 KB
testcase_01 AC 236 ms
79,816 KB
testcase_02 AC 242 ms
79,652 KB
testcase_03 AC 89 ms
72,208 KB
testcase_04 AC 98 ms
76,780 KB
testcase_05 AC 88 ms
72,100 KB
testcase_06 AC 107 ms
78,236 KB
testcase_07 AC 108 ms
78,352 KB
testcase_08 AC 90 ms
72,308 KB
testcase_09 AC 87 ms
72,308 KB
testcase_10 AC 132 ms
78,560 KB
testcase_11 AC 132 ms
78,084 KB
testcase_12 AC 147 ms
78,392 KB
testcase_13 AC 180 ms
79,004 KB
testcase_14 AC 114 ms
78,252 KB
testcase_15 AC 118 ms
78,476 KB
testcase_16 AC 117 ms
78,576 KB
testcase_17 AC 99 ms
72,364 KB
testcase_18 AC 87 ms
72,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/2134

"""

import sys
from sys import stdin
import random

N,M = map(int,stdin.readline().split())

lis = [0] * N

for loop in range(M):

    a = list(map(int,stdin.readline().split()))[1:]
    for i in range(len(a)):
        a[i] -= 1

    aset = set(a)

    r1 = random.randint(0,10**18)
    r2 = random.randint(0,10**18)

    for i in range(N):
        if i in aset:
            lis[i] ^= r1
        else:
            lis[i] ^= r2

part = len(set(lis))
print (pow(2,part,998244353))
0