Submission #772104

#TimeUsernameProblemLanguageResultExecution timeMemory
772104NK_Balloons (CEOI11_bal)C++17
10 / 100
139 ms7352 KiB
// Success consists of going from failure to failure without loss of enthusiasm #include <bits/stdc++.h> using namespace std; #define nl '\n' using ld = long double; const ld eps = 1e-9; int main() { cin.tie(0)->sync_with_stdio(0); cout << fixed << setprecision(10); int N; cin >> N; vector<pair<int, ld>> A; for(int i = 0; i < N; i++) { int x, r; cin >> x >> r; ld ans = r; while(size(A)) { ld D = (x - A.back().first) * ld(1) * (x - A.back().first); ld R = min(ld(r), D / (4 * A.back().second)); // cout << ans - R << " - " << x << endl; if ((ans - R) > eps) { ans = R; // cout << ans << endl; A.pop_back(); } else break; } cout << ans << nl; A.push_back({x, ans}); } 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...