結果

問題 No.3133 法B逆元
ユーザー ttkkggww
提出日時 2025-05-18 03:37:11
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 5,553 ms
コンパイル使用メモリ 331,988 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-05-18 03:37:18
合計ジャッジ時間 6,123 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
ll N,B;

void solve(){
    for(int i = 0;i<B;i++){
        if((N%B)*(i)%B==1%B){
            cout<<i<<endl;
            return;
        }
    }
    cout<<"NaN"<<endl;
}

signed main(){
    cin >> N >> B;
    solve();
}
0