結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2022-08-03 00:19:52 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 334 bytes |
| 記録 | |
| コンパイル時間 | 394 ms |
| コンパイル使用メモリ | 85,100 KB |
| 実行使用メモリ | 59,280 KB |
| 最終ジャッジ日時 | 2026-04-03 15:45:34 |
| 合計ジャッジ時間 | 2,126 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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