Submission #1006032

#TimeUsernameProblemLanguageResultExecution timeMemory
1006032MubarisBalloons (CEOI11_bal)C++17
20 / 100
2073 ms7052 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; for(int j=0;j<i;j++) st.push(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...