結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
ニックネーム
|
| 提出日時 | 2023-09-01 21:49:33 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 12,032 KB |
| 実行使用メモリ | 52,668 KB |
| 最終ジャッジ日時 | 2025-01-03 08:12:31 |
| 合計ジャッジ時間 | 34,225 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 TLE * 8 |
ソースコード
from heapq import heappop,heappush
from fractions import Fraction
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
hq = []
for i in range(n): heappush(hq,(Fraction(-a[i])/Fraction(b[0]),i,0))
while True:
_,i,j = heappop(hq); print(i+1); m -= 1
if m==0: break
heappush(hq,(Fraction(-a[i])/Fraction(b[j+1]),i,j+1))
ニックネーム