Submission #956882

#TimeUsernameProblemLanguageResultExecution timeMemory
956882vjudge1Balloons (CEOI11_bal)C++17
10 / 100
162 ms10836 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int maxn = 2e5 + 10; struct ball { double x, r; }; int n; ball a[maxn]; double ra[maxn]; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n; for(int i = 1; i <= n; ++i) { cin >> a[i].x >> a[i].r; ra[i] = a[i].r; } deque <ball> d; for(int i = 1; i <= n; ++i) { while(!d.empty()) { ball tmp = d.back(); ra[i] = min(ra[i], (a[i].x - tmp.x)*(a[i].x - tmp.x) / (4*tmp.r)); if(ra[i] >= tmp.r) d.pop_back(); else break; } d.push_back(a[i]); } for(int i = 1; i <= n; ++i) { cout << fixed << setprecision(3) << ra[i] << '\n'; } }
#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...