hiho week 30 register

Ended

Participants:387

Verdict:Accepted
Score:100 / 100
Submitted:2015-01-30 13:58:37

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
#include <iostream>
#include <cstdio>
#include <string.h>
#include <vector>
using namespace std;
const int maxn=100000+10;
int b[maxn];
int n;
bool solve(int temp,int a[])
{
    a[0]=0;
    a[1]=temp;
    for(int i=2;i<=n;i++)
    {
        a[i]=b[i-1]-a[i-1]-a[i-2];
        if(a[i]>1||a[i]<0)
            return false;
    }
    if(b[n]==a[n]+a[n-1])
        return true;
    else
        return false;
}
int main()
{
    int a[maxn],c[maxn],d[maxn],e[maxn];
    int kase;
    scanf("%d",&kase);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX