結果

問題 No.895 MESE
コンテスト
ユーザー ああいい
提出日時 2022-01-27 13:03:17
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 476 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 211 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 79,232 KB
最終ジャッジ日時 2026-05-30 19:17:56
合計ジャッジ時間 3,975 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

a,b,c = map(int,input().split())

inf = 10 ** 6
fact = [1] * inf
fact_inv = [1] * inf
P = 10 ** 9 + 7
for i in range(2,inf):
    fact[i] = fact[i-1] * i % P
fact_inv[-1] = pow(fact[-1],P-2,P)
for i in range(inf-2,1,-1):
    fact_inv[i] = fact_inv[i+1] * (i+1) % P
ans = 0
for i in  range(1,a+1):
    M = a + b + c - 1 - i
    tmp = fact[M-1] * fact_inv[c-1] % P * fact_inv[b-1] % P * fact_inv[a - i] % P
    tmp = (pow(2,M,P)-1) * tmp % P
    ans = (ans + tmp) % P
print(ans)
0