結果

問題 No.109 N! mod M
ユーザー karoyakanikaroyakani
提出日時 2019-05-05 09:09:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 176 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 12,652 KB
最終ジャッジ日時 2023-09-06 06:39:36
合計ジャッジ時間 7,910 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,852 KB
testcase_01 AC 656 ms
7,956 KB
testcase_02 AC 352 ms
7,848 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
権限があれば一括ダウンロードができます

ソースコード

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