結果

問題 No.2176 LRM Question 1
ユーザー first_vilfirst_vil
提出日時 2023-01-24 09:28:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 99,560 KB
最終ジャッジ日時 2023-09-08 06:33:55
合計ジャッジ時間 4,134 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,400 KB
testcase_01 AC 74 ms
71,488 KB
testcase_02 AC 103 ms
99,404 KB
testcase_03 AC 78 ms
71,488 KB
testcase_04 AC 100 ms
91,472 KB
testcase_05 AC 80 ms
76,504 KB
testcase_06 AC 76 ms
75,944 KB
testcase_07 AC 77 ms
76,652 KB
testcase_08 AC 97 ms
91,604 KB
testcase_09 AC 98 ms
91,384 KB
testcase_10 AC 101 ms
95,644 KB
testcase_11 AC 73 ms
71,068 KB
testcase_12 AC 72 ms
71,520 KB
testcase_13 AC 97 ms
91,324 KB
testcase_14 AC 103 ms
99,560 KB
testcase_15 AC 97 ms
94,632 KB
testcase_16 AC 95 ms
91,052 KB
testcase_17 AC 79 ms
76,608 KB
testcase_18 AC 97 ms
90,084 KB
testcase_19 AC 89 ms
85,692 KB
testcase_20 AC 82 ms
79,084 KB
testcase_21 AC 90 ms
85,340 KB
testcase_22 AC 78 ms
76,688 KB
testcase_23 AC 88 ms
84,032 KB
testcase_24 AC 87 ms
82,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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