結果

問題 No.2176 LRM Question 1
ユーザー square1001square1001
提出日時 2023-01-06 21:24:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 518 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-20 14:25:38
合計ジャッジ時間 4,740 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 13 ms
7,832 KB
testcase_02 AC 394 ms
7,796 KB
testcase_03 AC 14 ms
7,972 KB
testcase_04 AC 14 ms
7,920 KB
testcase_05 AC 19 ms
7,796 KB
testcase_06 AC 14 ms
7,780 KB
testcase_07 AC 20 ms
7,768 KB
testcase_08 AC 15 ms
7,796 KB
testcase_09 AC 13 ms
7,908 KB
testcase_10 AC 365 ms
7,952 KB
testcase_11 AC 14 ms
7,896 KB
testcase_12 AC 14 ms
7,872 KB
testcase_13 AC 272 ms
7,796 KB
testcase_14 AC 518 ms
7,836 KB
testcase_15 AC 324 ms
7,824 KB
testcase_16 AC 277 ms
7,764 KB
testcase_17 AC 20 ms
7,824 KB
testcase_18 AC 239 ms
7,764 KB
testcase_19 AC 184 ms
7,796 KB
testcase_20 AC 68 ms
7,764 KB
testcase_21 AC 166 ms
7,872 KB
testcase_22 AC 28 ms
7,796 KB
testcase_23 AC 134 ms
7,836 KB
testcase_24 AC 120 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L, R, M = map(int, input().split())

fact = 1
mul = 1
answer = 0
for i in range(1, min(R + 1, M)):
	fact = fact * i % M
	mul = mul * fact % M
	if i >= L:
		answer = (answer + mul) % M
print(answer)
0