結果
| 問題 |
No.8023 素数判定するだけ
|
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2020-10-23 15:55:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| コード長 | 303 bytes |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-21 10:16:09 |
| 合計ジャッジ時間 | 4,948 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
from operator import sub,add,floordiv,mul
import sys
N=int(input())
t=floordiv(N,N)
u=sub(ord("i"),ord("A"))
s=add(t,t)
if N==t:
print("NO")
sys.exit()
if N==s:
print("YES")
sys.exit()
i=s
while mul(i,i)<=N:
if pow(N,t,i)==sub(t,t):
print("NO")
break
i=add(i,t)
else:
print("YES")
harurun