結果

問題 No.809 かけ算
ユーザー iad_2889iad_2889
提出日時 2019-04-26 23:23:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 546 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 9,468 KB
最終ジャッジ日時 2023-08-16 17:36:18
合計ジャッジ時間 2,496 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,352 KB
testcase_01 AC 13 ms
8,328 KB
testcase_02 AC 13 ms
8,304 KB
testcase_03 AC 14 ms
8,316 KB
testcase_04 AC 546 ms
9,468 KB
testcase_05 AC 524 ms
9,424 KB
testcase_06 AC 14 ms
8,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import count
from math import sqrt
def primes():
    g = count(2)
    while True:
        p = next(g)
        yield p
        g = filter(lambda n,p = p:n % p,g)

C = int(input())
for A in primes():
    if A > sqrt(C):
        A = 1
        break
    if not C % A:
        break
B = C // A
print("%d %d" % (A,B))
0