結果

問題 No.1414 東大文系数学2021第2問改
ユーザー KudeKude
提出日時 2021-02-28 22:19:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,009 bytes
コンパイル時間 3,723 ms
コンパイル使用メモリ 256,760 KB
実行使用メモリ 173,540 KB
最終ジャッジ日時 2024-04-12 10:54:48
合計ジャッジ時間 12,213 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 708 ms
173,392 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n)for (int i = 0; i < int(n); ++i)
#define rrep(i,n)for (int i = int(n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
template<class T> void chmax(T& a, const T& b) {a = max(a, b);}
template<class T> void chmin(T& a, const T& b) {a = min(a, b);}
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;

using mint = modint998244353;
mint op(mint x, mint y) {return x + y;}
mint e() {return mint::raw(0);}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    segtree<mint, op, e> seg(k);
    seg.set(0, 1);
    int b = 0;
    rep(i, n) {
        mint s = seg.all_prod();
        b = (b - 1 + k) % k;
        seg.set(b, s);
    }
    mint ans = mint::raw(2).pow(n) - seg.all_prod();
    cout << ans.val() << endl;
}
0