完全贴合您的 C++ 题解代码逻辑!展现了 fa[][] 数组、tt[] 数组以及 gt[] 的生成过程与交互:
fa[][]
tt[]
gt[]
fa[i]
tt[i]
gt[i]
[l, r]
fa[l-1]
ans=tt[l-1]
gt[r+1]