# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
906202 |
2024-01-13T15:26:19 Z |
Ludissey |
Mobile (BOI12_mobile) |
C++14 |
|
824 ms |
15964 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;
int ans;
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;
ans=r;
}else{
l=mid;
}
}
cout << setprecision(5) << fixed << (double)ans << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
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 |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
600 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
344 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
344 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 |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
5 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
344 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
1628 KB |
Output is correct |
2 |
Correct |
38 ms |
1624 KB |
Output is correct |
3 |
Correct |
25 ms |
1116 KB |
Output is correct |
4 |
Correct |
53 ms |
1628 KB |
Output is correct |
5 |
Correct |
26 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
1628 KB |
Output is correct |
2 |
Correct |
41 ms |
1372 KB |
Output is correct |
3 |
Correct |
51 ms |
1628 KB |
Output is correct |
4 |
Correct |
55 ms |
1624 KB |
Output is correct |
5 |
Correct |
70 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
37 ms |
1624 KB |
Output is correct |
2 |
Correct |
43 ms |
1624 KB |
Output is correct |
3 |
Correct |
41 ms |
1624 KB |
Output is correct |
4 |
Correct |
78 ms |
1884 KB |
Output is correct |
5 |
Correct |
51 ms |
1628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
1884 KB |
Output is correct |
2 |
Correct |
47 ms |
2136 KB |
Output is correct |
3 |
Correct |
48 ms |
1880 KB |
Output is correct |
4 |
Correct |
79 ms |
1884 KB |
Output is correct |
5 |
Correct |
67 ms |
1884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
51 ms |
1880 KB |
Output is correct |
2 |
Correct |
48 ms |
1884 KB |
Output is correct |
3 |
Correct |
51 ms |
1884 KB |
Output is correct |
4 |
Correct |
85 ms |
1880 KB |
Output is correct |
5 |
Correct |
69 ms |
1884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
227 ms |
8280 KB |
Output is correct |
2 |
Correct |
241 ms |
8284 KB |
Output is correct |
3 |
Correct |
229 ms |
8288 KB |
Output is correct |
4 |
Correct |
383 ms |
8284 KB |
Output is correct |
5 |
Correct |
328 ms |
8280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
251 ms |
8280 KB |
Output is correct |
2 |
Correct |
358 ms |
8484 KB |
Output is correct |
3 |
Correct |
231 ms |
8284 KB |
Output is correct |
4 |
Correct |
382 ms |
8284 KB |
Output is correct |
5 |
Correct |
370 ms |
8280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
279 ms |
9820 KB |
Output is correct |
2 |
Correct |
293 ms |
9820 KB |
Output is correct |
3 |
Correct |
276 ms |
9820 KB |
Output is correct |
4 |
Correct |
824 ms |
9816 KB |
Output is correct |
5 |
Correct |
375 ms |
9816 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
303 ms |
10016 KB |
Output is correct |
2 |
Correct |
420 ms |
9820 KB |
Output is correct |
3 |
Correct |
289 ms |
9820 KB |
Output is correct |
4 |
Correct |
472 ms |
9820 KB |
Output is correct |
5 |
Correct |
404 ms |
9816 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
332 ms |
11352 KB |
Output is correct |
2 |
Correct |
345 ms |
11352 KB |
Output is correct |
3 |
Correct |
321 ms |
11352 KB |
Output is correct |
4 |
Correct |
578 ms |
11352 KB |
Output is correct |
5 |
Correct |
449 ms |
11356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
368 ms |
11356 KB |
Output is correct |
2 |
Correct |
480 ms |
11352 KB |
Output is correct |
3 |
Correct |
337 ms |
11356 KB |
Output is correct |
4 |
Correct |
536 ms |
11352 KB |
Output is correct |
5 |
Correct |
465 ms |
11352 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
371 ms |
12888 KB |
Output is correct |
2 |
Correct |
390 ms |
12888 KB |
Output is correct |
3 |
Correct |
365 ms |
12892 KB |
Output is correct |
4 |
Correct |
619 ms |
12888 KB |
Output is correct |
5 |
Correct |
513 ms |
12888 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
410 ms |
12892 KB |
Output is correct |
2 |
Correct |
564 ms |
12892 KB |
Output is correct |
3 |
Correct |
372 ms |
12888 KB |
Output is correct |
4 |
Correct |
628 ms |
12892 KB |
Output is correct |
5 |
Correct |
536 ms |
12892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
457 ms |
15964 KB |
Output is correct |
2 |
Correct |
491 ms |
15960 KB |
Output is correct |
3 |
Correct |
457 ms |
15964 KB |
Output is correct |
4 |
Correct |
769 ms |
15960 KB |
Output is correct |
5 |
Correct |
645 ms |
15964 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
504 ms |
15960 KB |
Output is correct |
2 |
Correct |
722 ms |
15964 KB |
Output is correct |
3 |
Correct |
478 ms |
15964 KB |
Output is correct |
4 |
Correct |
783 ms |
15964 KB |
Output is correct |
5 |
Correct |
676 ms |
15964 KB |
Output is correct |