![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
方偲~
大佬养成中...
展开
-
【图论之二分图匹配问题】总结
1.求解两组人最多可以匹配几对,经典的例题,红线代表互有好感,问最多能搓成几对情侣 2.例题:【HDU2063】过山车(二分图匹配,模板题) 3.模板:匈牙利算法 bool find(int x) { for(int i=1;i<=m;i++) { if(!vis[i] && G[x][i])//如果可以匹配,且未被匹配过 ...原创 2019-03-21 17:56:29 · 455 阅读 · 0 评论 -
【POJ - 2253 】Frogger(dijkstra,变形最短路,求最大值最小)
Frogger POJ - 2253 改一下松弛写法: dis[j] = min(dis[j],max(dis[k],get_dis(p[k],p[j])));//dis[j]为从一号石头到第j号石头所有通路中最长边中的最小边 看评论提醒要么输出写%.3f,要么编译环境选C++,不然写%.3lf就卡,我也不知道为什么... #include <iostream> ...原创 2019-04-03 20:59:47 · 154 阅读 · 0 评论 -
【POJ - 1797】Heavy Transportation(图论,最短路,dijkstra变形,求最小值最大)
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...原创 2019-04-09 14:19:08 · 199 阅读 · 0 评论 -
【HDUOJ】 2544 最短路 (dijkstra,模板题,简单)
最短路 Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 98133Accepted Submission(s): 42371 Problem Description 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t...原创 2019-03-14 11:57:00 · 214 阅读 · 0 评论 -
【POJ - 2387 】最短路(dijkstra,简单,模板题)
Til the Cows Come Home POJ - 2387 #include <iostream> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <map> #include <q...原创 2019-04-03 20:08:50 · 203 阅读 · 0 评论 -
【图论之最短路】dijkstra入门
例题 【HDUOJ】 2544 最短路 (dijkstra,模板题,简单) 【POJ - 2387 】最短路(dijkstra,简单,模板题) 【zcmuoj】1624: 最短路(dijkstra,别忘记重复边呀) 【HDU2066】一个人的旅行(dijkstra,再也不会忘mem(vis)放置在dijkstra里) 【POJ - 2253】Frogger(dijkstra,变形最短路...原创 2019-04-09 22:14:23 · 594 阅读 · 0 评论 -
【POJ - 3268 】Silver Cow Party (dijkstra变形,两次dijkstra)
One cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) unidirectional (one-way r...原创 2019-04-09 23:23:50 · 114 阅读 · 0 评论