結果
| 問題 | No.1163 I want to be a high achiever |
| ユーザー |
|
| 提出日時 | 2020-08-11 15:36:24 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,904 KB |
| 最終ジャッジ日時 | 2026-09-12 13:56:19 |
| 合計ジャッジ時間 | 48,099 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 TLE * 10 |
ソースコード
n, x = [int(i) for i in input().split()]
a = [int(i)-x for i in input().split()]
b = [int(i) for i in input().split()]
if all(map(lambda x: x < 0, a)):
print(-1)
exit()
sum_a = sum(a)
if sum_a >= 0:
print(0)
exit()
sum_a *= -1
dp = [10 ** 8] * (sum_a+1)
dp[0] = 0
for index, score in enumerate(a):
if score >= 0:
continue
for i in reversed(range(sum_a)):
j = min(sum_a, i - score)
dp[j] = min(dp[j], dp[i] + b[index])
print(dp[-1])