結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー flygonflygon
提出日時 2022-11-26 15:49:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 452 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,792 KB
実行使用メモリ 85,088 KB
最終ジャッジ日時 2024-04-16 12:52:27
合計ジャッジ時間 3,919 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
56,088 KB
testcase_01 AC 452 ms
85,088 KB
testcase_02 AC 439 ms
84,548 KB
testcase_03 AC 43 ms
54,488 KB
testcase_04 AC 88 ms
76,668 KB
testcase_05 AC 42 ms
55,360 KB
testcase_06 AC 98 ms
77,060 KB
testcase_07 AC 107 ms
76,892 KB
testcase_08 AC 44 ms
55,336 KB
testcase_09 AC 43 ms
54,780 KB
testcase_10 AC 253 ms
79,848 KB
testcase_11 AC 251 ms
79,612 KB
testcase_12 AC 286 ms
80,112 KB
testcase_13 AC 289 ms
80,556 KB
testcase_14 AC 104 ms
77,276 KB
testcase_15 AC 103 ms
76,800 KB
testcase_16 AC 97 ms
77,172 KB
testcase_17 AC 44 ms
54,780 KB
testcase_18 AC 43 ms
54,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
import pypyjit
pypyjit.set_param('max_unroll_recursion=-1')
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd
mod = 998244353
n,m = map(int,input().split())
A = [0]*m
Ac = [0]*m
B = [(2**n - 1)]*n
for i in range(m):
  l, *a = map(int,input().split())
  for j in range(l):
    A[i] |= 1 << (a[j] - 1)
  Ac[i] = ~A[i]
  for j in range(n):
    if (A[i] >> j) & 1:
      B[j] &= A[i]
    else:
      B[j] &= Ac[i]

s = set()
for i in range(n):
  s.add(B[i])

print(pow(2, len(s), mod))
0