結果
| 問題 | No.895 MESE |
| コンテスト | |
| ユーザー |
tekihei2317
|
| 提出日時 | 2019-09-28 08:59:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 2,000 ms |
| コード長 | 1,044 bytes |
| 記録 | |
| コンパイル時間 | 1,405 ms |
| コンパイル使用メモリ | 169,164 KB |
| 実行使用メモリ | 12,764 KB |
| 最終ジャッジ日時 | 2024-10-01 13:06:32 |
| 合計ジャッジ時間 | 2,652 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
const int mod=1e9+7;
const int sz=300010;
int fact[sz],inv[sz],ifact[sz];
void make(){
fact[0]=fact[1]=inv[1]=ifact[0]=ifact[1]=1;
for(int i=2;i<sz;i++){
fact[i]=fact[i-1]*i%mod;
inv[i]=inv[mod%i]*(mod-mod/i)%mod;
ifact[i]=ifact[i-1]*inv[i]%mod;
}
}
int comb(int n,int k){
if(n<k) return 0;
return fact[n]*ifact[k]%mod*ifact[n-k]%mod;
}
signed main()
{
cin.tie(0);
ios::sync_with_stdio(false);
make();
int a,b,c; cin>>a>>b>>c;
int N=a+b+c;
vector<int> two(N+1);
two[0]=1;
for(int i=0;i<N;i++){
two[i+1]=two[i]*2%mod;
}
int ans=0;
for(int i=N-2;i>=0;i--){
if(a<N-i-1) break;
ans+=(two[i]-1)*comb(i-1,c-1)%mod*comb(i-c,b-1);
ans%=mod;
}
cout<<ans<<endl;
return 0;
}
tekihei2317