# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
639217 |
2022-09-09T02:31:10 Z |
Pietra |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
15976 KB |
#include<bits/stdc++.h>
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) ;
}
int main(){
cin >> n >> l ;
for(int i = 1 ; i <= n ; i++) cin >> x[i] >> y[i] ;
double ini = 0, fim = inf, mid ;
int it = 43 ;
while(it--){
mid = (ini + fim)/2 ;
if(check(mid)) fim = mid ;
else ini = mid ;
}
cout << fixed << setprecision(4) << 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 |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 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 |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
3 ms |
340 KB |
Output is correct |
3 |
Correct |
3 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 |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
7 ms |
396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
5 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 |
5 ms |
340 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
4 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 |
1372 KB |
Output is correct |
2 |
Correct |
85 ms |
1464 KB |
Output is correct |
3 |
Correct |
50 ms |
1148 KB |
Output is correct |
4 |
Correct |
97 ms |
1356 KB |
Output is correct |
5 |
Correct |
40 ms |
1108 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1516 KB |
Output is correct |
2 |
Correct |
79 ms |
1288 KB |
Output is correct |
3 |
Correct |
95 ms |
1524 KB |
Output is correct |
4 |
Correct |
123 ms |
1488 KB |
Output is correct |
5 |
Correct |
119 ms |
1740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
70 ms |
1612 KB |
Output is correct |
2 |
Correct |
87 ms |
1576 KB |
Output is correct |
3 |
Correct |
77 ms |
1544 KB |
Output is correct |
4 |
Correct |
174 ms |
1740 KB |
Output is correct |
5 |
Correct |
90 ms |
1608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
1756 KB |
Output is correct |
2 |
Correct |
106 ms |
1808 KB |
Output is correct |
3 |
Correct |
90 ms |
1852 KB |
Output is correct |
4 |
Correct |
149 ms |
1772 KB |
Output is correct |
5 |
Correct |
118 ms |
1996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
111 ms |
1772 KB |
Output is correct |
2 |
Correct |
103 ms |
1760 KB |
Output is correct |
3 |
Correct |
92 ms |
1740 KB |
Output is correct |
4 |
Correct |
151 ms |
1904 KB |
Output is correct |
5 |
Correct |
114 ms |
1860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
412 ms |
8140 KB |
Output is correct |
2 |
Correct |
541 ms |
8140 KB |
Output is correct |
3 |
Correct |
522 ms |
8124 KB |
Output is correct |
4 |
Correct |
725 ms |
8124 KB |
Output is correct |
5 |
Correct |
584 ms |
8172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
561 ms |
8424 KB |
Output is correct |
2 |
Correct |
559 ms |
8348 KB |
Output is correct |
3 |
Correct |
457 ms |
8020 KB |
Output is correct |
4 |
Correct |
710 ms |
8172 KB |
Output is correct |
5 |
Correct |
615 ms |
8012 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
491 ms |
9636 KB |
Output is correct |
2 |
Correct |
649 ms |
9708 KB |
Output is correct |
3 |
Correct |
626 ms |
9776 KB |
Output is correct |
4 |
Correct |
883 ms |
9696 KB |
Output is correct |
5 |
Correct |
695 ms |
9632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
673 ms |
9756 KB |
Output is correct |
2 |
Correct |
642 ms |
9612 KB |
Output is correct |
3 |
Correct |
588 ms |
9720 KB |
Output is correct |
4 |
Correct |
883 ms |
9764 KB |
Output is correct |
5 |
Correct |
776 ms |
9772 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
580 ms |
11208 KB |
Output is correct |
2 |
Correct |
755 ms |
11320 KB |
Output is correct |
3 |
Correct |
731 ms |
11356 KB |
Output is correct |
4 |
Execution timed out |
1012 ms |
11416 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
786 ms |
11240 KB |
Output is correct |
2 |
Correct |
739 ms |
11224 KB |
Output is correct |
3 |
Correct |
650 ms |
11280 KB |
Output is correct |
4 |
Execution timed out |
1012 ms |
11372 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
656 ms |
12876 KB |
Output is correct |
2 |
Correct |
867 ms |
12932 KB |
Output is correct |
3 |
Correct |
842 ms |
12876 KB |
Output is correct |
4 |
Execution timed out |
1083 ms |
12920 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
907 ms |
13004 KB |
Output is correct |
2 |
Correct |
850 ms |
12852 KB |
Output is correct |
3 |
Correct |
750 ms |
12928 KB |
Output is correct |
4 |
Execution timed out |
1091 ms |
12708 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
836 ms |
15856 KB |
Output is correct |
2 |
Execution timed out |
1069 ms |
15976 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1089 ms |
15928 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |