跳到正文

题解

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

jinhao_wang约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年7月20日
收录
2026年3月3日
更新
2026年11月18日
篇幅
约 1 分钟
题目
P12130

版本

  1. v1当前

细究后可以发现,一次性到达在做圆周运动一定最优。

不妨以圆心为原点,过点 (233,666)(233,666) 做圆 AA。

根据距离公式 dis(P,Q)=(Px−Qx)2+(Py−Qy)2dis(P,Q)=\sqrt{(P_x-Q_x)^2 +(P_y-Q_y)^2} 得半径 r=2332+6662r=\sqrt {233^2+666^2}。

即小明须先沿 xx 轴移动 2332+6662\sqrt {233^2+666^2} 单位,再沿圆 AA 移动 arctan⁡(666/233)\arctan(666/233) 米。

所以,总距离:

S=round⁡(2332+6662×(arctan⁡(666/233)+1))≈1576S=\operatorname{round}(\sqrt{233^2+666^2} \times (\arctan(666/233)+1)) \approx 1576

AC 代码如下:

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

简单草率!

原文