Submission #1005807

#TimeUsernameProblemLanguageResultExecution timeMemory
1005807MubarisBalloons (CEOI11_bal)C++17
10 / 100
401 ms4948 KiB
#include<bits/stdc++.h> using namespace std; double f(int a,int b,double c,double d){ int dist=(b-a)*(b-a); double ans=(double)dist/4;ans=(double)ans/d; return (ans<c?ans:c); } void solve(){ int a;cin>>a; vector<double> b(a),c(a); for(int i=0;i<a;i++) cin>>b[i]>>c[i]; for(int i=0;i<a;i++){ stack<int> st; int j=1;while((i>=j)&&(b[i]-b[i-j])<(c[i]+c[i-j])) {st.push(i-j);j++;} while(!st.empty()) {c[i]=f(b[i],b[st.top()],c[i],c[st.top()]);st.pop();} cout<<fixed<<setprecision(3)<<c[i]<<endl; } } int main(){ int t=1; while(t--) solve(); }
#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...