Submission #1030132

#TimeUsernameProblemLanguageResultExecution timeMemory
1030132ArthuroWichBalloons (CEOI11_bal)C++17
10 / 100
2090 ms9296 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int struct bal { int x, r; }; void solve() { int n; cin >> n; vector<long double> ans(n); vector<bal> p(n); for (int i = 0; i < n; i++) { cin >> p[i].x >> p[i].r; ans[i] = p[i].r; } for (int i = 0; i < n; i++) { for (int j = i-1; j >= 0; j--) { long double delta = abs(p[i].x-p[j].x); ans[i] = min(ans[i], (long double) delta*delta/(4.0L*p[j].r)); } } for (int i = 0; i < n; i++) { cout << fixed << setprecision(3) << ans[i] << endl; } } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); int t; t = 1; while(t--) { solve(); } }
#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...