版本比较
根根治治
正文
增加 8 行删除 8 行
12 行未改动1314151617181920212223242526272829308 行未改动39404142434445464748495051525312 行未改动12 行未改动```cpp#include <bits/stdc++.h>using namespace std;const int N = 20000;const int S = 200;const int K = 2 * S + 1;const int Y = 2 * N + 1;int a[K][Y];int mp[K][Y];int main() {int n;cin >> n;vector<pair<int, int>> lines(n);for (int i = 0; i < n; i++) {int k, b;cin >> k >> b;lines[i] = {k, b};8 行未改动mp[x + S][y + N]++;}}}int q;cin >> q;while (q--) {int x, y;cin >> x >> y;if (abs(x) <= S) {cout << mp[x + S][y + N] << '\n';} else {int ans = 0;12 行未改动12 行未改动1314151617181920212223242526272829308 行未改动39404142434445464748495051525312 行未改动12 行未改动```cpp#include <bits/stdc++.h>using namespace std;const int N = 20000;const int S = 200;const int K = 2 * S + 1;const int Y = 2 * N + 1;int a[K][Y];int mp[K][Y];int main() {int n;cin >> n;vector<pair<int, int>> lines(n);for (int i = 0; i < n; i++) {int k, b;cin >> k >> b;lines[i] = {k, b};8 行未改动mp[x + S][y + N]++;}}}int q;cin >> q;while (q--) {int x, y;cin >> x >> y;if (abs(x) <= S) {cout << mp[x + S][y + N] << '\n';} else {int ans = 0;12 行未改动