結果

問題 No.2453 Seat Allocation
ユーザー mkawa2mkawa2
提出日時 2023-09-09 02:08:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,030 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 98,092 KB
最終ジャッジ日時 2023-09-09 02:09:05
合計ジャッジ時間 7,537 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,224 KB
testcase_01 AC 80 ms
71,224 KB
testcase_02 AC 74 ms
71,380 KB
testcase_03 AC 77 ms
71,332 KB
testcase_04 AC 77 ms
71,288 KB
testcase_05 AC 267 ms
98,092 KB
testcase_06 WA -
testcase_07 AC 145 ms
90,876 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 315 ms
90,440 KB
testcase_13 AC 238 ms
90,632 KB
testcase_14 AC 157 ms
90,160 KB
testcase_15 AC 281 ms
90,664 KB
testcase_16 AC 253 ms
90,428 KB
testcase_17 AC 77 ms
71,396 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 228 ms
85,104 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 73 ms
71,360 KB
testcase_24 AC 73 ms
71,132 KB
権限があれば一括ダウンロードができます

ソースコード

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 *

C=10**12
n,m=LI()
aa=LI()
bb=LI()

jj=[0]*n
hp=[]
for i in range(n):
    heappush(hp,(bb[0]*C//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]*C//aa[i],i))

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