Submission #630650

#TimeUsernameProblemLanguageResultExecution timeMemory
630650IwanttobreakfreeBalloons (CEOI11_bal)C++17
30 / 100
588 ms6060 KiB
#include <iostream> #include <vector> #include <stack> #include <iomanip> using namespace std; const long double EPS=1e-9; long double dist(int x,long double r1,int y){ return (long double)(x-y)*(x-y)/(4*r1); } int main(){ int n,x; long double r; cin>>n; stack<pair<int,long double>> st; for(int i=0;i<n;i++){ cin>>x>>r; while(st.size()){ long double ok=dist(st.top().first,st.top().second,x); r=min(r,ok); if(ok>=st.top().second)st.pop(); else break; //cout<<st.size()<<'\n'; } st.push({x,r}); cout<<fixed<<setprecision(10)<<r<<'\n'; } }
#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...