Submission #991325

#TimeUsernameProblemLanguageResultExecution timeMemory
991325BF001Mobile (BOI12_mobile)C++17
12 / 100
227 ms8020 KiB
#include <bits/stdc++.h> using namespace std; #define N 1000005 #define ld double int n, x[N], y[N], len; signed main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); cin >> n >> len; for (int i = 1; i <= n; i++) cin >> x[i] >> y[i]; ld l = 0, r = 2e9; while (r - l > 1e-3){ ld mid = (l + r) / 2.0; ld cur = 0; for (int i = 1; i <= n; i++){ ld denta = sqrt(mid * mid - y[i] * y[i]); ld a = x[i] - denta; ld b = x[i] + denta; if (a <= cur) cur = max(cur, b); } if (cur >= len) r = mid; else l = mid; } cout << fixed << setprecision(6) << 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...