J -
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

Input
3000
Output
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(公倍数)的更多相关文章

  1. codeforces 630J Divisibility

    J. Divisibility time limit per test 0.5 seconds memory limit per test 64 megabytes input standard in ...

  2. Codeforces 550C —— Divisibility by Eight——————【枚举 || dp】

     Divisibility by Eight time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  3. [math] Codeforces 597A Divisibility

    题目:http://codeforces.com/problemset/problem/597/A Divisibility time limit per test 1 second memory l ...

  4. Codeforces 922F Divisibility 构造

    Divisibility 我们考虑删数字 首先我们可以发现有一类数很特殊就是大于 n / 2的素数, 因为这些素数的贡献只有1, 并且在n大的时候, 这些素数的个数不是很少, 我们可以最后用这些数去调 ...

  5. Codeforces 922F Divisibility (构造 + 数论)

    题目链接  Divisibility 题意 给定$n$和$k$,构造一个集合$\left\{1, 2, 3, ..., n \right\}$的子集,使得在这个集合中恰好有$k$对正整数$(x, y) ...

  6. CodeForces 597A Divisibility

    水题. #include<iostream> #include<cstring> #include<cmath> #include<queue> #in ...

  7. Codeforces 988E. Divisibility by 25

    解题思路: 只有尾数为25,50,75,00的数才可能是25的倍数. 对字符串做4次处理,以25为例. a. 将字符串中的最后一个5移到最后一位.计算交换次数.(如果没有找到5,则不可能凑出25,考虑 ...

  8. 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/ ...

  9. Codeforces Testing Round #12 A. Divisibility 水题

    A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...

  10. Codeforces Round #486 (Div. 3) E. Divisibility by 25

    Codeforces Round #486 (Div. 3) E. Divisibility by 25 题目连接: http://codeforces.com/group/T0ITBvoeEx/co ...

随机推荐

  1. 以简单的例子谈一下C#中的COPY

    周五晚上加班的时候做一堆ComboBox直接的联动,然后呢,这些cbo的DataSource都是同一个DataTable,当时写代码的时候求快也就没有太注意DataTable的绑定,然后就出了一些小问 ...

  2. centOS7卸载google-chrome

    参考: https://www.jianshu.com/p/39d0b8f578d9

  3. linux mysql-workbench 创建与正式库表结构一样的表

    先在本地创建数据库 字符集选择这个 创建数据库成功 创建与正式库一样的表 step1: 连接正式库,找到要生成的表,导出创建表的sql语句 step2: 找到本地数据库,选择表,在sql执行区域复制s ...

  4. 文章或者观点说说等点赞功能实现(thinkphp)

    前端的代码: <!-- 点赞 --> <div class='btm'><a class='zan' id="{$article.id}" href= ...

  5. 初级模拟电路:3-1 BJT概述

    回到目录 1.   名称由来 BJT的全称是双极性结型晶体管(Bipolar Junction Transistor),国内俗称三极管.其实,在英语中,三极管(triode)特指以前的真空电子管形式的 ...

  6. java中一个数组不能放不同数据类型的值

    在java中,数组不能放不同数据类型的值. 方法一: 多态 定义数组类型的时候定义为父类,而存进数组为父类的子类 public class test2 { public static void mai ...

  7. codevs 1160 蛇形矩阵

    1160 蛇形矩阵 传送门  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 白银 Silver 题解       题目描述 Description 小明玩一个数字游戏,取个n行 ...

  8. Linux - redis主从同步

    目录 Linux - redis主从同步 环境准备 配置主从同步 测试写入数据,主库写入数据,检查从库数据 手动进行主从复制故障切换 Linux - redis主从同步 原理: 从服务器向主服务器发送 ...

  9. 【3】数据筛选2 - requests

    目录     1.概述     2.下载安装     3.入门程序     4.请求对象:请求方式     5.请求对象:GET参数传递     6.请求对象:POST参数传递     7.请求对象: ...

  10. h5知识总结

    移动开发基本知识点一. 使用rem作为单位 html { font-size: 100px; } @media(min-width: 320px) { html { font-size: 100px; ...