結果

問題 No.36 素数が嫌い!
ユーザー kekurekekure
提出日時 2019-07-07 08:26:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 5,000 ms
コード長 520 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 59,648 KB
最終ジャッジ日時 2024-04-14 06:03:33
合計ジャッジ時間 2,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,208 KB
testcase_01 AC 43 ms
58,760 KB
testcase_02 AC 37 ms
52,740 KB
testcase_03 AC 37 ms
52,928 KB
testcase_04 AC 37 ms
53,752 KB
testcase_05 AC 40 ms
58,400 KB
testcase_06 AC 40 ms
57,940 KB
testcase_07 AC 46 ms
58,932 KB
testcase_08 AC 37 ms
53,480 KB
testcase_09 AC 41 ms
52,980 KB
testcase_10 AC 38 ms
53,728 KB
testcase_11 AC 81 ms
58,204 KB
testcase_12 AC 167 ms
58,580 KB
testcase_13 AC 166 ms
58,724 KB
testcase_14 AC 40 ms
58,864 KB
testcase_15 AC 37 ms
52,304 KB
testcase_16 AC 36 ms
53,748 KB
testcase_17 AC 36 ms
52,316 KB
testcase_18 AC 37 ms
52,800 KB
testcase_19 AC 37 ms
52,784 KB
testcase_20 AC 45 ms
59,648 KB
testcase_21 AC 37 ms
52,628 KB
testcase_22 AC 37 ms
52,468 KB
testcase_23 AC 37 ms
52,656 KB
testcase_24 AC 63 ms
58,580 KB
testcase_25 AC 37 ms
52,592 KB
testcase_26 AC 97 ms
58,952 KB
testcase_27 AC 43 ms
58,672 KB
testcase_28 AC 95 ms
58,204 KB
testcase_29 AC 42 ms
59,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())

div = []
n = N
i = 2

limit = int(math.sqrt(N))

while (i <= limit) :
    if (n % i == 0) :
        n //= i
        break
    else :
        i += 1

if (n == N or n == i):
    print('NO')
else :
    limit = int(math.sqrt(n))
    isYes = False
    while (i <= limit) :
        if (n % i == 0) :
            n //= i
            isYes = True
            break
        else :
            i += 1
    if isYes :
        print('YES')
    else :
        print('NO')
    

        
        








0