結果
問題 | No.2527 H and W |
ユーザー |
![]() |
提出日時 | 2023-11-03 22:09:36 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 715 ms |
コンパイル使用メモリ | 83,068 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-09-25 20:34:42 |
合計ジャッジ時間 | 1,789 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <atcoder/modint> #include <iostream> using mint = atcoder::modint998244353; mint f[1000001]; int main() { long long H, W, K; std::cin >> H >> W >> K; f[0] = 1; for (int i = 1; i <= 1000000; ++i) f[i] = f[i - 1] * i; mint ret = 0; for (int d = 1; d <= H; ++d) { auto e = K / d; if (K % d or e > W) continue; ret += f[H] / f[d] / f[H - d] * f[W] / f[e] / f[W - e]; } std::cout << ret.val() << '\n'; }