結果
問題 | No.2527 H and W |
ユーザー | Ayuna |
提出日時 | 2023-11-03 21:45:36 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 3,870 bytes |
コンパイル時間 | 3,587 ms |
コンパイル使用メモリ | 235,372 KB |
実行使用メモリ | 19,020 KB |
最終ジャッジ日時 | 2024-09-25 19:52:49 |
合計ジャッジ時間 | 5,183 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
18,900 KB |
testcase_01 | AC | 24 ms
18,956 KB |
testcase_02 | AC | 33 ms
18,860 KB |
testcase_03 | AC | 22 ms
18,896 KB |
testcase_04 | AC | 37 ms
19,020 KB |
testcase_05 | AC | 37 ms
18,976 KB |
testcase_06 | AC | 37 ms
18,860 KB |
testcase_07 | AC | 24 ms
18,796 KB |
testcase_08 | AC | 34 ms
18,852 KB |
testcase_09 | AC | 34 ms
19,004 KB |
testcase_10 | AC | 33 ms
18,832 KB |
testcase_11 | AC | 33 ms
18,896 KB |
testcase_12 | AC | 32 ms
18,940 KB |
testcase_13 | AC | 34 ms
18,972 KB |
testcase_14 | AC | 36 ms
18,856 KB |
testcase_15 | AC | 36 ms
18,944 KB |
testcase_16 | AC | 35 ms
18,972 KB |
testcase_17 | AC | 35 ms
18,952 KB |
testcase_18 | AC | 36 ms
18,964 KB |
testcase_19 | AC | 31 ms
18,996 KB |
testcase_20 | AC | 33 ms
18,912 KB |
testcase_21 | AC | 36 ms
18,916 KB |
testcase_22 | AC | 35 ms
18,916 KB |
testcase_23 | AC | 33 ms
18,812 KB |
testcase_24 | AC | 31 ms
18,792 KB |
testcase_25 | AC | 33 ms
18,976 KB |
ソースコード
#if 1 #include <bits/stdc++.h> const long long MOD = 1000000007; #include <atcoder/all> using namespace atcoder; typedef modint998244353 mint93; typedef modint1000000007 mint17; typedef modint mint; using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; using ld = long double; using pll = pair<ll, ll>; #define vec vector template <class T> using v = vector<T>; template <class T> using vv = v<v<T>>; template <class T> using vvv = v<vv<T>>; using vl = v<ll>; using vvl = vv<ll>; using vvvl = vvv<ll>; using vpl = v<pll>; using UF = dsu; constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); } #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, N) for (ll i = 0; i < (ll)(N); i++) #define rep1(i, N) for (ll i = 1; i <= (ll)(N); i++) #define rrep(i, N) for (ll i = N - 1; i >= 0; i--) #define rrep1(i, N) for (ll i = N; i > 0; i--) #define fore(i, a) for (auto &i : a) #define fs first #define sc second #define eb emplace_back #define pb push_back #define ps push #define elif else if #define all(x) (x).begin(), (x).end() #define UNIQUE(x) (x).erase(unique((x).begin(), (x).end()), (x).end()); #define YES(x) cout << ((x) ? "YES\n" : "NO\n"); #define Yes(x) cout << ((x) ? "Yes\n" : "No\n"); #define yes(x) cout << ((x) ? "yes\n" : "no\n"); ll sum(vl &x) { return accumulate(all(x), 0ll); } template <class T, class U> void chmin(T &t, const U &u) { if (t > u) t = u; } template <class T, class U> void chmax(T &t, const U &u) { if (t < u) t = u; } const int inf = (1ll << 29); const ll infl = (1LL << 60); const ll mod93 = 998244353ll; const ll mod17 = 1000000007ll; int popcnt(uint x) { return __builtin_popcount(x); } int popcnt(ull x) { return __builtin_popcountll(x); } int bsr(uint x) { return 32 - __builtin_clz(x); } int bsr(ull x) { return 64 - __builtin_clzll(x); } int bsf(uint x) { return __builtin_ctz(x); } int bsf(ull x) { return __builtin_ctzll(x); } template <class T> istream &operator>>(istream &is, vector<T> &x) { for (auto &y : x) is >> y; return is; } template <class T> ostream &operator<<(ostream &os, vector<T> &x) { for (unsigned int i = 0, size = x.size(); i < size; i++) os << x[i] << (i == size - 1 ? "" : " "); return os; } template <class T, class S> istream &operator>>(istream &is, pair<T, S> &x) { return is >> x.first >> x.second; } template <class T, class S> ostream &operator<<(ostream &os, pair<T, S> &x) { return os << x.first << " " << x.second; } template <class T> T popleft(queue<T> &q) { T a = q.front(); q.pop(); return a; } template <class T> void print(T &t) { fore(H, t) cout << H << ' '; cout << endl; } struct StopWatch { bool f = false; clock_t st; void start() { f = true; st = clock(); } int msecs() { assert(f); return (clock() - st) * 1000 / CLOCKS_PER_SEC; } }; ll rand_int(ll l, ll r) { // [l, r] static random_device rd; static mt19937 gen(rd()); return uniform_int_distribution<ll>(l, r)(gen); } template <long long MOD> struct binomial { long long n; std::vector<atcoder::static_modint<MOD>> fact, ifact; binomial(long long n) : n(n), fact(n + 1), ifact(n + 1) { fact[0] = 1; for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i > 0; i--) ifact[i - 1] = ifact[i] * i; } atcoder::static_modint<MOD> operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } }; #endif // #define _GLIBCXX_DEBUG int main() { ll h, w, k; cin >> h >> w >> k; vpl kumi; FOR(i, 1, max(h, w) + 1) { if (k % i == 0) { if (i <= h && k / i <= w) kumi.pb({i, k / i}); } } mint93 ans = 0; binomial<mod93> comb(TEN(6) * 2); fore(pa, kumi){ ans += comb(h, pa.fs) * comb(w, pa.sc); } cout << ans.val() << endl; }