結果

問題 No.2176 LRM Question 1
ユーザー 👑 H20H20
提出日時 2023-01-06 21:58:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 228,128 KB
最終ジャッジ日時 2023-08-20 15:06:18
合計ジャッジ時間 4,958 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,332 KB
testcase_01 AC 78 ms
71,372 KB
testcase_02 AC 208 ms
228,124 KB
testcase_03 AC 79 ms
71,252 KB
testcase_04 AC 202 ms
228,044 KB
testcase_05 AC 85 ms
80,036 KB
testcase_06 AC 84 ms
76,172 KB
testcase_07 AC 87 ms
78,812 KB
testcase_08 AC 205 ms
228,024 KB
testcase_09 AC 194 ms
212,368 KB
testcase_10 AC 178 ms
196,656 KB
testcase_11 AC 80 ms
71,232 KB
testcase_12 AC 80 ms
71,184 KB
testcase_13 AC 208 ms
228,128 KB
testcase_14 AC 214 ms
227,992 KB
testcase_15 AC 177 ms
195,836 KB
testcase_16 AC 158 ms
170,692 KB
testcase_17 AC 82 ms
76,760 KB
testcase_18 AC 188 ms
211,156 KB
testcase_19 AC 149 ms
160,320 KB
testcase_20 AC 108 ms
103,568 KB
testcase_21 AC 130 ms
133,964 KB
testcase_22 AC 86 ms
78,792 KB
testcase_23 AC 130 ms
127,288 KB
testcase_24 AC 133 ms
134,376 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