Submission #1096865

#TimeUsernameProblemLanguageResultExecution timeMemory
1096865ocasuBalloons (CEOI11_bal)C++17
100 / 100
155 ms10248 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double signed main(){ int n; cin>>n; vector<int> x(n); vector<double> r(n); for (int i=0; i<n; i++) cin>>x[i]>>r[i]; stack<int> s; for (int i=0; i<n; i++){ while (!s.empty()){ r[i] = min(r[i], (double)((x[i]-x[s.top()])*((x[i]-x[s.top()])))/(double)(4*r[s.top()])); if (r[s.top()]>r[i]) break; s.pop(); } s.push(i); printf("%.3Lf\n", r[i]); } }
#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...