結果

問題 No.36 素数が嫌い!
ユーザー gahougahou
提出日時 2016-12-16 17:24:59
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 856 ms
コンパイル使用メモリ 6,652 KB
実行使用メモリ 8,332 KB
最終ジャッジ日時 2023-08-20 09:03:45
合計ジャッジ時間 49,424 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1,547 ms
8,176 KB
testcase_02 AC 1,546 ms
8,208 KB
testcase_03 AC 1,539 ms
8,212 KB
testcase_04 AC 1,541 ms
8,252 KB
testcase_05 AC 1,534 ms
8,256 KB
testcase_06 AC 1,539 ms
8,228 KB
testcase_07 AC 1,539 ms
8,176 KB
testcase_08 AC 1,536 ms
8,144 KB
testcase_09 AC 1,535 ms
8,144 KB
testcase_10 AC 1,543 ms
8,216 KB
testcase_11 AC 1,564 ms
8,332 KB
testcase_12 AC 1,566 ms
8,136 KB
testcase_13 AC 1,563 ms
8,312 KB
testcase_14 AC 1,535 ms
8,212 KB
testcase_15 AC 1,538 ms
8,256 KB
testcase_16 AC 1,540 ms
8,140 KB
testcase_17 AC 1,549 ms
8,212 KB
testcase_18 AC 1,537 ms
8,256 KB
testcase_19 AC 1,550 ms
8,212 KB
testcase_20 AC 1,547 ms
8,208 KB
testcase_21 WA -
testcase_22 AC 1,545 ms
8,140 KB
testcase_23 AC 1,537 ms
8,232 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1,559 ms
8,232 KB
testcase_27 AC 1,541 ms
8,252 KB
testcase_28 AC 1,557 ms
8,176 KB
testcase_29 AC 1,538 ms
8,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def primes():
  p=[2,3]
  i=5
  while True:
    isPrime = True
    for k in p:
      if i%k==0:
        isPrime = False
        break
      if i<k**2: break
    if isPrime: p.append(i)
    if 10**6<i: break
    i+=2
  return p

n=int(raw_input())
p=primes()
isValid=False
d={}
for k in p:
  c=0
  while True:
    if n%k==0:
      c+=1
      n/=k
    else:
      break
  if c>0:
    d[k]=c
  if n<k**2:
    if n!=1:
      d[n]=1
    break
count = sum(d.values())
if count>=3: print "YES"
else: print "NO"
0