Submission #1056881

#TimeUsernameProblemLanguageResultExecution timeMemory
1056881TimAniMobile (BOI12_mobile)C++17
60 / 100
470 ms8256 KiB
#include <bits/stdc++.h> #define long long long using namespace std; const double eps = 1E-3; const int N = (int) 1E6; int n, k; int x[N], y[N]; bool valid(double a) { double t = 0; for (int i = 0; i < n; i++) { if (a < y[i]) { continue; } double l = x[i] - sqrt(1.0 * a * a - 1.0 * y[i] * y[i]); double r = x[i] + sqrt(1.0 * a * a - 1.0 * y[i] * y[i]); if (l <= t && r >= t) { t = r; } } return t >= k; } void solve() { cin >> n >> k; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } double l = 0, r = 4E9; while(r - l > eps) { double R = (r + l) / 2; if(valid(R)) { r = R; } else { l = R; } } cout << fixed << setprecision(-log10(eps)) << r << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; t = 1; for (int i = 0; i < t; i++) { solve(); } return 0; } // time-limit: 3000
#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...