Submission #211950

#TimeUsernameProblemLanguageResultExecution timeMemory
211950csamoilaBalloons (CEOI11_bal)C++14
100 / 100
826 ms5624 KiB
#include <iostream> #include <stack> #include <iomanip> using namespace std; int n; stack < pair <int,double> > s; double raza_maxima(int x,double r) { while(!s.empty()) { int x1=s.top().first; double r1=s.top().second; double rnou=(double)(x-x1)*(x-x1)/(double)(4*r1); //cout << rnou << '\n'; //cout << s.size() << 'w'; r=min(rnou,r); if(r<r1) { break; } s.pop(); } s.push({x,r}); return r; } int main() { cin >> n; for(int i=1;i<=n;i++) { int x; double r; cin >> x >> r; cout << fixed << setprecision(3) << raza_maxima(x,r) << '\n'; } // while(!s.empty()) // { // cout << s.top().first << ' ' << s.top().second << '\n'; // s.pop(); // } }
#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...