Submission #414538

#TimeUsernameProblemLanguageResultExecution timeMemory
414538fahimcp495Balloons (CEOI11_bal)C++17
100 / 100
194 ms7768 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; int x[n]; double r[n]; for (int i = 0; i < n; ++i){ cin >> x[i] >> r[i]; } stack<int> st; for (int i = 0; i < n; ++i){ while (!st.empty()) { int dx = x[i]-x[st.top()]; r[i] = min(r[i], 1.0*dx*dx/(4*r[st.top()])); if (r[i] >= r[st.top()]) { st.pop(); } else break; } st.push(i); } cout << fixed << setprecision(3); for (int i = 0; i < n; ++i){ cout << r[i] << "\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...