Submission #925023

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