hiho week 30 register

Ended

Participants:387

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-24 21:03:23

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//Minesweeping
//hiho30
#include<algorithm>
#include<cassert>
#include<cstdio>
#include<cmath>
#include<ctime>
#include<cstring>
using namespace std;
int a[100010];
int ans1[100010];
int ans2[100010];
int n;
bool f1;
bool f2;
bool sov(int * ans){
    int i;
    ans[1]=a[0]-ans[0];
    if(ans[1]!=1&&ans[1]!=0){
        return false;
    }
    for(i=2;i<n;i++){
        ans[i]=a[i-1]-ans[i-2]-ans[i-1];
        if(ans[i]!=1&&ans[i]!=0){
            return false;
        }
    }
    return a[n-1]==ans[n-2]+ans[n-1];
}
void output(int * ans){
    int i;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX