結果

問題 No.36 素数が嫌い!
ユーザー gorugo30
提出日時 2021-02-25 22:00:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 274 ms / 5,000 ms
コード長 474 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-10-01 13:10:03
合計ジャッジ時間 2,851 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N == 1:
    print("NO")
    exit()

def isp(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True
if isp(N):
    print("NO")
    exit()

for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        N //= i
        break
if isp(N):
    print("NO")
    exit()
for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        N //= i
        break
if N == 1:
    print("NO")
else:
    print("YES")
0