結果
問題 | No.2453 Seat Allocation |
ユーザー | ニックネーム |
提出日時 | 2023-09-01 21:50:06 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 77 ms |
コンパイル使用メモリ | 10,984 KB |
実行使用メモリ | 40,188 KB |
最終ジャッジ日時 | 2023-09-01 21:50:16 |
合計ジャッジ時間 | 8,421 ms |
ジャッジサーバーID (参考情報) |
judge16 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
14,260 KB |
testcase_01 | AC | 28 ms
9,796 KB |
testcase_02 | AC | 28 ms
9,872 KB |
testcase_03 | AC | 28 ms
9,796 KB |
testcase_04 | AC | 29 ms
9,732 KB |
testcase_05 | AC | 1,979 ms
40,188 KB |
testcase_06 | AC | 903 ms
20,656 KB |
testcase_07 | AC | 608 ms
25,876 KB |
testcase_08 | AC | 366 ms
12,160 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 | -- | - |
ソースコード
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],b[0]),i,0)) while True: _,i,j = heappop(hq); print(i+1); m -= 1 if m==0: break heappush(hq,(Fraction(-a[i],b[j+1]),i,j+1))