版本比较
题解:P14363 [CSP-S 2025] 谐音替换 / replace(民间数据)
正文
增加 2 行删除 2 行
49 行未改动5051525354545556575841 行未改动1001011021031041041051061071082 行未改动49 行未改动#define left wshnl#define right wkqnlusing namespace std;const int N=200005;const int M=5e6+5; const int M=5e6+5;mt19937_64 rnd(time(0));int n,q,ans[N];ull w[M];int ch[M][30],trie=1;ull base=131;41 行未改动 H=H*base+y[j]; if(j<r)continue; e[u].push_back((event){i,1,H*w[r-l+1]}); e[v].push_back((event){i,-1,H*w[r-l+1]}); } } } dfs(1); for(int i=1;i<=q;i++)cout<<ans[i]<<"\n"; return 0;2 行未改动