結果

問題 No.36 素数が嫌い!
ユーザー momoyuumomoyuu
提出日時 2022-08-03 00:19:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 75,640 KB
最終ジャッジ日時 2023-10-01 00:59:27
合計ジャッジ時間 4,760 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,372 KB
testcase_01 AC 75 ms
71,180 KB
testcase_02 AC 77 ms
71,372 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 76 ms
75,400 KB
testcase_08 AC 72 ms
71,020 KB
testcase_09 AC 72 ms
71,372 KB
testcase_10 AC 74 ms
71,436 KB
testcase_11 AC 123 ms
75,640 KB
testcase_12 AC 218 ms
75,348 KB
testcase_13 WA -
testcase_14 AC 75 ms
75,424 KB
testcase_15 AC 72 ms
71,428 KB
testcase_16 AC 73 ms
71,464 KB
testcase_17 AC 72 ms
71,420 KB
testcase_18 AC 83 ms
71,184 KB
testcase_19 AC 73 ms
71,356 KB
testcase_20 AC 73 ms
71,172 KB
testcase_21 AC 72 ms
71,040 KB
testcase_22 AC 73 ms
71,648 KB
testcase_23 AC 73 ms
71,196 KB
testcase_24 AC 73 ms
71,524 KB
testcase_25 AC 72 ms
71,040 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def isPrime(n):
    """
    素数かどうかを判定する。
    O(√n)
    """

    import math
    m = math.floor(math.sqrt(n))
    for i in range(2,m+1):
        if n%i == 0:
            return False
    return True

if isPrime(N):
    print("NO")
else:
    print("YES")
0