#include <bits/stdc++.h>
using namespace std;
using pdd = pair<double, double>;
int32_t main() {
int n;
cin >> n;
vector<pdd> v(n);
for(pdd &x : v) cin >> x.first >> x.second;
stack<int> st;
for(int i=0; i<n; i++) {
while(!st.empty()) {
v[i].second = min(v[i].second, (v[st.top()].first - v[i].first) * (v[st.top()].first - v[i].first) / (4 * v[st.top()].second));
if(v[st.top()].second >= v[i].second) break;
st.pop();
}
st.push(i);
cout << setprecision(3) << fixed << v[i].second << '\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
3 ms |
348 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
1116 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
2132 KB |
50000 numbers |
2 |
Correct |
57 ms |
2388 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
114 ms |
4180 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
136 ms |
4776 KB |
115362 numbers |
2 |
Correct |
138 ms |
5460 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
179 ms |
6280 KB |
154271 numbers |
2 |
Correct |
242 ms |
9040 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
237 ms |
7892 KB |
200000 numbers |
2 |
Correct |
233 ms |
9044 KB |
199945 numbers |