結果

問題 No.1689 Set Cards
ユーザー titiatitia
提出日時 2021-09-24 23:23:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 77,036 KB
最終ジャッジ日時 2023-09-18 22:23:44
合計ジャッジ時間 3,699 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,100 KB
testcase_01 AC 78 ms
75,988 KB
testcase_02 AC 78 ms
76,160 KB
testcase_03 AC 77 ms
75,996 KB
testcase_04 AC 78 ms
76,320 KB
testcase_05 AC 77 ms
75,968 KB
testcase_06 AC 76 ms
76,328 KB
testcase_07 AC 78 ms
76,084 KB
testcase_08 AC 75 ms
76,064 KB
testcase_09 AC 73 ms
75,992 KB
testcase_10 AC 77 ms
76,204 KB
testcase_11 AC 96 ms
77,036 KB
testcase_12 AC 96 ms
76,904 KB
testcase_13 AC 94 ms
76,904 KB
testcase_14 AC 95 ms
76,784 KB
testcase_15 AC 83 ms
76,236 KB
testcase_16 AC 93 ms
76,620 KB
testcase_17 AC 81 ms
76,436 KB
testcase_18 AC 95 ms
76,908 KB
testcase_19 AC 94 ms
76,852 KB
testcase_20 AC 95 ms
76,676 KB
testcase_21 AC 99 ms
76,704 KB
testcase_22 AC 97 ms
76,484 KB
testcase_23 AC 97 ms
76,764 KB
testcase_24 AC 93 ms
76,636 KB
testcase_25 AC 94 ms
76,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())

mod=998244353

S=[list(map(int,input().split()))[1:] for i in range(N)]

DP=[0]*(1<<12)
DP[0]=1

for i in range(N):
    s=S[i]
    ax=0
    for j in range(12):
        if j+1 in s:
            continue
        ax+=(1<<j)

    for k in range((1<<12)-1,-1,-1):
        DP[ax|k]+=DP[k]
        DP[ax|k]%=mod

print(DP[-1])
0