結果

問題 No.2795 Perfect Number
コンテスト
ユーザー ra5anchor
提出日時 2024-07-07 11:50:09
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 346 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 65,796 KB
最終ジャッジ日時 2024-07-07 11:50:15
合計ジャッジ時間 3,819 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 TLE * 1 -- * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisors(n):
    res_low, res_high = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            res_low.append(i)
            if i != n // i:
                res_high.append(n // i)
        i += 1
    return res_low + res_high[::-1]


N = int(input())
dv = divisors(N)
if sum(dv) == 2*N:
    print('Yes')
else:
    print('No')
0