Submission #501773

#TimeUsernameProblemLanguageResultExecution timeMemory
501773chenwzMobile (BOI12_mobile)C++11
100 / 100
361 ms27392 KiB
// BalticOI2012 - Mobile #include <bits/stdc++.h> using namespace std; using LL = long long; #define _for(i, a, b) for (int i = (a); i < (int)(b); ++i) const int NN = 1e6 + 4; int X[NN], Y[NN]; int main() { ios::sync_with_stdio(false), cin.tie(0); int N, L; cin >> N >> L; // scanf("%d%d", &N, &L); for (int i = 0; i < N; i++) cin >> X[i] >> Y[i]; // scanf("%d%d", X + i, Y + i); double l = 1, r = 1.5e9; while (r - l > 1e-3) { double m = (l + r) / 2, curr = 0; for (int i = 0; i < N; i++) { double y = Y[i], delta = sqrt(m * m - y * y), a = X[i] - delta, b = X[i] + delta; if (a <= curr) curr = max(curr, b); if (curr >= L) break; } (curr >= L ? r : l) = m; } printf("%.4lf\n", l); return 0; } // 499716 Mobile (BOI12_mobile) C++11 100 / 100 405ms 27384KB
#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...