結果
問題 | No.2795 Perfect Number |
ユーザー |
![]() |
提出日時 | 2024-06-28 22:41:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,356 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-06-28 22:41:08 |
合計ジャッジ時間 | 2,843 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 35 |
ソースコード
from heapq import heappush, heappop, heapifyfrom collections import defaultdict, deque,Counterfrom math import ceil, floor, sqrt, factorial, gcd, cos, sin, pi, acos, asinfrom itertools import permutations, combinations, product, accumulatefrom bisect import bisect_left, bisect_right, insortfrom copy import deepcopyfrom fractions import Fractionfrom random import randintimport sysfrom functools import cache,lru_cache #@lru_cache(maxsize=None)from time import timefrom sortedcontainers import SortedSet, SortedList, SortedDict # type: ignoresys.setrecursionlimit(10**7)vector1 = [[0, -1], [1, 0], [0, 1], [-1, 0]]vector2 = [[0, 1], [1, 0], [-1, 0], [0, -1],[1,-1], [-1, 1], [1, 1], [-1, -1]]alphabet = "abcdefghijklmnopqrstuvwxyz"def make_divisors(n):lower_divisors, upper_divisors = [], []i = 1while i * i <= n:if n % i == 0:lower_divisors.append(i)if i != n // i:upper_divisors.append(n//i)i += 1return lower_divisors + upper_divisors[::-1]def main():N = int(input())divisors = make_divisors(N)y = 0for d in divisors:y += dif y == 2 * N:print("Yes")else:print("No")if __name__ == '__main__':main()