結果

問題 No.3133 法B逆元
コンテスト
ユーザー Raj Nangare
提出日時 2025-05-02 22:12:48
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 419 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,096 ms
コンパイル使用メモリ 209,392 KB
実行使用メモリ 9,412 KB
最終ジャッジ日時 2026-07-10 11:10:41
合計ジャッジ時間 5,098 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 3 TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

#define int long long





signed main() {
    
   
    int n, b;
    cin >> n >> b;
    int ans = -1;

    for(int i = 0; i <= min(b, n); i++){
        if((i * n) % b == 1){
            ans = i;
            break;
        }
    }
    if(ans == -1){
        cout << "Nan" << endl;
    }
    else{
        cout << ans << endl;
    }


    
    






    
    return 0;
}
 
0