問題一覧 > 通常問題

No.1514 Squared Matching

レベル : / AI推定難易度 : 1750 / 実行時間制限 : 1ケース 4.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 129
作問者 : だれ / テスター : evima nok0
お気に入りにしたユーザー ProblemId : 6365 / 自分の提出
問題文最終更新日: 2021-05-02 17:05:28
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もしくは右上の雲マークをクリックしてアカウントを作成してください。