結果

問題 No.312 置換処理
ユーザー 🍡yurahuna
提出日時 2015-12-21 00:01:13
言語 Python2
(2.7.18)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-11-15 11:59:04
合計ジャッジ時間 2,103 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = input()
n = N
cnt = 0
while n % 2 == 0:
    n /= 2
    cnt += 1
if n % 3 == 0:
    print 3
elif cnt >= 2:
    print 4
else:
    SQRT_N = int(math.floor(math.sqrt(N)))
    flag = False
    for i in xrange(3, SQRT_N +1, 2):
        if N % i == 0:
            flag = True
            break
    if flag:
        print i
    else:
        print n
0