답안 #941936

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
941936 2024-03-09T18:42:35 Z abel2008 Balloons (CEOI11_bal) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <stack>
#include <iomanip>
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:21:35: error: 'pow' was not declared in this scope
   21 |                         ll maxr = pow((x-S.top().first),2LL)/(4*S.top().second);
      |                                   ^~~