版本比较
杂题(9.8~9.14)
正文
增加 6 行删除 6 行
1,102 行未改动全部展开110311041105110611071107110811091110111177 行未改动11891190119111921193119311941195119611971198119912001200120112021203120411 行未改动1216121712181219122012201221122212231224122512261227122812281229123012311232352 行未改动全部展开158515861587158815891589159015911592159359 行未改动1,102 行未改动全部展开ll InvC(int x,int y) { if(x<0||y<0||x<y) return 0; return infact[x]*fact[y]%mod*fact[x-y]%mod;}ll pre1[N],pre2[N]; ll pre1[N],pre2[N];
void sol() { scanf("%d%d",&n,&m); if(n==1) {77 行未改动
struct Trie { int tr[N*31][2],sm[N*31],fa[N*31],stk[N*31],top=0,idx=0; int s[33];
inline int getnode() { int res; if(top) res=stk[top],--top;else res=++idx; tr[res][0]=tr[res][1]=sm[res]=0; return res; }
inline void erase(int u) { stk[++top]=u;int v=fa[u]; if(tr[v][0]==u) tr[v][0]=0; else tr[v][1]=0;11 行未改动 if(!sm[u]) s[++len]=u; } for(int i=len;i>=1;--i) erase(s[i]); }
inline int query(int x) { if(!sm[0]) return INF; int u=0,res=0; for(int i=30;i>=0;--i) { int to=(x>>i)&1; if(tr[u][to]&&sm[tr[u][to]]) u=tr[u][to]; else u=tr[u][to^1],res|=(1<<i); if(!u) return res; if(!u) return res; } return res; }}S[2];352 行未改动全部展开using namespace std;const int N=5e3+5,INF=2e9,mod=998244353;int n,m,k;ll dp0[N][N],dp1[N][N],g0[N][N],g1[N][N],s[N],fact[N],infact[N];int pre[N][2]; int pre[N][2];
inline void Add(ll &x,ll y) { x+=y;if(x>=mod) x-=mod;}59 行未改动