版本比较
论如何用六级算法爆切 [CSP-S 2025] 谐音替换
正文
增加 6 行删除 4 行
88 行未改动89909192939495969798991007 行未改动10810911011111211311411511611 行未改动88 行未改动int i, cur = 0;for (i=1; i<=nq; i++) hashes [i] = next_hash (hashes [i-1], ord (s [nq-i]));for (i=nq; i<=xq; i++){jnode (cur, ord (s [i]));jnode (cur, ord (t [i]));}jnode (cur, 26);int ans = 0;for (i=xq; i<len; i++){if (trie [cur] .pt != 0)7 行未改动else r = m-1;}ans += cpn.mp [hashes [l]];}E: if (i != len-1) jnode (cur, ord (s [i+1]));}return ans;}int main (void)11 行未改动88 行未改动89909192939495969798991007 行未改动10810911011111211311411511611711811 行未改动88 行未改动int i, cur = 0;for (i=1; i<=nq; i++) hashes [i] = next_hash (hashes [i-1], ord (s [nq-i]));for (i=nq; i<=xq; i++){if (0 == (cur = trie [cur] .nxt [ord (s [i])])) return 0;if (0 == (cur = trie [cur] .nxt [ord (t [i])])) return 0;}if (0 == (cur = trie [cur] .nxt [26])) return 0;int ans = 0;for (i=xq; i<len; i++){if (trie [cur] .pt != 0)7 行未改动else r = m-1;}ans += cpn.mp [hashes [l]];}if (i != len-1)if (0 == (cur = trie [cur] .nxt [ord (t [i+1])]))break;}return ans;}int main (void)11 行未改动