Submission #683572

#TimeUsernameProblemLanguageResultExecution timeMemory
683572NONTACBalloons (CEOI11_bal)C++11
10 / 100
2093 ms9592 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<long double, long double> ll; const int MAX_N = 200000; int n; long double x[MAX_N + 1], r[MAX_N + 1]; long double expected_val(long double x1, long double r1, long double x2) { return (x1 - x2) * (x1 - x2) / (4 * r1); } int main() { //freopen("test.in","r",stdin); //freopen("test.out","w",stdout); cin>>n; for(int i = 0; i < n; i++){ cin>>x[i]>>r[i]; } stack<ll> s; s.push(ll(0, r[0])); printf("%.3Lf\n", r[0]); for(int i = 1; i < n; i++){ long double tmp = 1000000000.0; for(int j = 0; j < i; j++){ tmp = min(tmp, expected_val(x[j], r[j], x[i])); } printf("%.3Lf\n", min(r[i], tmp)); } 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...