結果

問題 No.1186 長方形の敷き詰め
ユーザー glretoglreto
提出日時 2021-04-01 19:28:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 1,107 bytes
コンパイル時間 831 ms
コンパイル使用メモリ 102,440 KB
実行使用メモリ 11,740 KB
最終ジャッジ日時 2023-08-22 22:00:38
合計ジャッジ時間 2,069 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 5 ms
11,740 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 3 ms
7,604 KB
testcase_18 AC 5 ms
9,020 KB
testcase_19 AC 5 ms
10,980 KB
testcase_20 AC 5 ms
10,288 KB
testcase_21 AC 4 ms
8,224 KB
testcase_22 AC 9 ms
11,140 KB
testcase_23 AC 6 ms
8,012 KB
testcase_24 AC 6 ms
10,204 KB
testcase_25 AC 4 ms
8,360 KB
testcase_26 AC 4 ms
8,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iomanip>
#include<map>
#include<random>
#include<complex>
#include<math.h>
#include<functional>
#include<stack>
#include<queue>
#include<set>
#include <cassert>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(ll i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;
const int inf = 0x3fffffff;
const ll mod = 998244353;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll dp[1100000], n, m; dp[0] = 1; cin >> n >> m;
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    rep(i, m) {
        if (i +1< n) dp[i + 1] = dp[i];
        else dp[i + 1] = (dp[i] + dp[i - n+1]) % mod;
    }cout << dp[m] << endl;
}
0