Submission #919688

#TimeUsernameProblemLanguageResultExecution timeMemory
919688buzdiBalloons (CEOI11_bal)C++14
100 / 100
236 ms10064 KiB
//#include <fstream> #include <iostream> #include <stack> #include <queue> #include <algorithm> #include <vector> #include <cassert> #include <map> #include <iomanip> #define ll long long using namespace std; const int NMAX = 2e5; struct Point { long double x, y; void Read() { cin >> x >> y; } }; int n; Point a[NMAX + 1]; long double answer[NMAX + 1]; Point st[NMAX + 1]; int indst; long double Square(long double x) { return x * x; } long double Radius(Point p1, Point p2) { return Square(p2.x - p1.x) / (4.0 * p1.y); } int main() { cin >> n; for (int i = 1; i <= n; i++) a[i].Read(); for(int i = 1; i <= n; i++) { while(indst > 0 && (a[i].y = min(a[i].y, Radius(st[indst], a[i]))) >= st[indst].y) indst--; st[++indst] = a[i]; } for (int i = 1; i <= n; i++) cout << fixed << setprecision(3) << a[i].y << '\n'; return 0; }
#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...