結果

問題 No.3394 Big Binom
コンテスト
ユーザー chestnut_68
提出日時 2025-12-01 10:46:57
言語 C++23
(gcc 13.3.0 + boost 1.89.0)
結果
RE  
実行時間 -
コード長 1,239 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,273 ms
コンパイル使用メモリ 338,984 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-12-01 10:47:14
合計ジャッジ時間 16,614 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 16 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
#define rep1(a) for (int z = 0; z < a; z++)
#define rep2(i, a) for (ll i = 0; i < a; i++)
#define rep3(i, a, b) for (int i = a; i < b; i++)
#define rep4(i, a, b, c) for (int i = a; i < b; i += c)
#define overload4(a, b, c, d, e, ...) e
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
#define YN(x) cout << (x ? "Yes" : "No") << endl;
#define popc(x) __builtin_popcount(x)
#define cmp(x, l, r) ((l <= x) && (x <= r))
#define rrep(i, a) for (int i = (a)-1; i >= 0; i--)
#define ll long long
constexpr int MOD = 998244353;
vector<ll> f={1,808258749,117153405,761699708,573994984,62402409,511621808,242726978,887890124,875880304};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ll n,k,p=1e8;
  cin>>n>>k;
  auto m=n-k;
  ll A=n/p,a=n%p,B=k/p,b=k%p,C=m/p,c=m%p;
  mint s=f[A],t=f[B],u=f[C];
  auto x=max({a,b,c});
  rep(i,1,x+1){
  	if(i<=a)s*=(A*p+i);
  	if(i<=b)t*=(B*p+i);
  	if(i<=c)u*=(C*p+i);
  }
  t*=u;
  s/=t;
  
  cout<<s.val();
}
0