关于01Trix模板
查看原帖
关于01Trix模板
141335
qwq2519楼主2021/10/20 18:32
struct Trie{
 int ch[N*32][2],tot,val[N*32];
 inline void insert(int x){
 	int p(0);
 	drp(i,31,0){
 		int t=(x>>i)&1;
 		if(!ch[p][t]) ch[p][t]=++tot;
 		p=ch[p][t];
	 }
	 val[p]=x;
 }
 inline int query(int x){
 	int p(0);
 	drp(i,31,0){
 		int t=(x>>i)&1;
 		if(ch[p][t^1]) p=ch[p][t^1];
 		else p=ch[p][t];
	 }
	 return val[p];
 }
}T;

把31改成32就会WA 3 4 5 7 ,why

2021/10/20 18:32
加载中...