結果

問題 No.36 素数が嫌い!
ユーザー togatogatogatoga
提出日時 2015-09-02 10:35:03
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 77,348 KB
実行使用メモリ 179,580 KB
最終ジャッジ日時 2023-09-25 22:00:13
合計ジャッジ時間 24,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 709 ms
179,216 KB
testcase_01 AC 711 ms
178,984 KB
testcase_02 AC 708 ms
178,668 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 708 ms
179,348 KB
testcase_08 AC 711 ms
179,056 KB
testcase_09 AC 711 ms
178,868 KB
testcase_10 AC 711 ms
179,000 KB
testcase_11 AC 711 ms
179,112 KB
testcase_12 AC 720 ms
179,244 KB
testcase_13 WA -
testcase_14 AC 718 ms
179,276 KB
testcase_15 AC 711 ms
178,940 KB
testcase_16 AC 711 ms
178,824 KB
testcase_17 AC 710 ms
178,708 KB
testcase_18 AC 703 ms
178,988 KB
testcase_19 AC 706 ms
178,972 KB
testcase_20 AC 696 ms
179,212 KB
testcase_21 AC 711 ms
179,248 KB
testcase_22 AC 709 ms
179,224 KB
testcase_23 AC 711 ms
179,244 KB
testcase_24 AC 707 ms
179,400 KB
testcase_25 AC 710 ms
179,052 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
cnt = 0
is_prime = [True] * (10**7 + 10)
prime = []
def sieve(N):
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, N):
        if (is_prime[i]):
            prime.append(i)
            for j in range(i*i, N, i):
                is_prime[j] = False
sieve(10 ** 7)
for x in prime:
    if (x * x > N):
        break
    while (N % x == 0):
        N /= x
        cnt += 1
if (N != 1):
    cnt += 1
if (cnt == 0 or cnt == 1):
    print "NO"
else:
    print "YES"
0