問題一覧 > 通常問題

No.2795 Perfect Number

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