結果
| 問題 |
No.1186 長方形の敷き詰め
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 13:37:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 411 bytes |
| コンパイル時間 | 1,530 ms |
| コンパイル使用メモリ | 168,060 KB |
| 実行使用メモリ | 42,360 KB |
| 最終ジャッジ日時 | 2024-10-15 07:51:37 |
| 合計ジャッジ時間 | 2,435 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 3 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll N, M, MOD = 998244353;
vector<ll> f(1000001, -1);
ll solve(int x) {
if (f[x] != -1) return f[x];
if (x < N) {
f[x] = 1;
return 1;
}
f[x] = (solve(x - 1) + solve(x - N)) % MOD;
return f[x];
}
int main() {
cin >> N >> M;
cout << solve(M) << "\n";
}