結果

問題 No.2453 Seat Allocation
ユーザー mymelochanmymelochan
提出日時 2023-09-02 17:30:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 814 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 86,520 KB
実行使用メモリ 108,500 KB
最終ジャッジ日時 2023-09-02 17:30:16
合計ジャッジ時間 8,256 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,332 KB
testcase_01 AC 97 ms
71,356 KB
testcase_02 AC 98 ms
71,480 KB
testcase_03 AC 97 ms
71,600 KB
testcase_04 AC 100 ms
71,412 KB
testcase_05 AC 330 ms
108,500 KB
testcase_06 AC 180 ms
93,116 KB
testcase_07 AC 182 ms
104,172 KB
testcase_08 AC 162 ms
79,596 KB
testcase_09 AC 404 ms
107,680 KB
testcase_10 AC 400 ms
107,628 KB
testcase_11 AC 434 ms
107,896 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 164 ms
92,328 KB
testcase_15 AC 228 ms
93,352 KB
testcase_16 AC 223 ms
92,440 KB
testcase_17 AC 97 ms
71,396 KB
testcase_18 AC 313 ms
96,072 KB
testcase_19 AC 357 ms
102,068 KB
testcase_20 AC 235 ms
86,064 KB
testcase_21 AC 242 ms
88,968 KB
testcase_22 AC 292 ms
94,012 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations

ipt = sys.stdin.readline

def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))

MOD = 998244353
L = 10**15
#############################################################

N,M = lmin()
A = lmin()
B = lmin()

cnt = [1]*N
hq = []
for i,a in enumerate(A):
    heappush(hq,(-a/B[0]*L+i,i))

ans = []
while len(ans) < M:
    _,idx = heappop(hq)
    ans.append(idx+1)
    if cnt[idx] >= M:
        break
    heappush(hq,(-A[idx]/B[cnt[idx]]*L+idx,idx))
    cnt[idx] += 1


for a in ans:
    print(a)
0