Submission #798419

#TimeUsernameProblemLanguageResultExecution timeMemory
798419trMatherzMobile (BOI12_mobile)C++17
0 / 100
681 ms32480 KiB
# include <numeric> # include <vector> # include <algorithm> # include <cmath> # include <array> # include <bitset> # include <set> # include <map> # include <string> # include <cstdlib> # include <queue> # include <iomanip> using namespace std; #define ll long long int #define all(x) x.begin(), x.end() #define f x.first #define s x.second # include <iostream> /* # include <fstream> ifstream cin ("angry.in"); ofstream cout ("angry.out"); */ /* 1 3 8 10 11 2 5 2 1 */ int main(){ int n, k; cin >> n >> k; vector<array<ll, 2>> a(n); for(int i = 0; i < n; i++){ cin >> a[i][0] >> a[i][1]; } auto cf = [&](double m){ double cur = 0; for(int i = 0; i < n; i++){ double d = sqrt(m*m + a[i][1]*a[i][1]); double e1 = a[i][0] - d, e2 = a[i][0] + d; if(e1 <= cur){cur = max(cur, e2);} } if(cur >= k){return false;} return true; }; double l = 0, r = 1e9; while(r - l > 1e-3 ){ double m = l + (r-l)/2.0; if(cf(m)){l = m;} else{r = m;} } cout << l; 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...