結果

問題 No.2730 Two Types Luggage
ユーザー june19312june19312
提出日時 2024-04-19 21:45:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 559 bytes
コンパイル時間 704 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 126,968 KB
最終ジャッジ日時 2024-04-19 21:45:26
合計ジャッジ時間 7,004 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
18,208 KB
testcase_01 AC 31 ms
11,264 KB
testcase_02 AC 30 ms
11,264 KB
testcase_03 AC 30 ms
11,136 KB
testcase_04 AC 29 ms
11,264 KB
testcase_05 AC 30 ms
11,264 KB
testcase_06 AC 30 ms
11,264 KB
testcase_07 AC 29 ms
11,008 KB
testcase_08 AC 28 ms
11,136 KB
testcase_09 AC 29 ms
11,136 KB
testcase_10 AC 85 ms
15,480 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