Submission #532176

#TimeUsernameProblemLanguageResultExecution timeMemory
532176rsjwBalloons (CEOI11_bal)C++14
100 / 100
144 ms9112 KiB
#include <bits/stdc++.h> using namespace std; double x[200010],r[200010]; stack<int> s; int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%lf%lf",&x[i],&r[i]); for(i=1;i<=n;i++) { while(!s.empty()) { r[i]=min(r[i],(x[i]-x[s.top()])*(x[i]-x[s.top()])/4.0/r[s.top()]); if(r[s.top()]<=r[i]) s.pop(); else break; } s.push(i); } for(i=1;i<=n;i++) printf("%lf\n",r[i]); return 0; }

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
bal.cpp:8:25: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  for(i=1;i<=n;i++) scanf("%lf%lf",&x[i],&r[i]);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...