結果
問題 | No.2527 H and W |
ユーザー |
|
提出日時 | 2023-11-03 21:26:41 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 218 ms / 2,000 ms |
コード長 | 2,634 bytes |
コンパイル時間 | 5,465 ms |
コンパイル使用メモリ | 308,768 KB |
実行使用メモリ | 50,252 KB |
最終ジャッジ日時 | 2024-09-25 19:06:13 |
合計ジャッジ時間 | 11,001 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
// #pragma GCC target("avx2")// #pragma GCC optimize("O3")// #pragma GCC optimize("unroll-loops")#if __has_include(<bits/stdc++.h>)#include <bits/stdc++.h>#else#include <iostream>#include <string>#include <vector>#include <algorithm>#include <utility>#include <tuple>#include <cstdint>#include <cstdio>#include <map>#include <queue>#include <set>#include <stack>#include <deque>#include <unordered_map>#include <unordered_set>#include <bitset>#include <cctype>#include <cmath>#include <numeric>#include <iomanip>#endif#define rep(i,n) for(int i=0;i<n;i++)#define reps(i,s,e) for(int i=s;i<e;i++)#define rvrep(i,n) for(int i=n-1;i>=0;i--)#define repv(i,v) for(auto i:v)#define all(x) x.begin(),x.end()template<typename T>inline bool chmax(T &a,T b){return((a<b)?(a=b,true):(false));}template<typename T>inline bool chmin(T &a,T b){return((a>b)?(a=b,true):(false));}using namespace std;using ll=long long;using vi=vector<int>;using vvi=vector<vi>;using vvvi=vector<vvi>;using vl=vector<ll>;using vvl=vector<vl>;using vvvl=vector<vvl>;using pii=pair<int,int>;using vpii=vector<pii>;using pll=pair<ll,ll>;using vpll=vector<pll>;using pli=pair<ll,int>;using pil=pair<int,ll>;using mpi=map<int,int>;using mps=map<string,int>;using mpc=map<char,int>;using mpl=map<ll,int>;using sti=set<int>;using stc=set<char>;using sts=set<string>;using stl=set<ll>;#if __has_include(<atcoder/all>)#include <atcoder/all>using namespace atcoder;using mint=modint998244353;using mint1=modint1000000007;#endif// modcombstruct mComb {private:bool _calced = false;int _mod = 998244353;vl _fac, _invf, _inv;public:void setmod(int m) { _mod = m; }void init(int n) {_fac.resize(n + 1);_invf.resize(n + 1);_inv.resize(n + 1);_fac[0] = 1;_fac[1] = 1;_invf[0] = 1;_invf[1] = 1;_inv[1] = 1;reps(i, 2, n + 1) {_fac[i] = _fac[i - 1] * i % _mod;_inv[i] = _mod - _inv[_mod % i] * (_mod / i) % _mod;_invf[i] = _invf[i - 1] * _inv[i] % _mod;}_calced = true;}void _check() { if (!_calced) { cerr << "not initialized\n"; exit(1); } }ll F(int n) { _check(); return _fac[n]; }ll C(int n, int k) { _check(); return _invf[k] * _invf[n - k] % _mod * _fac[n] % _mod;}ll P(int n, int k) { _check(); return _invf[n - k] * _fac[n] % _mod;}ll H(int n, int k) { _check(); return _invf[k] * _invf[n-1] % _mod * _fac[n + k - 1] % _mod;}};int main() {ll h, w, k;cin >> h >> w >> k;mComb mc; mc.init(2000000);mint ans = 0;for (int i = 1; i <= h; i++) {if (k % i == 0 && k / i <= w) {ans += mc.C(h, i) * mc.C(w, k / i);}}cout << ans.val();}