Submission #844268

#TimeUsernameProblemLanguageResultExecution timeMemory
844268AsandeiStefanBalloons (CEOI11_bal)C++17
10 / 100
258 ms13924 KiB
#include <iomanip> #include <iostream> #include <stack> #include <vector> struct sphere { long double x, max_r; }; int n; std::vector<sphere> v; std::stack<sphere> s; int main() { std::cin >> n; v = std::vector<sphere>(n); for (int i = 0; i < n; i++) { std::cin >> v[i].x >> v[i].max_r; } for (int i = 0; i < n; i++) { long double min_r = v[i].max_r; while (!s.empty()) { sphere prev = s.top(); min_r = std::min(min_r, ((prev.x - v[i].x) * (prev.x - v[i].x)) / (4 * prev.max_r)); if (min_r >= prev.max_r) s.pop(); else break; } s.push(v[i]); std::cout << std::fixed << std::setprecision(5) << min_r << '\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...