結果

問題 No.36 素数が嫌い!
ユーザー AEnAEn
提出日時 2022-05-15 11:13:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 76,044 KB
最終ジャッジ日時 2023-10-01 06:13:18
合計ジャッジ時間 5,899 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
75,872 KB
testcase_01 AC 193 ms
75,772 KB
testcase_02 AC 70 ms
71,748 KB
testcase_03 WA -
testcase_04 AC 72 ms
71,848 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 77 ms
75,776 KB
testcase_08 AC 76 ms
75,716 KB
testcase_09 AC 77 ms
75,412 KB
testcase_10 AC 76 ms
75,408 KB
testcase_11 AC 125 ms
75,696 KB
testcase_12 AC 228 ms
75,520 KB
testcase_13 AC 225 ms
75,716 KB
testcase_14 AC 169 ms
75,692 KB
testcase_15 AC 72 ms
71,660 KB
testcase_16 AC 74 ms
71,824 KB
testcase_17 AC 72 ms
71,112 KB
testcase_18 AC 75 ms
75,776 KB
testcase_19 AC 134 ms
76,044 KB
testcase_20 AC 227 ms
75,492 KB
testcase_21 AC 190 ms
75,792 KB
testcase_22 AC 192 ms
75,516 KB
testcase_23 AC 147 ms
75,788 KB
testcase_24 AC 154 ms
75,692 KB
testcase_25 AC 154 ms
75,656 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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')
else:
    print('YES')
0