# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1125400 | yavuzskarahan | Balloons (CEOI11_bal) | C11 | 114 ms | 4380 KiB |
#include <stdio.h>
#include <math.h>
#define N 200005
int n, x[N];
double r[N];
int main() {
scanf("%d", &n);
int maksxi = 0;
long double maksx = 0;
for (int i = 1; i <= n; ++i) {
scanf("%d %lf", &x[i], &r[i]);
r[i] = fmin(r[i], fabs(x[i] - x[maksxi]) * fabs(x[i] - x[maksxi]) / (4 * r[maksxi]));
if (r[i] + x[i] > maksx) {
maksx = r[i] + x[i];
maksxi = i;
}
else if (r[i] + x[i] == maksx){
if (r[i] > r[maksxi]){
maksx = r[i] + x[i];
maksxi = i;
}
}
printf("%.4lf\n", r[i]);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |