結果
| 問題 | No.649 ここでちょっとQK! |
| コンテスト | |
| ユーザー |
Mr.Fuku
|
| 提出日時 | 2018-08-01 16:00:56 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 655 bytes |
| 記録 | |
| コンパイル時間 | 287 ms |
| コンパイル使用メモリ | 21,460 KB |
| 実行使用メモリ | 22,060 KB |
| 最終ジャッジ日時 | 2026-08-31 05:05:45 |
| 合計ジャッジ時間 | 6,542 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 4 TLE * 1 -- * 27 |
ソースコード
q,k = map(int,input().split())
index = k-1
lst = []
def ins(x):
l_len=len(lst)
if l_len==0:
lst.append(x)
else:
s,t = 0,l_len
while True:
m=(s+t)//2
if m==l_len:
lst.append(x)
return
elif lst[m]==x or not s<t:
lst.insert(m,x)
return
elif lst[m]<x:
s = m+1
else:
t = m
for i in range(q):
s=list(map(int,input().split()))
if s[0]==1:
ins(s[1])
else:
if len(lst)>=k:
print(lst.pop(index))
else:
print(-1)
Mr.Fuku