| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38448 | Gapple | 【S】T2 | C++ | 解答错误 | 35 | 301 MS | 400 KB | 981 | 2025-10-08 15:05:53 |
#include <array> #include <iostream> #include <utility> using namespace std; using i64 = long long; constexpr int V = 1 << 13, MOD = 998244353; inline int add(int x, int y) { return (x + y) % MOD; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int k0, q; cin >> k0 >> q; array<int, V + 1> f, g; f.fill(0); g.fill(0); f[k0] = 1; while (q-- > 0) { int op, w; cin >> op >> w; if (op == 1) { array<int, V + 1> nxt_f, nxt_g; nxt_f.fill(0); nxt_g.fill(0); for (int s = 0; s <= V; ++s) { nxt_g[s] = add(nxt_g[s], add(g[s], f[s ^ w])); nxt_f[s] = add(nxt_f[s], add(f[s], f[s ^ w])); } swap(f, nxt_f); swap(g, nxt_g); } else if (op == 2) cout << add(f[1], g[1]) << '\n'; } return 0; }