結果

問題 No.2028 Even Choice
ユーザー tailstails
提出日時 2022-08-05 21:38:00
言語 cLay
(20240104-1)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 164,912 KB
実行使用メモリ 7,648 KB
最終ジャッジ日時 2023-10-13 22:12:51
合計ジャッジ時間 3,816 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
6,796 KB
testcase_01 AC 21 ms
7,620 KB
testcase_02 AC 24 ms
6,512 KB
testcase_03 AC 13 ms
7,648 KB
testcase_04 AC 14 ms
7,636 KB
testcase_05 AC 5 ms
4,352 KB
testcase_06 AC 20 ms
6,616 KB
testcase_07 AC 6 ms
4,580 KB
testcase_08 AC 15 ms
5,452 KB
testcase_09 AC 16 ms
6,140 KB
testcase_10 AC 5 ms
4,456 KB
testcase_11 AC 5 ms
4,348 KB
testcase_12 AC 3 ms
4,352 KB
testcase_13 AC 14 ms
7,196 KB
testcase_14 AC 7 ms
4,424 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 2 ms
4,372 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,352 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 2 ms
4,352 KB
testcase_24 AC 1 ms
4,356 KB
testcase_25 AC 2 ms
4,368 KB
testcase_26 AC 2 ms
4,356 KB
testcase_27 AC 2 ms
4,352 KB
testcase_28 AC 7 ms
5,372 KB
testcase_29 AC 4 ms
4,828 KB
testcase_30 AC 3 ms
4,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@k,@a[n],z=0,s=0,x;
priority_queue<ll>q;
rrep(i,n-k+1,n){
	x=a[i];
	s+=x;
	q.push(-x);
}
rrep(i,n-k+1){
	x=a[i];
	if(i&1){
		z>?=s+x;
	}
	s+=x;
	q.push(-x);
	x=-q.top(); q.pop();
	s-=x;
}
wt(z);
0