Submission #722670

#TimeUsernameProblemLanguageResultExecution timeMemory
722670MackerBalloons (CEOI11_bal)C++14
100 / 100
207 ms5452 KiB
#include <iostream> #include <vector> #include <list> #include <algorithm> #include <math.h> #include <tuple> #include <queue> #include <stack> #include <unordered_map> #include <unordered_set> #include <set> #include <map> #include <climits> #include <fstream> #include <cassert> #include <iomanip> using namespace std; typedef long long ll; typedef long double ld; #define all(v) v.begin(), v.end() ld getR(ll dist, ld r) { return ((ld)(dist * dist)) / (4 * r); } int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); ll n; cin >> n; stack<pair<ll, ld>> s; cout << fixed << setprecision(3); for (ll i = 0; i < n; i++) { ll pos; ld r; cin >> pos >> r; while(!s.empty()) { ll d = pos - s.top().first; r = min(getR(d, s.top().second), r); if (r < s.top().second) break; else s.pop(); } cout << r << "\n"; s.push({ pos, r }); } }
#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...