No.1653 Squarefree
問題文最終更新日: 2021-08-09 09:32:23
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 310
(順位表)
の他の問題:
Problem Statement
A positive integer is said to be squarefree if it is not divisible by any perfect square greater than $1$.
Find the number of squarefree integers between $L$ and $R$, inclusive.
Input
$L\ R$
- $1\leq L\leq R\leq 10^{18}$
- $R-L\leq 10^6$
- All inputs are integers.
Output
Output the answer.
Sample
Sample 1
Input
3 14
Output
8
Among the integers between $3$ and $14$, inclusive, the squarefree ones are $3$, $5$, $6$, $7$, $10$, $11$, $13$, $14$, for a total of $8$.
Sample 2
Input
1 1
Output
1
Note that $1$ is squarefree.
Sample 3
Input
998244353 998244853
Output
305
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
chocorusk
sak