結果

問題 No.895 MESE
ユーザー titiatitia
提出日時 2019-09-27 23:12:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,249 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 41,572 KB
最終ジャッジ日時 2023-10-25 06:14:08
合計ジャッジ時間 22,566 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 281 ms
41,572 KB
testcase_01 AC 273 ms
41,572 KB
testcase_02 AC 279 ms
41,572 KB
testcase_03 AC 274 ms
41,572 KB
testcase_04 AC 272 ms
41,572 KB
testcase_05 AC 272 ms
41,572 KB
testcase_06 AC 274 ms
41,572 KB
testcase_07 AC 274 ms
41,572 KB
testcase_08 AC 280 ms
41,572 KB
testcase_09 AC 276 ms
41,572 KB
testcase_10 AC 278 ms
41,572 KB
testcase_11 AC 283 ms
41,572 KB
testcase_12 AC 280 ms
41,572 KB
testcase_13 AC 796 ms
41,572 KB
testcase_14 AC 827 ms
41,572 KB
testcase_15 AC 890 ms
41,572 KB
testcase_16 AC 776 ms
41,572 KB
testcase_17 AC 765 ms
41,572 KB
testcase_18 AC 1,230 ms
41,572 KB
testcase_19 AC 1,231 ms
41,572 KB
testcase_20 AC 1,225 ms
41,572 KB
testcase_21 AC 1,230 ms
41,572 KB
testcase_22 AC 1,228 ms
41,572 KB
testcase_23 AC 1,249 ms
41,572 KB
testcase_24 AC 1,237 ms
41,572 KB
testcase_25 AC 1,224 ms
41,572 KB
testcase_26 AC 1,217 ms
41,572 KB
testcase_27 AC 1,223 ms
41,572 KB
testcase_28 AC 1,222 ms
41,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

FACT_INV=[pow(FACT[-1],mod-2,mod)]
for i in range(4*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=pow(2,S-3,mod)*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+pow(2,i,mod)*COM*Combi(S-3-(a-1),b-1))%mod

print(ANS)

0