树状数组+DFS