Submission #941937

#TimeUsernameProblemLanguageResultExecution timeMemory
941937abel2008Balloons (CEOI11_bal)C++14
Compilation error
0 ms0 KiB
#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 (stderr)

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);
      |                                   ^~~