# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
925446 | BoopyTheNoob | Balloons (CEOI11_bal) | C++14 | 2066 ms | 8160 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 <bits/stdc++.h>
using namespace std;
void subtask1 (vector<pair<double, double>> info) {
vector<double> ans(info.size());
ans[0] = info[0].second;
for (int i = 1; i < info.size(); i++) {
double pans = 1e9;
for (int j = 0; j < i; j++)
pans = min(pans, (info[i].first - info[j].first) * (info[i].first - info[j].first) / (4 * ans[j]));
ans[i] = min(pans, info[i].second);
}
for (auto x: ans) printf("%.3lf\n", x);
}
int main (void) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<pair<double, double>> info(n);
for (int i = 0; i < n; i++)
scanf("%lf %lf", &info[i].first, &info[i].second);
subtask1(info);
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... |