Submission #941937

# Submission time Handle Problem Language Result Execution time Memory
941937 2024-03-09T18:43:09 Z abel2008 Balloons (CEOI11_bal) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <stack>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long double;
ll n,x,r,rez;
stack<pair<ll,ll>> S; // pozitia si raza pe care o are
int main() {
        cin>>n;
        cin>>x>>r;
        rez+=r;
        S.emplace(x,r);
        cout<<fixed<<setprecision(3)<<r<<'\n';
        for (int i = 2;i<=n;++i) {
                cin>>x>>r;
                ll crtr = r;
                // verificam limitele de dinainte
                bool ok = 1;
                while(ok&&!S.empty()) {
                        // calculam radius maxim fata de cercul de dinainte
                        ll maxr = pow((x-S.top().first),2LL)/(4*S.top().second);
                        crtr = min(crtr,maxr);
                        if (S.top().second<=crtr) {
                                // we can remove it and keep searching
                                ok = 1;
                                S.pop();
                        } else {
                                //
                                ok = 0;
                        }
                }
                S.emplace(x,crtr);
                rez+=crtr;
                cout<<fixed<<setprecision(3)<<crtr<<'\n';
        }
//        cout<<rez;
        return 0;
}

Compilation message

bal.cpp: In function 'int main()':
bal.cpp:22:35: error: 'pow' was not declared in this scope
   22 |                         ll maxr = pow((x-S.top().first),2LL)/(4*S.top().second);
      |                                   ^~~