結果

問題 No.37 遊園地のアトラクション
ユーザー KudeKude
提出日時 2020-09-05 23:33:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 67,712 KB
最終ジャッジ日時 2024-04-18 20:19:24
合計ジャッジ時間 2,880 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
63,872 KB
testcase_01 AC 53 ms
61,056 KB
testcase_02 AC 60 ms
63,488 KB
testcase_03 AC 61 ms
64,128 KB
testcase_04 AC 58 ms
62,720 KB
testcase_05 AC 58 ms
62,848 KB
testcase_06 AC 61 ms
64,256 KB
testcase_07 AC 69 ms
67,072 KB
testcase_08 AC 56 ms
62,208 KB
testcase_09 AC 47 ms
59,136 KB
testcase_10 AC 67 ms
65,792 KB
testcase_11 AC 62 ms
65,664 KB
testcase_12 AC 58 ms
63,616 KB
testcase_13 AC 58 ms
64,640 KB
testcase_14 AC 56 ms
62,848 KB
testcase_15 AC 61 ms
62,848 KB
testcase_16 AC 64 ms
65,408 KB
testcase_17 AC 63 ms
64,896 KB
testcase_18 AC 65 ms
66,560 KB
testcase_19 AC 49 ms
58,752 KB
testcase_20 AC 59 ms
63,232 KB
testcase_21 AC 61 ms
63,744 KB
testcase_22 AC 60 ms
65,792 KB
testcase_23 AC 41 ms
51,968 KB
testcase_24 AC 41 ms
52,096 KB
testcase_25 AC 41 ms
51,840 KB
testcase_26 AC 41 ms
52,352 KB
testcase_27 AC 64 ms
67,712 KB
testcase_28 AC 50 ms
60,544 KB
testcase_29 AC 57 ms
63,232 KB
testcase_30 AC 42 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
n = int(input())
c = list(map(int, input().split()))
v = list(map(int, input().split()))
dp = [0] * (t + 1000)
for ci, vi in zip(c, v):
    for i in range(t, -1, -1):
        vnow = vi
        for j in range(i + ci, i + ci * 9 + 1, ci):
            dp[j] = max(dp[j], dp[j - ci] + vnow)
            vnow //= 2
print(dp[t])
0