Submission #584573

#TimeUsernameProblemLanguageResultExecution timeMemory
584573israeladewuyiBalloons (CEOI11_bal)C++17
100 / 100
623 ms6852 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll #define endl "\n" int N; int32_t main(){ cin>>N; stack<pair<long double, long double>>St; for(int i = 0; i < N; i++){ long double pos, radius; cin>>pos>>radius; if(i == 0){ cout<<fixed<<setprecision(10)<<radius<<endl; St.push({pos, radius}); } else{ while(!St.empty()){ auto cur = St.top(); long double pp = cur.first; long double radd = cur.second; radius = min((long double)radius, (long double)((pos - pp) * (pos - pp)) / (long double)(4 * radd)); if(radius >= radd){ St.pop(); } else break; } St.push({pos, radius}); cout<<fixed<<setprecision(10)<<radius<<endl; } } return 0; }
#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...