Submission #605081

#TimeUsernameProblemLanguageResultExecution timeMemory
605081krit3379Balloons (CEOI11_bal)C++17
100 / 100
141 ms5420 KiB
#include<bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define N 200005 long double x,r; stack<pair<long double,long double>> st; int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++) for(i=1;i<=n;i++){ scanf("%Lf %Lf",&x,&r); while(!st.empty()){ auto [x1,r1]=st.top(); r=min(r,(x-x1)*(x-x1)/4/r1); if(r>=r1)st.pop(); else break; } st.push({x,r}); printf("%.3Lf\n",r); } return 0; }

Compilation message (stderr)

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