結果

問題 No.2527 H and W
ユーザー 👑 hitonanodehitonanode
提出日時 2023-11-03 22:07:02
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 518 bytes
コンパイル時間 765 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-11-03 22:07:09
合計ジャッジ時間 5,888 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 677 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 270 ms
4,348 KB
testcase_05 AC 11 ms
4,348 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mint ncr(int n, int r) {
    mint ret = 1;
    for (int i = 0; i < r; ++i) ret = ret * (n - i) / (i + 1);
    return ret;
}

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

    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 += ncr(H, d) * ncr(W, e);
    }

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