結果

問題 No.2191 一元二次式 mod 奇素数
ユーザー shobonvip
提出日時 2023-01-13 21:58:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-12-24 17:27:44
合計ジャッジ時間 2,579 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

p = int(input())
k = (p-1) // 2
targ = (1 - 4*k*k - 16*k) % p
if targ == 0:
	print("YES")
else:
	if pow(targ, k, p) == 1:
		print("YES")
	else:
		print("NO")
0