Submission #488007

#TimeUsernameProblemLanguageResultExecution timeMemory
488007s_samchenkoBalloons (CEOI11_bal)C++17
50 / 100
2095 ms7624 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> //#pragma GCC optimize("Ofast") //#pragma GCC target ("avx2") #define ll long long #define ull unsigned long long #define ff first #define ss second #define int ll #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define pb push_back #define pii pair <int, int> #define pdd pair <double, double> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const int inf = 1e15; const int mod = 1e9+7; const int N = 1e6+100, C = 330; void solve(){ int n; cin >> n; vector <int> x(n), r(n); for (int i = 0; i < n; ++i) cin >> x[i] >> r[i]; vector <double> ans(n); for (int i = 0; i < n; ++i){ double res = r[i]; for (int j = i-1; j >= 0; --j){ double cur = (x[i] - x[j]) * (x[i] - x[j]); cur /= 4 * ans[j]; res = min(res, cur); } ans[i] = res; } for (auto i : ans) cout << fixed << setprecision(10) << i << '\n'; } signed main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int tt = 1; //cin >> tt; while (tt--){ solve(); cout << '\n'; } }
#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...