제출 #1308748

#제출 시각아이디문제언어결과실행 시간메모리
1308748liptonekBalloons (CEOI11_bal)C++20
100 / 100
274 ms4400 KiB
#include <bits/stdc++.h> using namespace std; struct Balloon { long double x,r; }; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>>n; vector<Balloon> s; s.reserve(n); for(int i=0; i<n; i++) { long double xi,ri; cin>>xi>>ri; long double current=ri; while(!s.empty()) { const Balloon& prev=s.back(); long double limit=(xi-prev.x)*(xi-prev.x)/(4.0*prev.r); if(limit<current) { current=limit; } if(current>=prev.r) { s.pop_back(); } else { break; } } s.push_back({xi,current}); cout<<fixed<<setprecision(3)<<current<<endl; } 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...