Submission #269801

#TimeUsernameProblemLanguageResultExecution timeMemory
269801stefantagaBalloons (CEOI11_bal)C++14
100 / 100
259 ms15352 KiB
#include <bits/stdc++.h> using namespace std; pair <long double,long double> centru[200005],p1; long double raza[200005]; struct wow { long double loc,raza; }v[200005]; long double dist (pair <long double , long double> p1, pair <long double,long double> p2) { return (p1.first-p2.first)*(p1.first-p2.first)+(p1.second-p2.second)*(p1.second-p2.second); } long double raza1 (long double poz,int ind) { return ((poz-v[ind].loc)*(poz-v[ind].loc))/(4*raza[ind]); } int n,i; long double st,dr,mij,sol,minim; deque <int> d; int main() { ios_base :: sync_with_stdio(false); cin.tie(0); #ifdef HOME ifstream cin("date.in"); ofstream cout("date.out"); #endif // HOME cin>>n; for (i=1;i<=n;i++) { cin>>v[i].loc>>v[i].raza; minim=v[i].raza; while (!d.empty()) { minim=min(minim,raza1(v[i].loc,d.back())); if (minim>raza[d.back()]) { d.pop_back(); } else { break; } } raza[i]=minim; d.push_back(i); } for (i=1;i<=n;i++) { cout<<fixed<<setprecision(3)<<raza[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...