結果

問題 No.2354 Poor Sight in Winter
ユーザー tailstails
提出日時 2023-06-16 22:18:27
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 3,103 ms
コンパイル使用メモリ 181,460 KB
実行使用メモリ 11,380 KB
最終ジャッジ日時 2023-09-06 20:24:47
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge12 / 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 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 4 ms
4,384 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 62 ms
9,784 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@k,x[n+2],y[];
rd((x,y)(n+2));
priority_queue<pair<ll,pair<ll,ll>>>h;
rep(i,n+2){
	rep(j,n+2){
		h.push({-(abs(x[j]-x[i])+abs(y[j]-y[i])),{i,j}});
	}
}
priority_queue<pair<ll,pair<ll,ll>>>q;
unionFind u('m',n+2,1);
while(u(0)!=u(1)){
	auto a=h.top();
	h.pop();
	if(u(a.second.first,a.second.second)){
		q.push({-a.first,{-a.first,1}});
	}
}
rep(k){
	auto a=q.top();
	q.pop();
	q.push({a.second.first/+(a.second.second+1),{a.second.first,a.second.second+1}});
}
wt(q.top().first);
0