# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890730 | TimAni | Balloons (CEOI11_bal) | C++17 | 2041 ms | 9812 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <stack>
#include <queue>
#include <cmath>
#include <array>
#include <iomanip>
using namespace std;
void setIO(string File_name) {
cin.tie(0)->sync_with_stdio(0);
if (File_name.size()) {
freopen((File_name + ".in").c_str(), "r", stdin);
freopen((File_name + ".out").c_str(), "w", stdout);
}
}
const long double eps = 1e-9;
void sol() {
int n; cin >> n;
vector<pair<long double, long double>> v(n);
for(int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
vector<long double> ans(n);
auto radius = [&](int curr, int prev) -> long double {
long double r = 1.0 * (v[curr].first - v[prev].first) * ((v[curr].first - v[prev].first)) / (4 * v[prev].second);
return r;
};
for(int i = 0; i < n; i++){
ans[i] = v[i].second;
for(int j = i - 1; j >= 0; j--){
ans[i] = min(ans[i], radius(i, j));
}
}
for(auto el : ans){
cout << fixed << setprecision(6) << el << ' ';
}
}
int main() {
setIO("");
int T = 1;
//cin >> T;
while (T--) sol();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |