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 ...
随机推荐
- Linux命令基础
开启Linux操作系统,root用户登录GNOME图形界面,如下图: 切换到虚拟终端2,使用普通用户身份登录,查看系统提示符,如下图: 使用命令退出虚拟终端2上的登录用户,如下图: 切换到虚拟终端5, ...
- 项目管理器 ProjectManager Beta 10 发布
本次更新内容: 可以设置主界面是否显示表格线 去除了开发日志界面的表格线,看起来好像好看一些 修复主界面时间显示的问题 自定义问候语 修复习惯统计记录时间显示错误的问题 修复创建项目时间错误问题 增加 ...
- POJ-1062 昂贵的聘礼---Dijkstra+枚举上界
题目链接: https://vjudge.net/problem/POJ-1062 题目大意: 中文题 思路: 1是终点,可以额外添加一个源点0,0到任意一节点的距离就是这个点的money,最终求的是 ...
- JavaScript数据结构与算法(六) 链表的实现
// 链表存储有序的元素集合,但不同于数组,链表中的元素在内存中并不是连续放置的.每个 // 元素由一个存储元素本身的节点和一个指向下一个元素的引用(也称指针或链接)组成.下图展 // 示了一个链表的 ...
- [LeetCode] Max Chunks To Make Sorted 可排序的最大块数
Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into som ...
- 关于自定义view--实现自定义水波纹效果
开发中的东西太多,怕自己忘记了,简单记录一下. 声明:此控件借鉴了大佬的想法,在此感谢大佬提供的支持,我只是把大佬的想法拿出来而已. ok,废话到此结束,看效果: 分析一下,我们可以看到,图中有两个圆 ...
- Android Studio安装、配置、第一个程序的那些坑
最近在上Android课,老师布置了量大题难的作业,然而出师未捷身先死,还没看题目,就被Android Studio的安装和环境配置搞得要死要死的,网上的教程也多也杂,良莠不齐,在经历了5小时通过的搜 ...
- [POI 2004]ZAW
Description 在 Byte 山的山脚下有一个洞穴入口. 这个洞穴由复杂的洞室经过隧道连接构成. 洞穴的入口是 1 号点.两个洞室要么就通过隧道连接起来,要么就经过若干隧道间接的相连. 现在决 ...
- 洛谷P2572 [SCOI2010]序列操作
线段树 pushdown写的很浪~ #include<cstdio> #include<cstdlib> #include<algorithm> #include& ...
- HDU5339——Untitled
Problem Description There is an integer a and n integers b1,…,bn. After selecting some numbers from ...