#include <bits/stdc++.h>
using namespace std;
#define InTheNameOfGod ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
using ll = long long;
const int maxN = 2e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
int main() {
InTheNameOfGod;
int n;
cin >> n;
vector<pair<double, double> > v(n);
for(int i = 0; i < n; i++) {
cin >> v[i].first >> v[i].second;
}
vector<double> mo = {v[0].second};
for(int i = 1; i < n; i++) {
double mini = v[i].second;
for(int j = 0; j < i; j++) {
double x = v[i].first - v[j].first;
mini = min(mini, x*x/4.0/mo[j]);
}
mo.push_back(mini);
}
cout << fixed << setprecision(3);
for(int i = 0; i < n; i++) cout << mo[i] << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
600 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
348 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
346 ms |
1368 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2005 ms |
2696 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2033 ms |
4580 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2005 ms |
4692 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2098 ms |
5896 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2016 ms |
6968 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |