結果

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

テストケース

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

ソースコード

diff #

#include <atcoder/modint>
#include <iostream>
using mint = atcoder::modint998244353;
using namespace std;

mint facs[1000001];

int main() {
    long long H, W, K;
    cin >> H >> W >> K;

    facs[0] = 1;
    for (int i = 1; i <= 1000000; ++i) facs[i] = facs[i - 1] * i;

    mint ret = 0;
    for (long long d = 1; d <= H; ++d) {
        if (K % d) continue;
        long long e = K / d;
        if (e > W) continue;

        ret += facs[H] / facs[d] / facs[H - d] * facs[W] / facs[e] / facs[W - e];
    }

    cout << ret.val() << '\n';
}
0