思想不错,但感觉很鸡肋
https://www.cnblogs.com/aininot260/p/9304521.html
这道题运用了差分数组
http://codeforces.com/blog/entry/65079