結果

問題 No.36 素数が嫌い!
ユーザー etale.K3
提出日時 2021-08-19 17:42:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 797 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-12 18:34:00
合計ジャッジ時間 9,702 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

cnt = 0

while N%2 == 0:
    N //= 2
    cnt += 1
    if cnt > 2:
        print('YES')
        exit()

for i in range(3, int(N**0.5)+1, 2):
    while N%i == 0:
        N //= i
        cnt += 1
        if cnt > 2:
            print('YES')
            exit()

cnt += (N!=1)

print('YES' if cnt > 2 else 'NO')
0