結果

問題 No.649 ここでちょっとQK!
ユーザー tailstails
提出日時 2018-02-09 23:47:21
言語 cLay
(20231016-1)
結果
AC  
実行時間 121 ms / 3,000 ms
コード長 308 bytes
コンパイル時間 1,943 ms
コンパイル使用メモリ 163,672 KB
実行使用メモリ 13,748 KB
最終ジャッジ日時 2023-09-18 23:56:21
合計ジャッジ時間 7,854 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 4 ms
4,452 KB
testcase_04 AC 86 ms
13,748 KB
testcase_05 AC 83 ms
13,740 KB
testcase_06 AC 79 ms
13,728 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 42 ms
8,568 KB
testcase_13 AC 41 ms
8,300 KB
testcase_14 AC 40 ms
8,284 KB
testcase_15 AC 46 ms
8,344 KB
testcase_16 AC 43 ms
8,588 KB
testcase_17 AC 51 ms
8,896 KB
testcase_18 AC 57 ms
9,296 KB
testcase_19 AC 64 ms
9,884 KB
testcase_20 AC 71 ms
10,092 KB
testcase_21 AC 76 ms
10,460 KB
testcase_22 AC 82 ms
10,844 KB
testcase_23 AC 92 ms
11,252 KB
testcase_24 AC 102 ms
11,648 KB
testcase_25 AC 104 ms
12,192 KB
testcase_26 AC 121 ms
12,440 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 40 ms
7,860 KB
testcase_31 AC 41 ms
8,176 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,384 KB
testcase_34 AC 1 ms
4,384 KB
testcase_35 AC 1 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

multiset<ll> a,b;
ll q,k,v;
{
	rd(q,k);
	rep(q){
		rd(v);
		if(v==1){
			rd(v);
			a.insert(-v);
			if(a.size()==k){
				auto a1=a.begin();
				v=*a1;
				a.erase(a1);
				b.insert(-v);
			}
		}else{
			if(b.size()){
				auto b1=b.begin();
				wt(v=*b1);
				b.erase(b1);
			}else{
				wt(-1);
			}
		}
	}
}
0