Submission #467592

#TimeUsernameProblemLanguageResultExecution timeMemory
467592nicolaalexandraBalloons (CEOI11_bal)C++14
100 / 100
352 ms12112 KiB
#include <bits/stdc++.h> #define DIM 200010 using namespace std; struct cerc{ long long x; long double r; } v[DIM]; int n,i,j; deque <int> d; long double get_raza (int i, int j){ v[i].r = min (v[i].r, 1.0 * (v[i].x - v[j].x) * (v[i].x - v[j].x) / (4.0 * v[j].r)); return v[i].r; } int main (){ //ifstream cin ("date.in"); //ofstream cout ("date.out"); cin>>n; for (i=1;i<=n;i++) cin>>v[i].x>>v[i].r; for (i=1;i<=n;i++){ while (!d.empty() && get_raza(i,d.back()) > v[d.back()].r) d.pop_back(); d.push_back(i); cout<<setprecision(3)<<fixed<<v[i].r<<"\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...