题目链接:http://codeforces.com/problemset/problem/697/A

题目大意:

  输入三个数 t,s,x; 判断x是否合适

  合适的位置位 t , t+s, t+s+1, t+2s , t+2s+1 ,t+3s, t+3s+1 ......

  如果在合适的位置中,输出 “YES” 不合适输出“NO”

解题思路:

  如果x<t 不合适

  如果 (x-t)%s !=0|| !=1 合适 【注意要排除 x=t+1 这种情况】

AC Code :

 #include<stdio.h>
int main()
{
int t,s,x,tem;
while(~scanf("%d%d%d",&t,&s,&x))
{
tem=(x-t)%s;
if(x<t||x==t+||(tem!=&&tem!=))puts("NO");
else puts("YES");
}
return ;
}

Codeforces 697A - Pineapple Incident的更多相关文章

  1. Codeforce 697A - Pineapple Incident

    Ted has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks ...

  2. Codeforces Round #362 (Div. 2)->A. Pineapple Incident

    A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standar ...

  3. Codeforces Round #362 (Div. 2) A.B.C

    A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standar ...

  4. Codeforces Round #362

    A - Pineapple Incident #pragma comment(linker, "/STACK:102c000000,102c000000") #include &l ...

  5. Codeforces Round #362 (Div. 2) A 水也挂

    A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standar ...

  6. Codeforces Round #362 (Div. 2)

    闲来无事一套CF啊,我觉得这几个题还是有套路的,但是很明显,这个题并不难 A. Pineapple Incident time limit per test 1 second memory limit ...

  7. Codeforces Round #342 (Div. 2) B. War of the Corporations 贪心

    B. War of the Corporations 题目连接: http://www.codeforces.com/contest/625/problem/B Description A long ...

  8. Codeforces Round #192 (Div. 1) C. Graph Reconstruction 随机化

    C. Graph Reconstruction Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/3 ...

  9. Codeforces Round #375 (Div. 2) F. st-Spanning Tree 生成树

    F. st-Spanning Tree 题目连接: http://codeforces.com/contest/723/problem/F Description You are given an u ...

随机推荐

  1. Android studio配置Git

    Android studio配置Git 1.下载window 版git并安装:下载地址 2.Android Studio设置git插件:File->Setting->Version Con ...

  2. JSON与js对象序列化

    JavaScript对象表示法(JavaScript Object Notation,简称JSON)是一种轻量级的数据交换格式,它基于js字面量表示法,是js的一个子集.虽然是一个js的子集但是他与语 ...

  3. Jenkins_多项目构建(一):单独建立一个项目按顺序执行其它job

    有A,B,C三个Job,A为服务或web Job,B,C为A依赖的其它Job 单独建个Job,按B,C,A的顺序进行编译   1.安装插件:Multijob plugin   2.新建A,B,C三个J ...

  4. poj2186 强连通缩点

    Popular Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 29773   Accepted: 12080 De ...

  5. sql-insert一条语句执行多条数据插入

    有三种方法: .InSert Into <表名>(列名) Select <列名> From <源表名> 如: INSERT INTO TongXunLu (姓名,地 ...

  6. SurfaceView, TextureView, SurfaceTexture等的区别

    SurfaceView, GLSurfaceView, SurfaceTexture以及TextureView是Android当中名字比较绕,关系又比较密切的几个类.本文基于Android 5.0(L ...

  7. HTTP协议学习--- (十一)理解HTTP幂等性

    在httpcomponent 文档中看到如下段落: 1.4.1. HTTP transport safety It is important to understand that the HTTP p ...

  8. Linux命令:修改文件权限命令chmod、chgrp、chown的区别

    chmod是更改文件的权限 chown是改改文件的属主与属组 chgrp只是更改文件的属组. (1)chmod是修改文件/目录的权限.可以有文字修改和数字修改. #chmod 777 /home/be ...

  9. phpwind9.0模板制作教程——制作论坛风格

    由于论坛模板机制和门户等模板机制不同,所以今天我就先重点讲讲论坛模板制作的大概过程. 一.先来熟悉下phpwind9.0的论坛模板机制. 其实phpwind9.0的模板机制和discuzx2.5差不多 ...

  10. c# 监听文件夹动作

    static FileSystemWatcher watcher = new FileSystemWatcher(); /// <summary>        /// 初始化监听     ...