Submission #717824

#TimeUsernameProblemLanguageResultExecution timeMemory
717824adrilenBalloons (CEOI11_bal)C++17
100 / 100
275 ms5880 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; typedef pair<ld, ld> pii; ld dist(ld dx, ld r) { return dx * dx / (4 * r); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; cout << fixed << setprecision(5); stack<pii> s; ld x, r, l; while (n--) { cin >> x >> r; while (s.size()) { l = dist(s.top().first - x, s.top().second); l = min(l, r); if (l >= s.top().second) { s.pop(); r = min(r, l); } else { r = l; break; } } s.push(pii(x, r)); cout << r << "\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...