# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754415 | 2023-06-07T17:46:55 Z | PanosPask | Balloons (CEOI11_bal) | C++14 | 127 ms | 10108 KB |
#include <bits/stdc++.h> #define pb push_back using namespace std; typedef long long ll; int n; vector<int> active_circles; vector<long double> radius; vector<int> maxradius; vector<int> position; long double find_r2(int x1, long double r1, int x2) { return ((ll)(x1 - x2) * (x1 - x2)) / (4 * r1); } long double allowed_radius(int i, int j) { return find_r2(position[i], radius[i], position[j]); } int main(void) { scanf("%d", &n); position.resize(n); maxradius.resize(n); radius.resize(n); for (int i = 0; i < n; i++) { scanf("%d %d", &position[i], &maxradius[i]); } for (int i = 0; i < n; i++) { bool foundbreak = false; radius[i] = maxradius[i]; while (!active_circles.empty()) { radius[i] = min(radius[i], allowed_radius(active_circles.back(), i)); if (radius[i] >= radius[active_circles.back()]) active_circles.pop_back(); else break; } active_circles.push_back(i); printf("%.3Lf\n", radius[i]); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | 10 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | 2 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | 505 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 340 KB | 2000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 912 KB | 20000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 32 ms | 1900 KB | 50000 numbers |
2 | Correct | 27 ms | 2764 KB | 49912 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 66 ms | 3568 KB | 100000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 70 ms | 4052 KB | 115362 numbers |
2 | Correct | 72 ms | 6172 KB | 119971 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 96 ms | 5296 KB | 154271 numbers |
2 | Correct | 109 ms | 10080 KB | 200000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 127 ms | 6528 KB | 200000 numbers |
2 | Correct | 102 ms | 10108 KB | 199945 numbers |