結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2022-08-03 00:19:52 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 334 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 82,316 KB |
| 実行使用メモリ | 58,688 KB |
| 最終ジャッジ日時 | 2024-07-23 18:34:01 |
| 合計ジャッジ時間 | 2,918 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 9 |
ソースコード
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")
momoyuu