摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4739思路:状态压缩。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 struct Point{ 9 int x,y;10 }point[22];11 12 int dp[(1g[22];35 int main()36 {37 while(~scanf("%d",&n)){38 if(n==-1)break;39 for(int i=... 阅读全文
posted @ 2013-09-15 21:14 ihge2k 阅读(581) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=23727思路:首先是Tarjan找桥,对于桥,只能是双向边,而对于同一个连通分量而言,只要重新定向为同一个方向即可。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 #define MAXN 111110 typedef pairPP;11 12 int low[MAXN],dfn[MAXN];13 bool 阅读全文
posted @ 2013-09-15 10:10 ihge2k 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.uestc.edu.cn/problem.php?pid=1511思路:我们可以等到这样的5个关系式:k=1:dsit[a]-dist[b]>=0&&dist[b]-dist[a]>=0k=2:dist[a]-dist[b]=0;k=4:dist[a]-dist[b]>=1;k=5:dist[a]-dist[b] 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define MAXN 100200 8 #define inf 1 > 阅读全文
posted @ 2013-09-15 09:22 ihge2k 阅读(204) 评论(0) 推荐(0) 编辑