Submission #964131

#TimeUsernameProblemLanguageResultExecution timeMemory
964131dubabubaMobile (BOI12_mobile)C++14
100 / 100
778 ms16144 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3") #pragma GCC target("lzcnt", "popcnt") typedef pair<int, int> pii; #define x first #define y second #define MP make_pair const int mxn = 1e6 + 10; pii P[mxn]; int n, m; bool can(double r) { double sus = 0; for(int i = 1; i <= n; i++) { double x = P[i].x; double y = abs(P[i].y); if(y > r) continue; double d = sqrt(r * r - y * y); double L = x - d, R = x + d; if(sus >= L) sus = max(sus, R); } return sus >= 1.0 * m; } int main() { cin >> n >> m; for(int i = 1; i <= n; i++) cin >> P[i].x >> P[i].y; double L = 0, R = 1e18; while(R - L > 0.0000001) { double M = (L + R) / 2; if(can(M)) R = M; else L = M; } printf("%.6lf\n", 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...