# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
639208 |
2022-09-09T00:59:54 Z |
Pietra |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
15924 KB |
#include<bits/stdc++.h>
#define int long long
using namespace std ;
const int maxn = 2e6 + 5 ;
const double inf = 2e9 + 5 ;
double n, l, x[maxn], y[maxn] ;
bool check(double r){
double f = 0 ;
for(int i = 1 ; i <= n ; i++){
if(r < y[i]) continue ;
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, 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 |
1 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 |
340 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 |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
9 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 |
376 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 |
76 ms |
1392 KB |
Output is correct |
2 |
Correct |
85 ms |
1384 KB |
Output is correct |
3 |
Correct |
55 ms |
1132 KB |
Output is correct |
4 |
Correct |
107 ms |
1356 KB |
Output is correct |
5 |
Correct |
42 ms |
984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
83 ms |
1440 KB |
Output is correct |
2 |
Correct |
99 ms |
1356 KB |
Output is correct |
3 |
Correct |
99 ms |
1576 KB |
Output is correct |
4 |
Correct |
105 ms |
1480 KB |
Output is correct |
5 |
Correct |
122 ms |
1612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
1576 KB |
Output is correct |
2 |
Correct |
88 ms |
1556 KB |
Output is correct |
3 |
Correct |
84 ms |
1564 KB |
Output is correct |
4 |
Correct |
156 ms |
1812 KB |
Output is correct |
5 |
Correct |
97 ms |
1612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
1852 KB |
Output is correct |
2 |
Correct |
106 ms |
1828 KB |
Output is correct |
3 |
Correct |
94 ms |
1740 KB |
Output is correct |
4 |
Correct |
156 ms |
1864 KB |
Output is correct |
5 |
Correct |
127 ms |
1784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
124 ms |
1856 KB |
Output is correct |
2 |
Correct |
106 ms |
1784 KB |
Output is correct |
3 |
Correct |
90 ms |
1740 KB |
Output is correct |
4 |
Correct |
156 ms |
1836 KB |
Output is correct |
5 |
Correct |
123 ms |
1856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
420 ms |
8084 KB |
Output is correct |
2 |
Correct |
556 ms |
8012 KB |
Output is correct |
3 |
Correct |
539 ms |
8152 KB |
Output is correct |
4 |
Correct |
771 ms |
8124 KB |
Output is correct |
5 |
Correct |
615 ms |
8076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
598 ms |
8076 KB |
Output is correct |
2 |
Correct |
564 ms |
8104 KB |
Output is correct |
3 |
Correct |
467 ms |
8100 KB |
Output is correct |
4 |
Correct |
752 ms |
8120 KB |
Output is correct |
5 |
Correct |
655 ms |
8040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
525 ms |
9692 KB |
Output is correct |
2 |
Correct |
681 ms |
9624 KB |
Output is correct |
3 |
Correct |
669 ms |
9764 KB |
Output is correct |
4 |
Correct |
942 ms |
9644 KB |
Output is correct |
5 |
Correct |
734 ms |
9652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
708 ms |
9624 KB |
Output is correct |
2 |
Correct |
676 ms |
9676 KB |
Output is correct |
3 |
Correct |
583 ms |
9648 KB |
Output is correct |
4 |
Correct |
927 ms |
9640 KB |
Output is correct |
5 |
Correct |
774 ms |
9688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
621 ms |
11324 KB |
Output is correct |
2 |
Correct |
788 ms |
11280 KB |
Output is correct |
3 |
Correct |
755 ms |
11164 KB |
Output is correct |
4 |
Execution timed out |
1063 ms |
11176 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
813 ms |
11272 KB |
Output is correct |
2 |
Correct |
779 ms |
11260 KB |
Output is correct |
3 |
Correct |
667 ms |
11212 KB |
Output is correct |
4 |
Execution timed out |
1097 ms |
11156 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
701 ms |
12784 KB |
Output is correct |
2 |
Correct |
888 ms |
12876 KB |
Output is correct |
3 |
Correct |
858 ms |
12724 KB |
Output is correct |
4 |
Execution timed out |
1091 ms |
12868 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
943 ms |
12796 KB |
Output is correct |
2 |
Correct |
889 ms |
12856 KB |
Output is correct |
3 |
Correct |
770 ms |
12848 KB |
Output is correct |
4 |
Execution timed out |
1088 ms |
12724 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
857 ms |
15864 KB |
Output is correct |
2 |
Execution timed out |
1100 ms |
15900 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
15924 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |