# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
919300 |
2024-01-31T14:41:11 Z |
hqminhuwu |
Mobile (BOI12_mobile) |
C++14 |
|
956 ms |
35460 KB |
#include <bits/stdc++.h>
#define forr(_a,_b,_c) for(_a = (_b); _a <= (_c); ++_a)
#define ford(_a,_b,_c) for(_a = (_b) + 1; _a --> (_c);)
#define forf(_a,_b,_c) for(_a = (_b); _a < (_c); ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"
using namespace std;
const int N = 1e6 + 5;
const ll oo = 1e9;
const ll mod = 1e9 + 7;
int n, ff, i;
pll a[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef hqm
freopen(file".inp", "r", stdin); freopen(file".out", "w", stdout);
#endif
cin >> n >> ff;
forr (i, 1, n)
cin >> a[i].st >> a[i].nd;
double l = 1, r = 2 * oo;
int cnt = 100;
while (cnt--){
double mid = (r + l) / 2, qq = 0;
forr (i, 1, n){
double dis = sqrt(mid * mid - a[i].nd * a[i].nd);
if (a[i].st - dis <= qq)
qq = max (qq, a[i].st + dis);
}
if (qq >= ff)
r = mid;
else l = mid;
}
cout << fixed << setprecision(5) << l;
return 0;
}
/*
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
2 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
600 KB |
Output is correct |
3 |
Correct |
3 ms |
600 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
5 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
3 |
Correct |
4 ms |
344 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
73 ms |
2672 KB |
Output is correct |
2 |
Correct |
35 ms |
2648 KB |
Output is correct |
3 |
Correct |
27 ms |
2648 KB |
Output is correct |
4 |
Correct |
45 ms |
2696 KB |
Output is correct |
5 |
Correct |
29 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
2648 KB |
Output is correct |
2 |
Correct |
47 ms |
2648 KB |
Output is correct |
3 |
Correct |
52 ms |
2672 KB |
Output is correct |
4 |
Correct |
59 ms |
2648 KB |
Output is correct |
5 |
Correct |
55 ms |
2672 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
2652 KB |
Output is correct |
2 |
Correct |
37 ms |
2648 KB |
Output is correct |
3 |
Correct |
39 ms |
2652 KB |
Output is correct |
4 |
Correct |
72 ms |
2676 KB |
Output is correct |
5 |
Correct |
49 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
2668 KB |
Output is correct |
2 |
Correct |
52 ms |
2648 KB |
Output is correct |
3 |
Correct |
47 ms |
2896 KB |
Output is correct |
4 |
Correct |
62 ms |
2648 KB |
Output is correct |
5 |
Correct |
71 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
2648 KB |
Output is correct |
2 |
Correct |
46 ms |
2648 KB |
Output is correct |
3 |
Correct |
48 ms |
2896 KB |
Output is correct |
4 |
Correct |
66 ms |
2676 KB |
Output is correct |
5 |
Correct |
61 ms |
2672 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
207 ms |
8824 KB |
Output is correct |
2 |
Correct |
231 ms |
8784 KB |
Output is correct |
3 |
Correct |
222 ms |
8792 KB |
Output is correct |
4 |
Correct |
308 ms |
8784 KB |
Output is correct |
5 |
Correct |
287 ms |
8784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
8824 KB |
Output is correct |
2 |
Correct |
566 ms |
8824 KB |
Output is correct |
3 |
Correct |
246 ms |
8828 KB |
Output is correct |
4 |
Correct |
339 ms |
9040 KB |
Output is correct |
5 |
Correct |
308 ms |
8784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
244 ms |
11592 KB |
Output is correct |
2 |
Correct |
300 ms |
20168 KB |
Output is correct |
3 |
Correct |
292 ms |
19456 KB |
Output is correct |
4 |
Correct |
381 ms |
22784 KB |
Output is correct |
5 |
Correct |
392 ms |
18872 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
306 ms |
12304 KB |
Output is correct |
2 |
Correct |
660 ms |
18816 KB |
Output is correct |
3 |
Correct |
278 ms |
17724 KB |
Output is correct |
4 |
Correct |
393 ms |
22784 KB |
Output is correct |
5 |
Correct |
371 ms |
19624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
281 ms |
14512 KB |
Output is correct |
2 |
Correct |
333 ms |
23788 KB |
Output is correct |
3 |
Correct |
322 ms |
23164 KB |
Output is correct |
4 |
Correct |
465 ms |
26468 KB |
Output is correct |
5 |
Correct |
431 ms |
21976 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
344 ms |
16024 KB |
Output is correct |
2 |
Correct |
720 ms |
22188 KB |
Output is correct |
3 |
Correct |
355 ms |
21332 KB |
Output is correct |
4 |
Correct |
502 ms |
26328 KB |
Output is correct |
5 |
Correct |
444 ms |
23084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
363 ms |
17232 KB |
Output is correct |
2 |
Correct |
384 ms |
27404 KB |
Output is correct |
3 |
Correct |
381 ms |
26628 KB |
Output is correct |
4 |
Correct |
572 ms |
30648 KB |
Output is correct |
5 |
Correct |
518 ms |
26248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
385 ms |
19972 KB |
Output is correct |
2 |
Correct |
797 ms |
25568 KB |
Output is correct |
3 |
Correct |
405 ms |
24512 KB |
Output is correct |
4 |
Correct |
556 ms |
30544 KB |
Output is correct |
5 |
Correct |
506 ms |
26580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
466 ms |
20480 KB |
Output is correct |
2 |
Correct |
502 ms |
31468 KB |
Output is correct |
3 |
Correct |
475 ms |
30776 KB |
Output is correct |
4 |
Correct |
646 ms |
35316 KB |
Output is correct |
5 |
Correct |
634 ms |
29588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
478 ms |
24080 KB |
Output is correct |
2 |
Correct |
956 ms |
29452 KB |
Output is correct |
3 |
Correct |
516 ms |
28392 KB |
Output is correct |
4 |
Correct |
689 ms |
35460 KB |
Output is correct |
5 |
Correct |
629 ms |
30856 KB |
Output is correct |