結果
問題 |
No.2354 Poor Sight in Winter
|
ユーザー |
![]() |
提出日時 | 2023-06-16 22:18:27 |
言語 | cLay (20241019-1) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 3,707 ms |
コンパイル使用メモリ | 182,396 KB |
実行使用メモリ | 9,572 KB |
最終ジャッジ日時 | 2024-06-24 14:50:15 |
合計ジャッジ時間 | 5,052 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 18 |
ソースコード
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);