#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define endl '\n'
#define mask(i) (1LL << (i))
#define task "name"
#define ld long double
#define ull unsigned long long
using namespace std;
const ll mxN = 220797 + 7;
const ll inf = 1e9 + 277;
const ll mod = 2147483648;
const ll infll = 1e18 + 7;
const ll base = 307;
template <typename T1, typename T2> bool minimize(T1 &a, T2 b) {
if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maximize(T1 &a, T2 b) {
if (a < b) {a = b; return true;} return false;
}
struct Point{
int x , y;
} a[mxN];
int n , L;
bool ok(ld x)
{
vector<pair<ld , ld>> seg;
for(int i = 1 ; i <= n ; i++) {
ld h = abs(a[i].y);
if(h > x) continue;
if(h == x) seg.push_back({a[i].x , a[i].x});
if(h < x) {
ld leng = sqrt(x * x - h * h);
ld l = a[i].x - leng;
ld r = a[i].x + leng;
seg.push_back({l , r});
}
}
sort(seg.begin() , seg.end());
ld minl = 0;
for(auto it : seg) {
ld l = it.fi;
ld r = it.se;
if(l <= minl) minl = max(minl , r);
}
return minl >= L;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("task.inp" , "r" , stdin);
// freopen("task.out" , "w" , stdout);
cin >> n >> L;
for(int i = 1 ; i <= n ; i++) cin >> a[i].x >> a[i].y;
ld l = 0 , r = 1.5e9;
for(int i = 1 ; i <= 100 ; i++) {
ld mid = (l + r) / 2;
if(ok(mid)) r = mid;
else l = mid;
}
cout << fixed << setprecision(6) << l;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
2 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
560 KB |
Output is correct |
2 |
Correct |
25 ms |
568 KB |
Output is correct |
3 |
Correct |
10 ms |
460 KB |
Output is correct |
4 |
Correct |
22 ms |
588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
788 KB |
Output is correct |
2 |
Correct |
55 ms |
980 KB |
Output is correct |
3 |
Correct |
63 ms |
784 KB |
Output is correct |
4 |
Correct |
15 ms |
784 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
788 KB |
Output is correct |
2 |
Correct |
55 ms |
968 KB |
Output is correct |
3 |
Correct |
67 ms |
784 KB |
Output is correct |
4 |
Correct |
17 ms |
788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
61 ms |
784 KB |
Output is correct |
2 |
Correct |
55 ms |
848 KB |
Output is correct |
3 |
Correct |
77 ms |
892 KB |
Output is correct |
4 |
Correct |
14 ms |
872 KB |
Output is correct |
5 |
Correct |
20 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
506 ms |
7408 KB |
Output is correct |
2 |
Execution timed out |
1090 ms |
8620 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
339 ms |
7520 KB |
Output is correct |
2 |
Correct |
269 ms |
7212 KB |
Output is correct |
3 |
Correct |
280 ms |
7620 KB |
Output is correct |
4 |
Correct |
240 ms |
7572 KB |
Output is correct |
5 |
Correct |
217 ms |
7816 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1089 ms |
8100 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1087 ms |
8500 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1092 ms |
8452 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
42 ms |
3904 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
59 ms |
3836 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
40 ms |
3904 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
56 ms |
3912 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
41 ms |
3844 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
54 ms |
3936 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
39 ms |
3908 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
54 ms |
3924 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
39 ms |
3896 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
56 ms |
3924 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |