結果

問題 No.2527 H and W
ユーザー 👑 hitonanodehitonanode
提出日時 2023-11-03 22:09:36
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 847 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 7,568 KB
最終ジャッジ日時 2023-11-03 22:09:38
合計ジャッジ時間 1,949 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
7,568 KB
testcase_01 AC 7 ms
7,568 KB
testcase_02 AC 17 ms
7,568 KB
testcase_03 AC 7 ms
7,568 KB
testcase_04 AC 16 ms
7,568 KB
testcase_05 AC 17 ms
7,568 KB
testcase_06 AC 17 ms
7,568 KB
testcase_07 AC 8 ms
7,568 KB
testcase_08 AC 17 ms
7,568 KB
testcase_09 AC 7 ms
7,568 KB
testcase_10 AC 7 ms
7,568 KB
testcase_11 AC 17 ms
7,568 KB
testcase_12 AC 17 ms
7,568 KB
testcase_13 AC 17 ms
7,568 KB
testcase_14 AC 25 ms
7,568 KB
testcase_15 AC 17 ms
7,568 KB
testcase_16 AC 16 ms
7,568 KB
testcase_17 AC 17 ms
7,568 KB
testcase_18 AC 16 ms
7,568 KB
testcase_19 AC 13 ms
7,568 KB
testcase_20 AC 13 ms
7,568 KB
testcase_21 AC 16 ms
7,568 KB
testcase_22 AC 16 ms
7,568 KB
testcase_23 AC 17 ms
7,568 KB
testcase_24 AC 12 ms
7,568 KB
testcase_25 AC 7 ms
7,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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';
}
0