結果

問題 No.1126 SUM
ユーザー るさるさ
提出日時 2020-07-26 17:38:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 90 ms / 1,000 ms
コード長 205 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 10,948 KB
最終ジャッジ日時 2023-09-11 04:15:37
合計ジャッジ時間 3,379 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,368 KB
testcase_01 AC 68 ms
10,440 KB
testcase_02 AC 29 ms
8,728 KB
testcase_03 AC 37 ms
8,968 KB
testcase_04 AC 74 ms
10,556 KB
testcase_05 AC 55 ms
9,768 KB
testcase_06 AC 33 ms
8,868 KB
testcase_07 AC 21 ms
8,224 KB
testcase_08 AC 29 ms
8,724 KB
testcase_09 AC 45 ms
9,360 KB
testcase_10 AC 90 ms
10,948 KB
testcase_11 AC 19 ms
8,256 KB
testcase_12 AC 25 ms
8,256 KB
testcase_13 AC 23 ms
8,252 KB
testcase_14 AC 59 ms
9,916 KB
testcase_15 AC 55 ms
9,708 KB
testcase_16 AC 42 ms
9,172 KB
testcase_17 AC 41 ms
9,028 KB
testcase_18 AC 30 ms
8,660 KB
testcase_19 AC 75 ms
10,708 KB
testcase_20 AC 32 ms
8,852 KB
testcase_21 AC 74 ms
10,728 KB
testcase_22 AC 52 ms
9,588 KB
testcase_23 AC 53 ms
9,756 KB
testcase_24 AC 23 ms
8,252 KB
testcase_25 AC 16 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
n,m=list(map(int,input().split()))
r=1
for i in range(m-n+1,m+2):
    r=(r*i)%mod

inv=[0,1]
for i in range(2,n+2):
    inv.append((mod-inv[mod%i]*(mod//i))%mod)
    r=(r*inv[-1])%mod

print(r)
0