Submission #211947

#TimeUsernameProblemLanguageResultExecution timeMemory
211947csamoilaBalloons (CEOI11_bal)C++14
10 / 100
819 ms2772 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'; if(r<rnou) { break; } r=rnou; 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...