# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
639207 |
2022-09-09T00:57:49 Z |
Pietra |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
15988 KB |
#include<bits/stdc++.h>
#define int long long
using namespace std ;
const int maxn = 2e6 + 5 ;
const int inf = 2e10 + 5 ;
double n, l, x[maxn], y[maxn] ;
bool check(double r){
double f = 0 ;
for(int i = 1 ; i <= n ; i++){
double dx = sqrt(((r*r) - (y[i]*y[i]))) ;
double ini = x[i] - dx, fim = x[i] + dx ;
if(ini <= f) f = max(f, fim) ;
}
return (f >= l) ;
}
int32_t main(){
cin >> n >> l ;
for(int i = 1 ; i <= n ; i++) cin >> x[i] >> y[i] ;
double ini = 0, fim = inf*1.00, mid ;
while(fim - ini > 1e-6){
mid = (ini + fim)/2 ;
if(check(mid)) fim = mid ;
else ini = mid ;
}
cout << fixed << setprecision(6) << fim << "\n" ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
3 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
388 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
6 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
392 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
356 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
88 ms |
1428 KB |
Output is correct |
2 |
Correct |
82 ms |
1520 KB |
Output is correct |
3 |
Correct |
52 ms |
1088 KB |
Output is correct |
4 |
Correct |
93 ms |
1356 KB |
Output is correct |
5 |
Correct |
45 ms |
980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1496 KB |
Output is correct |
2 |
Correct |
74 ms |
1312 KB |
Output is correct |
3 |
Correct |
86 ms |
1460 KB |
Output is correct |
4 |
Correct |
113 ms |
1484 KB |
Output is correct |
5 |
Correct |
116 ms |
1696 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
1740 KB |
Output is correct |
2 |
Correct |
89 ms |
1500 KB |
Output is correct |
3 |
Correct |
83 ms |
1592 KB |
Output is correct |
4 |
Correct |
152 ms |
1740 KB |
Output is correct |
5 |
Correct |
89 ms |
1584 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
114 ms |
1792 KB |
Output is correct |
2 |
Correct |
110 ms |
1860 KB |
Output is correct |
3 |
Correct |
94 ms |
1856 KB |
Output is correct |
4 |
Correct |
152 ms |
1856 KB |
Output is correct |
5 |
Correct |
111 ms |
1924 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
113 ms |
1820 KB |
Output is correct |
2 |
Correct |
109 ms |
1840 KB |
Output is correct |
3 |
Correct |
105 ms |
1796 KB |
Output is correct |
4 |
Correct |
139 ms |
1800 KB |
Output is correct |
5 |
Correct |
111 ms |
1868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
460 ms |
8148 KB |
Output is correct |
2 |
Correct |
565 ms |
8120 KB |
Output is correct |
3 |
Correct |
636 ms |
8108 KB |
Output is correct |
4 |
Correct |
689 ms |
8200 KB |
Output is correct |
5 |
Correct |
579 ms |
8136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
592 ms |
8160 KB |
Output is correct |
2 |
Correct |
620 ms |
8136 KB |
Output is correct |
3 |
Correct |
483 ms |
8112 KB |
Output is correct |
4 |
Correct |
671 ms |
8120 KB |
Output is correct |
5 |
Correct |
585 ms |
8248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
519 ms |
9696 KB |
Output is correct |
2 |
Correct |
678 ms |
9764 KB |
Output is correct |
3 |
Correct |
692 ms |
9820 KB |
Output is correct |
4 |
Correct |
876 ms |
9588 KB |
Output is correct |
5 |
Correct |
688 ms |
9800 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
719 ms |
9696 KB |
Output is correct |
2 |
Correct |
755 ms |
9876 KB |
Output is correct |
3 |
Correct |
577 ms |
9688 KB |
Output is correct |
4 |
Correct |
837 ms |
9788 KB |
Output is correct |
5 |
Correct |
697 ms |
9780 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
587 ms |
11264 KB |
Output is correct |
2 |
Correct |
789 ms |
11248 KB |
Output is correct |
3 |
Correct |
756 ms |
11204 KB |
Output is correct |
4 |
Correct |
979 ms |
11164 KB |
Output is correct |
5 |
Correct |
779 ms |
11252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
836 ms |
11280 KB |
Output is correct |
2 |
Correct |
910 ms |
11324 KB |
Output is correct |
3 |
Correct |
706 ms |
11312 KB |
Output is correct |
4 |
Execution timed out |
1006 ms |
11272 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
698 ms |
12952 KB |
Output is correct |
2 |
Correct |
890 ms |
12752 KB |
Output is correct |
3 |
Correct |
912 ms |
12820 KB |
Output is correct |
4 |
Execution timed out |
1098 ms |
12876 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
925 ms |
12832 KB |
Output is correct |
2 |
Correct |
972 ms |
12876 KB |
Output is correct |
3 |
Correct |
799 ms |
12924 KB |
Output is correct |
4 |
Execution timed out |
1065 ms |
12708 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
891 ms |
15908 KB |
Output is correct |
2 |
Execution timed out |
1084 ms |
15888 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1096 ms |
15988 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |