結果

問題 No.2176 LRM Question 1
ユーザー 👑 H20H20
提出日時 2023-01-06 21:58:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 213,456 KB
最終ジャッジ日時 2024-05-07 21:32:32
合計ジャッジ時間 2,908 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,968 KB
testcase_01 AC 32 ms
51,328 KB
testcase_02 AC 134 ms
212,352 KB
testcase_03 AC 36 ms
52,208 KB
testcase_04 AC 125 ms
212,876 KB
testcase_05 AC 44 ms
65,016 KB
testcase_06 AC 41 ms
62,300 KB
testcase_07 AC 42 ms
64,176 KB
testcase_08 AC 130 ms
212,384 KB
testcase_09 AC 122 ms
197,436 KB
testcase_10 AC 123 ms
181,520 KB
testcase_11 AC 35 ms
52,628 KB
testcase_12 AC 33 ms
52,152 KB
testcase_13 AC 126 ms
213,456 KB
testcase_14 AC 133 ms
212,884 KB
testcase_15 AC 114 ms
180,904 KB
testcase_16 AC 100 ms
154,544 KB
testcase_17 AC 41 ms
61,560 KB
testcase_18 AC 117 ms
197,132 KB
testcase_19 AC 94 ms
146,508 KB
testcase_20 AC 58 ms
88,264 KB
testcase_21 AC 80 ms
118,792 KB
testcase_22 AC 42 ms
64,540 KB
testcase_23 AC 76 ms
111,700 KB
testcase_24 AC 82 ms
119,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

N = MOD
fact = [1]
ff = [1]
for n in range(1,N+1):
    fact.append(fact[-1]*n%MOD)
    ff.append(ff[-1]*fact[-1]%MOD)

ans = 0
if L<MOD:
    for i in range(L,R+1):
        if ff[i]==0:
            break
        ans = (ans+ff[i])%MOD
print(ans)
0