結果

問題 No.1737 One to N
ユーザー bayashi-clbayashi-cl
提出日時 2021-11-12 22:16:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 723 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2023-08-17 01:58:22
合計ジャッジ時間 3,090 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,708 KB
testcase_01 AC 31 ms
9,764 KB
testcase_02 AC 31 ms
9,680 KB
testcase_03 AC 31 ms
9,708 KB
testcase_04 AC 30 ms
9,824 KB
testcase_05 AC 31 ms
9,692 KB
testcase_06 AC 30 ms
9,828 KB
testcase_07 AC 31 ms
9,656 KB
testcase_08 AC 31 ms
9,712 KB
testcase_09 AC 31 ms
9,708 KB
testcase_10 AC 31 ms
9,652 KB
testcase_11 AC 33 ms
9,820 KB
testcase_12 AC 31 ms
9,656 KB
testcase_13 AC 30 ms
9,656 KB
testcase_14 AC 30 ms
9,860 KB
testcase_15 AC 31 ms
9,704 KB
testcase_16 AC 30 ms
9,788 KB
testcase_17 AC 30 ms
9,820 KB
testcase_18 AC 30 ms
9,820 KB
testcase_19 AC 31 ms
9,708 KB
testcase_20 AC 31 ms
9,688 KB
testcase_21 AC 30 ms
9,860 KB
testcase_22 AC 30 ms
9,832 KB
testcase_23 AC 30 ms
9,852 KB
testcase_24 AC 30 ms
9,796 KB
testcase_25 AC 30 ms
9,768 KB
testcase_26 AC 30 ms
9,812 KB
testcase_27 AC 30 ms
9,804 KB
testcase_28 AC 30 ms
9,872 KB
testcase_29 AC 32 ms
9,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# region template
import sys
import typing
from typing import Callable, Dict, List, Set, Tuple

sys.setrecursionlimit(10 ** 6)
Vec = List[int]
VecVec = List[Vec]
sinput: Callable[..., str] = sys.stdin.readline
MOD: int = 1000000007
INF: float = float("Inf")
IINF: int = sys.maxsize
# endregion


def prime_factorize(n: int) -> typing.List[int]:
    res = []
    while n % 2 == 0:
        res.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            res.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        res.append(n)
    return res


def main() -> None:
    n = int(sinput())
    print(sum(prime_factorize(n)))


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