- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 HDOJ4433-locker,2012ACM天津站C题,DP
被yobobobo的五十行代码给鄙视了!~写挫鸟~~ dp[i][j]表示前i个数字中前i-2个数字已经调换好了,第i-1个数字x和第i个数字y满足x*10+y=j对应状态的最小操作数,代码如下: #include #include #include using namespace std; const int NN=1010; int r1[NN][NN],r2[NN][NN]
2012-10-28 20:06:21 1879
原创 线性规划与网络流24题
1.飞行员配对方案问题 二分匹配 #include #include #include using namespace std; const int NN=110; int n,m,match[NN]; bool mp[NN][NN],used[NN]; bool dfs(int u) { for (int v=1; v<=m; v++) if (mp[u][v])
2012-10-23 21:27:05 1263
原创 HDOJ3663-Power Stations,DLX精确覆盖
//********************* //Source: HDOJ 3663 //Method: Dancing links //Author: yihuikang //********************* #include #include #include #include using namespace std; const int NN=1000; const i
2012-10-20 09:35:48 1005 3
原创 ZOJ3659,2012长春现场赛E题,并查集
赛后在麦当劳由科大一牛提点才会的~ #include #include #include #include using namespace std; typedef long long LL; const int NN=250000; struct Edge{ int u,v; LL w; bool operator <(const Edge a)const
2012-10-15 21:52:59 1154 1
原创 POJ2047-Concert Hall Scheduling
本想找个DP做做,一读题想到的做法还是费用流~~待会儿再想想DP写法: #include #include #include #include #include #include using namespace std; const int NN=2100; const int MM=1000000; const int INF=0x3f3f3f3f; struct inte
2012-10-04 21:37:04 1186
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人