Submission #654935

#TimeUsernameProblemLanguageResultExecution timeMemory
654935Koful123Mobile (BOI12_mobile)C++17
0 / 100
1093 ms31564 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double //#define endl "\n" #define pb push_back #define ff first #define ss second #define mod 1000000007 #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() const double eps = 0.000000001; double dis(pair<double,double> x,pair<double,double> y){ return sqrt(pow(x.ff - y.ff,2) + pow(x.ss - y.ss,2)); } void solve(){ double n,k; cin >> n >> k; vector<pair<double,double>> v(n); for(auto &[x,y] : v){ cin >> x >> y; } double ans = 0; for(int i=0;i<n;i++){ for(int j=0;j<i;j++){ double l = max((double)0,v[j].ff),r = min(v[i].ff,k); for(int k=1;k<=20;k++){ double m = (l + r + eps) / 2; if(dis({m,0},v[j]) <= dis({m,0},v[i])) l = m; else r = m - eps; } ans = max({ans,dis({l,0},v[j]),dis({l,0},v[i])}); } } cout << fixed << setprecision(10); cout << ans << endl; } signed main(){ ios::sync_with_stdio(0); cin.tie(0); int t = 1; // cin >> t; while(t--) solve(); return 0; }
#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...