結果

問題 No.2176 LRM Question 1
ユーザー katonyonkokatonyonko
提出日時 2023-01-06 21:29:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 219 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 228,432 KB
最終ジャッジ日時 2023-08-20 14:31:59
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,416 KB
testcase_01 AC 84 ms
71,360 KB
testcase_02 AC 253 ms
228,324 KB
testcase_03 AC 82 ms
71,328 KB
testcase_04 AC 235 ms
228,156 KB
testcase_05 AC 98 ms
80,328 KB
testcase_06 AC 93 ms
76,364 KB
testcase_07 AC 102 ms
79,096 KB
testcase_08 AC 224 ms
228,432 KB
testcase_09 AC 232 ms
212,508 KB
testcase_10 AC 176 ms
196,936 KB
testcase_11 AC 75 ms
71,292 KB
testcase_12 AC 73 ms
71,588 KB
testcase_13 AC 186 ms
228,204 KB
testcase_14 AC 190 ms
228,364 KB
testcase_15 AC 173 ms
196,068 KB
testcase_16 AC 155 ms
170,920 KB
testcase_17 AC 84 ms
77,160 KB
testcase_18 AC 170 ms
211,856 KB
testcase_19 AC 145 ms
160,512 KB
testcase_20 AC 124 ms
103,748 KB
testcase_21 AC 157 ms
134,420 KB
testcase_22 AC 96 ms
79,180 KB
testcase_23 AC 151 ms
127,364 KB
testcase_24 AC 152 ms
134,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L,R,M=map(int,input().split())
ap=[1]
aap=[1]
for i in range(M): ap.append(ap[-1]*(i+1)%M)
for i in range(M): aap.append(aap[-1]*ap[i+1]%M)
ans=0
for i in range(L,R+1):
  if i>=M: break
  ans+=aap[i]
  ans%=M
print(ans)
0