字典树Trie
字典树Trie
Alan_Lowe
世上没有白走的路,每一步都算数!——狂神
展开
-
最大异或对【字典树 Trie】
最大异或对【字典树 Trie】 CH1602、ACwing143 #include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e7; int n,a,ans,num; struct Node{ int p; int son[2]; int flag; } tree[N + 5]; void build(){ int now = 0; for(in原创 2022-03-20 11:35:20 · 288 阅读 · 2 评论 -
前缀统计【字典树 Trie】
前缀统计【字典树 Trie】 CH1601、ACwing142 #include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e6; int n,m,num; string s; struct Node{ int p; int son[26]; int flag; } tree[N + 5]; void build(){ int now = 0;原创 2022-03-19 19:44:49 · 393 阅读 · 0 评论