結果

問題 No.36 素数が嫌い!
ユーザー AEnAEn
提出日時 2022-05-15 11:16:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 228 ms / 5,000 ms
コード長 522 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 75,968 KB
最終ジャッジ日時 2023-10-01 06:16:31
合計ジャッジ時間 6,995 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
75,312 KB
testcase_01 AC 195 ms
75,788 KB
testcase_02 AC 75 ms
71,492 KB
testcase_03 AC 75 ms
71,584 KB
testcase_04 AC 75 ms
71,556 KB
testcase_05 AC 78 ms
75,968 KB
testcase_06 AC 77 ms
75,556 KB
testcase_07 AC 79 ms
75,696 KB
testcase_08 AC 77 ms
75,500 KB
testcase_09 AC 79 ms
75,584 KB
testcase_10 AC 79 ms
75,308 KB
testcase_11 AC 126 ms
75,392 KB
testcase_12 AC 228 ms
75,700 KB
testcase_13 AC 225 ms
75,444 KB
testcase_14 AC 172 ms
75,548 KB
testcase_15 AC 74 ms
71,516 KB
testcase_16 AC 75 ms
71,528 KB
testcase_17 AC 73 ms
71,284 KB
testcase_18 AC 78 ms
75,624 KB
testcase_19 AC 136 ms
75,528 KB
testcase_20 AC 226 ms
75,456 KB
testcase_21 AC 193 ms
75,620 KB
testcase_22 AC 197 ms
75,540 KB
testcase_23 AC 149 ms
75,692 KB
testcase_24 AC 158 ms
75,488 KB
testcase_25 AC 156 ms
75,452 KB
testcase_26 AC 170 ms
75,308 KB
testcase_27 AC 206 ms
75,456 KB
testcase_28 AC 168 ms
75,568 KB
testcase_29 AC 222 ms
75,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

N = int(input())
a = factorization(N)
if len(a) == 1 and a[0][1] <= 2:
    print('NO')
elif len(a) == 2 and a[0][1] == a[1][1] == 1:
    print('NO')
else:
    print('YES')
0