博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Strategic Game HDU - 1054(最小顶点覆盖)
阅读量:4476 次
发布时间:2019-06-08

本文共 736 字,大约阅读时间需要 2 分钟。

最小顶点覆盖:用最少的点,让每条边都至少和其中一个点关联;

。。。以为自己很聪明。。用边连边。。。最后还是点连点  哎。。。。

hc 写的  匈牙利足够/

#include 
#include
#include
#include
#include
#include
#include
#define mem(a, b) memset(a, b, sizeof(a))using namespace std;const int maxn = 10010, INF = 0x7fffffff;int dx[maxn], dy[maxn], cx[maxn], cy[maxn], used[maxn];int nx, ny, dis, n;vector
G[maxn];int bfs(){ queue
Q; dis = INF; mem(dx, -1); mem(dy, -1); for(int i=0; i<=nx; i++) { if(cx[i] == -1) { Q.push(i); dx[i] = 0; } } while(!Q.empty()) { int u = Q.front(); Q.pop(); if(dx[u] > dis) break; for(int v=0; v
> n) { for(int i=0; i

 

转载于:https://www.cnblogs.com/WTSRUVF/p/9311068.html

你可能感兴趣的文章
CURRICULUM VITAE
查看>>
Groovy 程序结构
查看>>
SpringAOP用到了什么代理,以及动态代理与静态代理的区别
查看>>
备忘pwnable.kr 之passcode
查看>>
好久没敲代码了,手有点生——一个小小的时钟
查看>>
运算符 AS和IS 的区别
查看>>
(转)详解C中volatile关键字
查看>>
easyui时的时间格式yyyy-MM-dd与yyyy-MM-ddd HH:mm:ss
查看>>
Codeforces Round #426 (Div. 2) (A B C)
查看>>
The Most Simple Introduction to Hypothesis Testing
查看>>
UVA10791
查看>>
P2664 树上游戏
查看>>
jQuery 停止动画
查看>>
Sharepoint Solution Gallery Active Solution时激活按钮灰色不可用的解决方法
查看>>
教你50招提升ASP.NET性能(二十二):利用.NET 4.5异步结构
查看>>
lua连续随机数
查看>>
checkstyle使用介绍
查看>>
会了这十种Python优雅的写法,让你工作效率翻十倍,一人顶十人用!
查看>>
在做操作系统实验的一些疑问
查看>>
Log4J日志配置详解
查看>>