# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
925468 | 2024-02-11T17:05:02 Z | BoopyTheNoob | Balloons (CEOI11_bal) | C++14 | 123 ms | 13056 KB |
#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); } void subtask2 (vector<pair<double, double>> info) { vector<double> ans(info.size()); vector<pair<double, double>> q; ans[0] = info[0].second; q.push_back({info[0].first, ans[0]}); for (int i = 1; i < info.size(); i++) { double pans = info[i].second; int j = q.size() - 1; for (; j >= 0; j--) { double span = (info[i].first - q[j].first) * (info[i].first - q[j].first) / (4 * q[j].second); if (span <= pans) pans = span; else { j++; break; } } ans[i] = pans; for (int k = j + 1; k < q.size(); k++) q.pop_back(); q.push_back({info[i].first, ans[i]}); } 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++) cin >> info[i].first >> info[i].second; subtask2(info); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 5th numbers differ - expected: '17.1630000000', found: '99.0000000000', error = '81.8370000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | 2 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | 3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 604 KB | 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 1760 KB | 196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 36 ms | 3548 KB | 13945th numbers differ - expected: '0.0140000000', found: '7.0000000000', error = '6.9860000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 65 ms | 6740 KB | 7236th numbers differ - expected: '0.0070000000', found: '7.0000000000', error = '6.9930000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 76 ms | 7880 KB | 4645th numbers differ - expected: '0.0260000000', found: '8.0000000000', error = '7.9740000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 103 ms | 11188 KB | 1734th numbers differ - expected: '1856.0220000000', found: '1865.0000000000', error = '8.9780000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 123 ms | 13056 KB | 2716th numbers differ - expected: '22.1690000000', found: '43.0000000000', error = '20.8310000000' |
2 | Halted | 0 ms | 0 KB | - |