相关链接
题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4152
神犇题解:http://blog.csdn.net/qq_34731703/article/details/52724766
解题报告
因为横着的边和竖着的边相互独立
于是分开考虑,先考虑横着的边:
直接连是 $ O({n^2})$
但因为 $ dis(i,j) = dis(i,k) + dis(k,j)(i < k < j)$ 所以只连相邻的点就可以啦!
竖着的边也同理
这样的话,边数和点数都是 $ O(n)$ 级别的
于是就可以上正常的最短路辣!
另外,据说这题卡SPFA?
Some really good info , Sword lily I detected this.
Aw, this was a very nice post. In idea I wish to put in writing like this moreover – taking time and actual effort to make an excellent article… but what can I say… I procrastinate alot and on no account seem to get one thing done.
238665 796513Its like you read my mind! You appear to know so a lot about this, like you wrote the book in it or something. I feel which you can do with some pics to drive the message home a bit, but instead of that, this is wonderful weblog. A wonderful read. Ill certainly be back. 253066
56443 797047Using writers exercises such as chunking. They use numerous websites that contain several creative writing exercises. Writers read an exercise, and do it. 688186
866203 2131Quite informative and excellent bodily structure of content material material , now thats user friendly (:. 244784
356739 579223Hello there, just became alert to your blog through Google, and located that it is genuinely informative. Im gonna watch out for brussels. Ill be grateful in case you continue this in future. Several people will be benefited from your writing. Cheers! 17373
260518 59407I like this internet site very much so considerably exceptional info. 548970
7602 790891Thank you for writing this tremendous top quality article. The details in this material confirms my point of view and you truly laid it out properly. I could never have written an post this good. 54543
136314 37556You got a quite outstanding web site, Glad I noticed it by means of yahoo. 547810
710458 643915This plot doesnt reveal itself; it has to be explained. 62135
849462 285019Dead written articles , Really enjoyed reading . 122361
410001 679591Really good publish, thanks a lot for sharing. Do you happen to have an RSS feed I can subscribe to? 273878
797352 578514What cell phone browser is this internet site page optimized for Internet explorer? 573165
758463 676569I took a break to view your article. I discovered it extremely relaxing 302236