結果

問題 No.2176 LRM Question 1
ユーザー pluto77pluto77
提出日時 2023-01-19 10:01:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 790 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 10,480 KB
実行使用メモリ 86,448 KB
最終ジャッジ日時 2023-09-03 17:51:20
合計ジャッジ時間 8,903 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,720 KB
testcase_01 AC 15 ms
7,720 KB
testcase_02 AC 611 ms
23,520 KB
testcase_03 AC 16 ms
7,860 KB
testcase_04 AC 406 ms
23,640 KB
testcase_05 AC 35 ms
8,748 KB
testcase_06 AC 23 ms
8,496 KB
testcase_07 AC 34 ms
8,892 KB
testcase_08 AC 406 ms
23,720 KB
testcase_09 AC 401 ms
23,468 KB
testcase_10 AC 517 ms
21,740 KB
testcase_11 AC 15 ms
7,784 KB
testcase_12 AC 15 ms
7,812 KB
testcase_13 AC 396 ms
23,456 KB
testcase_14 AC 790 ms
86,448 KB
testcase_15 AC 509 ms
25,240 KB
testcase_16 AC 412 ms
18,052 KB
testcase_17 AC 28 ms
8,224 KB
testcase_18 AC 370 ms
22,532 KB
testcase_19 AC 266 ms
17,524 KB
testcase_20 AC 104 ms
11,336 KB
testcase_21 AC 247 ms
14,504 KB
testcase_22 AC 37 ms
8,596 KB
testcase_23 AC 215 ms
13,768 KB
testcase_24 AC 181 ms
14,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,R,M=map(int,input().split())
x=[1]
y=[1]
res=0
for i in range(1,M):
 x.append(x[-1]*i%M)
for i in range(1,M):
 y.append(y[-1]*x[i]%M)
for i in range(L,min(R+1,M)):
 res=(res+y[i])%M
print(res)
0