Submission #1086341

#TimeUsernameProblemLanguageResultExecution timeMemory
1086341SnowRaven52Balloons (CEOI11_bal)C++17
100 / 100
412 ms14928 KiB
#include <bits/stdc++.h> using namespace std; int main(){ // freopen("main.in", "r", stdin); // freopen(".out", "w", stdout); long long n; cin >> n; long double x[n], r[n], r_f[n]; for (long long i = 0; i < n; i++) cin >> x[i] >> r[i]; stack<long long> st; for (long long i = 0; i < n; i++){ while (st.size()) { long double rad = (x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * r_f[st.top()]); r[i] = min(r[i], rad); if (r[i] >= r_f[st.top()]) { st.pop(); continue; } else break; } r_f[i] = r[i]; st.push(i); } cout << fixed << setprecision(3); for (long long i = 0; i < n; i++) cout << r_f[i] << endl; }
#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...