結果

問題 No.1186 長方形の敷き詰め
ユーザー betrue12betrue12
提出日時 2020-09-01 03:32:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 2,126 ms
コンパイル使用メモリ 202,796 KB
実行使用メモリ 11,076 KB
最終ジャッジ日時 2024-04-28 13:47:54
合計ジャッジ時間 3,313 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 10 ms
10,964 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 6 ms
6,940 KB
testcase_18 AC 7 ms
8,300 KB
testcase_19 AC 8 ms
9,236 KB
testcase_20 AC 8 ms
9,948 KB
testcase_21 AC 6 ms
8,016 KB
testcase_22 AC 12 ms
11,076 KB
testcase_23 AC 7 ms
7,640 KB
testcase_24 AC 10 ms
10,056 KB
testcase_25 AC 7 ms
7,424 KB
testcase_26 AC 8 ms
8,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const int64_t MOD = 998244353;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

int main(){
    int N, M;
    cin >> N >> M;
    vector<int64_t> dp(M+1);
    dp[0] = 1;
    for(int i=0; i<M; i++){
        add(dp[i+1], dp[i]);
        if(i+N <= M) add(dp[i+N], dp[i]);
    }
    cout << dp[M] << endl;
    return 0;
}
0