Submission #464026

#TimeUsernameProblemLanguageResultExecution timeMemory
464026dutchBalloons (CEOI11_bal)C++17
100 / 100
147 ms4356 KiB
#include <bits/stdc++.h> using namespace std; #ifdef _WIN32 #define getchar _getchar_nolock #else #define getchar getchar_unlocked #endif struct readInt{ readInt& operator>>(int &I){ char J = I = 0; while(J < 48) J = getchar(); while(J > 47) I = I * 10 + J - 48, J = getchar(); return *this; } #define cin __read__ } __read__; const int LIM = 2e5; int n, x[LIM], st[LIM+1], *p = st; double y[LIM]; signed main(){ cin >> n; cout << fixed << setprecision(4); for(int i=0, j; i<n; ++i){ cin >> x[i] >> j; y[i] = j; while(p != st){ y[i] = min(y[i], (double(x[*p] - x[i]) * double(x[*p] - x[i])) / (4.0 * y[*p])); if(y[*p] < y[i]) --p; else break; } cout << y[*(++p) = i] << '\n'; } }
#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...