Submission #218322

#TimeUsernameProblemLanguageResultExecution timeMemory
218322ChanchoBalloons (CEOI11_bal)C++14
20 / 100
263 ms11896 KiB
#include <iostream> #include <iomanip> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int pila[n]; long double x[n]; long double r[n]; long double ans[n]; for(int i=0;i<n;i++){ cin >> x[i] >> r[i]; } pila[0] =0; int index = 0; for(int i=0;i<n;i++){ if(i==0){ ans[0] = r[0]; } else{ bool first = true; long double k; while (index >= 0){ if(first){ k = min(r[i],((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]])); first = false; } else{ k = min(k,((x[i]-x[pila[index]])/(4*ans[pila[index]]))*(x[i]-x[pila[index]])); } if(k<=ans[index]){ break; } pila[index] = 0; index--; } ans[i] = k; pila[index+1] = i; index++; } cout << fixed << setprecision(6) << ans[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...