結果

問題 No.2176 LRM Question 1
ユーザー rlangevinrlangevin
提出日時 2023-03-18 22:42:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,832 KB
実行使用メモリ 75,512 KB
最終ジャッジ日時 2023-10-18 17:35:14
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,560 KB
testcase_01 AC 36 ms
53,560 KB
testcase_02 AC 69 ms
75,512 KB
testcase_03 AC 35 ms
53,560 KB
testcase_04 WA -
testcase_05 AC 43 ms
60,536 KB
testcase_06 WA -
testcase_07 AC 44 ms
60,428 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 65 ms
73,064 KB
testcase_11 AC 34 ms
53,560 KB
testcase_12 AC 35 ms
53,560 KB
testcase_13 AC 60 ms
75,252 KB
testcase_14 AC 69 ms
75,512 KB
testcase_15 AC 64 ms
72,248 KB
testcase_16 AC 60 ms
69,944 KB
testcase_17 AC 42 ms
60,204 KB
testcase_18 AC 59 ms
73,724 KB
testcase_19 AC 53 ms
69,196 KB
testcase_20 AC 45 ms
62,804 KB
testcase_21 AC 53 ms
66,216 KB
testcase_22 AC 44 ms
60,424 KB
testcase_23 AC 51 ms
65,408 KB
testcase_24 AC 50 ms
66,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L, R, M = map(int, input().split())
f = [1] * (M + 5)
ff = [1] * (M + 5)
for i in range(M):
    f[i + 1] = f[i] * (i + 1) % M
for i in range(M):
    ff[i + 1] = ff[i] * f[i + 1] % M

ans = 0
for i in range(L, min(R, M + 1)):
    ans += ff[i]
    ans %= M
print(ans)
0