Submission #550355

#TimeUsernameProblemLanguageResultExecution timeMemory
550355aadit_ambadkarBalloons (CEOI11_bal)C++11
100 / 100
592 ms7564 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; int main() { int n; cin >> n; cout << fixed << setprecision(3); stack<ld> st; stack<int> xs; int x; ld r; cin >> x >> r; st.push(r); xs.push(x); cout << r << "\n"; for (int i = 0; i < n-1; i++) { cin >> x >> r; r = min(r, ((ld)xs.top()-x)*((ld)xs.top()-x)/(4*st.top())); while (!st.empty() && r > st.top()) { st.pop(); xs.pop(); if (st.empty()) break; r = min(r, ((ld)xs.top()-x)*((ld)xs.top()-x)/(4*st.top())); } cout << r << "\n"; st.push(r); xs.push(x); } }
#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...