Submission #1059315

#TimeUsernameProblemLanguageResultExecution timeMemory
1059315ssitaramBalloons (CEOI11_bal)C++17
100 / 100
103 ms11860 KiB
#include <bits/stdc++.h> using namespace std; typedef long double ld; struct bal { ld x, r; }; ld sq(ld v) { return v * v; } int main() { ios::sync_with_stdio(0); cin.tie(nullptr); cout << fixed << setprecision(3); int n; cin >> n; vector<bal> ball(n); for (bal& b : ball) cin >> b.x >> b.r; stack<bal> pre; for (bal& b : ball) { while (!pre.empty()) { b.r = min(b.r, sq(b.x - pre.top().x) / (4 * pre.top().r)); if (b.r < pre.top().r) break; pre.pop(); } pre.push(b); cout << b.r << '\n'; } return 0; }
#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...