結果

問題 No.2176 LRM Question 1
ユーザー ニックネームニックネーム
提出日時 2023-01-06 21:28:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2024-05-07 20:57:46
合計ジャッジ時間 9,169 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 748 ms
26,496 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 57 ms
11,520 KB
testcase_06 WA -
testcase_07 AC 54 ms
11,520 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 638 ms
24,320 KB
testcase_11 AC 29 ms
10,752 KB
testcase_12 AC 28 ms
10,880 KB
testcase_13 AC 521 ms
26,496 KB
testcase_14 AC 928 ms
89,216 KB
testcase_15 AC 657 ms
28,160 KB
testcase_16 AC 464 ms
20,864 KB
testcase_17 AC 41 ms
11,264 KB
testcase_18 AC 455 ms
25,088 KB
testcase_19 AC 319 ms
20,352 KB
testcase_20 AC 123 ms
14,080 KB
testcase_21 AC 290 ms
17,280 KB
testcase_22 AC 57 ms
11,392 KB
testcase_23 AC 260 ms
16,384 KB
testcase_24 AC 235 ms
17,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l,r,m = map(int,input().split())
a = [1]; b = [1]; ans = 0
for i in range(1,m): a.append(a[-1]*i%m)
for i in range(1,m): b.append(b[-1]*a[i]%m)
for i in range(l, m): ans = (ans+b[i])%m
print(ans)
0