Submission #1016358

#TimeUsernameProblemLanguageResultExecution timeMemory
1016358cryptobunnyBalloons (CEOI11_bal)C++14
10 / 100
374 ms10836 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()]; while (lim >= r[s.top()]) { s.pop(); if (s.empty()) break; lim = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()]; } if (!s.empty()) 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...