結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2024-12-22 06:49:52 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 441 bytes |
| 記録 | |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 138,900 KB |
| 最終ジャッジ日時 | 2026-05-28 15:21:23 |
| 合計ジャッジ時間 | 23,509 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 TLE * 3 |
ソースコード
from fractions import Fraction
from heapq import heappush, heappop
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
que = []
for i in range(N):
heappush(que, (-Fraction(A[i], B[0]), i, 0))
for _ in range(M):
f, i, j = heappop(que)
f = -f
print(i+1)
if j+1 < M:
heappush(que, (-Fraction(A[i], B[j+1]), i, j+1))
else:
heappush(que, (0, i, j+1))
detteiuu