Submission #781085

#TimeUsernameProblemLanguageResultExecution timeMemory
781085upedMobile (BOI12_mobile)C++14
0 / 100
1083 ms70748 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fastio(); int n, len; cin >> n >> len; vector<pair<int, int>> v(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[i] = {a, b}; } double l = 0.0, r = 1e12; // todo r for (int i = 0; i < 100; ++i) { double radius = (l + r) / 2.0; map<double, int> m; for (int j = 0; j < n; ++j) { int x = v[j].first; int y= v[j].second; double a = sqrt( radius * radius - y * y); if (x + a >= 0 && x - a <= len) { if (x + a <= len) { --m[x + a + 1e-7]; } ++m[max(x - a, 0.0)]; } } int cur = 0; bool ok = true; for (auto& it : m) { cur += it.second; if (cur <= 0) { ok = false; break; } } if (ok) { r = radius; } else { l = radius; } } cout << setprecision(20) << r; 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...