Submission #925021

#TimeUsernameProblemLanguageResultExecution timeMemory
925021VMaksimoski008Balloons (CEOI11_bal)C++14
100 / 100
242 ms9044 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[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)); if(v[st.top()].second >= v[i].second) break; st.pop(); } 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...