# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
484256 |
2021-11-02T17:54:20 Z |
Olympia |
Balloons (CEOI11_bal) |
C++17 |
|
2000 ms |
4288 KB |
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <set>
#include <iomanip>
#define ll long long
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<double> x(n), r(n);
for (int i = 0; i < n; i++) {
cin >> x[i] >> r[i];
}
vector<int> indices = {0};
for (int i = 1; i < n; i++) {
vector<int> new_indices;
int myMax = 0;
for (int ind: indices) {
int j = -ind;
double val = ((x[i] - x[j]) * (x[i] - x[j])) / (4.0 * r[j]);
r[i] = min(r[i], val);
if (r[j] >= myMax) {
new_indices.push_back(-j);
} else {
break;
}
}
new_indices.push_back(-i);
indices = new_indices;
}
for (double d: r) {
cout << setprecision(10) << d << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
2nd numbers differ - expected: '252735385.4379999936', found: '252735385.4000000060', error = '0.0379999876' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
332 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
460 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
852 ms |
1392 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2093 ms |
1960 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2091 ms |
2624 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2090 ms |
2808 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2087 ms |
3352 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2086 ms |
4288 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |