結果
問題 |
No.3133 法B逆元
|
ユーザー |
|
提出日時 | 2024-03-03 19:47:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 635 bytes |
コンパイル時間 | 400 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 75,856 KB |
最終ジャッジ日時 | 2025-05-02 20:50:33 |
合計ジャッジ時間 | 11,693 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 1 |
ソースコード
# import import time # input N, B = map(int, input().split()) start_time = time.time() if N == 0 and B == 1: print(0) elif N==0: print('NaN') elif N % B == 0: print('NaN') else: N = N % B K = 0 while True: current_time = time.time() elapsed_time = current_time - start_time if elapsed_time >= 1.9: print('NaN') break if N == 0: ans = 0 print(ans) break elif (K * B + 1) % N == 0: ans = (K * B + 1) // N print(ans) break else: K += 1