結果
問題 | No.895 MESE |
ユーザー | titia |
提出日時 | 2019-09-27 23:08:43 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
TLE
|
実行時間 | - |
コード長 | 580 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 11,948 KB |
実行使用メモリ | 51,812 KB |
最終ジャッジ日時 | 2023-10-25 06:00:19 |
合計ジャッジ時間 | 6,208 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 150 ms
51,812 KB |
testcase_01 | AC | 159 ms
25,892 KB |
testcase_02 | AC | 155 ms
25,892 KB |
testcase_03 | AC | 151 ms
25,892 KB |
testcase_04 | AC | 152 ms
25,892 KB |
testcase_05 | AC | 153 ms
25,892 KB |
testcase_06 | AC | 151 ms
25,892 KB |
testcase_07 | AC | 155 ms
25,892 KB |
testcase_08 | AC | 156 ms
25,892 KB |
testcase_09 | AC | 153 ms
25,892 KB |
testcase_10 | AC | 156 ms
25,892 KB |
testcase_11 | AC | 162 ms
25,892 KB |
testcase_12 | AC | 156 ms
25,892 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 | -- | - |
ソースコード
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)