제출 #1130265

#제출 시각아이디문제언어결과실행 시간메모리
1130265Abdalaziz_AlshamiBalloons (CEOI11_bal)C++20
100 / 100
157 ms2572 KiB
#include<bits/stdc++.h> #define int long long using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin>>n; stack<pair<int,double>>st; for(int i=0;i<n;i++){ int x; double r; cin>>x>>r; while(st.size()){ auto [y,r2]=st.top(); double g=1.0*(x-y)*(x-y)/(4*r2); r=min(g,r); if(r>=r2) st.pop(); else break; } cout<<fixed<<setprecision(6)<<r<<'\n'; st.push({x,r}); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...