結果

問題 No.36 素数が嫌い!
ユーザー nohakai3nohakai3
提出日時 2022-10-19 15:06:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 704 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 75,952 KB
最終ジャッジ日時 2023-09-12 04:37:15
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,360 KB
testcase_01 AC 80 ms
71,532 KB
testcase_02 AC 76 ms
71,320 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 79 ms
75,524 KB
testcase_08 AC 77 ms
71,324 KB
testcase_09 AC 76 ms
71,364 KB
testcase_10 AC 77 ms
71,348 KB
testcase_11 AC 102 ms
75,648 KB
testcase_12 AC 146 ms
75,316 KB
testcase_13 WA -
testcase_14 AC 75 ms
75,496 KB
testcase_15 AC 73 ms
71,364 KB
testcase_16 AC 76 ms
71,240 KB
testcase_17 AC 76 ms
71,168 KB
testcase_18 AC 78 ms
71,328 KB
testcase_19 AC 75 ms
71,168 KB
testcase_20 AC 74 ms
71,352 KB
testcase_21 AC 74 ms
71,176 KB
testcase_22 AC 75 ms
71,484 KB
testcase_23 AC 75 ms
71,480 KB
testcase_24 AC 75 ms
71,480 KB
testcase_25 AC 73 ms
71,352 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
if n==1:
    print("NO")
    exit()

import math

def is_prime(num):
    if num < 2:
        return False
    elif num == 2:
        return True
    elif num % 2 == 0:
        return False
    
    sqrtNum = math.floor(math.sqrt(num))
    for i in range(3, sqrtNum + 1, 2):
        if num % i == 0:
            return False
    
    return True

if not is_prime(n):
    print("YES")
else:
    print("NO")
0