結果

問題 No.2176 LRM Question 1
ユーザー MasKoaTSMasKoaTS
提出日時 2022-08-28 18:24:54
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 264 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 58,752 KB
最終ジャッジ日時 2024-04-16 11:32:18
合計ジャッジ時間 2,088 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 42 ms
51,584 KB
testcase_02 AC 55 ms
57,984 KB
testcase_03 AC 41 ms
51,840 KB
testcase_04 AC 40 ms
51,584 KB
testcase_05 AC 48 ms
58,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 40 ms
51,584 KB
testcase_12 AC 41 ms
51,840 KB
testcase_13 AC 53 ms
57,728 KB
testcase_14 AC 54 ms
57,984 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 49 ms
58,240 KB
testcase_18 AC 51 ms
57,472 KB
testcase_19 AC 49 ms
57,600 KB
testcase_20 AC 47 ms
57,856 KB
testcase_21 AC 51 ms
58,752 KB
testcase_22 WA -
testcase_23 AC 50 ms
58,240 KB
testcase_24 AC 49 ms
57,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

a, b = 1, 1
for i in range(1, min(m, l + 1)):
	a *= i;  a %= m
	b *= a;  b %= m
ans = 0
for i in range(l, min(m, r + 1)):
	a *= i;  a %= m
	b *= a;  b %= m
	ans += b;  ans %= m
print(ans)
0