結果

問題 No.2453 Seat Allocation
ユーザー mkawa2mkawa2
提出日時 2023-09-01 22:28:29
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,006 bytes
コンパイル時間 1,121 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 106,516 KB
最終ジャッジ日時 2023-09-01 22:28:37
合計ジャッジ時間 8,176 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,476 KB
testcase_01 AC 75 ms
71,436 KB
testcase_02 AC 76 ms
71,328 KB
testcase_03 RE -
testcase_04 AC 77 ms
71,268 KB
testcase_05 AC 284 ms
106,516 KB
testcase_06 AC 188 ms
90,624 KB
testcase_07 RE -
testcase_08 AC 134 ms
79,000 KB
testcase_09 AC 432 ms
103,484 KB
testcase_10 AC 438 ms
103,688 KB
testcase_11 AC 421 ms
103,180 KB
testcase_12 AC 220 ms
90,660 KB
testcase_13 AC 227 ms
90,500 KB
testcase_14 AC 141 ms
90,224 KB
testcase_15 AC 267 ms
91,064 KB
testcase_16 AC 267 ms
90,248 KB
testcase_17 AC 77 ms
71,632 KB
testcase_18 AC 352 ms
99,584 KB
testcase_19 AC 374 ms
102,372 KB
testcase_20 AC 219 ms
85,404 KB
testcase_21 AC 222 ms
87,760 KB
testcase_22 AC 326 ms
97,456 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 *

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)
    jj[i]+=1
    j=jj[i]
    heappush(hp,(bb[j]/aa[i],i))
    ans.append(i+1)

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