結果

問題 No.414 衝動
ユーザー けむけむけむけむ
提出日時 2021-08-08 11:05:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 514 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 10,260 KB
最終ジャッジ日時 2023-10-19 10:33:03
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,248 KB
testcase_01 AC 29 ms
10,164 KB
testcase_02 AC 30 ms
10,196 KB
testcase_03 AC 155 ms
10,248 KB
testcase_04 AC 31 ms
10,164 KB
testcase_05 AC 159 ms
10,248 KB
testcase_06 AC 157 ms
10,248 KB
testcase_07 RE -
testcase_08 AC 101 ms
10,260 KB
testcase_09 AC 154 ms
10,260 KB
testcase_10 AC 29 ms
10,168 KB
testcase_11 AC 30 ms
10,196 KB
testcase_12 AC 31 ms
10,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def shodo(N):
    if N % 2 == 0:
        return f'2 {N // 2}'
    elif (N == 3) or (N == 5) or (N == 7):
        return f'1 {N}'
    else:
        end = int(N ** (0.5)) + 1
        for i in range(3, end):
            if N % i == 0:
                ans1 = i
                ans2 = N // i
                break
            elif i == end - 1:
                ans1 = 1
                ans2 = N
        return f'{ans1} {ans2}'

def main():
    N = int(input())
    print(shodo(N))

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