| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38436 | masppy | 【S】T2 | C++ | 运行出错 | 0 | 92 MS | 480 KB | 866 | 2025-10-08 14:13:54 |
#include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e4+10; const ll inf=1e10; const ll mod=998244353; ll n,m; ll num[maxn],ans[maxn]; struct node{ int opt,x; }q[maxn]; int main(){ // freopen("xortree.in","r",stdin); // freopen("xortree.out","w",stdout); scanf("%lld%lld",&n,&m); memset(num,0,sizeof(num)); num[n]=1; memset(ans,0,sizeof(ans)); for(int i=1;i<=m;i++){ scanf("%d%d",&q[i].opt,&q[i].x); } for(int i=1;i<=m;i++){ if(q[i].opt==2){ printf("%lld\n",(num[q[i].x]+ans[q[i].x])%mod); if(q[i+1].opt==1&&i<m){ memset(ans,0,sizeof(ans)); } } else{ int x=q[i].x; for(int j=0;j<=8200;j++){ num[x^j]+=num[j]; num[x^j]%=mod; if(q[i+1].opt==2) ans[x^j]+=num[j],ans[x^j]%=mod; } } } fclose(stdin); fclose(stdout); return 0; }