No.2795 Perfect Number
問題文最終更新日: 2024-06-28 21:02:04
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 435
(順位表)
の他の問題:
Problem Statement
You are given a positive integer $N$.
Determine whether $N$ is a perfect number. That is, determine whether the following condition is satisfied.
- The sum of the positive divisors of $N$ is $2N$.
Constraints
- All input values are integers.
- $1\le N\le 10^{18}$
Input
$N$
Output
Print Yes if $N$ is a perfect number, and No otherwise.
Sample
Sample 1
Input
6
Output
Yes
The sum of the positive divisors of $6$ is $1+2+3+6=12=2\times 6$, so $6$ is a perfect number.
Sample 2
Input
28
Output
Yes
Sample 3
Input
628
Output
No
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noya2