結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 4 ms
4,524 KB
testcase_04 AC 90 ms
13,816 KB
testcase_05 AC 85 ms
13,732 KB
testcase_06 AC 82 ms
13,708 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 44 ms
8,308 KB
testcase_13 AC 45 ms
8,312 KB
testcase_14 AC 44 ms
8,320 KB
testcase_15 AC 49 ms
8,328 KB
testcase_16 AC 46 ms
8,636 KB
testcase_17 AC 58 ms
8,880 KB
testcase_18 AC 65 ms
9,336 KB
testcase_19 AC 74 ms
9,720 KB
testcase_20 AC 81 ms
10,080 KB
testcase_21 AC 89 ms
10,436 KB
testcase_22 AC 111 ms
11,016 KB
testcase_23 AC 115 ms
11,232 KB
testcase_24 AC 118 ms
11,712 KB
testcase_25 AC 133 ms
12,268 KB
testcase_26 AC 143 ms
12,432 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 41 ms
8,060 KB
testcase_31 AC 47 ms
8,148 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

multiset<ll> a;
multiset<ll> 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