题 OwO http://acm.hdu.edu.cn/showproblem.php?pid=6059 解 由于每个数字最多是30位,枚举数字每一位考虑, 建一棵记录前缀(位的前缀,比如10拆成1010,那么就把1010从前往后插入这个字典树中)的字典树, nxt记录其后继,gcnt记录这个节点添加的个数,ng代表不符合要减去的个数(后文会提到) tol[i][j]代表第i位的j(j=0,1)当前数量 枚举Ak的每一位,对于Ak的第t位(记作Ak[t]) 1. 如果Ak[t]==1,那么对答案…