結果

問題 No.2191 一元二次式 mod 奇素数
ユーザー MasKoaTSMasKoaTS
提出日時 2022-11-17 12:54:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 882 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 85,732 KB
最終ジャッジ日時 2023-10-19 05:13:24
合計ジャッジ時間 5,005 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
85,732 KB
testcase_01 AC 131 ms
85,728 KB
testcase_02 AC 127 ms
85,728 KB
testcase_03 AC 129 ms
85,728 KB
testcase_04 AC 128 ms
85,728 KB
testcase_05 AC 131 ms
85,724 KB
testcase_06 AC 131 ms
85,728 KB
testcase_07 AC 129 ms
85,724 KB
testcase_08 AC 129 ms
85,728 KB
testcase_09 AC 129 ms
85,724 KB
testcase_10 AC 128 ms
85,724 KB
testcase_11 AC 128 ms
85,724 KB
testcase_12 AC 130 ms
85,728 KB
testcase_13 AC 128 ms
85,724 KB
testcase_14 AC 128 ms
85,724 KB
testcase_15 AC 129 ms
85,724 KB
testcase_16 AC 129 ms
85,728 KB
testcase_17 AC 128 ms
85,728 KB
testcase_18 AC 133 ms
85,724 KB
testcase_19 AC 129 ms
85,724 KB
testcase_20 AC 128 ms
85,732 KB
testcase_21 AC 127 ms
85,724 KB
testcase_22 AC 129 ms
85,724 KB
testcase_23 AC 129 ms
85,728 KB
testcase_24 AC 130 ms
85,732 KB
testcase_25 AC 130 ms
85,724 KB
testcase_26 AC 131 ms
85,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# WA(?)

import itertools as iter
import collections as coll
import heapq as hq
import bisect as bis
from decimal import Decimal as dec
from functools import cmp_to_key
import math
import sys
#import pypyjit
#pypyjit.set_param('max_unroll_recursion=-1')
sys.setrecursionlimit(10 ** 6)
inp = sys.stdin.readline
input = lambda : inp().rstrip()
getN = lambda : int(inp())
getNs = lambda : map(int, inp().split())
getList = lambda :list(map(int, inp().split()))
getStrs = lambda n : [input() for _ in [0] * n]
def yexit(): print("Yes"); exit(0)
def nexit(): print("No"); exit(0)
pi = 3.141592653589793
mod = 1000000007
MOD = 998244353
INF = 4611686018427387903
dx = [1, 0, -1, 0];	dy = [0, 1, 0, -1]
#di = coll.defaultdict(int)


"""
Main Code
"""

p = getN()

K = (p - 1) >> 1
a = p - abs(-4 * K * K - 16 * K + 1) % p
if(pow(a, (p - 1) >> 1, p) == 1):
	print("YES")
else:
	print("NO")
0