結果

問題 No.36 素数が嫌い!
ユーザー leno
提出日時 2017-08-20 12:37:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-14 17:23:36
合計ジャッジ時間 48,426 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 21 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_decomposition(N):
    M = N
    i = 2
    table =[]
    while i * i <= N:
        while M % i == 0:
            M /= i
            table.append(int(i))
        i += 1
    if M > 1:
        table.append(int(M))
    return table


def not_prime_table(N):
    table = []
    i = 3
    while i * i <= N:
        if not is_prime_number(i):
            table.append(i)
        i += 2
    return table


def is_prime_number(N):
    if N in [1, 2]:
        return True
    elif N == 0:
        return False
    else:
        i = 3
        while i * i <= N:
            if N % i == 0:
                return False
        return True


if __name__ == '__main__':
    N = int(input())
    if list(set(prime_decomposition(N))) == prime_decomposition(N):
        print('NO')
    else:
        print('YES')
0