結果

問題 No.1126 SUM
ユーザー roarisroaris
提出日時 2020-07-24 22:06:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 1,000 ms
コード長 174 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 87,408 KB
実行使用メモリ 77,028 KB
最終ジャッジ日時 2023-09-08 04:23:24
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
77,028 KB
testcase_01 AC 102 ms
76,348 KB
testcase_02 AC 92 ms
76,464 KB
testcase_03 AC 78 ms
76,032 KB
testcase_04 AC 102 ms
76,216 KB
testcase_05 AC 99 ms
76,320 KB
testcase_06 AC 96 ms
76,296 KB
testcase_07 AC 128 ms
76,420 KB
testcase_08 AC 118 ms
76,432 KB
testcase_09 AC 113 ms
76,340 KB
testcase_10 AC 80 ms
76,324 KB
testcase_11 AC 121 ms
76,136 KB
testcase_12 AC 134 ms
76,528 KB
testcase_13 AC 104 ms
76,252 KB
testcase_14 AC 86 ms
76,432 KB
testcase_15 AC 83 ms
76,372 KB
testcase_16 AC 119 ms
76,080 KB
testcase_17 AC 91 ms
75,984 KB
testcase_18 AC 116 ms
76,376 KB
testcase_19 AC 100 ms
76,140 KB
testcase_20 AC 98 ms
76,256 KB
testcase_21 AC 99 ms
76,380 KB
testcase_22 AC 99 ms
76,108 KB
testcase_23 AC 116 ms
76,012 KB
testcase_24 AC 121 ms
76,012 KB
testcase_25 AC 144 ms
76,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
ans = 1
now = 1
MOD = 10**9+7

for i in range(N, M):
    now = now*(i+1)*pow(i+1-N, MOD-2, MOD)%MOD
    ans += now
    ans %= MOD

print(ans)
0