#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#define ll long long
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define shit short int
#define pii pair<int, int>
#define NEK 2147483640
#define mod 1000000007
#define mod2 1000000009
#define rsz resize
#define prv1 43
#define prv2 47
#define D 8
using namespace std;
int main() {
double n, asd;
cin >> n >> asd;
vec<pii> p;
For(i, n) {
double x, y;
cin >> x >> y;
if (p.size() > 0) {
if (x == p.back().ff && y > 0 && p.back().ss > 0) continue;
if (x == p.back().ff && y < 0) p.pop_back();
}
p.push_back({ x, y });
}
double l = 0;
double r = 1414213570;
while ((r - l) > (0.0001)) {
double mid = (l + r) / 2;
double k = 0;
For(i, p.size()) {
double d = sqrt(mid * mid - p[i].ss * p[i].ss);
double s = p[i].ff - d;
double e = p[i].ff + d;
if (s > k) continue;
k = max(k, e);
}
if (k >= asd) r = mid;
else l = mid;
}
cout << fixed << setprecision(3);
cout << l << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
492 KB |
Output is correct |
2 |
Correct |
4 ms |
432 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Incorrect |
7 ms |
492 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
344 KB |
Output is correct |
2 |
Correct |
4 ms |
348 KB |
Output is correct |
3 |
Correct |
4 ms |
348 KB |
Output is correct |
4 |
Incorrect |
4 ms |
540 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
1340 KB |
Output is correct |
2 |
Incorrect |
85 ms |
980 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
592 KB |
Output is correct |
2 |
Correct |
47 ms |
980 KB |
Output is correct |
3 |
Incorrect |
66 ms |
1480 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
1488 KB |
Output is correct |
2 |
Incorrect |
54 ms |
984 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
69 ms |
964 KB |
Output is correct |
2 |
Incorrect |
118 ms |
976 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
74 ms |
1556 KB |
Output is correct |
2 |
Incorrect |
61 ms |
1044 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
279 ms |
6076 KB |
Output is correct |
2 |
Correct |
315 ms |
8276 KB |
Output is correct |
3 |
Correct |
276 ms |
7588 KB |
Output is correct |
4 |
Incorrect |
536 ms |
14008 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
300 ms |
436 KB |
Output is correct |
2 |
Correct |
424 ms |
6112 KB |
Output is correct |
3 |
Incorrect |
253 ms |
1484 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
347 ms |
9400 KB |
Output is correct |
2 |
Correct |
357 ms |
344 KB |
Output is correct |
3 |
Incorrect |
334 ms |
420 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
367 ms |
348 KB |
Output is correct |
2 |
Correct |
518 ms |
10424 KB |
Output is correct |
3 |
Incorrect |
310 ms |
1480 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
388 ms |
10296 KB |
Output is correct |
2 |
Correct |
428 ms |
344 KB |
Output is correct |
3 |
Correct |
410 ms |
348 KB |
Output is correct |
4 |
Incorrect |
767 ms |
10168 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
466 ms |
592 KB |
Output is correct |
2 |
Correct |
573 ms |
9912 KB |
Output is correct |
3 |
Incorrect |
380 ms |
1564 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
433 ms |
10168 KB |
Output is correct |
2 |
Correct |
451 ms |
512 KB |
Output is correct |
3 |
Correct |
448 ms |
600 KB |
Output is correct |
4 |
Incorrect |
890 ms |
10676 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
555 ms |
464 KB |
Output is correct |
2 |
Correct |
729 ms |
10048 KB |
Output is correct |
3 |
Incorrect |
468 ms |
1544 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
601 ms |
10016 KB |
Output is correct |
2 |
Correct |
625 ms |
600 KB |
Output is correct |
3 |
Incorrect |
569 ms |
348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
608 ms |
684 KB |
Output is correct |
2 |
Correct |
840 ms |
10424 KB |
Output is correct |
3 |
Incorrect |
604 ms |
2496 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |