結果

問題 No.1737 One to N
ユーザー dn6049949dn6049949
提出日時 2021-11-14 21:40:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 676 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 71,804 KB
最終ジャッジ日時 2023-08-20 06:21:16
合計ジャッジ時間 5,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,728 KB
testcase_01 AC 99 ms
71,384 KB
testcase_02 AC 100 ms
71,180 KB
testcase_03 AC 100 ms
71,436 KB
testcase_04 AC 101 ms
71,764 KB
testcase_05 AC 102 ms
71,412 KB
testcase_06 AC 100 ms
71,436 KB
testcase_07 AC 100 ms
71,132 KB
testcase_08 AC 99 ms
71,392 KB
testcase_09 AC 104 ms
71,172 KB
testcase_10 AC 105 ms
71,756 KB
testcase_11 AC 103 ms
71,436 KB
testcase_12 AC 105 ms
71,620 KB
testcase_13 AC 104 ms
71,376 KB
testcase_14 AC 104 ms
71,668 KB
testcase_15 AC 104 ms
71,244 KB
testcase_16 AC 102 ms
71,384 KB
testcase_17 AC 101 ms
71,768 KB
testcase_18 AC 102 ms
71,596 KB
testcase_19 AC 100 ms
71,480 KB
testcase_20 AC 104 ms
71,352 KB
testcase_21 AC 103 ms
71,668 KB
testcase_22 AC 102 ms
71,800 KB
testcase_23 AC 103 ms
71,488 KB
testcase_24 AC 102 ms
71,180 KB
testcase_25 AC 103 ms
71,488 KB
testcase_26 AC 99 ms
71,760 KB
testcase_27 AC 100 ms
71,804 KB
testcase_28 AC 103 ms
71,392 KB
testcase_29 AC 100 ms
71,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def main():
    n = I()
    i = 2
    ans = 0
    while i*i <= n:
        while n%i == 0:
            n //= i
            ans += i
        i += 1
    ans += n if n > 1 else 0
    print(ans)
    return


if __name__ == "__main__":
    main()
0