結果

問題 No.3133 法B逆元
ユーザー askr58
提出日時 2025-05-02 21:26:20
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 5,217 ms
コンパイル使用メモリ 332,224 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-02 21:26:27
合計ジャッジ時間 5,972 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ull=unsigned long long;
int main()
{   
    ull n;
    int b;
    cin>>n>>b;
    n%=b;
    for(ull i=1;i<=b;i++){
        if(i*n%b==1%b){
            cout<<i<<endl;
            return 0;
        }
    }
    cout<<"NaN"<<endl;
    
    return 0;
}
0