Submission #238944

#TimeUsernameProblemLanguageResultExecution timeMemory
238944dolphingarlicBalloons (CEOI11_bal)C++14
100 / 100
184 ms3908 KiB
#include <bits/stdc++.h> main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f\n",r);}}

Compilation message (stderr)

bal.cpp:2:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f\n",r);}}
      ^
bal.cpp: In function 'int main()':
bal.cpp:2:57: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f\n",r);}}
                                                    ~~~~~^~~~~~~~~
bal.cpp:2:94: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 main(){int n;std::stack<std::pair<double,double>>s;scanf("%d",&n);while(n--){double x,r;scanf("%lf %lf",&x,&r);while(s.size()){r=std::min(r,pow(x-s.top().first,2)/s.top().second/4);if(r>s.top().second)s.pop();else break;}s.push({x,r});printf("%f\n",r);}}
                                                                                         ~~~~~^~~~~~~~~~~~~~~~~
#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...