結果

問題 No.1457 ツブ消ししとるなHard
ユーザー convexineqconvexineq
提出日時 2021-05-05 21:09:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 1,194 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 87,884 KB
最終ジャッジ日時 2023-10-11 15:14:05
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,372 KB
testcase_01 AC 92 ms
71,348 KB
testcase_02 WA -
testcase_03 AC 96 ms
71,544 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 91 ms
71,508 KB
testcase_08 AC 93 ms
71,556 KB
testcase_09 AC 102 ms
76,708 KB
testcase_10 AC 102 ms
76,792 KB
testcase_11 AC 94 ms
71,568 KB
testcase_12 AC 123 ms
78,004 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 105 ms
77,316 KB
testcase_16 AC 94 ms
71,604 KB
testcase_17 AC 103 ms
76,968 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,x,y,z = map(int,input().split())
*a, = map(int,input().split())
from collections import defaultdict
dp = defaultdict(int)
dp[(0,0)] = 1
V = C = 0
for ai in a:
    if ai >= x:
        V += ai-z
        C += 1
    elif ai > y:
        ndp = dp.copy()
        for (v,c),r in dp.items():
            ndp[(v+ai-z,c+1)] += r
        dp = ndp
print(sum(dp[(-V,i)] for i in range(m+1-C)) if C <= m else "Handicapped")
0