Codeforces 697A - Pineapple Incident
题目链接: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的更多相关文章
- Codeforce 697A - Pineapple Incident
Ted has a pineapple. This pineapple is able to bark like a bulldog! At time t (in seconds) it barks ...
- 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 ...
- 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 ...
- Codeforces Round #362
A - Pineapple Incident #pragma comment(linker, "/STACK:102c000000,102c000000") #include &l ...
- Codeforces Round #362 (Div. 2) A 水也挂
A. Pineapple Incident time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Codeforces Round #362 (Div. 2)
闲来无事一套CF啊,我觉得这几个题还是有套路的,但是很明显,这个题并不难 A. Pineapple Incident time limit per test 1 second memory limit ...
- 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 ...
- Codeforces Round #192 (Div. 1) C. Graph Reconstruction 随机化
C. Graph Reconstruction Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/3 ...
- 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 ...
随机推荐
- oracle游标调试结果显示位置
在SQL窗口输入内容,按F8后,可以在下图看到
- .net网站的文件上传读取进度条和断点下载
文件上传到服务器时的进度读取 //调整上传配置 AdapterInfo(info); UpfileResult result = new UpfileResult(); try { //直接使用req ...
- Entity Framework Code First (三)Data Annotations
Entity Framework Code First 利用一种被称为约定(Conventions)优于配置(Configuration)的编程模式允许你使用自己的 domain classes 来表 ...
- 绘图: Shape, Path
Shape - 图形 Path - 路径 示例1.演示“Shape”相关知识点Drawing/Shape.xaml <Page x:Class="Windows10.Drawing.S ...
- Mac OS 下 eclipse中文乱码解决方法(eclipse for mac 中文乱码)
由于一些java源码是从其他人那里拷贝过来,放入Mac os 版本的eclipse下,发现中文都是乱码.经过小试,可以解决. 1.打开eclipse 偏好设置 2.General ——>Cont ...
- UITextView实现placeHolder方法汇总
UITextField中有一个placeholder属性,可以设置UITextField的占位文字,起到提示用户的作用.可是UITextView就没那么幸运了,apple没有给UITextView提供 ...
- here 文档
#!/usr/bin/perl -w use strict; my $someURL = 'http://www.perl.com'; my $html = <<EOF; # EOF 可以 ...
- ——YC,你学到了吗?——学到了学到了
又是周末了,想着开始我的每周一切(每周做一次从切图到静态网页布局的练习)任务吧,无意间看了看别人的页面,发现--我去,这个动画挺有意思的啊,怎么实现的?然后翻代码+搜索,啊,原来是插件啊~给我的也用上 ...
- 操作系统中的IPC机制
按发送路径来看,可分为直接通信和间接通信. 1. 直接通信 (1)进程必须正确的命名对方 send (P, message) – 发送信息到进程P receive(Q, message) – 从进程 ...
- mysql为表添加外键完成性约束 报错Can't create table 'sfkbbs.#sql-513_25' (errno: 150)
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtkAAAAyCAIAAAAGM1ChAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4Xu