# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
671244 |
2022-12-12T13:49:17 Z |
adaawf |
Balloons (CEOI11_bal) |
C++14 |
|
540 ms |
7044 KB |
#include <iostream>
#include <stack>
#include <iomanip>
using namespace std;
double res[1000005];
int main() {
int n;
cin >> n;
stack<pair<double, double>> s;
for (int i = 0; i < n; i++){
double x, r, mi;
cin >> x >> r;
mi = r;
while (!s.empty()) {
pair<double, double> p = s.top();
mi = min(mi, (p.first - x) * (p.first - x) / (p.second * 4));
if (mi >= p.second) {
s.pop();
}
else break;
}
s.push(make_pair(x, mi));
res[i] = mi;
}
cout << fixed << setprecision(3);
for (int i = 0; i < n; i++) {
cout << res[i] << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
312 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
56 ms |
828 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
141 ms |
1880 KB |
50000 numbers |
2 |
Correct |
149 ms |
1868 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
292 ms |
3452 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
321 ms |
4032 KB |
115362 numbers |
2 |
Correct |
328 ms |
4308 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
418 ms |
5144 KB |
154271 numbers |
2 |
Correct |
534 ms |
6888 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
520 ms |
6124 KB |
200000 numbers |
2 |
Correct |
540 ms |
7044 KB |
199945 numbers |