随笔分类 -  dfs

UvaOJ 10167
摘要:暴力搜索 1 #include 2 3 struct node 4 { 5 int x; 6 int y; 7 }s[10000]; 8 int main() 9 {10 //freopen("input.txt","r",stdin);11 int a,b,n,n... 阅读全文
posted @ 2014-07-23 01:01 lpt 阅读(387) 评论(0) 推荐(0)
poj 1129 Channel Allocation
摘要:可以转化为着色模型dfs + 四色定理 1 #include 2 #include 3 int n,num; 4 int d[100][100]; 5 int c[100]; 6 7 bool ok(int step) 8 { 9 for(int i = 0; i = n) return ... 阅读全文
posted @ 2014-07-18 00:22 lpt 阅读(173) 评论(0) 推荐(0)
hdu 1312 Red and Black
摘要:集训第一场 B题dfs简单题 做完这题就撤,回来再继续做吧= = 水手加油~ 1 #include 2 #include 3 4 int Count; 5 int to[4][2] = {{-1,0},{1,0},{0,1},{0,-1}}; 6 int row,col; 7 char room[... 阅读全文
posted @ 2014-07-16 20:02 lpt 阅读(122) 评论(0) 推荐(0)
hdu 1241 Oil Deposits
摘要:集训第一场,A题dfs简单题之前看过dfs,没实现过,第一次实现出来O(∩_∩)O~水手加油~ 1 #include 2 #include 3 using namespace std; 4 int row,col; 5 char oil[1000][1000]; 6 int to[8][2]={{-... 阅读全文
posted @ 2014-07-16 20:00 lpt 阅读(101) 评论(0) 推荐(0)