結果

問題 No.649 ここでちょっとQK!
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-30 16:57:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 316 ms / 3,000 ms
コード長 284 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 166,544 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-04-23 13:05:42
合計ジャッジ時間 8,685 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,820 KB
testcase_02 AC 2 ms
6,816 KB
testcase_03 AC 297 ms
6,944 KB
testcase_04 AC 259 ms
12,928 KB
testcase_05 AC 257 ms
12,928 KB
testcase_06 AC 260 ms
12,800 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 134 ms
7,296 KB
testcase_13 AC 138 ms
7,168 KB
testcase_14 AC 133 ms
7,168 KB
testcase_15 AC 139 ms
7,424 KB
testcase_16 AC 137 ms
7,808 KB
testcase_17 AC 155 ms
8,064 KB
testcase_18 AC 173 ms
8,448 KB
testcase_19 AC 195 ms
8,704 KB
testcase_20 AC 212 ms
9,216 KB
testcase_21 AC 228 ms
9,472 KB
testcase_22 AC 239 ms
9,728 KB
testcase_23 AC 254 ms
10,112 KB
testcase_24 AC 280 ms
10,624 KB
testcase_25 AC 296 ms
10,880 KB
testcase_26 AC 316 ms
11,264 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 3 ms
6,944 KB
testcase_29 AC 3 ms
6,944 KB
testcase_30 AC 96 ms
7,296 KB
testcase_31 AC 106 ms
7,552 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,940 KB
testcase_35 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:2:59: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;long long K,V;multiset<long long> a,b;main(){for(cin>>V>>K;cin>>V;)if(V<2){cin>>V;a.insert(-V);if(a.size()==K){auto i=a.begin();b.insert(-*i);a.erase(i);}}else{if(b.size()){auto i=b.begin();cout<<*i<<endl;b.erase(i);}else{cout<<-1<<endl;}}}
      |                                                           ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;long long K,V;multiset<long long> a,b;main(){for(cin>>V>>K;cin>>V;)if(V<2){cin>>V;a.insert(-V);if(a.size()==K){auto i=a.begin();b.insert(-*i);a.erase(i);}}else{if(b.size()){auto i=b.begin();cout<<*i<<endl;b.erase(i);}else{cout<<-1<<endl;}}}
0