摘要: 链接这样的叫迭代吗。。最近多做些搜索题了要分行分列搜 判断满足条件 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int o[8][8],n,m,q,p[8][8]; 8 int ans; 9 int judge(int x,int y)10 {11 int i,j,kk=0;12 if(o[x][y])13 return 0;14 for(i = x-1 ; i>= 0 ;i--)15 if(o[i][y]||p[i][y])16 ... 阅读全文
posted @ 2013-08-26 14:48 _雨 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 链接想O(n*n)的DP 怎么想都超内存 看讨论有说hash+DP过的 实现比较繁琐大部分直接暴力过了直接枚举每个i j 与他们在一条线上的点 是不是给出的点注意它必须能跳进和跳出 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define N 5010 8 bool flag[N][N]; 9 struct node10 {11 int x,y;12 }p[N];13 bool cmp(node a,node b)14 {15 if(a.x==b.x)16 ... 阅读全文
posted @ 2013-08-26 10:54 _雨 阅读(218) 评论(0) 推荐(0) 编辑