摘要:
int fail[N]; int trie[N][26],tot; int g[N]; void add(char *s,int x) { int p=0; for(int i=1;s[i];i++) { int c=s[i]-'a'; if(!trie[p][c]) trie[p][c]=++to 阅读全文
摘要:
D.Edge Weight Assignment "题目链接" 题目概述 大致意思就是给一颗树,让你构造边权,使得所有叶子节点两两间的距离(“距离”定义为$u,v$之间边权的异或和)为0。 For every two different leaves v1 and v2 of this tree, 阅读全文