結果

問題 No.36 素数が嫌い!
ユーザー magurogumamaguroguma
提出日時 2017-08-08 17:51:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 667 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-20 05:12:05
合計ジャッジ時間 15,301 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 128 ms
10,624 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 25 ms
10,624 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 41 ms
10,752 KB
testcase_06 AC 41 ms
10,624 KB
testcase_07 AC 41 ms
10,752 KB
testcase_08 AC 27 ms
10,624 KB
testcase_09 AC 27 ms
10,624 KB
testcase_10 AC 26 ms
10,624 KB
testcase_11 AC 1,897 ms
10,624 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 WA -
testcase_15 AC 26 ms
10,624 KB
testcase_16 AC 31 ms
10,880 KB
testcase_17 AC 28 ms
10,752 KB
testcase_18 AC 28 ms
10,624 KB
testcase_19 AC 28 ms
10,752 KB
testcase_20 AC 206 ms
10,624 KB
testcase_21 AC 27 ms
10,880 KB
testcase_22 AC 26 ms
10,624 KB
testcase_23 AC 27 ms
10,752 KB
testcase_24 AC 872 ms
10,752 KB
testcase_25 AC 27 ms
10,624 KB
testcase_26 AC 3,427 ms
10,624 KB
testcase_27 AC 4,912 ms
10,752 KB
testcase_28 AC 3,415 ms
10,624 KB
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

"""
素数で割り切れるものもアウトの可能性があることに注意
(6の約数は1,2,3,6で2,3が素数なのでアウト)

合成数は必要条件,約数に1と自身を除いた合成数を1つでも持たないといけない
→なんでもいいからN^0.5以下の約数を複数持っていれば,それらの積がイエスの条件となる

Nは上限が10の14乗でN^0.5は1千万
"""

N = int(input())

i = 2
divisors = []
while i <= pow(N, 0.5):
    remainder = N % i
    if remainder == 0:
        divisors.append(i)
    if len(divisors) == 2:
        print('YES')
        exit()
    i += 1
print('NO')
0