| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363675 | vjudge1 | Balloons (CEOI11_bal) | C++20 | 232 ms | 1848 KiB |
#include <bits/stdc++.h>
using namespace std;
double f(pair<double, double> a, double bx) {
return (a.first - bx) * (a.first - bx) / (4 * a.second);
}
int main() {
int n;
cin >> n;
stack<pair<double, double>> st;
for (int i = 0; i < n; i++) {
double x, r;
cin >> x >> r;
double res = r;
while (!st.empty()) {
pair<double, double> last = st.top();
double fr = f(last, x);
res = min(res, fr);
if (res >= last.second) {
st.pop();
continue;
}
else {
break;
}
}
st.push({x, res});
cout << fixed << setprecision(3) << res << endl;
}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
