CSP-201509-1-数列分段
解题代码
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;int n, t, maxSeg = 0;int main() {cin >> n;vector<int>list(n);for (int i = 0; i < n; i++){cin >> list[i];}auto last = unique(list.begin(), list.end());list.erase(last, list.end());cout << list.size();return 0;
}