Submission #1016360

#TimeUsernameProblemLanguageResultExecution timeMemory
1016360cryptobunnyBalloons (CEOI11_bal)C++14
20 / 100
421 ms8276 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<long double> r(n), x(n); cout << fixed << setprecision(3); for (int i = 0; i < n; i++) cin >> x[i] >> r[i]; stack<int> s; for (int i = 0; i < n; i++) { if (s.empty()) { s.push(i); cout << r[i] << endl; } else { long double lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()]; r[i] = min(lim, r[i]); while (lim > r[i]) { s.pop(); if (s.empty()) break; lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()]; r[i] = min(lim, r[i]); } cout << r[i] << endl; s.push(i); } } }
#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...