結果

問題 No.2176 LRM Question 1
ユーザー titiatitia
提出日時 2023-01-06 21:33:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,429 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 102,188 KB
最終ジャッジ日時 2023-08-20 14:36:14
合計ジャッジ時間 29,440 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 905 ms
39,668 KB
testcase_01 AC 922 ms
39,464 KB
testcase_02 AC 1,192 ms
39,436 KB
testcase_03 AC 911 ms
39,436 KB
testcase_04 AC 931 ms
39,612 KB
testcase_05 AC 900 ms
39,612 KB
testcase_06 AC 929 ms
39,652 KB
testcase_07 AC 928 ms
39,684 KB
testcase_08 AC 950 ms
39,552 KB
testcase_09 AC 949 ms
39,672 KB
testcase_10 AC 1,082 ms
39,888 KB
testcase_11 AC 1,175 ms
39,428 KB
testcase_12 AC 1,204 ms
39,644 KB
testcase_13 AC 1,049 ms
39,628 KB
testcase_14 AC 1,429 ms
102,188 KB
testcase_15 AC 1,274 ms
44,396 KB
testcase_16 AC 1,280 ms
39,664 KB
testcase_17 AC 1,206 ms
39,636 KB
testcase_18 AC 1,046 ms
39,780 KB
testcase_19 AC 946 ms
39,632 KB
testcase_20 AC 997 ms
39,492 KB
testcase_21 AC 1,221 ms
39,612 KB
testcase_22 AC 1,254 ms
39,524 KB
testcase_23 AC 1,208 ms
39,680 KB
testcase_24 AC 917 ms
39,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

FACT=[1]
for i in range(1,2*10**6+1):
    FACT.append(FACT[-1]*i%mod)

FACTS=[1]*(2*10**6+1)

for i in range(1,2*10**6+1):
    FACTS[i]=FACTS[i-1]*FACT[i]%mod

ANS=0

for i in range(L,min(R+1,2*10**6)):
    ANS+=FACTS[i]

print(ANS%mod)
0