题目链接: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. openwrt的环境搭建、定制和编译

    参考1:编译openwrt全过程 参考2: ARM9的OpenWRT系统的移植以及 无线视觉操控系统的软件开发 参考3:搭建OpenWrt开发环境(包括编译过程) 参考4:各个openwrt版本的sv ...

  2. mysql数据库默认存放位置修改

    windows:   方式一 使用符号连接 假设你的mysql安装在c:\mysql,数据目录就是c:\mysql\data 现在你想在D 盘建立一个名为foo的数据库,路径为d:\data\foo. ...

  3. Maven-setting.xml详解

    settings.xml对于maven来说相当于全局性的配置,用于所有的项目,当Maven运行过程中的各种配置,例如pom.xml,不想绑定到一个固定的project或者要分配给用户时,我们使用set ...

  4. java类生命周期详细解析

    (一)详解java类的生命周期 引言 最近有位细心的朋友在阅读笔者的文章时,对java类的生命周期问题有一些疑惑,笔者打开百度搜了一下相关的问题,看到网上的资料很少有把这个问题讲明白的,主要是因为目前 ...

  5. jquery datatable

    <html><head></head> <script type="text/javascript"> $(document).re ...

  6. 数据结构之二分查找(PHP)

    <?php //二分查找算法 //前提:索引数组.数组已排好顺序 $a=array(1,3,4,6,8,9,11,13,15,24,25,27,30,38); $search = 30;//要查 ...

  7. 解决虚拟机 MAC10.9 不能设置1366*768分辨率问题

    首先在虚拟机设置里,显示--3d下面--固定分辨率--最大设成1024*768--保存然后打开虚拟机的.vmx文件,最后几行 svga.autodetect = "FALSE"sv ...

  8. bzoj 2005

    裸的2D gcd.ans=(Σ(d<=n)phi[d]*(n/d)*(m/d))*2-n*m; #include<iostream> #include<cstdio> # ...

  9. bzoj1042: [HAOI2008]硬币购物

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  10. Jenkins的Publish Over FTP Plugin插件参数使用

    无论在Windows还是Linux下,都是采用这样方式${WORKSPACE}