結果

問題 No.2176 LRM Question 1
ユーザー ニックネームニックネーム
提出日時 2023-01-06 21:30:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 797 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 86,552 KB
最終ジャッジ日時 2023-08-20 14:32:17
合計ジャッジ時間 7,524 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,916 KB
testcase_01 AC 17 ms
7,832 KB
testcase_02 AC 610 ms
23,744 KB
testcase_03 AC 15 ms
7,980 KB
testcase_04 AC 411 ms
23,600 KB
testcase_05 AC 36 ms
8,756 KB
testcase_06 AC 23 ms
8,540 KB
testcase_07 AC 34 ms
8,976 KB
testcase_08 AC 402 ms
23,716 KB
testcase_09 AC 404 ms
23,496 KB
testcase_10 AC 526 ms
21,760 KB
testcase_11 AC 16 ms
7,912 KB
testcase_12 AC 16 ms
7,856 KB
testcase_13 AC 405 ms
23,684 KB
testcase_14 AC 797 ms
86,552 KB
testcase_15 AC 511 ms
25,496 KB
testcase_16 AC 421 ms
18,276 KB
testcase_17 AC 29 ms
8,396 KB
testcase_18 AC 384 ms
22,612 KB
testcase_19 AC 271 ms
17,760 KB
testcase_20 AC 103 ms
11,484 KB
testcase_21 AC 248 ms
14,612 KB
testcase_22 AC 40 ms
8,848 KB
testcase_23 AC 213 ms
13,680 KB
testcase_24 AC 189 ms
15,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l,r,m = map(int,input().split())
a = [1]; b = [1]; ans = 0
for i in range(1,m): a.append(a[-1]*i%m)
for i in range(1,m): b.append(b[-1]*a[i]%m)
for i in range(l,min(r+1,m)): ans = (ans+b[i])%m
print(ans)
0