Codeforces C. Monsters And Spells
思路:本题比较难想,但一旦想到是区间合并的话就很简单了,对于每个数就扩成一个区间去处理就完事了,合并完区间后会发现每个区间的长度之和就是答案Code:#include<iostream>#include<cstring>#include<algorithm>#include<vector>using namespace std;typedef pair<int,int&a