Submission #1005063

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