
2018暑假 第三周 训练2
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【HDU - 3790】最短路径问题(DIjkstra算法 双权值)
题干:给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1<n<=1000, 0&...原创 2018-08-01 22:12:28 · 923 阅读 · 0 评论 -
【HDU - 2066】:一个人的旅行(Dijkstra算法)
题干:虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好...原创 2018-08-01 22:09:17 · 207 阅读 · 0 评论 -
【HDU - 3342】Legal or Not(拓扑排序)
题干:ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat...原创 2018-08-01 22:09:04 · 293 阅读 · 0 评论 -
【POJ - 3268 】Silver Cow Party(Dijkstra最短路+思维)
题干:One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-w...原创 2018-08-01 19:11:05 · 297 阅读 · 0 评论 -
【HDU - 1546】 Idiomatic Phrases Game(Dijkstra,可选map处理字符串)
题干: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 Tom two idioms. He should build a list of idiom...原创 2018-08-02 09:42:34 · 361 阅读 · 0 评论 -
【POJ - 3310】Caterpillar(并查集判树+树的直径求树脊椎(bfs记录路径)+dfs判支链)
题干:An undirected graph is called a caterpillar if it is connected, has no cycles, and there is a path in the graph where every node is either on this path or a neighbor of a node on the path. This p...原创 2018-08-02 15:32:16 · 491 阅读 · 0 评论 -
*【POJ - 1860】Currency Exchange (单源最长路---Bellman_Ford算法判正环)
题干:DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these cur...原创 2018-08-02 15:33:20 · 608 阅读 · 0 评论 -
【POJ - 1062】【nyoj - 510】昂贵的聘礼 (Dijkstra最短路+思维)
题干:年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其...原创 2018-08-02 21:25:38 · 331 阅读 · 0 评论 -
【POJ - 3169】 Layout(差分约束+spfa)(当板子记?)
题干:Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows ...原创 2018-08-02 22:44:34 · 262 阅读 · 0 评论