結果

問題 No.2354 Poor Sight in Winter
ユーザー tailstails
提出日時 2023-06-16 22:06:55
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 3,356 ms
コンパイル使用メモリ 180,612 KB
実行使用メモリ 4,960 KB
最終ジャッジ日時 2023-09-06 20:00:06
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 5 ms
4,384 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,652 KB
testcase_12 AC 3 ms
4,608 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,384 KB
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));
DijkstraHeap<ll>h;
h.malloc((n+2)*(n+2),1);
priority_queue<pair<ll,pair<ll,ll>>>q;
h.change(0,0);
while(true){
	ll i=h.pop();
	ll v=h.val[i];
	q.push({v,{v,1}});
	if(i==1){
		break;
	}
	rep(j,n+2){
		h.change(j,abs(x[j]-x[i])+abs(y[j]-y[i]));
	}
}
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