結果

問題 No.2134 $\sigma$-algebra over Finite Set
ユーザー flygonflygon
提出日時 2022-11-26 15:49:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 463 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 86,636 KB
最終ジャッジ日時 2023-07-29 05:39:32
合計ジャッジ時間 5,233 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,884 KB
testcase_01 AC 462 ms
86,540 KB
testcase_02 AC 463 ms
86,636 KB
testcase_03 AC 94 ms
71,720 KB
testcase_04 AC 132 ms
77,960 KB
testcase_05 AC 94 ms
71,768 KB
testcase_06 AC 141 ms
78,692 KB
testcase_07 AC 147 ms
78,604 KB
testcase_08 AC 95 ms
72,104 KB
testcase_09 AC 94 ms
71,964 KB
testcase_10 AC 288 ms
81,260 KB
testcase_11 AC 287 ms
81,548 KB
testcase_12 AC 316 ms
81,596 KB
testcase_13 AC 317 ms
82,288 KB
testcase_14 AC 148 ms
78,576 KB
testcase_15 AC 146 ms
78,236 KB
testcase_16 AC 141 ms
78,204 KB
testcase_17 AC 95 ms
72,136 KB
testcase_18 AC 94 ms
72,060 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