結果
問題 | No.2795 Perfect Number |
ユーザー | _a |
提出日時 | 2024-06-28 21:36:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,821 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 45,044 KB |
最終ジャッジ日時 | 2024-06-28 21:36:55 |
合計ジャッジ時間 | 19,784 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 457 ms
44,664 KB |
testcase_01 | AC | 466 ms
44,788 KB |
testcase_02 | AC | 501 ms
44,536 KB |
testcase_03 | AC | 458 ms
44,276 KB |
testcase_04 | AC | 498 ms
44,664 KB |
testcase_05 | AC | 465 ms
45,044 KB |
testcase_06 | AC | 524 ms
44,788 KB |
testcase_07 | AC | 464 ms
44,788 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 491 ms
44,280 KB |
testcase_12 | AC | 464 ms
44,536 KB |
testcase_13 | AC | 480 ms
44,536 KB |
testcase_14 | AC | 456 ms
44,404 KB |
testcase_15 | AC | 463 ms
44,792 KB |
testcase_16 | AC | 494 ms
44,540 KB |
testcase_17 | AC | 467 ms
44,272 KB |
testcase_18 | AC | 485 ms
44,920 KB |
testcase_19 | AC | 460 ms
44,532 KB |
testcase_20 | AC | 478 ms
44,660 KB |
testcase_21 | AC | 462 ms
44,668 KB |
testcase_22 | AC | 466 ms
44,660 KB |
testcase_23 | AC | 479 ms
44,792 KB |
testcase_24 | AC | 462 ms
44,788 KB |
testcase_25 | AC | 493 ms
44,920 KB |
testcase_26 | AC | 473 ms
44,280 KB |
testcase_27 | AC | 472 ms
44,408 KB |
testcase_28 | AC | 494 ms
44,660 KB |
testcase_29 | AC | 467 ms
44,660 KB |
testcase_30 | AC | 494 ms
44,664 KB |
testcase_31 | AC | 495 ms
44,280 KB |
testcase_32 | AC | 493 ms
44,788 KB |
testcase_33 | AC | 469 ms
44,540 KB |
testcase_34 | AC | 471 ms
44,436 KB |
testcase_35 | AC | 495 ms
44,664 KB |
testcase_36 | AC | 483 ms
44,532 KB |
testcase_37 | AC | 514 ms
44,656 KB |
ソースコード
import numpy as np import scipy 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): if n > 10**6: return 'No' div_sum = np.sum([i + (n // i if i != n // i else 0) for i in range(1, int(np.sqrt(n)) + 1) if n % i == 0]) 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()