Submission #945457

#TimeUsernameProblemLanguageResultExecution timeMemory
945457nolqfBalloons (CEOI11_bal)C++14
100 / 100
154 ms11672 KiB
#include <bits/stdc++.h> using namespace std; using ld = long double; const int DIM = 2e5 + 5; ld x[DIM], r[DIM]; inline ld get( int i, int j ) { return (x[i] - x[j]) * (x[i] - x[j]) / (4.0 * r[j]); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for ( int i = 1; i <= n; ++i ) { cin >> x[i] >> r[i]; } vector<int> stk; for ( int i = 1; i <= n; ++i ) { while ( stk.size() ) { r[i] = min(r[i], get(i, stk.back())); if ( r[i] < r[stk.back()] ) break; stk.pop_back(); } stk.push_back(i); } cout << fixed << setprecision(3); for ( int i = 1; i <= n; ++i ) { cout << r[i] << "\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...