Submission #919685

#TimeUsernameProblemLanguageResultExecution timeMemory
919685buzdiBalloons (CEOI11_bal)C++11
100 / 100
1617 ms10108 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++) { for (int j = 1; j <= indst; j++) a[i].y = min(a[i].y, Radius(st[j], a[i])); while (indst > 0 && st[indst].y <= a[i].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...