結果

問題 No.1689 Set Cards
ユーザー chineristACchineristAC
提出日時 2021-09-24 21:39:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 78,948 KB
最終ジャッジ日時 2023-09-18 20:57:53
合計ジャッジ時間 4,855 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
77,724 KB
testcase_01 AC 102 ms
77,872 KB
testcase_02 AC 105 ms
77,660 KB
testcase_03 AC 104 ms
77,716 KB
testcase_04 AC 104 ms
77,756 KB
testcase_05 AC 107 ms
77,652 KB
testcase_06 AC 107 ms
77,636 KB
testcase_07 AC 106 ms
77,840 KB
testcase_08 AC 99 ms
76,932 KB
testcase_09 AC 100 ms
77,160 KB
testcase_10 AC 106 ms
77,520 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 134 ms
78,836 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 131 ms
78,644 KB
testcase_20 AC 129 ms
78,948 KB
testcase_21 AC 121 ms
78,596 KB
testcase_22 AC 123 ms
78,340 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

mod = 998244353

N = int(input())

dp = [0 for i in range(4096)]
dp[4095] = 1

for i in range(N):
    k,*C = li()
    tmp = 0
    for c in C:
        tmp += pow(2,c-1)
    
    ndp = [dp[j] for j in range(4096)]
    for j in range(4096):
        ndp[j&tmp] += dp[j]
        ndp[j] %= mod
    dp = ndp

print(dp[0])
0