結果

問題 No.2453 Seat Allocation
ユーザー ニックネームニックネーム
提出日時 2023-09-01 21:49:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 376 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 40,204 KB
最終ジャッジ日時 2023-09-01 21:49:45
合計ジャッジ時間 10,143 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,884 KB
testcase_01 AC 30 ms
9,724 KB
testcase_02 AC 30 ms
9,724 KB
testcase_03 AC 31 ms
9,844 KB
testcase_04 AC 31 ms
9,660 KB
testcase_05 TLE -
testcase_06 AC 1,152 ms
20,528 KB
testcase_07 AC 851 ms
25,724 KB
testcase_08 AC 426 ms
12,072 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0