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 = ;
scanf("%d",&n);
int last = ;
for(int i = ;i < n;i++)
{
scanf("%d",&a);
if(flag == ) continue;
if(last > a) flag = ;
a -= last;
last = a%;
}
if(flag)
{
scanf("%d",&a);
if(last > a) flag = ;
if(flag)
{
a -= last;
if(a%) flag = ;
}
}
if(flag) printf("YES\n");
else printf("NO\n");
return ;
}

Codeforces_731_B的更多相关文章

随机推荐

  1. DM7的SQL批量插入for、while方法

    示例1,for用法: begin for i in 1...10000 loop insert into test values(i,i,'aaa',sysdate); if i mod 20 = 0 ...

  2. Using TFRecords and tf.Example

    -----这篇其实是TensorFlow的官方tutorials,由于没有翻译,笔者姑且翻译一下,用来日后思考.------- 原址:https://www.tensorflow.org/tutori ...

  3. bootstrap4.4 Stretched link的使用

    Stretched link功能介绍:扩大可点击区域. 原理 .stretched-link::after { position: absolute; top: 0; right:0; bottom: ...

  4. 5.pycharm中导入第三方模块的方法

    最近刚入门学习python,网上查找了一些资料,发现python编程用的软件pycharm还是比较多的,于是就跟随大众,学习使用pycharm,在学习的过程中,想要导入第三方模块pyperclip,但 ...

  5. Spring Cloud Alibaba Nacos

    1. Spring Cloud Alibaba 介绍 Spring Cloud Alibaba 为分布式应用程序开发提供了一站式解决方案.它包含了开发分布式应用程序所需的所有组件,使得你可以轻松地使用 ...

  6. 图解kubernetes调度器SchedulingQueue核心源码实现

    SchedulingQueue是kubernetes scheduler中负责进行等待调度pod存储的对,Scheduler通过SchedulingQueue来获取当前系统中等待调度的Pod,本文主要 ...

  7. 【转】Java集合框架面试问题集锦

    Java集合框架(例如基本的数据结构)里包含了最常见的Java常见面试问题.很好地理解集合框架,可以帮助你理解和利用Java的一些高级特性.下面是面试Java核心技术的一些很实用的问题. Q:最常见的 ...

  8. RocketMQ客户端加载流程

     这节介绍RocketMQ客户端的启动流程,即Consumer和Producer的启动流程. 1. 客户端demo  首先先看下客户端的demo Producer: public class Sync ...

  9. org.springframework.core.type.classreading.ClassMetadataReadingVisitor 异常

    今天项目启动的时候发现了一个异常: Exception in thread "main" org.springframework.beans.factory.BeanDefinit ...

  10. 关于爬虫的日常复习(7)—— DOM操作及selenium库