結果

問題 No.109 N! mod M
ユーザー karoyakani
提出日時 2019-05-05 09:08:22
言語 PyPy2
(7.3.15)
結果
RE  
実行時間 -
コード長 176 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 76,948 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2024-06-24 01:17:18
合計ジャッジ時間 1,958 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

def fun():
  n,p = map(int, input().split())
  x = 1
  for i in range(1, n+1):
    x = x*i % p
  print(x)

if __name__ == "__main__":
  for _ in range(int(input())):
    fun()
0