Submission #397172

#TimeUsernameProblemLanguageResultExecution timeMemory
397172alexis_1729Balloons (CEOI11_bal)C++14
100 / 100
203 ms9172 KiB
#include <bits/stdc++.h> using namespace std; int n; stack<int>st; struct est{ double xi,ri; }vx[200000]; int main() { ios_base::sync_with_stdio(0);cin.tie(0); cin>>n; for(int i=0;i<n;i++){ cin>>vx[i].xi>>vx[i].ri; while(!st.empty()){ vx[i].ri=min(vx[i].ri,((vx[i].xi-vx[st.top()].xi)*(vx[i].xi-vx[st.top()].xi))/(4*vx[st.top()].ri)); if(vx[i].ri<vx[st.top()].ri)break; st.pop(); } st.push(i); } for(int i=0;i<n;i++)printf("%3f\n",vx[i].ri); }
#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...