Submission #433143

#TimeUsernameProblemLanguageResultExecution timeMemory
433143jli12345Balloons (CEOI11_bal)C++14
100 / 100
209 ms10892 KiB
#include <bits/stdc++.h> using namespace std; int N; pair<long long, double> arr[200100]; double ans[200100]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> N; for (int i = 1; i <= N; i++){ cin >> arr[i].first >> arr[i].second; } stack<int> s; for (int i = 1; i <= N; i++){ double rad = arr[i].second; while (!s.empty()){ rad = min(rad, pow((arr[i].first-arr[s.top()].first), 2)/(4*ans[s.top()])); rad = min(rad, arr[i].second); if (rad > ans[s.top()]) s.pop(); else break; } s.push(i); ans[i] = rad; } for (int i = 1; i <= N; i++){ cout << fixed << setprecision(5) << ans[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...