//豆包批注 #include <iostream> #include <vector> #include <algorithm> using namespace std; typedef long long ll; bool cmp(const pair<ll, ll>& a, const pair<ll, ll>& b) { return a.first < b.first; // 按位置升序排序 } int main() { ios::sync_with_stdio(false); cin.tie(null...