提供一组能卡掉我的某次 错误SAM (TLE)的题解,错误的原因:在克隆完节点沿着后缀连接往回跳的时候,没有在当前节点的出边不是被克隆的节点的时候及时 break。
break
GEN 如下:
#include <bits/stdc++.h> using namespace std; int main() { cout << 'b'; for (int i = 2; i <= 2e5; i++) { cout << 'a'; } cout << '\n'; }
正确答案:
10000000000