题解:P12130 [蓝桥杯 2025 省 B] 移动距离

· · 题解

做题策略:先水平移动到足够大的半径 r,使得目标点 (233,666) 位于圆周上;

然后沿圆周移动所需角度 \theta=\operatorname{atan}2(666,233)

总距离=水平移动距离 (r)+ 圆周移动距离 (r\theta)

最优解出现在 r=\sqrt{233²+666²} 时。

计算:半径 r=\sqrt{233²+666^2}\approx706.155

角度 \theta=\operatorname{atan}(666/233)\approx1.2310 弧度;

总距离 =r+r\theta\approx706.155+706.155\times1.2310\approx1576.448
四舍五入得 1576

#include<bits/stdc++.h>
using namespace std;
int main(){
    printf("1576");
    return 0;
}