結果
| 問題 |
No.2176 LRM Question 1
|
| コンテスト | |
| ユーザー |
sepa38
|
| 提出日時 | 2023-01-07 09:48:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 262 bytes |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 116,044 KB |
| 最終ジャッジ日時 | 2024-12-14 09:11:12 |
| 合計ジャッジ時間 | 5,240 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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
ans %= m
fac *= i + 1
fac %= m
now *= fac
now %= m
print(ans)
sepa38