# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
767278 |
2023-06-26T14:59:14 Z |
Alora |
Balloons (CEOI11_bal) |
C++17 |
|
125 ms |
4288 KB |
#include <bits/stdc++.h>
#define name "cownav"
#define fi(i,a,b) for(int i = a; i <= b; i++)
#define fid(i,a,b) for(int i = a; i >= b; i--)
#define ll long long
#define f first
#define se second
#define pii pair<int, int>
#define getbit(i, j) ((i >> j) & 1)
#define pb push_back
#define all(v) v.begin(), v.end()
#define maxn 200005
const int M = 1e9 + 7;
using namespace std;
int n, x[maxn], top, q[maxn];
double r[maxn];
void sub1(){
fi(i, 2, n){
fi(j, 1, i - 1){
ll A = 1ll*(x[i] - x[j])*(x[i] - x[j]);
double _r = A/(4*r[j]);
r[i] = min(r[i], _r);
}
}
fi(i, 1, n) cout << fixed << setprecision(3) << r[i] << '\n';
exit(0);
}
double radius(int a, int b, double c){
ll A = 1ll*(a - b)*(a - b);
return A/(4*c);
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
// freopen(name".in", "r", stdin);
// freopen(name".out", "w", stdout);
cin >> n;
fi(i, 1, n) cin >> x[i] >> r[i];
if(n <= 2000) sub1();
top = 1; q[1] = 1;
fi(i, 2, n){
while(top > 0 && radius(x[q[top]], x[i], r[q[top]]) < r[i]){
r[i] = min(r[i], radius(x[q[top]], x[i], r[q[top]]));
top--;
}
q[++top] = i;
}
fi(i, 1, n) cout << fixed << setprecision(3) << r[i] << '\n';
}
# |
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 |
5 ms |
340 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
680 KB |
196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
1324 KB |
13945th numbers differ - expected: '0.0140000000', found: '7.0000000000', error = '6.9860000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
71 ms |
2392 KB |
7236th numbers differ - expected: '0.0070000000', found: '7.0000000000', error = '6.9930000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
79 ms |
2764 KB |
4645th numbers differ - expected: '0.0260000000', found: '8.0000000000', error = '7.9740000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
110 ms |
3516 KB |
1730th numbers differ - expected: '5.6890000000', found: '6.8060000000', error = '1.1170000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
125 ms |
4288 KB |
2716th numbers differ - expected: '22.1690000000', found: '43.0000000000', error = '20.8310000000' |
2 |
Halted |
0 ms |
0 KB |
- |