# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
641298 | Trisanu_Das | Balloons (CEOI11_bal) | C++17 | 0 ms | 0 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;
int main(){
int n; cin >> n;
int x[n], st[n+1], *p = st;
double r[n];
for(int i=0; i<n; ++i){
cin >> x[i] >> r[i];
while(p != st){
y[i] = min(y[i], pow(x[*p]-x[i], 2)/(4.0*r[*p]));
if(r[*p] < r[i]) --p;
else break;
}
*(++p) = i;
cout << fixed << setprecision(4) << r[i] << '\n';
}
}