結果

問題 No.2795 Perfect Number
ユーザー _a_a
提出日時 2024-06-28 21:33:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 1,681 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-28 21:33:35
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sympy
import os, sys
import math, decimal, queue, heapq, bisect, itertools, functools, collections, string
from bisect import bisect, bisect_left
from collections import defaultdict, OrderedDict, deque, Counter
from functools import cmp_to_key, lru_cache, reduce
from heapq import heapify, heappush, heappushpop, heappop, heapreplace, nlargest, nsmallest
from itertools import accumulate, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice, permutations, product, repeat, starmap, takewhile, tee, zip_longest
from math import gcd, factorial, isqrt, comb, perm, prod, inf
from queue import Queue, PriorityQueue, LifoQueue
from string import ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, octdigits

az, AZ, mod = ascii_lowercase, ascii_uppercase, 1_000_000_007


def solve():

    def _f(n):
        div_sum = sum(sympy.divisors(n))
        return 'Yes' if div_sum == 2 * n else 'No'

    def run(W):
        return _f(W[0])

    print(run(W))


if __name__ == '__main__':
    LOCAL = sys.argv[0] if '4a' in sys.argv[0] else None

    P = lambda *p: [print(i, end='  ') for i in p] if LOCAL else None
    PI = lambda *p: print(' '.join(map(str, p))) or None
    PII = lambda X: [PI(*row) for row in X]

    sys.stdin = open(os.path.join(os.getcwd(), 'a1.txt'), 'r') if LOCAL else sys.stdin
    I = lambda: [int(a) for l in sys.stdin for a in l.strip().split()]
    S = lambda: [a for l in sys.stdin for a in l.strip().split()]
    IM = lambda: [[int(a) for a in l.split()] for l in sys.stdin]
    SM = lambda: [[a for a in l.split()] for l in sys.stdin]
    W = I()
    # P(W)
    solve()
0