# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
973218 |
2024-05-01T16:17:28 Z |
HuyAT |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
31660 KB |
#include<bits/stdc++.h>
const int MaxN = 1e6 + 10;
const long double Eps = 1e-12;
const long double MaxV = 1e18;
int n;
long double length,x[MaxN + 1],y[MaxN + 1];
void readData(){
std::cin >> n >> length;
for(int i = 1;i <= n;++i){
std::cin >> x[i] >> y[i];
}
}
bool f(long double mid){
long double l = 0,r = 0;
for(int i = 1;i <= n;++i){
if(mid < y[i]){
continue;
}
long double distance = sqrt(mid * mid - y[i] * y[i]);
if(x[i] - distance <= r && x[i] + distance >= l){
l = std::min(l,x[i] - distance);
r = std::max(r,x[i] + distance);
}
}
return (l <= 0 && r >= length);
}
long double solve(long double lo,long double hi){
while(hi - lo > Eps){
long double mid = (lo + hi) / 2;
if(f(mid)){
hi = mid;
}else{
lo = mid;
}
// std::cerr << mid << "\n";
}
return hi;
}
int main(){
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);std::cout.tie(nullptr);
readData();
std::cout << std::fixed << std::setprecision(8) << solve(0,MaxV * 2);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
2396 KB |
Output is correct |
2 |
Correct |
4 ms |
2396 KB |
Output is correct |
3 |
Correct |
3 ms |
2396 KB |
Output is correct |
4 |
Correct |
3 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
2396 KB |
Output is correct |
2 |
Correct |
8 ms |
2648 KB |
Output is correct |
3 |
Correct |
6 ms |
2396 KB |
Output is correct |
4 |
Correct |
8 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
2396 KB |
Output is correct |
2 |
Correct |
7 ms |
2604 KB |
Output is correct |
3 |
Correct |
6 ms |
2396 KB |
Output is correct |
4 |
Correct |
8 ms |
2396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2396 KB |
Output is correct |
2 |
Correct |
9 ms |
2396 KB |
Output is correct |
3 |
Correct |
6 ms |
2396 KB |
Output is correct |
4 |
Correct |
8 ms |
2396 KB |
Output is correct |
5 |
Correct |
7 ms |
2648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
91 ms |
6996 KB |
Output is correct |
2 |
Correct |
96 ms |
6736 KB |
Output is correct |
3 |
Correct |
60 ms |
4740 KB |
Output is correct |
4 |
Correct |
121 ms |
6792 KB |
Output is correct |
5 |
Correct |
61 ms |
4700 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
104 ms |
6788 KB |
Output is correct |
2 |
Correct |
111 ms |
6788 KB |
Output is correct |
3 |
Correct |
129 ms |
6784 KB |
Output is correct |
4 |
Correct |
125 ms |
6736 KB |
Output is correct |
5 |
Correct |
138 ms |
6792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
118 ms |
6748 KB |
Output is correct |
2 |
Correct |
100 ms |
6804 KB |
Output is correct |
3 |
Correct |
93 ms |
6788 KB |
Output is correct |
4 |
Correct |
162 ms |
6744 KB |
Output is correct |
5 |
Correct |
126 ms |
6788 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1020 ms |
6736 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
125 ms |
6788 KB |
Output is correct |
2 |
Correct |
121 ms |
6808 KB |
Output is correct |
3 |
Correct |
110 ms |
6748 KB |
Output is correct |
4 |
Correct |
165 ms |
6784 KB |
Output is correct |
5 |
Correct |
157 ms |
6796 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1010 ms |
19100 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1040 ms |
19092 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1050 ms |
23200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1048 ms |
23380 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1038 ms |
25244 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1051 ms |
25248 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1020 ms |
29344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1008 ms |
29344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1041 ms |
31660 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1002 ms |
31640 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |