結果

問題 No.1457 ツブ消ししとるなHard
ユーザー shiomusubi496shiomusubi496
提出日時 2021-03-26 11:40:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 54,096 KB
最終ジャッジ日時 2023-08-19 14:48:58
合計ジャッジ時間 7,719 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 13 ms
7,796 KB
testcase_02 AC 13 ms
7,744 KB
testcase_03 AC 13 ms
7,780 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 14 ms
7,728 KB
testcase_09 AC 120 ms
11,716 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 314 ms
16,636 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 14 ms
7,844 KB
testcase_18 AC 14 ms
7,684 KB
testcase_19 WA -
testcase_20 AC 14 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

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 i in range(M+1)]for i in range(N+1)]
    dp[0][0][0]=1
    for i in range(N):
        if A[i]<X:
            dp[i+1]=dp[i]
        if A[i]>Y:
            for j in range(M):
                for k in range(M*Z-A[i]+1):
                    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