摘要: 水题。好久没有写过优化搜索题了。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 char str[31][31]; 7 int r[31][31]; 8 int c[31][31]; 9 int judge(int rx,int ry,int lx,int ly)10 {11 int i,j;12 for(i = lx;i = 1;i --)46 {47 for(j = m;j >= 1;j --)48 {49 fo... 阅读全文
posted @ 2013-10-30 17:08 Naix_x 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 挺简单的组合把。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 #define LL long long 7 int flag[1001]; 8 int p[1001]; 9 class LittleElephantAndIntervalsDiv110 {11 public :12 LL getNumber(int M, vector L, vector R)13 {14 LL ans = 1;15 int i,j;16 for... 阅读全文
posted @ 2013-10-30 09:56 Naix_x 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 数位DP的感觉,但是跟模版不是一个套路的,看的题解,代码好理解,但是确实难想。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define LL long long 6 LL dp[31][2][2][2]; 7 int a[31],b[31],c[31]; 8 void fun(int *p,int x) 9 {10 int i;11 for(i = 0; i <= 30; i ++)12 {13 if(x&(1<<i))14 p[i] = 1;15 ... 阅读全文
posted @ 2013-10-30 09:37 Naix_x 阅读(258) 评论(0) 推荐(0) 编辑