| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1340644 | Nipphitch | Balloons (CEOI11_bal) | C++20 | 133 ms | 5736 KiB |
#include <bits/stdc++.h>
using namespace std;
int n;
stack <pair <double,double>> st;
double cal(double x,double R){
return (x*x)/(4*R);
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i=1;i<=n;i++){
double p,r;
cin >> p >> r;
if(i==1){
cout << fixed << setprecision(10) << r << "\n";
st.push({p,r});
}
else{
auto u=st.top();
if(u.first+u.second>p-r) r=min(r,cal(p-u.first,u.second));
cout << fixed << setprecision(10) << r << "\n";
if(p+r>u.first+u.second || (p+r==u.first+u.second && r>u.second)) st.push({p,r});
}
}
}| # | 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... | ||||
