結果

問題 No.414 衝動
ユーザー ssmkzkssmkzk
提出日時 2019-03-31 16:14:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 557 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 821,400 KB
最終ジャッジ日時 2024-05-01 14:15:54
合計ジャッジ時間 4,852 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

M = int(input())

def SoE(x):
    if x < 2:
        return [1]
    
    l = [i for i in range(x + 1)]
    l[1] = 0
    
    for i in l:
        if i > math.sqrt(x):
            break
        if i == 0:
            continue
        for j in range(2 * i , x + 1, i):
            l[j] = 0
    
    return [i for i in l if i != 0]

l = SoE(M)

if l[-1] == M:
    print(1,M)
else:
    if M % 2 == 0:
        print(2, M // 2)
    else:
        for i in range(3, M, 2):
            if M % i == 0:
                print(i, M // i)
                break
0