Submission #1016364

#TimeUsernameProblemLanguageResultExecution timeMemory
1016364cryptobunnyBalloons (CEOI11_bal)C++14
100 / 100
446 ms12112 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 { while (!s.empty()) { long double lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()]; r[i] = min(lim, r[i]); if (r[s.top()] < r[i]) { s.pop(); continue; } break; } 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...