結果

問題 No.2191 一元二次式 mod 奇素数
ユーザー shobonvipshobonvip
提出日時 2023-01-13 21:50:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 392 bytes
コンパイル時間 2,923 ms
コンパイル使用メモリ 214,148 KB
実行使用メモリ 7,648 KB
最終ジャッジ日時 2023-08-26 03:33:58
合計ジャッジ時間 7,782 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 13 ms
4,380 KB
testcase_22 AC 497 ms
4,376 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ll p; cin >> p;
	ll k = (p-1) / 2;
	ll targ = (p - (k * k % p + 4 * k + 2) % p) % p;
	for (ll i=0; i<p; i++){
		if ((i * i % p + 3 * i) % p == targ){
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}
0