版本比较
【题解】P3699 [CQOI2017]小Q的草稿
正文
增加 8 行删除 8 行
32 行未改动3334353637373839394041424344454646474849505152535455555657585910 行未改动7071727374747576777878798081825 行未改动88899091929293949495969732 行未改动signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr);
int n, m;
cin >> n >> m; for (int i = 0; i < n; i++) cin >> p[i]; for (int i = 0; i < m; i++) cin >> a[i] >> b[i] >> c[i]; qc.reserve(n + m * 3);
int ans = 0; for (int i = 0; i < n; i++) { qc.clear(); for (int j = 0; j < i; j++) qc.emplace_back(point{ 2 * p[i].x - p[j].x, 2 * p[i].y - p[j].y }, j); for (int j = i + 1; j < n; j++) qc.emplace_back(p[j], j);
for (int j = 0; j < m; j++) { point x[3] = { a[j], b[j], c[j] }; sort(x, x + 3, [&](point lhs, point rhs) {10 行未改动 qc.emplace_back(x[2], n); qc.emplace_back(x[0], -1); } }
for (auto &[pt, _] : qc) pt.x -= p[i].x, pt.y -= p[i].y; sort(qc.begin(), qc.end());
int cnt = 0; for (auto [_, x] : qc) { if (x == -1)5 行未改动 else f[i][x] = cnt; } }
cout << ans << endl;
return 0;}```