# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
948275 | Amaarsaa | Balloons (CEOI11_bal) | C++14 | 109 ms | 5532 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;
using ll = long long ;
double Find_r(double x1, double r1, double x2) {
x1 = x1 - x2;
x1 = x1 * x1;
x1 = x1 / (4.0 * r1);
return x1;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll t, x, r, max_r;
cin >> t;
stack < pair < double , double > > st;
while ( t --) {
double r, max_r;
cin >> x >> r;
max_r = r;
while (!st.empty()) {
pair < double , double > R =st.top();
max_r = min(max_r, Find_r(R.first, R.second, x));
if ( R.second <= max_r) st.pop();
else break;
}
printf("%.3lf\n", max_r);
st.push({x, max_r});
}
}
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... |