/* 题意:给你一列仅仅能取0和1的数. 限制:每3个相邻的数的值固定,开头和结尾仅仅限制两个数 求:有多少种组合方案 解:搜索,在开头和结尾再加一个仅仅能取零的数,直接推断是否符合条件就可以 */ #include<stdio.h> #include<string.h> #include<stdlib.h> using namespace std; #define N 11000 int sum; int dp[N]; int a[N],n; void dfs(int…
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12519 Accepted Submission(s): 7753 Problem Description There is a rectangular room, covered with square tiles. Each tile is color…
POJ1979 Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can mo…
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18201 Accepted: 9192 Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100…
Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can mo…