結果

問題 No.1126 SUM
ユーザー koba-e964koba-e964
提出日時 2021-10-06 16:14:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 1,000 ms
コード長 212 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 75,876 KB
最終ジャッジ日時 2023-09-30 08:47:50
合計ジャッジ時間 4,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,600 KB
testcase_01 AC 71 ms
75,572 KB
testcase_02 AC 71 ms
75,700 KB
testcase_03 AC 72 ms
75,840 KB
testcase_04 AC 76 ms
75,656 KB
testcase_05 AC 74 ms
75,740 KB
testcase_06 AC 73 ms
75,876 KB
testcase_07 AC 73 ms
75,604 KB
testcase_08 AC 72 ms
75,832 KB
testcase_09 AC 73 ms
75,752 KB
testcase_10 AC 75 ms
75,592 KB
testcase_11 AC 71 ms
75,736 KB
testcase_12 AC 70 ms
75,732 KB
testcase_13 AC 74 ms
75,628 KB
testcase_14 AC 71 ms
75,580 KB
testcase_15 AC 73 ms
75,808 KB
testcase_16 AC 71 ms
75,668 KB
testcase_17 AC 74 ms
75,728 KB
testcase_18 AC 72 ms
75,724 KB
testcase_19 AC 73 ms
75,844 KB
testcase_20 AC 73 ms
75,576 KB
testcase_21 AC 74 ms
75,588 KB
testcase_22 AC 72 ms
75,696 KB
testcase_23 AC 73 ms
75,556 KB
testcase_24 AC 73 ms
75,588 KB
testcase_25 AC 70 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

n, m = map(int, input().split())

a = 1
b = 1
MOD = pow(10, 9) + 7
for i in range(1, n + 2):
    b *= i
    b %= MOD
    a *= m - n + i
    a %= MOD

print(a * pow(b, MOD - 2, MOD) % MOD)
0