# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
853866 |
2023-09-25T11:07:24 Z |
laurasofia |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
31752 KB |
#include <bits/stdc++.h>
using namespace std;
#define vv vector<lli>
#define vvi vector<vector<int>>
#define vii vector<pr>
#define pr pair<double,double>
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define lli long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define mkp make_pair
#define fast ios::sync_with_stdio(false);cin.tie(0);
int l,n;
vector<pr > v;
pr g(double r, double x, double y){
pr res={0,0};
if (abs(y)>=r)return res;
r=r*r;
res.first=x-sqrt(r-(y*y));
res.second=x+sqrt(r-(y*y));
return res;
}
bool check(double r){
vector<pr> q(n+1);
//q[n]=make_pair(0,0);
q[n]=make_pair(l,l);
FOR(i,0,n){
q[i]=g(r,v[i].first, v[i].second);
}
sort(q.begin(),q.end());
double last=0;
pr lll=make_pair(l,l);
FOR(i,0,n){
if (q[i].first>last)return false;
if (q[i]==lll)return true;
last=max(last, q[i].second);
}
return true;
}
void fun(){
double l,m, r;
l=0;
r=1000000000;
FOR(i,0,1000){
m=(l+r)/2;
if (check(m))r=m;
else l=m;
}
if (check(l))r=l;
cout<<r<<endl;
}
int main(){
ios::sync_with_stdio(0); cin.tie(0);
// freopen("out.txt", "w", stdout);
cin>>n>>l;
v=vector<pr>(n);
FOR(i,0,n)cin>>v[i].first>>v[i].second;
fun();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
Incorrect |
2 ms |
344 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
344 KB |
Output is correct |
2 |
Incorrect |
55 ms |
512 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
121 ms |
600 KB |
Output is correct |
2 |
Incorrect |
98 ms |
600 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
115 ms |
600 KB |
Output is correct |
2 |
Incorrect |
98 ms |
604 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
112 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1029 ms |
2748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1047 ms |
2696 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1034 ms |
3152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1047 ms |
3416 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1051 ms |
3408 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1038 ms |
16072 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
15956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1046 ms |
19148 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1063 ms |
19120 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1038 ms |
22352 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1046 ms |
22420 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1038 ms |
25300 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1040 ms |
25464 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1053 ms |
31720 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1052 ms |
31752 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |