# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
906100 |
2024-01-13T13:56:10 Z |
Ludissey |
Mobile (BOI12_mobile) |
C++14 |
|
783 ms |
35440 KB |
#include <bits/stdc++.h>
using namespace std;
#define int double
double dist(double x1, double y1, double x2, double y2){
double dist=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
return dist;
}
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int N,L; cin >> N >> L;
vector<pair<double,double>> a(N);
for (int i = 0; i < N; i++){
cin >> a[i].first >> a[i].second;
a[i].second=abs(a[i].second);
}
int l=0,r=L;
while(r-l>0.0003){
int mid=(l+r)/2;
int rght=0;
for (int i = 0; i < N; i++)
{
int pnt1=a[i].first-sqrt(pow(mid,2)-pow(a[i].second,2)),pnt2=a[i].first+sqrt(pow(mid,2)-pow(a[i].second,2));
if(mid>=a[i].second){
if(pnt1<=rght) rght=max(rght, pnt2);
}
}
if(rght>=L) {
r=mid;
}else{
l=mid;
}
}
cout << setprecision(5) << fixed << (double)l << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
5 |
Correct |
5 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
1628 KB |
Output is correct |
2 |
Correct |
36 ms |
1628 KB |
Output is correct |
3 |
Correct |
27 ms |
1116 KB |
Output is correct |
4 |
Correct |
52 ms |
1628 KB |
Output is correct |
5 |
Correct |
24 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
1624 KB |
Output is correct |
2 |
Correct |
42 ms |
2140 KB |
Output is correct |
3 |
Correct |
51 ms |
2652 KB |
Output is correct |
4 |
Correct |
58 ms |
2644 KB |
Output is correct |
5 |
Correct |
64 ms |
3084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
40 ms |
1628 KB |
Output is correct |
2 |
Correct |
41 ms |
1628 KB |
Output is correct |
3 |
Correct |
39 ms |
2652 KB |
Output is correct |
4 |
Correct |
79 ms |
3924 KB |
Output is correct |
5 |
Correct |
51 ms |
2616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
1880 KB |
Output is correct |
2 |
Correct |
48 ms |
1884 KB |
Output is correct |
3 |
Correct |
50 ms |
1884 KB |
Output is correct |
4 |
Correct |
96 ms |
1880 KB |
Output is correct |
5 |
Correct |
71 ms |
3164 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
1880 KB |
Output is correct |
2 |
Correct |
48 ms |
1884 KB |
Output is correct |
3 |
Correct |
45 ms |
1880 KB |
Output is correct |
4 |
Correct |
86 ms |
1880 KB |
Output is correct |
5 |
Correct |
62 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
226 ms |
8284 KB |
Output is correct |
2 |
Correct |
245 ms |
8284 KB |
Output is correct |
3 |
Correct |
227 ms |
8284 KB |
Output is correct |
4 |
Correct |
377 ms |
8280 KB |
Output is correct |
5 |
Correct |
332 ms |
15060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
251 ms |
8280 KB |
Output is correct |
2 |
Correct |
352 ms |
8280 KB |
Output is correct |
3 |
Correct |
238 ms |
14032 KB |
Output is correct |
4 |
Correct |
401 ms |
17492 KB |
Output is correct |
5 |
Correct |
329 ms |
15576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
285 ms |
9820 KB |
Output is correct |
2 |
Correct |
292 ms |
9824 KB |
Output is correct |
3 |
Correct |
275 ms |
9816 KB |
Output is correct |
4 |
Correct |
459 ms |
9820 KB |
Output is correct |
5 |
Correct |
415 ms |
17748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
323 ms |
9816 KB |
Output is correct |
2 |
Correct |
424 ms |
9820 KB |
Output is correct |
3 |
Correct |
299 ms |
9820 KB |
Output is correct |
4 |
Correct |
470 ms |
21356 KB |
Output is correct |
5 |
Correct |
408 ms |
18412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
324 ms |
11356 KB |
Output is correct |
2 |
Correct |
362 ms |
11356 KB |
Output is correct |
3 |
Correct |
321 ms |
11352 KB |
Output is correct |
4 |
Correct |
546 ms |
11352 KB |
Output is correct |
5 |
Correct |
446 ms |
20308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
347 ms |
11352 KB |
Output is correct |
2 |
Correct |
480 ms |
11356 KB |
Output is correct |
3 |
Correct |
337 ms |
19540 KB |
Output is correct |
4 |
Correct |
549 ms |
24984 KB |
Output is correct |
5 |
Correct |
473 ms |
21524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
380 ms |
12892 KB |
Output is correct |
2 |
Correct |
389 ms |
12888 KB |
Output is correct |
3 |
Correct |
361 ms |
12888 KB |
Output is correct |
4 |
Correct |
615 ms |
12892 KB |
Output is correct |
5 |
Correct |
530 ms |
23988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
408 ms |
12892 KB |
Output is correct |
2 |
Correct |
561 ms |
12892 KB |
Output is correct |
3 |
Correct |
384 ms |
22320 KB |
Output is correct |
4 |
Correct |
614 ms |
28244 KB |
Output is correct |
5 |
Correct |
556 ms |
24492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
472 ms |
15960 KB |
Output is correct |
2 |
Correct |
524 ms |
15960 KB |
Output is correct |
3 |
Correct |
463 ms |
15964 KB |
Output is correct |
4 |
Correct |
783 ms |
35204 KB |
Output is correct |
5 |
Correct |
668 ms |
29912 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
519 ms |
15960 KB |
Output is correct |
2 |
Correct |
679 ms |
15964 KB |
Output is correct |
3 |
Correct |
523 ms |
28408 KB |
Output is correct |
4 |
Correct |
782 ms |
35440 KB |
Output is correct |
5 |
Correct |
709 ms |
30840 KB |
Output is correct |