Submission #549591

#TimeUsernameProblemLanguageResultExecution timeMemory
549591JomnoiBalloons (CEOI11_bal)C++17
100 / 100
223 ms5436 KiB
#include <bits/stdc++.h> #define DEBUG 0 using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; stack <pair <double, double>> stk; for(int i = 1; i <= n; i++) { double x, r, nr; cin >> x >> r; while(!stk.empty() and (r = min(r, (stk.top().first - x) * (stk.top().first - x) / (4 * stk.top().second))) >= stk.top().second) { stk.pop(); } stk.emplace(x, r); cout << fixed << setprecision(3) << r << '\n'; } return 0; }

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:11:22: warning: unused variable 'nr' [-Wunused-variable]
   11 |         double x, r, nr;
      |                      ^~
#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...