Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136166 | 陈家宝 | 交叉的梯子 | C++ | 通过 | 100 | 362 MS | 244 KB | 440 | 2024-03-08 13:19:29 |
#include<bits/stdc++.h> #define int long long using namespace std; double x, y, c; bool check(double l){ double a = sqrt(x*x-l*l), b = sqrt(y*y-l*l); return (a+b)*c < a*b; } signed main() { while (cin >> x >> y >> c) { double l=0, r=min(x, y); while (l <= r) { double mid = (l + r) / 2.; if (check(mid))l = mid+1e-4; else r = mid-1e-4; } cout << fixed << setprecision(3) << l << endl; } return 0; }