This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std;
#define ll long long
#define ii pair<int, int>
#define FOR(i, l, r) for (int i = (l); i <= (r); i++)
#define all(x) x.begin(), x.end()
const int N = 5e5 + 5;
const ll MOD = 998244353;
int n;
pair<long double, long double> a[N];
long double z[N];
int main() {
#ifdef CHUNGDINH
freopen("main.inp","r",stdin);
#endif // CHUNGDINH
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i].first >> a[i].second;
long double tt = a[i].second;
for (int j = i - 1; j >= 1; j--) tt = min(tt, (a[i].first - a[j].first) * (a[i].first - a[j].first) / 4 / z[j]);
z[i] = tt;
printf("%.3Lf\n", z[i]);
}
}
# | 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... |