0_0_38506328_31518.cpp: In function 'void solve()': 0_0_38506328_31518.cpp:81:80: error: 'last' was not declared in this scope ans[i][j] = ans[i][j] + sam.tree[sam.last].len - sam.tree[sam.tree[last].fa].len; ^