Kirill And The Game CodeForces - 842A
需要将除法改换成乘法进行计算
#include<bits/stdc++.h>
using namespace std; int main() {
long long l,r,x,y;
long long k;
while(~scanf("%lld %lld %lld %lld %lld",&l,&r,&x,&y,&k)) { int flag = ;
for(int i = x; i <= y; i++) {
if( l <= i*k && i*k <= r ) {
flag = ;
break;
}
}
if(flag)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return ;
}
在写这种题目的时候
1.使用 long long
2.把除法改换成乘法
Kirill And The Game CodeForces - 842A的更多相关文章
- Codeforces 842A Kirill And The Game【暴力,水】
A. Kirill And The Game time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...
- Codeforces Round #430 A. Kirill And The Game
Kirill plays a new computer game. He came to the potion store where he can buy any potion. Each poti ...
- 【 Codeforces Round #430 (Div. 2) A 】 Kirill And The Game
[链接]点击打开链接 [题意] 水题 [题解] 枚举b从x..y看看k*i是不是在l..r之间就好. [错的次数] 0 [反思] 在这了写反思 [代码] #include <cstdio> ...
- Codeforces Round #430 (Div. 2) 【A、B、C、D题】
[感谢牛老板对D题的指点OTZ] codeforces 842 A. Kirill And The Game[暴力] 给定a的范围[l,r],b的范围[x,y],问是否存在a/b等于k.直接暴力判断即 ...
- Codeforces Round #468 Div. 2题解
A. Friends Meeting time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
随机推荐
- Windows10下的docker安装与入门 (三) 创建自己的docker镜像并且在容器中运行它
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制,相互之间不会有任何 ...
- linux centos-7.2-64bit 安装配置启动nginx
1.安装依赖包yum -y install openssl openssl-develyum install pcre*yum install openssl*yum install zlib yum ...
- python json.dumps 中的ensure_ascii 参数引起的中文编码问题
在使用json.dumps时要注意一个问题 >>> import json >>> print json.dumps('中国') "\u4e2d\u5 ...
- libevent中evmap实现(哈希表)
libevent中,需要将大量的监听事件event进行归类存放,比如一个文件描述符fd可能对应多个监听事件,对大量的事件event采用监听的所采用的数据结构是event_io_map,其实现通过哈希表 ...
- C++11 作用域内枚举
enum class MyEnum{ P1 = , P2, P3, P4, P5 }; MyEnum myEnum = MyEnum::P2; 使用作用域的方式获取并限定P2的值.之所以要使用作用域, ...
- 将python代码打印成pdf
将python代码打印成pdf,打印出来很丑,完全不能看. mac下:pycharm 编辑器有print的功能,但是会提示: Error: No print service found. 所以需要一个 ...
- Java必须了解的“递归”与“IO流”!!!
>>>First: 递归! 1. 定义: 在函数自身内部,调用函数本身的方式,称为递归. 2. 注意: 递归包括递进去.归出来两步. 首先,依次执行[函数调自身语句]上半部分的代码, ...
- [Luogu 3919]【模板】可持久化数组(可持久化线段树/平衡树)
Description 如题,你需要维护这样的一个长度为 N 的数组,支持如下几种操作 在某个历史版本上修改某一个位置上的值 访问某个历史版本上的某一位置的值 此外,每进行一次操作(对于操作2,即为生 ...
- [USACO17FEB]Why Did the Cow Cross the Road I S
题目描述 Farmer John's cows are trying to learn to cross the road effectively. Remembering the old " ...
- 【BZOJ2243】【SDOI2011】染色
题意见试题传送门 解题思路:显然是题树剖题. 考虑用线段树维护区间端点颜色与颜色数,这样就可以方便的合并,注意查询的时候对端点的特殊处理即可. 时间效率最高为\( O (m \log^{2} n) \ ...