結果

問題 No.3133 法B逆元
ユーザー tombo_
提出日時 2025-05-02 21:37:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 141 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-05-02 21:37:48
合計ジャッジ時間 2,953 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

N, B = map(int, input().split())

if B == 1:
  print("0")
  exit()
for i in range(B):
  if N*i%B == 1:
    print(i)
    exit()

print("NaN")
0