結果

問題 No.1689 Set Cards
ユーザー wolgnikwolgnik
提出日時 2021-09-24 22:21:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 77,060 KB
最終ジャッジ日時 2023-09-18 21:40:35
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,268 KB
testcase_01 AC 78 ms
76,272 KB
testcase_02 AC 77 ms
76,216 KB
testcase_03 AC 78 ms
76,088 KB
testcase_04 AC 79 ms
75,788 KB
testcase_05 AC 77 ms
76,096 KB
testcase_06 AC 80 ms
76,132 KB
testcase_07 AC 78 ms
76,024 KB
testcase_08 AC 76 ms
76,056 KB
testcase_09 AC 76 ms
76,032 KB
testcase_10 AC 79 ms
76,060 KB
testcase_11 AC 103 ms
76,592 KB
testcase_12 AC 100 ms
76,736 KB
testcase_13 AC 97 ms
76,940 KB
testcase_14 AC 96 ms
76,796 KB
testcase_15 AC 81 ms
76,160 KB
testcase_16 AC 93 ms
76,760 KB
testcase_17 AC 79 ms
76,280 KB
testcase_18 AC 95 ms
76,912 KB
testcase_19 AC 95 ms
77,056 KB
testcase_20 AC 95 ms
77,060 KB
testcase_21 AC 92 ms
76,664 KB
testcase_22 AC 94 ms
77,020 KB
testcase_23 AC 95 ms
76,928 KB
testcase_24 AC 95 ms
76,892 KB
testcase_25 AC 95 ms
76,604 KB
権限があれば一括ダウンロードができます

ソースコード

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