結果
問題 |
No.2730 Two Types Luggage
|
ユーザー |
![]() |
提出日時 | 2024-04-19 22:04:02 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 510 bytes |
コンパイル時間 | 298 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 253,760 KB |
最終ジャッジ日時 | 2024-10-11 15:13:42 |
合計ジャッジ時間 | 5,876 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 TLE * 1 -- * 26 |
ソースコード
from heapq import heappop,heappush 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): heappush(t,(-v,-v,1)) for i,v in enumerate(B): heappush(t,(-(C[i]//B[i]),-C[i],B[i])) ans = 0 weight = 0 while t: tanka,value,omosa = heappop(t) # print("tanka",tanka,"omosa",omosa,"value",value) if weight + omosa <= W: weight += omosa ans += value*(-1) print(ans)