結果

問題 No.36 素数が嫌い!
ユーザー kutsutama
提出日時 2018-03-14 12:45:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 2,825 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-27 01:22:37
合計ジャッジ時間 30,691 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())

sq = math.ceil(math.sqrt(n))
cnt = 0
d = 2
while n > 1 and d <= sq:
  if n % d == 0:
    cnt += 1
    n //= d
    if cnt >= 3:
      break
  else:
    d += 1
res = 'NO'
if cnt >= 3:
  res = 'YES'
elif cnt >= 2 and n > 1:
  res = 'YES'

print(res)
0