結果

問題 No.414 衝動
ユーザー yansi819yansi819
提出日時 2024-05-19 12:14:51
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 359 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 65,196 KB
最終ジャッジ日時 2024-05-19 12:14:56
合計ジャッジ時間 1,765 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
58,576 KB
testcase_01 AC 35 ms
52,288 KB
testcase_02 AC 35 ms
53,124 KB
testcase_03 AC 48 ms
57,648 KB
testcase_04 AC 47 ms
58,552 KB
testcase_05 AC 48 ms
58,804 KB
testcase_06 AC 48 ms
57,596 KB
testcase_07 RE -
testcase_08 AC 45 ms
58,612 KB
testcase_09 AC 46 ms
57,572 KB
testcase_10 AC 33 ms
53,348 KB
testcase_11 AC 37 ms
58,824 KB
testcase_12 AC 37 ms
58,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factors(N):
    d = []
    for i in range(2, int(N ** 0.5) + 1):
        while N % i == 0:
            d.append(i)
            N //= i
    if N != 1:
        d.append(N)
    return d

M = int(input())
pf = prime_factors(M)
if len(pf) == 1:
    print(1, M)
else:
    ans = 1
    for i in range(1, len(pf)):
        ans *= pf[i]
    print(pf[0], ans)
0