結果

問題 No.2191 一元二次式 mod 奇素数
ユーザー 遭難者
提出日時 2023-01-13 22:57:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 3,420 ms
コンパイル使用メモリ 250,916 KB
最終ジャッジ日時 2025-02-10 03:05:49
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using m = atcoder::modint;
int main()
{
    int p;
    std::cin >> p;
    m::set_mod(p);
    std::cout << (m(8).pow((p - 1) / 2).val() == 1 ? "YES" : "NO");
}
0