結果

問題 No.36 素数が嫌い!
ユーザー ronpooronpoo
提出日時 2023-08-23 14:42:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 617 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 75,512 KB
最終ジャッジ日時 2023-08-23 14:42:08
合計ジャッジ時間 5,667 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
74,924 KB
testcase_01 AC 75 ms
74,948 KB
testcase_02 AC 72 ms
70,704 KB
testcase_03 AC 73 ms
70,928 KB
testcase_04 WA -
testcase_05 AC 76 ms
74,880 KB
testcase_06 AC 76 ms
74,928 KB
testcase_07 AC 76 ms
75,276 KB
testcase_08 AC 73 ms
70,700 KB
testcase_09 AC 72 ms
70,836 KB
testcase_10 AC 75 ms
74,820 KB
testcase_11 AC 99 ms
74,948 KB
testcase_12 AC 153 ms
74,796 KB
testcase_13 WA -
testcase_14 AC 75 ms
75,384 KB
testcase_15 AC 71 ms
70,836 KB
testcase_16 AC 72 ms
70,988 KB
testcase_17 AC 75 ms
71,048 KB
testcase_18 AC 72 ms
70,556 KB
testcase_19 AC 81 ms
74,832 KB
testcase_20 AC 78 ms
74,840 KB
testcase_21 AC 86 ms
74,844 KB
testcase_22 AC 77 ms
74,864 KB
testcase_23 AC 75 ms
74,868 KB
testcase_24 AC 87 ms
75,364 KB
testcase_25 AC 91 ms
74,736 KB
testcase_26 AC 132 ms
75,048 KB
testcase_27 AC 81 ms
74,792 KB
testcase_28 AC 105 ms
74,844 KB
testcase_29 AC 79 ms
74,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def prime_factorize_num(x):
    d = {1:1}
    if x % 2 == 0:
        d[2] = 0
    while x % 2 == 0:
        d[2] += 1
        x //= 2
    f = 3
    while f * f <= x:
        if x % f == 0:
            if f not in d:
                d[f] = 0
            d[f] += 1
            x //= f
        else:
            f += 2
    if x != 1:
        if x not in d:
            d[x] = 0
        d[x] += 1
        
    return d

d = prime_factorize_num(N)

if len(d) >= 4:
    print('YES')
else:
    for v in d.values():
        if v >= 2:
            print('YES')
            break
    else:
        print('NO')
0