結果

問題 No.809 かけ算
ユーザー 👑 もぐら 3.0もぐら 3.0
提出日時 2023-11-13 20:07:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 57,300 KB
最終ジャッジ日時 2023-11-13 20:07:30
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 34 ms
53,460 KB
testcase_04 AC 38 ms
57,300 KB
testcase_05 AC 38 ms
57,300 KB
testcase_06 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

C = int(input())

ans = prime_factorize(C)

if C==1:
    print(1,1)
else:
    print(ans[0],C//ans[0])
0