結果

問題 No.36 素数が嫌い!
ユーザー tnoda_
提出日時 2015-07-31 17:25:10
言語 Python2
(2.7.18)
結果
AC  
実行時間 979 ms / 5,000 ms
コード長 250 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 00:22:44
合計ジャッジ時間 4,371 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

def factor(x):
    i = 2
    while i * i <= x:
        if x % i == 0:
            return i
        i += 1
    return -1

N = input()
p = factor(N)
if p < 0:
    print('NO')
    quit()
p = factor(N/p)
if p < 0:
    print('NO')
    quit()
print('YES')
0