結果

問題 No.36 素数が嫌い!
ユーザー popketle
提出日時 2020-02-12 00:07:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,247 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-01 12:55:26
合計ジャッジ時間 14,840 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

def prime_factorize(n):
    ls,tmp=[],n
    c=int(n**0.5)+1
    for i in range(2,c):
        while tmp%i==0:
            tmp=tmp//i
            ls.append(i)
        if tmp==1:
            break
    return ls
prime_factor=prime_factorize(n)
if len(prime_factor)>1 and prime_factor[0]*prime_factor[1]<n:
    print('YES')
else:
    print('NO')
0