結果

問題 No.37 遊園地のアトラクション
ユーザー pluto77pluto77
提出日時 2017-08-12 09:53:07
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 333 bytes
コンパイル時間 915 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,876 KB
最終ジャッジ日時 2023-08-29 21:54:33
合計ジャッジ時間 7,039 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 19 ms
6,564 KB
testcase_02 AC 103 ms
6,612 KB
testcase_03 AC 148 ms
6,556 KB
testcase_04 AC 65 ms
6,468 KB
testcase_05 AC 100 ms
6,620 KB
testcase_06 AC 89 ms
6,584 KB
testcase_07 AC 448 ms
6,732 KB
testcase_08 AC 59 ms
6,468 KB
testcase_09 AC 29 ms
6,636 KB
testcase_10 AC 354 ms
6,468 KB
testcase_11 AC 345 ms
6,872 KB
testcase_12 AC 98 ms
6,556 KB
testcase_13 AC 137 ms
6,552 KB
testcase_14 AC 63 ms
6,576 KB
testcase_15 AC 74 ms
6,496 KB
testcase_16 AC 199 ms
6,628 KB
testcase_17 AC 167 ms
6,876 KB
testcase_18 AC 426 ms
6,656 KB
testcase_19 AC 28 ms
6,552 KB
testcase_20 AC 144 ms
6,632 KB
testcase_21 AC 70 ms
6,492 KB
testcase_22 AC 631 ms
6,804 KB
testcase_23 AC 17 ms
6,656 KB
testcase_24 AC 18 ms
6,560 KB
testcase_25 AC 17 ms
6,584 KB
testcase_26 AC 18 ms
6,636 KB
testcase_27 AC 86 ms
6,600 KB
testcase_28 AC 18 ms
6,508 KB
testcase_29 AC 55 ms
6,548 KB
testcase_30 AC 18 ms
6,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_37

dp=[-1 for i in xrange(100000)]
t=int(raw_input())
n=int(raw_input())
c=map(int,raw_input().split())
v=map(int,raw_input().split())
dp[0]=0
res=0
for i in xrange(n):
 while v[i]:
  for j in xrange(t,c[i]-1,-1):
   if dp[j]:
    dp[j]=max(dp[j],dp[j-c[i]]+v[i])
  v[i]/=2
for i in xrange(t+1):
 res=max(dp[i],res)
print res
0