結果

問題 No.2023 Tiling is Fun
ユーザー Nzt3Nzt3
提出日時 2022-07-30 00:57:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 1,963 ms
コンパイル使用メモリ 198,184 KB
実行使用メモリ 8,232 KB
最終ジャッジ日時 2023-09-27 01:31:41
合計ジャッジ時間 3,185 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
8,068 KB
testcase_01 AC 6 ms
8,004 KB
testcase_02 AC 7 ms
7,984 KB
testcase_03 AC 6 ms
8,108 KB
testcase_04 AC 7 ms
7,980 KB
testcase_05 AC 6 ms
7,988 KB
testcase_06 AC 6 ms
8,068 KB
testcase_07 AC 6 ms
8,000 KB
testcase_08 AC 7 ms
8,008 KB
testcase_09 AC 6 ms
7,996 KB
testcase_10 AC 7 ms
8,008 KB
testcase_11 AC 6 ms
8,112 KB
testcase_12 AC 6 ms
8,108 KB
testcase_13 AC 6 ms
8,000 KB
testcase_14 AC 6 ms
8,104 KB
testcase_15 AC 6 ms
8,036 KB
testcase_16 AC 6 ms
8,008 KB
testcase_17 AC 6 ms
8,232 KB
testcase_18 AC 6 ms
8,032 KB
testcase_19 AC 6 ms
8,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

const int mod=998244353;
long long fac[200005];
long long inv[200005];
long long finv[200005];
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int A,B;
  cin>>A>>B;
  --A,--B;
  fac[1]=inv[1]=finv[1]=1;
  for(int i=2;i<200005;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=inv[mod%i]*(mod-mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
  cout<<fac[A+B]*finv[A]%mod*finv[B]%mod<<'\n';
}
0