結果

問題 No.36 素数が嫌い!
ユーザー flippergoflippergo
提出日時 2020-12-31 19:08:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,441 ms / 5,000 ms
コード長 508 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,608 KB
実行使用メモリ 187,776 KB
最終ジャッジ日時 2024-04-18 00:36:18
合計ジャッジ時間 41,293 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,233 ms
187,264 KB
testcase_01 AC 1,257 ms
186,624 KB
testcase_02 AC 1,234 ms
186,880 KB
testcase_03 AC 1,239 ms
187,136 KB
testcase_04 AC 1,270 ms
187,008 KB
testcase_05 AC 1,246 ms
187,200 KB
testcase_06 AC 1,210 ms
187,392 KB
testcase_07 AC 1,341 ms
186,880 KB
testcase_08 AC 1,294 ms
187,264 KB
testcase_09 AC 1,283 ms
186,752 KB
testcase_10 AC 1,200 ms
187,264 KB
testcase_11 AC 1,214 ms
187,136 KB
testcase_12 AC 1,395 ms
186,880 KB
testcase_13 AC 1,332 ms
187,776 KB
testcase_14 AC 1,441 ms
187,520 KB
testcase_15 AC 1,395 ms
186,624 KB
testcase_16 AC 1,382 ms
187,008 KB
testcase_17 AC 1,389 ms
186,880 KB
testcase_18 AC 1,411 ms
187,264 KB
testcase_19 AC 1,319 ms
187,008 KB
testcase_20 AC 1,366 ms
187,008 KB
testcase_21 AC 1,394 ms
186,752 KB
testcase_22 AC 1,359 ms
186,752 KB
testcase_23 AC 1,301 ms
186,880 KB
testcase_24 AC 1,262 ms
187,008 KB
testcase_25 AC 1,245 ms
187,008 KB
testcase_26 AC 1,235 ms
187,136 KB
testcase_27 AC 1,227 ms
187,008 KB
testcase_28 AC 1,303 ms
186,624 KB
testcase_29 AC 1,239 ms
187,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P = [i for i in range(10**7+1)]
for i in range(2,int((10**7)**0.5)+1):
    for j in range(i*i,10**7+1,i):
        P[j]=P[i]
Q = []
for i in range(2,10**7+1):
    if P[i]==i:
        Q.append(i)
N = int(input())
C = {}
flag = 0
for q in Q:
    while N%q==0:
        if q not in C:
            C[q] = 0
        C[q] += 1
        N = N//q
if N>1:
    C[N]=1
rmax = 0
for c in C:
    rmax = max(rmax,C[c])
if (len(C)==1 and rmax>2) or (len(C)==2 and rmax>1) or (len(C)>=3):
    print("YES")
else:
    print("NO")
0