Codeforces Round #430 (Div. 2) - A
题目链接:http://codeforces.com/contest/842/problem/A
题意:给定l,r,x,y,k.问是否存在a (l<=a<=r) 和b (x<=b<=y) 使得 a/b=k (a/b可能为浮点数)。
思路:暴力枚举即可。
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<queue>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<time.h>
#include<cmath>
#include<sstream>
#include<assert.h>
using namespace std;
typedef long long int LL;
const int inf = 0x3f3f3f3f;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
const int MAXN = 1e5 + ; int main(){
//#ifdef kirito
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
//#endif
// int start = clock();
int l, r, x, y, k;
while (~scanf("%d%d%d%d%d",&l,&r,&x,&y,&k)){
bool flag = false;
for (int i = l; i <= r; i++){
int b = i / k;
if (i%k == && b >= x&&b <= y){
flag = true; break;
}
}
printf(flag ? "YES\n" : "NO\n");
}
//#ifdef LOCAL_TIME
// cout << "[Finished in " << clock() - start << " ms]" << endl;
//#endif
return ;
}
Codeforces Round #430 (Div. 2) - A的更多相关文章
- C - Ilya And The Tree Codeforces Round #430 (Div. 2)
http://codeforces.com/contest/842/problem/C 树 dp 一个数的质因数有限,用set存储,去重 #include <cstdio> #includ ...
- D. Vitya and Strange Lesson Codeforces Round #430 (Div. 2)
http://codeforces.com/contest/842/problem/D 树 二进制(路径,每个节点代表一位) #include <cstdio> #include < ...
- Codeforces Round #430 (Div. 2) C. Ilya And The Tree
地址:http://codeforces.com/contest/842/problem/C 题目: C. Ilya And The Tree time limit per test 2 second ...
- 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 #430 (Div. 2) - D
题目链接:http://codeforces.com/contest/842/problem/D 题意:定义Mex为一个序列中最小的未出现的正整数,给定一个长度为n的序列,然后有m个询问,每个询问给定 ...
- Codeforces Round #430 (Div. 2) - B
题目链接:http://codeforces.com/contest/842/problem/B 题意:给定一个圆心在原点(0,0)半径为r的大圆和一个圆内的圆环长度d,然后给你n个小圆,问你有多少个 ...
- Codeforces Round #430 (Div. 2)
A. Kirill And The Game time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- Codeforces Round #430 (Div. 2) D. Vitya and Strange Lesson
因为抑或,一眼字典树 但是处理起来比较难 #include<iostream> #include<map> #include<iostream> #include& ...
- 【Codeforces Round #430 (Div. 2) A C D三个题】
·不论难度,A,C,D自己都有收获! [A. Kirill And The Game] ·全是英文题,述大意: 给出两组区间端点:l,r,x,y和一个k.(都是正整数,保证区间不为空),询问是否 ...
随机推荐
- 一句话搞定python六剑客
六剑客 一行搞定六剑客:三个函数:map filter reduce + lambda 切片 推导列表 python最有特点的一行代码,所有代码均可以借用一行代码(目标) 1.map(函数,列表或者字 ...
- MYSQL与Navicat的连接错误问题
唱,跳,RAP,Basketball MySQL版本安装 遇到的一个坑(密码加密规则被修改导致Navicat连接不上) 众所周知,老师的一些任务,往往做起来不是很困难,只要按着步骤就可以,但是在程序的 ...
- HDU6025 Coprime Sequence(gcd)
HDU6025 Coprime Sequence 处理出数列的 \(gcd\) 前缀和后缀,删除一个数后的 \(gcd\) 为其前缀和后缀的 \(gcd\) . 遍历数列取 \(max\) 即为答案. ...
- lnmp源码搭建
Nginx工作原理 这里需要结合Apache的工作,对PHP文件处理过程的区别 1:Nginx是通过php-fpm这个服务来处理php文件 2:Apache是通过libphp5.so ...
- 在vi vim中使用正则表达式与 普通perl正则的区别?
参考这篇文章很好 vim中的正则表达式常用的命令有种, 即搜索和替换 /: 搜索 :s 替换 在vim中的正则表达式和perl编程的正则表达式还是有区别的: 正则表达式中的内容包括: 字面字符... ...
- XML文件解析!!!
在java jdk中解析XMl文件使用 org.w3c.dom.Document工具 一下是写入全程: import java.io.File; import java.io.IOExceptio ...
- java网络通信:同步阻塞式I/O模型(BIO)
缺点:一个线程只能处理一个客户端连接 服务端: public class TimeServer { public static void main(String[] args) throws IOEx ...
- C#异常操作
C#异常处理子系统包括: Try:需要异常机制的函数在其中运行 Catch:捕获异常 Throw:抛出异常 Finally:在try结束实现 C#异常主要在Exception类中,而在CLR机制中的异 ...
- oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle
--新增inset测试--dept 表结构orcl,ogg都存在,数据相同(但是rep1配置文件没有添加) SCOTT@ orcl ,'hongquan','BBA'); row created. S ...
- 【SpringMVC】---搭建框架步骤
项目如下 一.加入 Jar 包 部分jar包可以不导(第4.9.11个可以不导入) 二.在 Web.xml 中配置 DispatcherServlet <?xml version="1 ...