899E - Segments Removal 思路:priority_queue+pair 代码: #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define mem(a,b) memset(a,b,sizeof(a)) ; int pre[N]; int nxt[N]; int col[N]; int num[N]; p…
题目 Vasya has an array of integers of length n. Vasya performs the following operations on the array: on each step he finds the longest segment of consecutive equal integers (the leftmost, if there are several such segments) and removes it. For exampl…
D. Vika and Segments 题目连接: http://www.codeforces.com/contest/610/problem/D Description Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordinate system on this sheet and drew n black hor…
C. Four Segments 题目连接: http://codeforces.com/contest/14/problem/C Description Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while,…