版本比较
P2632 Explorer 题解
正文
增加 3 行删除 3 行
1212345642 行未改动4950515253535455565716 行未改动[可能更好的食用体验](/article/osy9gr3e) $|$ [题目传送门](/problem/P2632) $|$ [可能更好的食用体验](/article/osy9gr3e) $|$[题目传送门](/problem/P2632) $|$[我的其他题解](/user/523641/article?category=2)
------------### ${\color{#00CD00}\text{思路}}$42 行未改动 for(int i=1; i<n; i++) edge.push_back({dist(p1[i-1], p1[i]), i-1, i}); for(int i=1; i<m; i++) edge.push_back({dist(p2[i-1], p2[i]), i-1+n, i+n}); for(int i=0; i<n; i++){ auto [x, y] = p1[i]; double xx, yy; // 计算垂足坐标 double xx, yy; // 计算垂足坐标 if(kk == 0) xx = CX, yy = y; else if(k == 0) xx = x, yy = b; else xx = (y - kk * x - b) / (k - kk), yy = k * xx + b; int p = lower_bound(p2.begin(), p2.end(), Point{xx, yy}) - p2.begin();16 行未改动