正文
增加 7 行删除 7 行
39 行未改动404142434445464748495014 行未改动65666768697071727374757677783 行未改动82838485868788899091929394959697989939 行未改动signed main(){ios_base::sync_with_stdio(false);cin.tie(nullptr);int n, m;cin >> n >> m;for (int i = 0; i < n; i++){ll sr, er, sc, ec, r, c;14 行未改动b.push_back(c);op.emplace_back(r, c, 2, i);}sort(all(op));sort(all(b));b.erase(unique(all(b)), end(b));auto s = [&](ll x) { return lower_bound(all(b), x) - begin(b); };auto lowbit = [](int x) { return x & -x; };auto add = [&](int x, int v) {for (x++; x <= ssz(b); x += lowbit(x))tr[x] += v;3 行未改动for (x++; x; x -= lowbit(x))res += tr[x];return res;};for (auto [r, c, ty, v] : op){if (ty == 1)add(s(c), v);elseans[v] = get(s(c));}for (int i = 0; i < m; i++)cout << ans[i] << "\n";return 0;}```39 行未改动404142434445464748495014 行未改动65666768697071727374757677783 行未改动82838485868788899091929394959697989939 行未改动signed main(){ios_base::sync_with_stdio(false);cin.tie(nullptr);int n, m;cin >> n >> m;for (int i = 0; i < n; i++){ll sr, er, sc, ec, r, c;14 行未改动b.push_back(c);op.emplace_back(r, c, 2, i);}sort(all(op));sort(all(b));b.erase(unique(all(b)), end(b));auto s = [&](ll x) { return lower_bound(all(b), x) - begin(b); };auto lowbit = [](int x) { return x & -x; };auto add = [&](int x, int v) {for (x++; x <= ssz(b); x += lowbit(x))tr[x] += v;3 行未改动for (x++; x; x -= lowbit(x))res += tr[x];return res;};for (auto [r, c, ty, v] : op){if (ty == 1)add(s(c), v);elseans[v] = get(s(c));}for (int i = 0; i < m; i++)cout << ans[i] << "\n";return 0;}```