結果
| 問題 | No.8023 素数判定するだけ |
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2020-10-23 15:55:00 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 1,000 ms |
| コード長 | 303 bytes |
| 記録 | |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2026-04-03 04:24:11 |
| 合計ジャッジ時間 | 8,152 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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