結果

問題 No.649 ここでちょっとQK!
ユーザー 💕💖💞
提出日時 2018-11-22 17:22:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 302 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 36,572 KB
最終ジャッジ日時 2024-12-24 17:42:31
合計ジャッジ時間 73,761 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 TLE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

Q, K = map(int, input().split())

s = []

for q in range(Q):
  line = input().strip()
  if line[0] == '1':
    _, val = map(int, line.split())
    s.append(val)
  if line[0] == '2':
    if len(s) < K:
      print(-1)
      continue
    else:
      s = sorted(s)
      val = s.pop(K-1)
      print(val)
0