Submission #319679

#TimeUsernameProblemLanguageResultExecution timeMemory
319679dolphingarlicMobile (BOI12_mobile)C++14
100 / 100
538 ms16240 KiB
#include <bits/stdc++.h> #define FOR(i, x, y) for (int i = x; i < y; i++) #define x first #define y second using namespace std; pair<long long, long long> p[1000000]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, len; cin >> n >> len; FOR(i, 0, n) cin >> p[i].x >> p[i].y; double l = 1, r = 1.5e9; while (r - l > 1e-3) { double mid = (l + r) / 2, curr = 0; FOR(i, 0, n) { double delta = sqrt(mid * mid - p[i].y * p[i].y); double a = p[i].x - delta, b = p[i].x + delta; if (a <= curr) curr = max(curr, b); } if (curr >= len) r = mid; else l = mid; } cout << fixed << setprecision(4) << 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...