結果

問題 No.895 MESE
ユーザー titiatitia
提出日時 2019-09-27 23:09:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 580 bytes
コンパイル時間 710 ms
コンパイル使用メモリ 81,672 KB
実行使用メモリ 114,824 KB
最終ジャッジ日時 2023-10-25 06:02:06
合計ジャッジ時間 5,087 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
93,596 KB
testcase_01 AC 69 ms
89,248 KB
testcase_02 AC 68 ms
89,248 KB
testcase_03 AC 66 ms
89,248 KB
testcase_04 AC 66 ms
89,248 KB
testcase_05 AC 67 ms
89,248 KB
testcase_06 AC 67 ms
89,248 KB
testcase_07 AC 66 ms
89,248 KB
testcase_08 AC 76 ms
93,908 KB
testcase_09 AC 72 ms
91,484 KB
testcase_10 AC 77 ms
93,932 KB
testcase_11 AC 79 ms
95,968 KB
testcase_12 AC 77 ms
93,932 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c=map(int,input().split())
mod=10**9+7

FACT=[1]
for i in range(1,2*10**5+1):
    FACT.append(FACT[-1]*i%mod)

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(2*10**5,0,-1):
    FACT_INV.append(FACT_INV[-1]*i%mod)

FACT_INV.reverse()

def Combi(a,b):
    if 0<=b<=a:
        return FACT[a]*FACT_INV[b]*FACT_INV[a-b]%mod
    else:
        return 0

S=a+b+c
ANS=(1<<(S-3))*Combi(S-3,a-1)*Combi(S-3-(a-1),b-1)%mod


for i in range(S-3):
    COM=Combi(S-2,a-1)
    if S-(i+1)<=a:
        COM-=Combi(i,a-(S-(i+1)))

    ANS=(ANS+(1<<i)*COM*Combi(S-3-(a-1),b-1))%mod

print(ANS)

0