Submission #712526

#TimeUsernameProblemLanguageResultExecution timeMemory
712526yuseok0803Balloons (CEOI11_bal)C++14
20 / 100
149 ms9592 KiB
#include <stdio.h> #include <vector> #include <queue> #include <set> #include <map> #include <algorithm> #include <stdlib.h> #include <string.h> #include <math.h> #include <stack> #include <ctype.h> #define p(x,y) pair<x, y> #define pii pair<int, int> #define v(x) vector<x> #define q(x) queue<x> #define pq(x) priority_queue<x> #define uppq(x, comp) priority_queue<x, vector<x>, comp> #define st(x) set<x> #define m(x, y) map<x, y> #define fi(s,e) for(int i=s;i<e;i++) #define fj(s,e) for(int j=s;j<e;j++) #define fk(s,e) for(int k=s;k<e;k++) typedef long long int ll; typedef unsigned long long int ull; typedef __int128 ulll; using namespace std; int x[200010]; int r[200010]; double ans[200010]; stack<int> bal; int main(void){ int n; scanf("%d",&n); fi(0,n){ scanf("%d%d",&x[i],&r[i]); ans[i]=r[i]; while(bal.size()){ ans[i] = min(ans[i], (double)((x[i]-x[bal.top()])*(x[i]-x[bal.top()])/(ans[bal.top()]*4.0))); if(ans[i] > ans[bal.top()]) bal.pop(); else break; } bal.push(i); } fi(0,n) printf("%.3lf\n", ans[i]); return 0; }

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:35:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
bal.cpp:37:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |   scanf("%d%d",&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...