# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
484254 |
2021-11-02T17:52:07 Z |
Olympia |
Balloons (CEOI11_bal) |
C++17 |
|
2000 ms |
4072 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];
}
set<int> indices = {0};
for (int i = 1; i < n; i++) {
set<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]);
if (r[j] >= myMax) {
new_indices.insert(-j);
//break;
} else {
break;
}
r[i] = min(r[i], val);
}
new_indices.insert(-i);
indices = new_indices;
}
for (double d: r) {
cout << setprecision(30) << d << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
348 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
222 ms |
460 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2086 ms |
1092 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2099 ms |
1612 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2084 ms |
2396 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2100 ms |
2624 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2061 ms |
3156 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2076 ms |
4072 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |