結果

問題 No.2453 Seat Allocation
ユーザー chineristACchineristAC
提出日時 2023-09-27 14:07:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 1,069 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 105,884 KB
最終ジャッジ日時 2023-09-27 14:07:35
合計ジャッジ時間 9,164 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
74,620 KB
testcase_01 AC 94 ms
74,572 KB
testcase_02 AC 93 ms
74,612 KB
testcase_03 AC 96 ms
74,700 KB
testcase_04 AC 98 ms
74,616 KB
testcase_05 AC 337 ms
104,856 KB
testcase_06 AC 196 ms
95,236 KB
testcase_07 AC 213 ms
95,008 KB
testcase_08 AC 180 ms
83,912 KB
testcase_09 AC 455 ms
105,884 KB
testcase_10 AC 414 ms
104,908 KB
testcase_11 AC 432 ms
104,892 KB
testcase_12 AC 247 ms
94,888 KB
testcase_13 AC 259 ms
95,524 KB
testcase_14 AC 179 ms
95,008 KB
testcase_15 AC 317 ms
95,224 KB
testcase_16 AC 310 ms
94,772 KB
testcase_17 AC 100 ms
74,416 KB
testcase_18 AC 339 ms
103,584 KB
testcase_19 AC 373 ms
101,324 KB
testcase_20 AC 267 ms
90,140 KB
testcase_21 AC 256 ms
94,592 KB
testcase_22 AC 307 ms
101,892 KB
testcase_23 WA -
testcase_24 AC 95 ms
74,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random
from itertools import permutations
from collections import deque
from heapq import *

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,M = mi()
A = li()
B = li()

select = []
idx = [0 for i in range(N)]
t = 10**20
pq = [(-A[i]*t/B[0],i) for i in range(N)]
heapify(pq)
while len(select) < M:
    val,i = heappop(pq)
    select.append((i,idx[i]))
    idx[i] += 1
    if idx[i] < M:
        val = -A[i]*t/B[idx[i]]
        heappush(pq,(val,i))


for i,j in select:
    print(i+1)






0