Submission #844192

#TimeUsernameProblemLanguageResultExecution timeMemory
844192AsandeiStefanBalloons (CEOI11_bal)C++17
10 / 100
2045 ms7788 KiB
#include <iomanip> #include <iostream> #include <vector> struct sphere { double x, max_r; }; int n; std::vector<sphere> v; std::vector<double> dists; int main() { std::cin >> n; v = std::vector<sphere>(n); dists = std::vector<double>(n); for (int i = 0; i < n; i++) { std::cin >> v[i].x >> v[i].max_r; } dists[0] = static_cast<double>(v[0].max_r); for (int i = 1; i < n; i++) { double min_r = v[i].max_r; for (int j = 0; j < i; j++) { min_r = std::min(min_r, ((v[i].x - v[j].x) * (v[i].x - v[j].x)) / (4 * v[j].max_r)); } dists[i] = min_r; } for (double d : dists) std::cout << std::fixed << std::setprecision(3) << d << '\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...