結果

問題 No.2248 max(C)-min(C)
ユーザー tailstails
提出日時 2023-03-17 23:17:01
言語 cLay
(20240104-1)
結果
AC  
実行時間 121 ms / 3,000 ms
コード長 337 bytes
コンパイル時間 4,253 ms
コンパイル使用メモリ 177,244 KB
実行使用メモリ 16,432 KB
最終ジャッジ日時 2023-10-18 16:17:36
合計ジャッジ時間 8,395 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,704 KB
testcase_01 AC 2 ms
7,704 KB
testcase_02 AC 2 ms
7,704 KB
testcase_03 AC 2 ms
7,732 KB
testcase_04 AC 2 ms
7,724 KB
testcase_05 AC 3 ms
7,716 KB
testcase_06 AC 2 ms
7,768 KB
testcase_07 AC 3 ms
7,780 KB
testcase_08 AC 3 ms
7,780 KB
testcase_09 AC 3 ms
7,780 KB
testcase_10 AC 2 ms
7,712 KB
testcase_11 AC 3 ms
7,780 KB
testcase_12 AC 3 ms
7,740 KB
testcase_13 AC 3 ms
7,756 KB
testcase_14 AC 3 ms
7,780 KB
testcase_15 AC 3 ms
7,780 KB
testcase_16 AC 2 ms
7,732 KB
testcase_17 AC 3 ms
7,772 KB
testcase_18 AC 20 ms
15,444 KB
testcase_19 AC 5 ms
8,916 KB
testcase_20 AC 23 ms
16,432 KB
testcase_21 AC 22 ms
16,040 KB
testcase_22 AC 16 ms
13,792 KB
testcase_23 AC 11 ms
11,940 KB
testcase_24 AC 6 ms
9,556 KB
testcase_25 AC 20 ms
15,704 KB
testcase_26 AC 18 ms
14,904 KB
testcase_27 AC 20 ms
15,640 KB
testcase_28 AC 4 ms
8,640 KB
testcase_29 AC 19 ms
15,132 KB
testcase_30 AC 10 ms
11,264 KB
testcase_31 AC 22 ms
16,432 KB
testcase_32 AC 7 ms
9,836 KB
testcase_33 AC 9 ms
11,052 KB
testcase_34 AC 23 ms
16,432 KB
testcase_35 AC 22 ms
16,432 KB
testcase_36 AC 22 ms
16,432 KB
testcase_37 AC 13 ms
12,684 KB
testcase_38 AC 81 ms
16,432 KB
testcase_39 AC 80 ms
16,432 KB
testcase_40 AC 83 ms
16,432 KB
testcase_41 AC 69 ms
15,296 KB
testcase_42 AC 82 ms
16,432 KB
testcase_43 AC 69 ms
15,528 KB
testcase_44 AC 79 ms
16,432 KB
testcase_45 AC 61 ms
14,684 KB
testcase_46 AC 31 ms
11,816 KB
testcase_47 AC 84 ms
16,432 KB
testcase_48 AC 66 ms
16,432 KB
testcase_49 AC 121 ms
16,432 KB
testcase_50 AC 121 ms
16,432 KB
testcase_51 AC 118 ms
16,432 KB
testcase_52 AC 118 ms
16,432 KB
testcase_53 AC 17 ms
9,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@a[n],@b[];
Heap<pair<ll,pair<ll,ll>>>h;
h.malloc(n);
ll mx=0;
rep(i,n){
	ll x=min(a[i],b[i]);
	h.push({x,{abs(a[i]-b[i])>>1,2}});
	mx>?=x;
}
ll z=mx;
while(true){
	auto c=h.pop();
	z<?=mx-c.first;
	if(c.second.second==0){
		break;
	}
	ll x=c.first+c.second.first;
	h.push({x,{c.second.first,c.second.second-1}});
	mx>?=x;
}
wt(z);
0