Submission #853863

#TimeUsernameProblemLanguageResultExecution timeMemory
853863laurasofiaMobile (BOI12_mobile)C++14
0 / 100
1050 ms44496 KiB
#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); map<char,int>c; string s; int l,n; vector<pr > v; pr g(double r, int x, int 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; FOR(i,0,n){ if (q[i].first>last)return false; last=max(last, q[i].second); } return true; } void fun(){ double l,m, r; l=0; r=1000000000; FOR(i,0,100){ 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...