結果

問題 No.36 素数が嫌い!
ユーザー flippergoflippergo
提出日時 2020-12-31 18:46:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 187,736 KB
最終ジャッジ日時 2024-04-18 00:11:28
合計ジャッジ時間 44,130 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,527 ms
186,760 KB
testcase_01 AC 1,518 ms
186,752 KB
testcase_02 AC 1,285 ms
186,984 KB
testcase_03 AC 1,312 ms
186,916 KB
testcase_04 WA -
testcase_05 AC 1,389 ms
187,264 KB
testcase_06 AC 1,426 ms
187,736 KB
testcase_07 AC 1,510 ms
186,752 KB
testcase_08 AC 1,367 ms
186,884 KB
testcase_09 AC 1,341 ms
186,980 KB
testcase_10 AC 1,494 ms
187,048 KB
testcase_11 AC 1,306 ms
187,008 KB
testcase_12 AC 1,268 ms
187,340 KB
testcase_13 WA -
testcase_14 AC 1,269 ms
187,264 KB
testcase_15 AC 1,267 ms
186,860 KB
testcase_16 AC 1,247 ms
186,752 KB
testcase_17 AC 1,286 ms
186,784 KB
testcase_18 AC 1,286 ms
187,128 KB
testcase_19 AC 1,313 ms
186,972 KB
testcase_20 AC 1,234 ms
186,880 KB
testcase_21 AC 1,325 ms
187,056 KB
testcase_22 AC 1,255 ms
186,752 KB
testcase_23 AC 1,245 ms
186,988 KB
testcase_24 AC 1,338 ms
186,968 KB
testcase_25 AC 1,374 ms
187,328 KB
testcase_26 AC 1,471 ms
186,880 KB
testcase_27 AC 1,556 ms
187,040 KB
testcase_28 AC 1,351 ms
187,048 KB
testcase_29 AC 1,565 ms
187,264 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())
X = N
C = {}
flag = 0
for q in Q:
    while N%q==0:
        if q not in C:
            C[q] = 0
        C[q] += 1
        if C[q]>1:
            flag = 1
        N = N//q
if N>1:
    C[N]=1
if X==1:
    print("NO")
elif len(C)>2 or flag==1:
    print("YES")
else:
    print("NO")
0