题解 | #游游开车出游#求导法
游游开车出游
https://www.nowcoder.com/practice/667369e08b2f498c89a935df0af921b3
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
using ll=long long;
int main() {
ll v,x,y;
cin>>v>>x>>y;
if(x*y<=v*v){
cout<<setprecision(10)<<y*1.0/v;
}else{
cout<<setprecision(10)<<(2.0*sqrt(x*y*1.0)-v)*1.0/x;
}
}
// 64 位输出请用 printf("%lld")
由于鼠鼠没有学过三分,就使用初等数学方法解决了,说来搞笑的是,基本不等式早就还给高中老师了,只能使用求导法。
查看5道真题和解析