結果
| 問題 | No.2453 Seat Allocation |
| コンテスト | |
| ユーザー |
ゼット
|
| 提出日時 | 2023-09-01 22:07:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 345 ms / 2,000 ms |
| + 793µs | |
| コード長 | 538 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 96,244 KB |
| 実行使用メモリ | 113,532 KB |
| 最終ジャッジ日時 | 2026-07-12 09:22:52 |
| 合計ジャッジ時間 | 5,798 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
from heapq import heappush,heappop
S=[]
T={}
for i in range(N):
x=A[i]*(10**20)
x//=B[0]
score=x*10**6+(10**5-i)
heappush(S,-score)
count=0
while True:
count+=1
score=heappop(S)
score=-score
ans=score%(10**6)
ans=10**5-ans
print(ans+1)
if not ans in T:
T[ans]=1
else:
T[ans]+=1
if count==M:
break
else:
n=T[ans]
x=A[ans]*10**20
x//=B[n]
score=x*10**6+10**5-ans
heappush(S,-score)
ゼット