【hiho】1114

扫雷

http://hihocoder.com/problemset/problem/1114?sid=250113


第一位是0或者1,两种情况都试一下(最坏情况下)。

/* hiho1114
 * @author:zorroshen
 */

#include 
#include 
using namespace std;
int n;
int array[100001];
int res[100001];
int check(int i){
	if (i==0)
	{
		return res[i]+res[i+1];
	}
	if (i==n-1)
	{
		return res[i-1]+res[i];
	}
	return res[i-1]+res[i]+res[i+1];
}

int main(){
    for(int i=0;i<=100001;++i) res[i]=0;
	int times;cin>>times;
	for(int i=0;i>n;
		for(int i=0;i>array[i];
		}
		for(int i=0;i<=100001;++i) res[i]=0;
		bool res0_1 = false;
		res[0]=1;
		for (int i = 0; i < n-1; ++i)
		{  // cout< vec0,vec1;
		for(int k=0;k


你可能感兴趣的:(杂类)