結果

問題 No.2453 Seat Allocation
ユーザー mkawa2mkawa2
提出日時 2023-09-01 22:29:25
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,015 bytes
コンパイル時間 1,033 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 106,632 KB
最終ジャッジ日時 2023-09-02 11:13:07
合計ジャッジ時間 7,381 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,328 KB
testcase_01 AC 72 ms
71,464 KB
testcase_02 AC 73 ms
71,328 KB
testcase_03 AC 73 ms
71,544 KB
testcase_04 AC 73 ms
71,212 KB
testcase_05 AC 308 ms
106,632 KB
testcase_06 AC 150 ms
90,700 KB
testcase_07 AC 143 ms
91,952 KB
testcase_08 AC 132 ms
78,864 KB
testcase_09 AC 393 ms
103,336 KB
testcase_10 AC 371 ms
103,624 KB
testcase_11 AC 388 ms
103,364 KB
testcase_12 AC 204 ms
90,480 KB
testcase_13 AC 208 ms
91,084 KB
testcase_14 AC 135 ms
90,340 KB
testcase_15 AC 251 ms
90,448 KB
testcase_16 AC 252 ms
90,084 KB
testcase_17 AC 78 ms
71,212 KB
testcase_18 AC 303 ms
99,652 KB
testcase_19 AC 341 ms
102,420 KB
testcase_20 AC 207 ms
85,244 KB
testcase_21 AC 204 ms
87,556 KB
testcase_22 AC 283 ms
97,476 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(1000005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = -1-(-1 << 63)
# md = 10**9+7
md = 998244353

from heapq import *

n,m=LI()
aa=LI()
bb=LI()

jj=[0]*n
hp=[]
for i in range(n):
    heappush(hp,(bb[0]/aa[i],i))

ans=[]
for _ in range(m):
    _,i=heappop(hp)
    ans.append(i+1)
    jj[i]+=1
    j = jj[i]
    if j<m:heappush(hp,(bb[j]/aa[i],i))

print(*ans,sep="\n")
0