Unverified Commit c1c7e556 authored by abc1763613206's avatar abc1763613206 Committed by GitHub
Browse files

Update divide-combine.md

parent b3fe369b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

我们由一个小清新的问题引入:

> 对于一个 1-n 的排列,我们称一个值域连续的区间为段。问一个排列的段的个数。比如,$\{5 ,3 ,4, 1 ,2\}$ 的段有:$[1,1],[2,2],[3,3],[4,4],[5,5],[2,3],[4,5],[1,3],[2,5],[1,5]$。
> 对于一个 $1-n$ 的排列,我们称一个值域连续的区间为段。问一个排列的段的个数。比如,$\{5 ,3 ,4, 1 ,2\}$ 的段有:$[1,1],[2,2],[3,3],[4,4],[5,5],[2,3],[4,5],[1,3],[2,5],[1,5]$。

看到这个东西,感觉要维护区间的值域集合,复杂度好像挺不友好的。线段树可以查询某个区间是否为段,但不太能统计段的个数(也可能是因为我太菜了不会用线段树)