結果

問題 No.3133 法B逆元
ユーザー タケタニユウキ
提出日時 2025-06-26 20:02:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 1,239 ms
コンパイル使用メモリ 105,340 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-26 20:02:34
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<iomanip>
#include<cmath>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<limits.h>
#include<bit>
#include<bitset>

using namespace std;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
#define infl LLONG_MAX
#define infi INT32_MAX

void de(ll n){cout << n << endl;}
typedef pair<ll, ll> P;

#define all(a) (a).begin(), (a).end()

void cincout(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout<< fixed << setprecision(15);
}


int main(){
    cincout();
    long long N; cin >> N;
	int B; cin >> B;
	 N %= B;
	int one = 1 % B;
	for(int i = 0 ; i < B ; i++ ){
    	if( N * i % B == one ){
    		cout << i << "\n";
    		return 0;
    	}
	}
	cout << "NaN\n";
}
0