Submission #573363

#TimeUsernameProblemLanguageResultExecution timeMemory
573363codebuster_10Balloons (CEOI11_bal)C++17
100 / 100
274 ms5404 KiB
#include <bits/stdc++.h> using ld = long double; typedef std::pair<ld,ld> pll; ld raio(ld d,ld r2){ return (d*d)/(4*r2); } int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int N; std::cin>>N; std::stack<pll> stack; for(int _ = 0;_!=N;++_){ ld x,r; std::cin>>x>>r; while(stack.size()){ ld l = raio(stack.top().first-x,stack.top().second); l=std::min(l,r); if(l>=stack.top().second){ stack.pop(); r=std::min(l,r); }else { r=l; break; } } stack.push({x,r}); std::cout<<std::fixed<<std::setprecision(3)<<r<<"\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...