結果

問題 No.1186 長方形の敷き詰め
ユーザー mencottonmencotton
提出日時 2020-08-22 14:46:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 68,936 KB
実行使用メモリ 10,828 KB
最終ジャッジ日時 2023-08-05 12:00:22
合計ジャッジ時間 2,028 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 10 ms
10,776 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 9 ms
10,828 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 5 ms
5,384 KB
testcase_18 AC 7 ms
8,188 KB
testcase_19 AC 8 ms
8,932 KB
testcase_20 AC 8 ms
9,720 KB
testcase_21 AC 7 ms
7,684 KB
testcase_22 AC 9 ms
10,820 KB
testcase_23 AC 7 ms
7,480 KB
testcase_24 AC 9 ms
9,844 KB
testcase_25 AC 7 ms
7,200 KB
testcase_26 AC 7 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

const ll MOD = 998244353;

int main() {
    int n, m;
    cin >> n >> m;
    vector<ll> dp(m + 1);
    dp[0] = 1;
    for (int i = 1; i <= m; i++) {
        dp[i] += dp[i - 1];
        if (i >= n && n != 1)dp[i] += dp[i - n];
        dp[i] %= MOD;
    }
    cout << dp[m] << endl;
    return 0;
}
0