Submission #1116647

#TimeUsernameProblemLanguageResultExecution timeMemory
1116647BananabreadBalloons (CEOI11_bal)C++17
100 / 100
123 ms4512 KiB
#include<bits/stdc++.h> #define ll int #define ntr "\n" #define mod (ll)(1e9+7) #define taskname "BALLOONS" #define frep freopen(taskname".inp","r",stdin); freopen(taskname".out","w",stdout); using namespace std; ll n; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); //frep; cin>>n; cout<<fixed<<setprecision(3); stack<pair<ll, double>> st; for(int i=1;i<=n;i++){ ll x; double r; cin>>x>>r; while(!st.empty()){ pair<ll, double> curr=st.top(); r=min(r,( double)1LL*(x-curr.first)*(x-curr.first)/(4.0*curr.second)); if(r>curr.second){ st.pop(); continue; } else{ break; } } st.push({x,r}); cout<<r<<ntr; } }
#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...