結果

問題 No.2176 LRM Question 1
ユーザー HydruHydru
提出日時 2023-01-06 21:39:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 1,359 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 152,304 KB
最終ジャッジ日時 2023-08-20 14:43:23
合計ジャッジ時間 5,077 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,412 KB
testcase_01 AC 73 ms
70,828 KB
testcase_02 AC 133 ms
152,304 KB
testcase_03 AC 72 ms
71,344 KB
testcase_04 AC 126 ms
151,940 KB
testcase_05 AC 81 ms
78,300 KB
testcase_06 AC 79 ms
76,012 KB
testcase_07 AC 81 ms
77,416 KB
testcase_08 AC 127 ms
152,184 KB
testcase_09 AC 125 ms
144,388 KB
testcase_10 AC 127 ms
136,336 KB
testcase_11 AC 74 ms
71,348 KB
testcase_12 AC 73 ms
71,160 KB
testcase_13 AC 125 ms
152,012 KB
testcase_14 AC 138 ms
152,272 KB
testcase_15 AC 126 ms
135,972 KB
testcase_16 AC 117 ms
123,300 KB
testcase_17 AC 78 ms
76,736 KB
testcase_18 AC 120 ms
143,472 KB
testcase_19 AC 109 ms
117,916 KB
testcase_20 AC 87 ms
89,688 KB
testcase_21 AC 105 ms
105,216 KB
testcase_22 AC 81 ms
77,528 KB
testcase_23 AC 103 ms
101,780 KB
testcase_24 AC 101 ms
105,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l,r,m=map(int,input().split())

A=[0]
factorial_value=1
factorial_factorial_value=1
for i in range(1,m):
    factorial_value*=i
    factorial_value%=m
    factorial_factorial_value*=factorial_value
    factorial_factorial_value%=m
    A.append(factorial_factorial_value)

ans=0
for i in range(l,min(m,r+1)):
    ans+=A[i]
    ans%=m


print(ans)
0