結果
| 問題 |
No.3133 法B逆元
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-02 22:12:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 419 bytes |
| コンパイル時間 | 2,372 ms |
| コンパイル使用メモリ | 193,500 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-05-02 22:12:52 |
| 合計ジャッジ時間 | 3,271 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 18 |
ソースコード
#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;
}