結果
| 問題 | No.3509 Get More Money |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 05:41:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,069 bytes |
| 記録 | |
| コンパイル時間 | 281 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 52,736 KB |
| 最終ジャッジ日時 | 2026-04-18 05:41:19 |
| 合計ジャッジ時間 | 7,330 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 60 |
ソースコード
import sys
import heapq
def solve():
input = sys.stdin.read().split()
if not input:
return
idx = 0
T_cases = int(input[idx])
idx += 1
results = []
for _ in range(T_cases):
N = int(input[idx])
K = int(input[idx+1])
idx += 2
A = list(map(int, input[idx : idx + N]))
idx += N
B = list(map(int, input[idx : idx + N]))
idx += N
C = list(map(int, input[idx : idx + N]))
idx += N
D = list(map(int, input[idx : idx + N]))
idx += N
total_profit = 0
buy_heap = []
current_inventory = 0
for i in range(N):
heapq.heappush(buy_heap, (A[i], B[i]))
can_sell = D[i]
while can_sell > 0 and buy_heap:
cost, count = heapq.heappop(buy_heap)
if cost < C[i]:
trade_qty = min(can_sell, count)
results.append(calculate_max_profit(N, K, A, B, C, D))
print('\n'.join(map(str, results)))
def calculate_max_profit(N, K, A, B, C, D):
pass