結果

問題 No.1044 正直者大学
ユーザー umezoumezo
提出日時 2022-08-12 01:09:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 797 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 202,356 KB
実行使用メモリ 13,280 KB
最終ジャッジ日時 2023-10-22 05:51:23
合計ジャッジ時間 3,814 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
13,220 KB
testcase_01 AC 11 ms
13,220 KB
testcase_02 AC 11 ms
13,276 KB
testcase_03 AC 11 ms
13,220 KB
testcase_04 AC 10 ms
13,276 KB
testcase_05 AC 11 ms
13,276 KB
testcase_06 AC 12 ms
13,276 KB
testcase_07 AC 11 ms
13,276 KB
testcase_08 AC 11 ms
13,276 KB
testcase_09 AC 10 ms
13,276 KB
testcase_10 AC 11 ms
13,276 KB
testcase_11 AC 11 ms
13,276 KB
testcase_12 AC 10 ms
13,276 KB
testcase_13 AC 12 ms
13,276 KB
testcase_14 AC 10 ms
13,276 KB
testcase_15 AC 10 ms
13,276 KB
testcase_16 AC 11 ms
13,276 KB
testcase_17 AC 11 ms
13,276 KB
testcase_18 AC 11 ms
13,276 KB
testcase_19 AC 10 ms
13,276 KB
testcase_20 AC 11 ms
13,276 KB
testcase_21 AC 11 ms
13,276 KB
testcase_22 AC 10 ms
13,276 KB
testcase_23 AC 10 ms
13,276 KB
testcase_24 AC 11 ms
13,276 KB
testcase_25 AC 11 ms
13,276 KB
testcase_26 AC 10 ms
13,276 KB
testcase_27 AC 11 ms
13,220 KB
testcase_28 WA -
testcase_29 AC 10 ms
13,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

const int MAX=410000;
const int MOD=1e9+7;
ll fac[MAX],finv[MAX],inv[MAX];
void init(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for(int i=2;i<MAX;i++){
    fac[i]=fac[i-1]*i%MOD;
    inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
    finv[i]=finv[i-1]*inv[i]%MOD;
  }
}

ll nCr(int n,int k){
  if(n<k) return 0;
  if(n<0 || k<0) return 0;
  return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  init();
  ll n,m,k;
  cin>>n>>m>>k;
  ll ans=0,p=(n+m-k-2)/2;
  for(int i=0;i<=p;i++) ans=(ans+nCr(n,i+1)*nCr(m-1,i)%MOD)%MOD;
  cout<<ans*fac[n-1]%MOD*fac[m]%MOD<<endl;
  
  return 0;
}
0