結果
問題 |
No.2795 Perfect Number
|
ユーザー |
![]() |
提出日時 | 2024-06-28 21:21:37 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 63,104 KB |
最終ジャッジ日時 | 2024-06-28 21:21:54 |
合計ジャッジ時間 | 3,913 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 TLE * 1 -- * 32 |
ソースコード
def divisors(X): assert X >= 1 from math import isqrt head = [d for d in range(1, isqrt(X) + 1) if X%d == 0] tail = [X//d for d in reversed(head)] if isqrt(X)**2 == X: head.pop() return head + tail N = int(input()) S = sum(divisors(N)) ans = S == N*2 if ans is True: print("Yes") else: print("No")