結果

問題 No.1457 ツブ消ししとるなHard
ユーザー shiomusubi496shiomusubi496
提出日時 2021-03-27 08:43:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 640 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 84,368 KB
最終ジャッジ日時 2023-08-19 14:50:40
合計ジャッジ時間 7,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,X,Y,Z=map(int,input().split())
cnt=0
A=list(map(int,input().split()))
for i in range(N):
    if A[i]>=X:
        cnt+=1
if cnt>M:
    print("Handicapped")
else:
    dp=[[[0]*(M*Z+1) for j in range(M+1)]for i in range(N+1)]
    dp[0][0][0]=1
    for i in range(N):
        if A[i]<X:
            for j in range(M):
                for k in range(M*Z+1):
                    dp[i+1][j][k]=dp[i][j][k]
        if A[i]>Y:
            for j in range(M):
                k=0
                while k+A[i]<=M*Z:
                    dp[i+1][j+1][k+A[i]]+=dp[i][j][k]
    ans=0
    for i in range(1,M+1):
        ans+=dp[N][i][i*Z]
    print(ans)
0