結果

問題 No.3298 K-th Slime
ユーザー Treewhitetree
提出日時 2025-10-05 15:09:07
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 585 bytes
コンパイル時間 2,973 ms
コンパイル使用メモリ 278,468 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-10-05 15:09:14
合計ジャッジ時間 6,029 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
  int N, K, Q, A, t, n;
  cin >> N >> K >> Q;
  multiset<int> s;
  rep(i, N){
    cin >> A;
    s.insert(A);
  }
  auto itr = s.begin();
  rep(i, K-1)itr++;
  rep(i, Q){
    cin >> t;
    switch(t){
      case 1:
      cin >> n;
      if(*itr < n)s.insert(n);
      else{
        s.insert(n);
        itr--;
      }
      break;
      case 2:
      cin >> n;
      s.insert(*itr+n);
      itr = s.erase(itr);
      break;
      case 3:
      cout << *itr << endl;
    }
  }
}
0