constint N = 300010;//n和m的范围都是10^5,然后一共是n个x,然后2m个下标,因此最多坐标用了2m+n个,因此开3x10^5+10即可。
int n, m; int a[N], s[N];
vector<int> alls; vector<PII> add, query;
intfind(int x) { int l = 0, r = alls.size() - 1; while (l < r) { int mid = l + r >> 1; if (alls[mid] >= x) r = mid; else l = mid + 1; } return r + 1; }
vector<int>::iterator unique(vector<int> &a) { int j = 0; for (int i = 0; i < a.size(); i ++ ) if (!i || a[i] != a[i - 1]) a[j ++ ] = a[i]; // a[0] ~ a[j - 1] 所有a中不重复的数
return a.begin() + j; }
intmain() { cin >> n >> m; for (int i = 0; i < n; i ++ ) { int x, c; cin >> x >> c; add.push_back({x, c});
alls.push_back(x); }
for (int i = 0; i < m; i ++ ) { int l, r; cin >> l >> r; query.push_back({l, r});