結果

問題 No.37 遊園地のアトラクション
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-01-01 10:40:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 301 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 65,596 KB
最終ジャッジ日時 2024-04-18 04:40:01
合計ジャッジ時間 2,746 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
62,352 KB
testcase_01 AC 47 ms
61,588 KB
testcase_02 AC 53 ms
64,720 KB
testcase_03 AC 52 ms
64,128 KB
testcase_04 AC 50 ms
63,184 KB
testcase_05 AC 53 ms
64,352 KB
testcase_06 AC 52 ms
64,508 KB
testcase_07 AC 58 ms
64,464 KB
testcase_08 AC 46 ms
63,444 KB
testcase_09 AC 43 ms
60,328 KB
testcase_10 AC 51 ms
63,132 KB
testcase_11 AC 52 ms
64,352 KB
testcase_12 AC 47 ms
64,180 KB
testcase_13 AC 48 ms
63,660 KB
testcase_14 AC 45 ms
64,436 KB
testcase_15 AC 46 ms
64,280 KB
testcase_16 AC 51 ms
65,596 KB
testcase_17 AC 49 ms
63,140 KB
testcase_18 AC 51 ms
63,032 KB
testcase_19 AC 39 ms
60,468 KB
testcase_20 AC 46 ms
63,820 KB
testcase_21 AC 46 ms
62,500 KB
testcase_22 AC 49 ms
60,704 KB
testcase_23 AC 34 ms
52,920 KB
testcase_24 AC 33 ms
52,140 KB
testcase_25 AC 33 ms
52,064 KB
testcase_26 AC 38 ms
58,176 KB
testcase_27 AC 46 ms
63,604 KB
testcase_28 AC 38 ms
60,608 KB
testcase_29 AC 48 ms
64,060 KB
testcase_30 AC 33 ms
53,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
n = int(input())
C = list(map(int,input().split()))
V = list(map(int,input().split()))

dp = [0]*(T+1)
for c,v in zip(C,V):
    for i in range(10):
        for t in range(T+1)[::-1]:
            if c+t <= T:
                dp[c+t] = max(dp[c+t],dp[t]+v)
        v //= 2
print(dp[-1])
0