結果
問題 | No.2795 Perfect Number |
ユーザー |
|
提出日時 | 2024-06-29 10:29:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 316 bytes |
コンパイル時間 | 206 ms |
コンパイル使用メモリ | 82,412 KB |
実行使用メモリ | 57,856 KB |
最終ジャッジ日時 | 2024-06-29 10:29:07 |
合計ジャッジ時間 | 2,957 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
N = int(input()) t = 1 n = N for i in range(2,10 ** 6 + 1): if n % i == 0: count = 1 n //= i while n % i == 0: n //= i count += 1 t *= (i ** (count + 1) - 1) // (i - 1) if n > 1: t *= (n + 1) if t == N + N: print('Yes') else: print('No')