結果

問題 No.1251 絶対に間違ってはいけない最小化問題
ユーザー tailstails
提出日時 2020-10-09 22:08:39
言語 cLay
(20240104-1)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 5,313 ms
コンパイル使用メモリ 215,044 KB
実行使用メモリ 14,392 KB
最終ジャッジ日時 2023-09-19 01:34:56
合計ジャッジ時間 23,171 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
9,500 KB
testcase_01 AC 3 ms
9,576 KB
testcase_02 AC 3 ms
9,560 KB
testcase_03 AC 3 ms
9,556 KB
testcase_04 AC 3 ms
9,724 KB
testcase_05 AC 3 ms
9,580 KB
testcase_06 AC 3 ms
9,656 KB
testcase_07 AC 3 ms
9,500 KB
testcase_08 AC 3 ms
9,504 KB
testcase_09 AC 3 ms
9,684 KB
testcase_10 AC 2 ms
9,512 KB
testcase_11 AC 3 ms
9,612 KB
testcase_12 AC 3 ms
9,552 KB
testcase_13 AC 2 ms
9,512 KB
testcase_14 AC 3 ms
9,660 KB
testcase_15 AC 3 ms
9,468 KB
testcase_16 AC 3 ms
9,512 KB
testcase_17 AC 3 ms
9,460 KB
testcase_18 AC 19 ms
14,160 KB
testcase_19 AC 18 ms
14,076 KB
testcase_20 AC 12 ms
11,432 KB
testcase_21 AC 4 ms
9,700 KB
testcase_22 AC 13 ms
11,600 KB
testcase_23 AC 4 ms
9,656 KB
testcase_24 AC 16 ms
13,848 KB
testcase_25 AC 12 ms
11,648 KB
testcase_26 AC 6 ms
10,304 KB
testcase_27 AC 4 ms
9,664 KB
testcase_28 AC 19 ms
14,176 KB
testcase_29 AC 19 ms
14,212 KB
testcase_30 AC 20 ms
14,264 KB
testcase_31 AC 19 ms
14,368 KB
testcase_32 AC 19 ms
14,184 KB
testcase_33 AC 19 ms
14,180 KB
testcase_34 AC 20 ms
14,280 KB
testcase_35 AC 19 ms
14,304 KB
testcase_36 AC 20 ms
14,192 KB
testcase_37 AC 19 ms
14,392 KB
testcase_38 AC 20 ms
14,208 KB
testcase_39 AC 19 ms
14,328 KB
testcase_40 AC 19 ms
14,224 KB
testcase_41 AC 19 ms
14,180 KB
testcase_42 AC 19 ms
14,284 KB
testcase_43 AC 3 ms
9,516 KB
testcase_44 AC 3 ms
9,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,a[2d5],b[2d5],e;
ll c,d,z;
{
	rd(n,a(n),b(n));
	sortA(n,a,b);
	c=sum(b(n));
	rep(i,n) {
		d+=b[i];
		if(d*2<c+1){
			e=i+1;
		}
	}
	rep(i,n) {
		z+=1ll*b[i]*abs(a[i]-a[e]);
	}
	wt(a[e],z);
}
0