結果

問題 No.1689 Set Cards
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-09-24 22:32:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 77,004 KB
最終ジャッジ日時 2023-09-18 21:47:19
合計ジャッジ時間 3,716 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
76,312 KB
testcase_01 AC 79 ms
76,008 KB
testcase_02 AC 81 ms
76,156 KB
testcase_03 AC 80 ms
76,324 KB
testcase_04 AC 77 ms
76,364 KB
testcase_05 AC 80 ms
76,200 KB
testcase_06 AC 80 ms
76,228 KB
testcase_07 AC 80 ms
76,220 KB
testcase_08 AC 78 ms
76,180 KB
testcase_09 AC 77 ms
76,072 KB
testcase_10 AC 79 ms
76,112 KB
testcase_11 AC 101 ms
76,964 KB
testcase_12 AC 101 ms
76,896 KB
testcase_13 AC 101 ms
77,004 KB
testcase_14 AC 103 ms
76,920 KB
testcase_15 AC 84 ms
76,004 KB
testcase_16 AC 93 ms
76,848 KB
testcase_17 AC 81 ms
76,112 KB
testcase_18 AC 97 ms
76,996 KB
testcase_19 AC 96 ms
76,860 KB
testcase_20 AC 97 ms
76,960 KB
testcase_21 AC 93 ms
76,916 KB
testcase_22 AC 96 ms
76,936 KB
testcase_23 AC 97 ms
76,824 KB
testcase_24 AC 96 ms
76,836 KB
testcase_25 AC 98 ms
76,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

or が0になるような選び方の通り数

"""


from sys import stdin
import sys

N = int(stdin.readline())
mod = 998244353

M = 2**12

dp = [0] * M

for i in range(N):

    kC = list(map(int,stdin.readline().split()))
    bi = 0

    for j in range(1,len(kC)):
        nc = kC[j]-1
        bi += 2**nc

    for j in range(M):
        dp[j & bi] += dp[j]
        dp[j & bi] %= mod

    dp[bi] += 1

print (dp[0] % mod)
0