結果

問題 No.8023 素数判定するだけ
ユーザー machoniump
提出日時 2020-12-21 15:05:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-21 12:58:35
合計ジャッジ時間 5,180 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
import math
def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False
  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True
if n==1:
    print("NO")
    exit()
if isPrime(n):
    print("YES")
else:print('NO')
0