結果
問題 |
No.2191 一元二次式 mod 奇素数
|
ユーザー |
![]() |
提出日時 | 2023-01-13 21:49:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 1,732 ms |
コンパイル使用メモリ | 194,524 KB |
最終ジャッジ日時 | 2025-02-10 02:26:54 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 TLE * 3 |
ソースコード
#include<bits/stdc++.h> #include<atcoder/modint> using namespace std; using namespace atcoder; typedef modint998244353 mint; 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; }