版本比较
题解:P16011 [CCO 2016 Day 2] Zombie Apocalypse 僵尸启示录
正文
增加 2 行删除 2 行
23 行未改动2425262728293031322 行未改动35363738394041424346 行未改动23 行未改动//计算距离 ≤ d 的格子总数ll cal(int d){if(d < 0)return 0;//存储每个僵尸的覆盖矩形vector<array<int, 4>> a;for(auto [r, c] : z){int t = max(1, r - d);2 行未改动int rr = min(m, (ll)c + d);if(t <= b && l <= rr)a.push_back({t, b, l, rr});}if(a.empty())return 0;//收集所有y坐标用于扫描线vector<int> ys = {1, (int)n + 1};for(auto [t, b, l, rr] : a){ys.push_back(t);46 行未改动23 行未改动2425262728293031322 行未改动35363738394041424346 行未改动23 行未改动//计算距离 ≤ d 的格子总数ll cal(int d){if(d < 0)return 0;//存储每个僵尸的覆盖矩形vector<array<int, 4>> a;for(auto [r, c] : z){int t = max(1, r - d);2 行未改动int rr = min(m, (ll)c + d);if(t <= b && l <= rr)a.push_back({t, b, l, rr});}if(a.empty())return 0;//收集所有y坐标用于扫描线vector<int> ys = {1, (int)n + 1};for(auto [t, b, l, rr] : a){ys.push_back(t);46 行未改动