#include<bits/stdc++.h> using namespace std; int n; static const int maxn=1e5+5; vector<pair<int,int> > solve; //根据题目定义的规则函数 bool cmp(pair<int,int> a, pair<int,int> b) { if( a.first!=b.first ) { return a.first<b.first; } else { ...