Codeforces--630J--Divisibility(公倍数)
Divisibility
Crawling in process...
Crawling failed
Time Limit:500MS
Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number
of sales is divisible by all numbers from 2 to
10 every developer of this game gets a small bonus.
A game designer Petya knows that the company is just about to release a new game that was partly developed by him. On the basis of his experience he predicts that
n people will buy the game during the first month. Now Petya wants to determine how many times he will get the bonus. Help him to know it.
Input
The only line of the input contains one integer n (1 ≤ n ≤ 1018) — the prediction on the number of people who
will buy the game.
Output
Output one integer showing how many numbers from 1 to
n are divisible by all numbers from
2 to 10.
Sample Input
3000
1
求在1--n中可以被2--10全部整除的数字的个数,很明显,被2--10全部整除就是求2--10这几个数的最小公倍数,好吧,就是2520
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
__int64 n;
while(cin>>n)
{
cout<<n/2520<<endl;
}
return 0;
}
Codeforces--630J--Divisibility(公倍数)的更多相关文章
- codeforces 630J Divisibility
J. Divisibility time limit per test 0.5 seconds memory limit per test 64 megabytes input standard in ...
- Codeforces 550C —— Divisibility by Eight——————【枚举 || dp】
Divisibility by Eight time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- [math] Codeforces 597A Divisibility
题目:http://codeforces.com/problemset/problem/597/A Divisibility time limit per test 1 second memory l ...
- Codeforces 922F Divisibility 构造
Divisibility 我们考虑删数字 首先我们可以发现有一类数很特殊就是大于 n / 2的素数, 因为这些素数的贡献只有1, 并且在n大的时候, 这些素数的个数不是很少, 我们可以最后用这些数去调 ...
- Codeforces 922F Divisibility (构造 + 数论)
题目链接 Divisibility 题意 给定$n$和$k$,构造一个集合$\left\{1, 2, 3, ..., n \right\}$的子集,使得在这个集合中恰好有$k$对正整数$(x, y) ...
- CodeForces 597A Divisibility
水题. #include<iostream> #include<cstring> #include<cmath> #include<queue> #in ...
- Codeforces 988E. Divisibility by 25
解题思路: 只有尾数为25,50,75,00的数才可能是25的倍数. 对字符串做4次处理,以25为例. a. 将字符串中的最后一个5移到最后一位.计算交换次数.(如果没有找到5,则不可能凑出25,考虑 ...
- Codeforces Round #306 (Div. 2) C. Divisibility by Eight 暴力
C. Divisibility by Eight Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/ ...
- Codeforces Testing Round #12 A. Divisibility 水题
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...
- Codeforces Round #486 (Div. 3) E. Divisibility by 25
Codeforces Round #486 (Div. 3) E. Divisibility by 25 题目连接: http://codeforces.com/group/T0ITBvoeEx/co ...
随机推荐
- echarts交叉关系图二
echarts关系图表,此图是坐标关系图,此图用的随机坐标,此图可以拖拽,更方便整理关系, 引入echarts.js就可以实现 代码: var graph={ //这是数据项目中一般都是获取到的 no ...
- boolean b=true?false:true==true?false:true;
下列代码的输出结果是_____ boolean b=true?false:true==true?false:true;System.out.println(b); 答案:false 题目来源:携程20 ...
- (转) SolrCloud之分布式索引及与Zookeeper的集成
http://blog.csdn.net/ebay/article/details/46549481 作者:Wang, Josh 一.概述 Lucene是一个Java语言编写的利用倒排原理实现的文本检 ...
- Android之Fragment的优点和作用
一:什么是Fragment 碎片.片段.其目的是为了解决不同屏幕分辩率的动态和灵活UI设计.大屏幕如平板小屏幕如手机,平板电脑的设计使得其有更多的空间来放更多的UI组件,而多出来的空间存放UI使其会产 ...
- C# 把时间 月 //把第一个0替换为空
string str = "2019-01"; //name: "2019-01月" str = str.Substring(str.Length - , ); ...
- illumina测序原理
一些常用基本概念的介绍: flowcell流动池 是指Illumina测序时,测序反应发生的位置,1个flowcell含有8条lane lane通道 每一个flowcell上都有8条泳道,用于测序反应 ...
- enote笔记语言(4)(ver0.2)——“5w1h2k”分析法
章节:“5w1h2k”分析法 what:我想知道某个“关键词(keyword)”(即,词汇.词语,或称单词,可以是概念|专业术语|.......)的定义. why:我想知道事物发生的原因.“why ...
- Luogu 2951 捉迷藏Hide and Seek
P2951 [USACO09OPEN]捉迷藏Hide and Seek 题目描述 Bessie is playing hide and seek (a game in which a number o ...
- JavaScript控制iframe中元素的样式
//根据ID获取要操控元素 var deptObjs=document.getElementById("IFRAMEID").contentWindow.document.getE ...
- HTML学习笔记之标签进阶
目录 1.框架 2.表单 3.音频 4.视频 5.文档类型 6.头部元素 7.样式 8.脚本 9.实体 1.框架 使用框架允许我们在同一个浏览器窗口中显示多个页面,其中每份 HTML 文档称为一个框架 ...