結果
問題 | No.1457 ツブ消ししとるなHard |
ユーザー | roaris |
提出日時 | 2021-03-31 21:41:05 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 710 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 86,816 KB |
実行使用メモリ | 123,180 KB |
最終ジャッジ日時 | 2023-08-22 00:11:59 |
合計ジャッジ時間 | 5,675 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 119 ms
77,900 KB |
testcase_01 | AC | 90 ms
71,352 KB |
testcase_02 | WA | - |
testcase_03 | AC | 107 ms
77,436 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 88 ms
71,360 KB |
testcase_08 | AC | 90 ms
71,560 KB |
testcase_09 | AC | 166 ms
90,800 KB |
testcase_10 | AC | 165 ms
90,788 KB |
testcase_11 | AC | 118 ms
77,888 KB |
testcase_12 | AC | 314 ms
123,180 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 218 ms
100,384 KB |
testcase_16 | AC | 253 ms
122,664 KB |
testcase_17 | AC | 91 ms
71,544 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
ソースコード
import sys input = sys.stdin.readline from collections import * N, M, X, Y, Z = map(int, input().split()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if A[i]>=X: cnt += 1 if cnt>M: print('Handicapped') exit() dp = [[[0]*2510 for _ in range(N+1)] for _ in range(N+1)] dp[0][0][0] = 1 for i in range(N): for j in range(N+1): for k in range(2510): if A[i]>Y and j+1<=N and k+A[i]<2510: dp[i+1][j+1][k+A[i]] += dp[i][j][k] if A[i]<X: dp[i+1][j][k] += dp[i][j][k] ans = 0 for i in range(M+1): for j in range(2510): if j==i*Z: ans += dp[N][i][j] print(ans)