可能是 ub。
u[++tot] = v[tot - 1] 是错误的,应该改为 u[tot] = v[++tot - 1]。
u[++tot] = v[tot - 1]
u[tot] = v[++tot - 1]
这个故事告诉我们要用结构体。