No.1514 Squared Matching
問題文最終更新日: 2021-05-02 17:05:28
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 296
(順位表)
の他の問題:
Problem Statement
Find the number of ordered pairs $(a, b)$ of integers between $1$ and $N$, inclusive, such that the product $ab$ is a perfect square.
Notes
Be careful of the execution time limit. (For C++, it has been confirmed that the problem can be solved even with the execution time limit reduced to $1/4$.)
Input
$N$
- $1 \leq N \leq 5 \times 10^7$
- $N$ is an integer.
Output
Output the answer, followed by a newline.
Sample
Sample 1
Input
4
Output
6
There are $6$ such pairs: $(a, b) = (1, 1), (1, 4), (2, 2), (3, 3), (4, 1), (4, 4)$.
Sample 2
Input
50000000
Output
545761220
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
だれ
evima
nok0