Submission #1098716

#TimeUsernameProblemLanguageResultExecution timeMemory
1098716sanoMobile (BOI12_mobile)C++14
12 / 100
994 ms9908 KiB
#include<iostream> #include<vector> #include<queue> #include<deque> #include<string> #include<fstream> #include<algorithm> #include <iomanip> #include<map> #include <set> #include <unordered_map> #include <stack> #include <unordered_set> #include <cmath> #define ll long long #define For(i, n) for(int i = 0; i < (int)n; i++) #define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++) #define rfor(i, n) for(int i = (int)n; i >= (int)0; i--) #define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--) #define vec vector #define ff first #define ss second #define pb push_back #define shit short int #define pii pair<int, int> #define NEK 2147483640 #define mod 1000000007 #define mod2 1000000009 #define rsz resize #define prv1 43 #define prv2 47 #define D 8 using namespace std; int main() { double n, asd; cin >> n >> asd; vec<pii> p; For(i, n) { double x, y; cin >> x >> y; if (p.size() > 0) { if (x == p.back().ff && y > 0 && p.back().ss > 0) continue; if (x == p.back().ff && y < 0) p.pop_back(); } p.push_back({ x, y }); } double l = 0; double r = 1414213570; while ((r - l) > (0.0000001)) { double mid = (l + r) / 2; double k = 0; For(i, p.size()) { double d = sqrt(mid * mid - p[i].ss * p[i].ss); double s = p[i].ff - d; double e = p[i].ff + d; if (s > k) continue; k = max(k, e); } if (k >= asd) r = mid; else l = mid; } cout << fixed << setprecision(3); cout << l << '\n'; 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...