結果

問題 No.36 素数が嫌い!
ユーザー kbyskbys
提出日時 2020-09-14 16:42:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 8,296 KB
最終ジャッジ日時 2023-09-04 00:44:10
合計ジャッジ時間 9,124 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 399 ms
8,188 KB
testcase_01 AC 45 ms
8,296 KB
testcase_02 AC 16 ms
8,012 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 21 ms
7,832 KB
testcase_08 AC 16 ms
8,232 KB
testcase_09 AC 16 ms
7,856 KB
testcase_10 AC 16 ms
8,196 KB
testcase_11 AC 554 ms
7,976 KB
testcase_12 AC 1,669 ms
7,816 KB
testcase_13 WA -
testcase_14 AC 22 ms
8,024 KB
testcase_15 AC 16 ms
8,184 KB
testcase_16 AC 17 ms
7,980 KB
testcase_17 AC 17 ms
8,192 KB
testcase_18 AC 16 ms
7,868 KB
testcase_19 AC 82 ms
8,276 KB
testcase_20 AC 68 ms
8,220 KB
testcase_21 AC 231 ms
8,236 KB
testcase_22 AC 41 ms
8,100 KB
testcase_23 AC 26 ms
8,148 KB
testcase_24 AC 253 ms
8,216 KB
testcase_25 AC 301 ms
8,244 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

n = int(input())

if n == 1:
    print('NO')
    exit()

fac = factorize(n)

if len(fac) >= 2:
    print('YES')
    exit()

if fac[0][1] >= 2:
    print('YES')
else:
    print('NO')
0