# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532176 | rsjw | Balloons (CEOI11_bal) | C++14 | 144 ms | 9112 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;
double x[200010],r[200010];
stack<int> s;
int main(){
int n,i;
scanf("%d",&n);
for(i=1;i<=n;i++) scanf("%lf%lf",&x[i],&r[i]);
for(i=1;i<=n;i++) {
while(!s.empty()) {
r[i]=min(r[i],(x[i]-x[s.top()])*(x[i]-x[s.top()])/4.0/r[s.top()]);
if(r[s.top()]<=r[i]) s.pop();
else break;
}
s.push(i);
}
for(i=1;i<=n;i++) printf("%lf\n",r[i]);
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... |