結果
| 問題 | No.2176 LRM Question 1 | 
| コンテスト | |
| ユーザー |  sepa38 | 
| 提出日時 | 2023-01-07 09:50:13 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 255 bytes | 
| コンパイル時間 | 314 ms | 
| コンパイル使用メモリ | 82,300 KB | 
| 実行使用メモリ | 117,624 KB | 
| 最終ジャッジ日時 | 2024-12-14 09:11:54 | 
| 合計ジャッジ時間 | 5,284 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 TLE * 1 | 
ソースコード
l, r, m = map(int, input().split())
fac = 1
now = 1
for i in range(l):
  fac *= i + 1
  fac %= m
  now *= fac
  now %= m
ans = 0
for i in range(l, r+1):
  if now == 0:
    break
  ans += now
  fac *= i + 1
  fac %= m
  now *= fac
  now %= m
print(ans % m)
            
            
            
        