結果

問題 No.36 素数が嫌い!
ユーザー Navier_Boltzmann
提出日時 2023-06-09 03:19:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 5,000 ms
コード長 641 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 62,988 KB
最終ジャッジ日時 2024-12-31 10:32:52
合計ジャッジ時間 4,624 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
X = make_divisors(N)
if len(X)<=3:
    print('NO')
    exit()

if len(X)>=5:
    print('YES')
    exit()

X.sort()
p = X[1]
if all(i%p==0 for i in X[1:]):
    print('YES')
else:
    print('NO')
0