// source identifier task_name
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define lck cout << "ick bmi 32.9\n"
#define cam_cs cout << "ick orz\n"
#define orz(x) cout << (x) << " orz\n"
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pcc pair<char, char>
#define ll long long
#define ull unsigned long long
#define ld long double
#define int long long
#define vi vector<int>
#define vll vector<long long>
#define vd vector<double>
#define vpii vector<pair<int, int>>
#define vpll vector<pair<long long, long long>>
#define vc vector<char>
#define vsc vector<string>
#define vb vector<bool>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define yes() cout << "Yes\n"
#define no() cout << "No\n"
#define impossible() cout << "Impossible\n"
template<typename T, typename V>
inline void print (const std::pair<T, V> &x) {std::cout << x.first << ' ' << x.second << '\n';}
template<typename T>
inline void print (const T &x) {std::cout << x << '\n';}
template<typename T>
inline void print (std::vector<T> &x) {for (auto &y : x) std::cout << y << " "; std::cout << '\n';}
inline void print () {std::cout << '\n';}
using namespace std;
const ld pi = acos(-1);
const ld eps = 1e-9;
const ll mod = 1000000007;
const ll inf = 1000000007;
clock_t T, NT;
inline double get_time() {NT = clock() - T; return (double)(NT) / CLOCKS_PER_SEC;}
void file_io (string x);
/*
>>>>>>>>>>>>>>>>>>>>>>>>>>END OF TEMPLATE HEADER<<<<<<<<<<<<<<<<<<<<<<<<
*/
void solve (/*int &tc*/) {
int n, len; cin >> n >> len;
vpii a(n); for (auto &[x, y] : a) cin >> x >> y;
double l = 1, r = 1.5e9, mid, curr, temp, lb, rb;
while (r - l > 1e-3) {
mid = (l + r) / 2;
curr = 0;
for (int i = 0; i < n; i++) {
temp = sqrt(mid * mid - a[i].se * a[i].se);
lb = a[i].fi - temp, rb = a[i].fi + temp;
if (lb <= curr) curr = rb;
if (curr >= len) break;
}
if (curr >= len) r = mid;
else l = mid;
}
cout << fixed << setprecision(4) << l << '\n';
}
signed main () {
cin.tie(0)->sync_with_stdio(false);
T = clock();
srand(time(NULL));
// file_io("");
int t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) {
solve(/*i*/);
// if (i != t) cout << '\n';
}
// while (true) {solve(t); t++;}
return 0;
}
// void file_io (string x = "x") {
// string i = x + ".in";
// freopen(i.c_str(), "r", stdin);
// string o = x + ".out";
// freopen(o.c_str(), "w", stdout);
// }
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Incorrect |
2 ms |
468 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
26 ms |
1492 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
26 ms |
1492 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
16 ms |
1620 KB |
Output is correct |
2 |
Correct |
17 ms |
1620 KB |
Output is correct |
3 |
Correct |
17 ms |
2516 KB |
Output is correct |
4 |
Incorrect |
39 ms |
3768 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
1876 KB |
Output is correct |
2 |
Correct |
22 ms |
3284 KB |
Output is correct |
3 |
Correct |
23 ms |
2900 KB |
Output is correct |
4 |
Incorrect |
46 ms |
3760 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1876 KB |
Output is correct |
2 |
Correct |
28 ms |
3284 KB |
Output is correct |
3 |
Correct |
21 ms |
2908 KB |
Output is correct |
4 |
Incorrect |
43 ms |
3588 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
8148 KB |
Output is correct |
2 |
Correct |
132 ms |
11140 KB |
Output is correct |
3 |
Correct |
114 ms |
11232 KB |
Output is correct |
4 |
Incorrect |
177 ms |
11288 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
112 ms |
8148 KB |
Output is correct |
2 |
Incorrect |
186 ms |
10636 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
130 ms |
9684 KB |
Output is correct |
2 |
Correct |
135 ms |
13084 KB |
Output is correct |
3 |
Correct |
130 ms |
12532 KB |
Output is correct |
4 |
Incorrect |
212 ms |
12488 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
133 ms |
9684 KB |
Output is correct |
2 |
Incorrect |
238 ms |
12292 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
158 ms |
11220 KB |
Output is correct |
2 |
Correct |
160 ms |
14656 KB |
Output is correct |
3 |
Correct |
149 ms |
13500 KB |
Output is correct |
4 |
Incorrect |
247 ms |
13656 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
159 ms |
11220 KB |
Output is correct |
2 |
Incorrect |
261 ms |
13332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
163 ms |
12756 KB |
Output is correct |
2 |
Correct |
207 ms |
16176 KB |
Output is correct |
3 |
Correct |
180 ms |
14904 KB |
Output is correct |
4 |
Incorrect |
324 ms |
15000 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
186 ms |
12756 KB |
Output is correct |
2 |
Incorrect |
299 ms |
14892 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
203 ms |
15956 KB |
Output is correct |
2 |
Correct |
215 ms |
18820 KB |
Output is correct |
3 |
Correct |
232 ms |
18172 KB |
Output is correct |
4 |
Incorrect |
359 ms |
16716 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
231 ms |
15956 KB |
Output is correct |
2 |
Incorrect |
363 ms |
17612 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |