Codeforces_731_B

Posted 冷暖知不知

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces_731_B相关的知识,希望对你有一定的参考价值。

http://codeforces.com/problemset/problem/731/B

 

模拟模拟。

 

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;

int n,a;

int main()
{
    int flag = 1;
    scanf("%d",&n);
    int last = 0;
    for(int i = 1;i < n;i++)
    {
        scanf("%d",&a);
        if(flag == 0)    continue;
        if(last > a)    flag = 0;
        a -= last;
        last = a%2;
    }
    if(flag)
    {
        scanf("%d",&a);
        if(last > a)    flag = 0;
        if(flag)
        {
            a -= last;
            if(a%2)    flag = 0;
        }
    }
    if(flag)    printf("YES\n");
    else        printf("NO\n");
    return 0;
}

 

以上是关于Codeforces_731_B的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces_731_C

Codeforces_731_F

Codeforces Round #731 (Div. 3)

CodeForces 731C Socks

Codeforces Round #731 (Div. 3) F. Array Stabilization (GCD version)

Codeforces Round #731 (Div. 3) A. Shortest Path with Obstaclea