結果

問題 No.3133 法B逆元
ユーザー moon17
提出日時 2025-05-02 21:56:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 132 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2025-05-02 21:56:12
合計ジャッジ時間 1,864 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
n,b=map(int,input().split())
g=gcd(n,b)
i=pow(n,b-2,b)
if(n*i-1)%b==0 and i>=0:
  print(i)
else:
  print('NaN')
0