ACM__最短路
最短路
P1n9
这个作者很懒,什么都没留下…
展开
-
最短路-------C - Heavy Transportation
Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cust...原创 2018-10-03 20:57:41 · 159 阅读 · 0 评论 -
Educational Codeforces Round 54 (Rated for Div. 2) D. Edge Deletion
地址:http://codeforces.com/contest/1076/problem/D 因为di定义为是图上1到i点的最短路径的长度,如果不限制边数,那么最少需要就是n - 1条边,使得n个点用最短路径边连起来,迪杰斯特拉就是用已知最短路的点去更新其他点,那么其他点的最短路一定会经过已知最短路的点,题中要求留k条边good点最多,那肯定是最短路上的点,k是1,有两个good点,k为2,有三...原创 2018-11-14 20:58:35 · 108 阅读 · 0 评论 -
Dijkstra模板,Dinic模板和sap模板
Dijkstra模板: struct Edge{ int from,to; int dist; }; struct HeapNode{ int d,u; bool operator < (const HeapNode& rhs) const{ return d > rhs.d; } }; ...转载 2018-10-07 10:30:24 · 131 阅读 · 0 评论 -
最短路--------Q - Marriage Match IV
Do not sincere non-interference。 Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get ...原创 2018-10-07 10:17:26 · 157 阅读 · 0 评论 -
最短路 ------R - 0 or 1
Given a nn matrix C ij (1<=i,j<=n),We want to find a nn matrix X ij (1<=i,j<=n),which is 0 or 1. Besides,X ij meets the following conditions: 1.X 12+X 13+…X 1n=1 2.X 1n+X 2n+…X n-1n=1 3.fo...原创 2018-10-06 17:24:24 · 258 阅读 · 0 评论 -
最短路-------P - The Shortest Path in Nya Graph
This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of this paragraph, just ...原创 2018-10-05 20:53:17 · 155 阅读 · 0 评论 -
最短路--------L - Subway
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don’t want ...原创 2018-10-05 17:05:52 · 181 阅读 · 0 评论 -
最短路-------K - Candies
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the...原创 2018-10-05 11:36:44 · 152 阅读 · 0 评论 -
最短路------J - Invitation Cards
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They ...原创 2018-10-05 10:35:38 · 110 阅读 · 0 评论 -
最短路-------M - 昂贵的聘礼
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:“嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,...原创 2018-10-04 15:00:07 · 140 阅读 · 0 评论