結果

問題 No.1689 Set Cards
ユーザー NoneNone
提出日時 2021-10-06 01:40:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 77,204 KB
最終ジャッジ日時 2023-09-30 08:36:32
合計ジャッジ時間 4,160 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,056 KB
testcase_01 AC 75 ms
76,212 KB
testcase_02 AC 75 ms
76,176 KB
testcase_03 AC 75 ms
76,212 KB
testcase_04 AC 74 ms
76,364 KB
testcase_05 AC 74 ms
76,280 KB
testcase_06 AC 75 ms
75,948 KB
testcase_07 AC 76 ms
76,148 KB
testcase_08 AC 74 ms
75,964 KB
testcase_09 AC 74 ms
75,912 KB
testcase_10 AC 76 ms
76,196 KB
testcase_11 AC 103 ms
77,064 KB
testcase_12 AC 106 ms
77,112 KB
testcase_13 AC 99 ms
77,096 KB
testcase_14 AC 107 ms
77,156 KB
testcase_15 AC 80 ms
76,320 KB
testcase_16 AC 92 ms
76,984 KB
testcase_17 AC 76 ms
75,988 KB
testcase_18 AC 98 ms
77,200 KB
testcase_19 AC 95 ms
77,120 KB
testcase_20 AC 96 ms
77,040 KB
testcase_21 AC 92 ms
77,060 KB
testcase_22 AC 94 ms
76,960 KB
testcase_23 AC 95 ms
76,732 KB
testcase_24 AC 98 ms
77,204 KB
testcase_25 AC 96 ms
76,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=998244353
N=int(input())
L=12
mask=(1<<L)-1
dp=[0]*(1<<L)
dp[mask]=1
for _ in range(N):
    C=list(map(int, input().split()))
    b=0
    for c in C[1:]:
        c-=1
        b|=1<<c
    for bit in range(1<<L):
        dp[b&bit]+=dp[bit]
        dp[b&bit]%=MOD

print(dp[0])
0