結果

問題 No.2191 一元二次式 mod 奇素数
ユーザー MasKoaTSMasKoaTS
提出日時 2022-11-27 16:43:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 173 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 82,360 KB
実行使用メモリ 53,812 KB
最終ジャッジ日時 2024-04-15 00:04:47
合計ジャッジ時間 2,341 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,764 KB
testcase_01 AC 38 ms
52,244 KB
testcase_02 AC 37 ms
53,288 KB
testcase_03 AC 37 ms
53,356 KB
testcase_04 AC 37 ms
52,124 KB
testcase_05 AC 37 ms
52,392 KB
testcase_06 AC 37 ms
52,608 KB
testcase_07 AC 37 ms
52,336 KB
testcase_08 AC 37 ms
52,064 KB
testcase_09 AC 37 ms
52,272 KB
testcase_10 AC 37 ms
53,432 KB
testcase_11 AC 38 ms
52,216 KB
testcase_12 AC 37 ms
52,356 KB
testcase_13 AC 37 ms
52,892 KB
testcase_14 AC 37 ms
53,372 KB
testcase_15 AC 37 ms
52,092 KB
testcase_16 AC 37 ms
52,240 KB
testcase_17 AC 37 ms
52,576 KB
testcase_18 AC 37 ms
52,692 KB
testcase_19 AC 37 ms
52,448 KB
testcase_20 AC 37 ms
52,964 KB
testcase_21 AC 37 ms
52,868 KB
testcase_22 AC 37 ms
52,000 KB
testcase_23 AC 38 ms
53,812 KB
testcase_24 AC 37 ms
53,004 KB
testcase_25 AC 37 ms
52,504 KB
testcase_26 AC 37 ms
52,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

p = int(input())

K = (p - 1) >> 1
a = p - abs(-4 * K * K - 16 * K + 1) % p

if(pow(a, K, p) == 1):
	print("YES")
else:
	print("NO")
	
0