結果

問題 No.414 衝動
ユーザー けむけむけむけむ
提出日時 2021-08-08 11:07:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 156 ms / 1,000 ms
コード長 488 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 11,948 KB
実行使用メモリ 10,252 KB
最終ジャッジ日時 2023-10-19 10:35:34
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def shodo(N):
    if N % 2 == 0:
        return f'2 {N // 2}'
    elif 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