結果

問題 No.36 素数が嫌い!
ユーザー kbyskbys
提出日時 2020-03-14 04:26:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 7,924 KB
最終ジャッジ日時 2023-08-15 11:28:17
合計ジャッジ時間 10,170 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 345 ms
7,772 KB
testcase_01 AC 420 ms
7,884 KB
testcase_02 AC 13 ms
7,844 KB
testcase_03 AC 12 ms
7,848 KB
testcase_04 WA -
testcase_05 AC 16 ms
7,768 KB
testcase_06 AC 16 ms
7,768 KB
testcase_07 AC 16 ms
7,848 KB
testcase_08 AC 15 ms
7,812 KB
testcase_09 AC 14 ms
7,924 KB
testcase_10 AC 15 ms
7,804 KB
testcase_11 AC 243 ms
7,852 KB
testcase_12 AC 737 ms
7,812 KB
testcase_13 WA -
testcase_14 AC 306 ms
7,844 KB
testcase_15 AC 13 ms
7,824 KB
testcase_16 AC 13 ms
7,844 KB
testcase_17 AC 14 ms
7,848 KB
testcase_18 AC 14 ms
7,796 KB
testcase_19 AC 294 ms
7,856 KB
testcase_20 AC 568 ms
7,844 KB
testcase_21 AC 560 ms
7,844 KB
testcase_22 AC 590 ms
7,908 KB
testcase_23 AC 354 ms
7,848 KB
testcase_24 AC 299 ms
7,848 KB
testcase_25 AC 383 ms
7,908 KB
testcase_26 AC 438 ms
7,888 KB
testcase_27 AC 627 ms
7,860 KB
testcase_28 AC 449 ms
7,804 KB
testcase_29 AC 715 ms
7,880 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) > 2:
    print("YES")
else:
    for s in a:
        if s[1] > 1:
            print("YES")
            break
    else:
        print("NO")
0