Submission #924851

#TimeUsernameProblemLanguageResultExecution timeMemory
924851VMaksimoski008Balloons (CEOI11_bal)C++14
0 / 100
218 ms5156 KiB
#include <bits/stdc++.h> using namespace std; using pdd = pair<double, double>; int32_t main() { int n; cin >> n; vector<pdd> v(n); for(pdd &x : v) cin >> x.first >> x.second; stack<int> st; for(int i=0; i<n; i++) { while(!st.empty() && v[st.top()].second <= v[i].second) st.pop(); if(!st.empty()) v[i].second = min(v[i].second, (v[st.top()].first - v[i].first) * (v[st.top()].first - v[i].first) / (4 * v[st.top()].second)); st.push(i); cout << setprecision(3) << fixed << v[i].second << '\n'; } return 0; }
#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...