CF665F.Four Divisors

提高+/省选-

通过率:0%

时间限制:10.00s

内存限制:768MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

If an integer a is divisible by another integer b, then b is called the divisor of a.

For example: 12 has positive 6 divisors. They are 1, 2, 3, 4, 6 and 12.

Let’s define a function D(n) — number of integers between 1 and n (inclusive) which has exactly four positive divisors.

Between 1 and 10 only the integers 6, 8 and 10 has exactly four positive divisors. So, D(10) = 3.

You are given an integer n. You have to calculate D(n).

如果一个整数 aa 能被另一个整数 bb 整除,则称 bb 是 aa 的一个约数(或因数)。

例如:12 有 6 个正约数,它们是 1、2、3、4、6 和 12。

我们定义函数 D(n)D(n):表示在 11 到 nn(含端点)之间,恰好有四个正约数的整数的个数。

在 11 到 1010 之间,仅有整数 6、8 和 10 恰好有四个正约数。因此,D(10)=3D(10) = 3。

给定一个整数 nn,你需要计算 D(n)D(n)。

输入格式

The only line contains integer n (1 ≤ n ≤ 1011) — the parameter from the problem statement.

唯一的一行包含一个整数 nn(1≤n≤10111 \leq n \leq 10^{11})——即题目描述中的参数。

输出格式

Print the only integer c — the number of integers between 1 and n with exactly four divisors.

输出唯一的整数 cc —— 即在 11 到 nn 之间恰好有四个正因数的整数的个数。

输入输出样例

  • 输入#1

    10

    输出#1

    3
  • 输入#2

    20

    输出#2

    5

输入解题思路,AI测评打分。不知道怎么写?

首页