priority_queue
默认大根堆 --->自动排序 头最大 priority_queue
, greater > 小根堆 --->自动排序 头最小
#includeusing namespace std; typedef long long ll; const int N=2e9; #define x first #define y second typedef pair PII; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin>>n; vector a; for(int i=0; i >x>>y; a.push_back({x,y}); } sort(a.begin(),a.end()); //整体就是 最小的时间也加不进去 就只能开个新的了 priority_queue ,greater >q;//小根堆 队头值最小 for(auto i:a) { if(q.empty()||q.top()>=i.x)q.push(i.y); else { q.pop(); q.push(i.y); } } cout<



