結果

問題 No.1689 Set Cards
ユーザー wolgnik
提出日時 2021-09-24 22:21:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,796 KB
実行使用メモリ 66,120 KB
最終ジャッジ日時 2024-07-05 10:51:46
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())
mod = 998244353
m = 12
dp = [0] * (1 << m)
for _ in range(N):
  c = list(map(int, input().split()))
  t = 0
  if c[0]:
    for x in c[1: ]: t |= 1 << (x - 1)

  for i in range(1 << m):
    dp[i & t] += dp[i]
    dp[i & t] %= mod
  dp[t] += 1
  dp[t] %= mod
print(dp[0])
0