Submission #722669

#TimeUsernameProblemLanguageResultExecution timeMemory
722669MackerBalloons (CEOI11_bal)C++14
20 / 100
250 ms6544 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(int dist, ld r) { return (ld)(dist * dist) / (4 * r); } int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int n; cin >> n; stack<pair<int, ld>> s; cout << fixed << setprecision(3); for (int i = 0; i < n; i++) { int pos; ld r; cin >> pos >> r; while(!s.empty()) { int 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...