题目链接: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的更多相关文章

  1. C - Ilya And The Tree Codeforces Round #430 (Div. 2)

    http://codeforces.com/contest/842/problem/C 树 dp 一个数的质因数有限,用set存储,去重 #include <cstdio> #includ ...

  2. D. Vitya and Strange Lesson Codeforces Round #430 (Div. 2)

    http://codeforces.com/contest/842/problem/D 树 二进制(路径,每个节点代表一位) #include <cstdio> #include < ...

  3. 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 ...

  4. 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.直接暴力判断即 ...

  5. Codeforces Round #430 (Div. 2) - D

    题目链接:http://codeforces.com/contest/842/problem/D 题意:定义Mex为一个序列中最小的未出现的正整数,给定一个长度为n的序列,然后有m个询问,每个询问给定 ...

  6. Codeforces Round #430 (Div. 2) - B

    题目链接:http://codeforces.com/contest/842/problem/B 题意:给定一个圆心在原点(0,0)半径为r的大圆和一个圆内的圆环长度d,然后给你n个小圆,问你有多少个 ...

  7. Codeforces Round #430 (Div. 2)

    A. Kirill And The Game time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  8. Codeforces Round #430 (Div. 2) D. Vitya and Strange Lesson

    因为抑或,一眼字典树 但是处理起来比较难 #include<iostream> #include<map> #include<iostream> #include& ...

  9. 【Codeforces Round #430 (Div. 2) A C D三个题】

    ·不论难度,A,C,D自己都有收获! [A. Kirill And The Game] ·全是英文题,述大意:    给出两组区间端点:l,r,x,y和一个k.(都是正整数,保证区间不为空),询问是否 ...

随机推荐

  1. Integer类源码浅析

    1.首先Integer提供了两类工具类,包括把一个int类型转成二进等, 其实执行转换算法只有一个方法: public static String toString(int i, int radix) ...

  2. swagger2简单使用

    1.引入jar <!--引入swagger--> <dependency> <groupId>io.springfox</groupId> <ar ...

  3. JDK源码--HashMap(之resize)

    1.HashMap源码阅读目标了解具体的数据结构(hash及冲突链表.红黑树)和重要方法的具体实现(hashCode.equals.put.resize...) 2.重要方法 hashCode 与 e ...

  4. js运行原理

    https://www.youtube.com/watch?v=8aGhZQkoFbQ

  5. zay大爷的膜你题 D2T2——不老梦(AK梦)

    还是万年不变的外链 这个题.....是最难的....但是不知道为啥扶苏神仙讲完了之后我竟然听懂了.... 所以这个题我要好好写一写 首先我们看一看每一个测试点,来一点点得分 第一个测试点n = 1,直 ...

  6. leetcode 4寻找两个有序数组的中位数

    最优解O(log(min(m,n))) /** 之前用合并有序数组的思想做了O((m+n+1)/2),现在试一试O(log(min(m,n))) 基本思路为:通过二分查找较小的数组得到对应的中位数(假 ...

  7. Spring MVC静态资源处理——<mvc:resources /> ||<mvc:default-servlet-handler />

    优雅REST风格的资源URL不希望带 .html 或 .do 等后缀.由于早期的Spring MVC不能很好地处理静态资源,所以在web.xml中配置DispatcherServlet的请求映射,往往 ...

  8. Debian或者Ubuntu中安装secureCRT/secureFX

    1.官网下载 ubuntu 下的 xx.deb安装包.此处使用的安装包是scrt-sfx-8.5.4-1942.ubuntu16-64.x86_64.deb,点击下载,提取码:5em3. 2.安装 d ...

  9. 【web前端】前段时间的面题整理(1)

    这是我的试题答案整理,可能有多种答案.我也就写了一两种.在慢慢整合中 第一题 用js实现随机选取10-100之间的10个数字,存入一个数组,去重后求和(保证这10个数字不能出现重复) 要求:去重不能使 ...

  10. python接口自动化:绕过验证码登录

    上线产品的登录接口会有验证码,一般可以通过添加cookie的方式绕过验证码. 一.抓登录的cookie 1. 先手动登录一次,然后用fiddler抓取这个cookie,再直接把这个值添加到cookie ...