102503: [AtCoder]ABC250 D - 250-like Number
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Score : $400$ points
Problem Statement
Let us regard an integer $k$ as "similar to $250$" if the following condition is satisfied:
- $k$ is represented as $k=p \times q^3$ with primes $p<q$.
How many integers less than or equal to $N$ are "similar to $250$"?
Constraints
- $N$ is an integer between $1$ and $10^{18}$ (inclusive)
Input
Input is given from Standard Input in the following format:
$N$
Output
Print the answer as an integer.
Sample Input 1
250
Sample Output 1
2
- $54 = 2 \times 3^3$ is "similar to $250$".
- $250 = 2 \times 5^3$ is "similar to $250$".
The two integers above are all the integers "similar to $250$".
Sample Input 2
1
Sample Output 2
0
Sample Input 3
123456789012345
Sample Output 3
226863
Input
题意翻译
### 【题目描述】 如果一个整数$k$满足:存在素数$p$和$q$使得 $k=p\ \times\ q^3 $,则称$k$为“与$250$相似的数”。 现在给出一个数$N$,请求出小于$N$的“与$250$相似的数”一共有几个。 ### 【数据规模】 $N$为$(1,10^{18})$范围内的整数。Output
分数:$400$分
问题描述
如果满足以下条件,我们称整数$k$“与$250$相似”:
- $k$可以表示为$k=p \times q^3$,其中$p<q$是素数。
小于或等于$N$的整数中有多少个“与$250$相似”?
限制条件
- $N$是一个在$1$到$10^{18}$(含)之间的整数。
输入
从标准输入以以下格式获取输入:
$N$
输出
打印答案为整数。
样例输入1
250
样例输出1
2
- $54 = 2 \times 3^3$“与$250$相似”。
- $250 = 2 \times 5^3$“与$250$相似”。
上述两个整数是所有“与$250$相似”的整数。
样例输入2
1
样例输出2
0
样例输入3
123456789012345
样例输出3
226863