結果

問題 No.2730 Two Types Luggage
ユーザー june19312
提出日時 2024-04-19 21:45:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 559 bytes
コンパイル時間 627 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 125,312 KB
最終ジャッジ日時 2024-10-11 14:39:20
合計ジャッジ時間 6,288 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal,getcontext

#小数点何桁まで精度を持たせたいか設定

getcontext().prec = 100

N,M,W = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
t = []
for i,v in enumerate(A):
    t.append([v,1,v])
for i,v in enumerate(B):
    t.append([Decimal(C[i])/Decimal(B[i]),B[i],C[i]])

t.sort()
#print(t)

ans = 0
weight = 0
while t:
    tanka,omosa,value = t.pop()
    if weight + omosa <= W:
        weight += omosa
        ans += value

print(ans)
0