結果

問題 No.3133 法B逆元
ユーザー Facade
提出日時 2025-05-03 12:46:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2025-05-03 12:46:04
合計ジャッジ時間 2,336 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n,b=map(int,input().split())
def solve(n,b):
    if  ( math.gcd(n,b)!=1):
        print("NaN")
        return
    i=pow(n,-1,b)
    print(i)  
    return  
# for i in range(0,10**3):
#     for j in range(1,10**3):
#         print("N ->",i,"B ->",j)
#         solve(i,j)
solve(n,b)
0