Submission #1131636

#TimeUsernameProblemLanguageResultExecution timeMemory
1131636monostackBalloons (CEOI11_bal)C++20
0 / 100
1 ms328 KiB
#include<bits/stdc++.h> using namespace std; #define ld long double int main(){ if(fopen("input.txt","r")){ freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); }else{ freopen("bal.in","r",stdin); freopen("bal.out","w",stdout); } cout<<fixed<<setprecision(3); int n; cin>>n; vector<long double> ans; stack<pair<int,long double>> ms; for(auto i = 0; i < n; i++){ int x,r; cin>>x>>r; ld r_ = r; while(ms.size()){ r_ = ((ld)(x - ms.top().first)*(ld)(x - ms.top().first))/((ld)4*ms.top().second); if(r_ < r) ms.pop(); else break; } r_ = min(r_, r+0.000l); ms.push({x,r_}); cout<<ms.top().second<<'\n'; } }

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:9:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |         freopen("input.txt","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:10:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         freopen("output.txt","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:12:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         freopen("bal.in","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
bal.cpp:13:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         freopen("bal.out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...