摘要: 题目链接:http://poj.org/problem?id=3177这道题跟3352十分相似,只是有重边的,再输入的过程中处理下就可以了。View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 const int MAX=5005; 6 struct ss { 7 int x; 8 int next; 9 }edge[MAX*3]; 10 11 int degree[MAX]; 12 int head[MAX]; 1. 阅读全文
posted @ 2012-04-03 19:52 我们一直在努力 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1556这是一道很好的计算几何和图论的综合题,贵在建图,哪些点之间可以连线,只有当两点之间没有墙时才可以,怎么判断呢 只用把墙的x坐标带入两点的直线中看y坐标是否在墙上就可以了。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cmath> 5 using namespace std; 6 const int MAX=20; 7 const int MMAX=80; 阅读全文
posted @ 2012-04-03 13:52 我们一直在努力 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=16361)DFS+DP法View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 using namespace std; 5 const int MAX=210; 6 int map[MAX][MAX]; 7 int vist[3][MAX]; 8 int dp[MAX][MAX]; 9 int asize,bsize;10 int m,r;11 void init()12 {13 memset(dp, 阅读全文
posted @ 2012-04-03 13:41 我们一直在努力 阅读(517) 评论(0) 推荐(0) 编辑