| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38477 | Gapple | 【S】T2 | C++ | 通过 | 100 | 277 MS | 416 KB | 1030 | 2025-10-08 15:49:49 |
#include <cstring> #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; int f[V], g[V]; memset(f, 0, sizeof(f)); memset(g, 0, sizeof(g)); f[k0] = 1; while (q-- > 0) { int op, w; cin >> op >> w; if (op == 1) { int nxt_f[V], nxt_g[V]; memset(nxt_f, 0, sizeof(nxt_f)); memset(nxt_g, 0, sizeof(nxt_g)); 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[w], g[w]) << '\n'; } return 0; }