This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3,unroll-loops")
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<set>
#include<unordered_set>
#include<numeric>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<math.h>
#include<iomanip>
#include<array>
#include<climits>
//#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define double long double
#define str string
#define ins insert
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sqr(x) (x)*(x)
using namespace std;
//using namespace __gnu_pbds;
//template <typename T>
//using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
void solve() {
int n;
cin >> n;
vector<double> x(n),r(n);
for (int i=0; i<n; i++) {
cin >> x[i] >> r[i];
} vector<double> ans(n);
ans[0]=r[0];
for (int i=1; i<n; i++) {
double fori=r[i];
for (int j=0; j<i; j++) {
fori=min(fori,(double)sqr(x[i]-x[j])/(double)(4*ans[j]));
} ans[i]=fori;
} for (int i=0; i<n; i++) {
cout << ans[i];
if (i<n-1) cout << "\n";
}
}
int main() {
//freopen("sleepy.in", "r", stdin);
//freopen("sleepy.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0);
int tt=1;
//cin >> tt;
cout << fixed << setprecision(3);
for (int i=1; i<=tt; i++) {
//cout << "Case#" << i << ":\n";
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |