随笔分类 - 最短路
摘要:Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly
阅读全文
摘要:在郊区有 N 座通信基站,P 条双向电缆,第 i 条电缆连接基站AiAi和BiBi。 特别地,1 号基站是通信公司的总站,N 号基站位于一座农场中。 现在,农场主希望对通信线路进行升级,其中升级第 i 条电缆需要花费LiLi。 电话公司正在举行优惠活动。 农产主可以指定一条从 1 号基站到 N 号基
阅读全文
摘要:Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly
阅读全文
摘要:Recently, Shua Shua had a big quarrel with his GF. He is so upset that he decides to take a trip to some other city to avoid meeting her. He will trav
阅读全文
摘要:Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give To
阅读全文
摘要:最短路(vector+Dijkstra优先队列优化) #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<queue> #include<stack> #include<set> #in
阅读全文
摘要:A friend of yours, an inventor, has built a spaceship recently and wants to explore space with it. During his first voyages, he discovered that the un
阅读全文
摘要:Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to wal
阅读全文
摘要:年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他...
阅读全文
摘要:Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capita...
阅读全文
摘要:题目描述梦工厂有 n 个分厂(从 1 开始编号),有m对分厂通过双向铁路相连。为了保证每两个分厂之间的同学可以方便地进行交流,掌舵人张老师就在那些没有铁路连接的分厂之间建造了公路。在两个直接通过公路或铁路相连的分厂之间移动,需要花费 1 小时。现在菜鸡wxy和hbz都...
阅读全文
摘要:有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。输入格式:输入说明:输入数据的第1行给出4个正整数N、...
阅读全文