結果

問題 No.2730 Two Types Luggage
ユーザー june19312june19312
提出日時 2024-04-19 21:44:14
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 559 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 297,648 KB
最終ジャッジ日時 2024-04-19 21:44:34
合計ジャッジ時間 7,399 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
84,992 KB
testcase_01 AC 102 ms
79,744 KB
testcase_02 AC 105 ms
79,744 KB
testcase_03 AC 111 ms
79,872 KB
testcase_04 AC 107 ms
79,872 KB
testcase_05 AC 108 ms
79,872 KB
testcase_06 AC 104 ms
79,872 KB
testcase_07 AC 101 ms
79,744 KB
testcase_08 AC 104 ms
79,872 KB
testcase_09 AC 101 ms
79,360 KB
testcase_10 AC 195 ms
85,248 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

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