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 ...
随机推荐
- java设计模式03装饰者者模式
动态地给一个对象添加一些额外的职责.就增加功能来说, Decorator模式相比生成子类更为灵活.该模式以对客 户端透明的方式扩展对象的功能. (1)在不影响其他对象的情况下,以动态.透明的方式给单个 ...
- demo记录
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http ...
- centos7安装个人网盘nextcloud
本节介绍如何在centos7上建立个人云盘nextcloud服务器 第一:建立用户nextcloud 第二:安装下载工具wget 第三:把nextcloud账号添加到sudoers目录下 第四:切换到 ...
- javascript中 (function(){})();如何理解?
javascript中 (function(){})();如何理解? javascript中: (function(){})()是匿名函数,主要利用函数内的变量作用域,避免产生全局变量,影响整体页面环 ...
- SSHFS使用笔记
在写树莓派集群项目的时候,发现如果在树莓派上维护的代码需要非常费力才能跟本地项目代码同步,因此打算将Server端和Client端代码分开,树莓派上的Client端代码远程挂载到本地,这样做比之前要更 ...
- 洛谷——P1572 计算分数
P1572 计算分数 模拟+字符串 注意有两位数的情况以及负数情况 #include<bits/stdc++.h> using namespace std; string s; ],b[] ...
- 观察者模式之Golang实现
观察者模式的具体概念原理,参见https://baike.baidu.com/item/%E8%A7%82%E5%AF%9F%E8%80%85%E6%A8%A1%E5%BC%8F/5881786?fr ...
- 第三节:初识pandas之DataFrame(上)
DataFrame是Python中Pandas库中的一种数据结构,它类似excel,是一种二维表.
- Modbus 协议解析
- 1.2 Java“白皮书”的关键术语
Java的设计者已经编写了颇有影响力的“白皮书”,来解释设计的初衷以及完成的情况,并且发布了一个简短的摘要.这个摘要用下面11个关键术语进行组织: 简单性 面向对象 分布式 健壮性 安全性 体 ...