結果

問題 No.1186 長方形の敷き詰め
ユーザー mencotton
提出日時 2020-08-22 14:46:18
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 69,128 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-15 09:04:13
合計ジャッジ時間 1,425 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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