結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 383 ms
7,908 KB
testcase_01 AC 471 ms
7,804 KB
testcase_02 AC 16 ms
7,852 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 18 ms
7,912 KB
testcase_08 AC 16 ms
7,876 KB
testcase_09 AC 17 ms
7,848 KB
testcase_10 AC 17 ms
7,736 KB
testcase_11 AC 271 ms
7,820 KB
testcase_12 AC 805 ms
7,824 KB
testcase_13 WA -
testcase_14 AC 337 ms
7,904 KB
testcase_15 AC 16 ms
7,772 KB
testcase_16 AC 16 ms
7,904 KB
testcase_17 AC 15 ms
7,856 KB
testcase_18 AC 16 ms
7,864 KB
testcase_19 AC 321 ms
7,824 KB
testcase_20 AC 621 ms
7,864 KB
testcase_21 AC 618 ms
7,852 KB
testcase_22 AC 637 ms
7,772 KB
testcase_23 AC 390 ms
7,772 KB
testcase_24 AC 327 ms
7,952 KB
testcase_25 AC 425 ms
7,800 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) >= 2:
    print("YES")
else:
    for s in a:
        if s[1] > 1:
            print("YES")
            break
    else:
        print("NO")
0