結果

問題 No.1689 Set Cards
ユーザー 👑 KazunKazun
提出日時 2021-09-24 22:40:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 77,100 KB
最終ジャッジ日時 2023-09-18 21:50:02
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
76,044 KB
testcase_01 AC 83 ms
76,028 KB
testcase_02 AC 83 ms
76,032 KB
testcase_03 AC 81 ms
76,120 KB
testcase_04 AC 81 ms
76,148 KB
testcase_05 AC 86 ms
76,172 KB
testcase_06 AC 84 ms
76,192 KB
testcase_07 AC 85 ms
76,144 KB
testcase_08 AC 80 ms
76,208 KB
testcase_09 AC 82 ms
76,096 KB
testcase_10 AC 84 ms
76,036 KB
testcase_11 AC 115 ms
76,820 KB
testcase_12 AC 108 ms
76,812 KB
testcase_13 AC 109 ms
76,916 KB
testcase_14 AC 108 ms
76,740 KB
testcase_15 AC 91 ms
76,576 KB
testcase_16 AC 105 ms
77,012 KB
testcase_17 AC 88 ms
76,196 KB
testcase_18 AC 112 ms
77,100 KB
testcase_19 AC 109 ms
76,972 KB
testcase_20 AC 109 ms
76,952 KB
testcase_21 AC 102 ms
77,012 KB
testcase_22 AC 104 ms
76,908 KB
testcase_23 AC 106 ms
76,732 KB
testcase_24 AC 110 ms
76,940 KB
testcase_25 AC 111 ms
77,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def encode(S):
    X=0
    for s in S:
        X+=1<<(s-1)
    return X

N=int(input())
Mod=998244353

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

for _ in range(N):
    k,*C=map(int,input().split())

    y=encode(C)

    for x in range(1<<12):
        DP[x&y]+=DP[x]

    for x in range(1<<12):
        DP[x]%=Mod

print(DP[0])
0