結果

問題 No.36 素数が嫌い!
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-06-09 03:19:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 264 ms / 5,000 ms
コード長 641 bytes
コンパイル時間 949 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 77,276 KB
最終ジャッジ日時 2023-08-30 03:32:15
合計ジャッジ時間 6,761 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 180 ms
76,828 KB
testcase_01 AC 232 ms
77,076 KB
testcase_02 AC 105 ms
72,868 KB
testcase_03 AC 107 ms
73,200 KB
testcase_04 AC 106 ms
73,256 KB
testcase_05 AC 109 ms
76,856 KB
testcase_06 AC 109 ms
76,996 KB
testcase_07 AC 111 ms
77,080 KB
testcase_08 AC 110 ms
77,072 KB
testcase_09 AC 112 ms
77,000 KB
testcase_10 AC 108 ms
77,000 KB
testcase_11 AC 157 ms
77,084 KB
testcase_12 AC 263 ms
76,864 KB
testcase_13 AC 263 ms
77,100 KB
testcase_14 AC 202 ms
77,052 KB
testcase_15 AC 105 ms
73,044 KB
testcase_16 AC 104 ms
73,080 KB
testcase_17 AC 105 ms
73,184 KB
testcase_18 AC 108 ms
77,008 KB
testcase_19 AC 167 ms
76,932 KB
testcase_20 AC 264 ms
77,008 KB
testcase_21 AC 224 ms
77,076 KB
testcase_22 AC 228 ms
77,012 KB
testcase_23 AC 179 ms
77,100 KB
testcase_24 AC 187 ms
76,980 KB
testcase_25 AC 189 ms
77,176 KB
testcase_26 AC 206 ms
77,044 KB
testcase_27 AC 240 ms
77,112 KB
testcase_28 AC 200 ms
77,276 KB
testcase_29 AC 259 ms
77,120 KB
権限があれば一括ダウンロードができます

ソースコード

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