結果

問題 No.36 素数が嫌い!
ユーザー lenoleno
提出日時 2017-08-20 12:37:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-22 18:12:48
合計ジャッジ時間 49,386 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,145 ms
10,624 KB
testcase_01 AC 2,946 ms
10,752 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 WA -
testcase_05 AC 38 ms
10,752 KB
testcase_06 AC 34 ms
10,880 KB
testcase_07 AC 35 ms
10,752 KB
testcase_08 WA -
testcase_09 AC 34 ms
10,624 KB
testcase_10 AC 34 ms
10,624 KB
testcase_11 AC 1,039 ms
10,752 KB
testcase_12 AC 3,132 ms
10,624 KB
testcase_13 WA -
testcase_14 AC 2,229 ms
10,496 KB
testcase_15 WA -
testcase_16 AC 26 ms
10,624 KB
testcase_17 AC 27 ms
10,624 KB
testcase_18 AC 27 ms
10,624 KB
testcase_19 AC 1,624 ms
10,624 KB
testcase_20 AC 3,799 ms
10,752 KB
testcase_21 AC 3,319 ms
10,752 KB
testcase_22 WA -
testcase_23 AC 1,824 ms
10,624 KB
testcase_24 AC 2,082 ms
10,752 KB
testcase_25 AC 2,328 ms
10,624 KB
testcase_26 AC 2,908 ms
10,752 KB
testcase_27 WA -
testcase_28 AC 2,747 ms
10,752 KB
testcase_29 AC 3,915 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

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