# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1119469 |
2024-11-27T05:05:50 Z |
Miquella_ |
Balloons (CEOI11_bal) |
C++14 |
|
210 ms |
34868 KB |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define S second
#define F first
#define all(x) (x).begin(), (x).end()
#define el "\n"
#define fo(i,a,b) for(int i =a;i<=b;i++)
#define fo1(i,a,b) for(int i =a;i>=b;i--)
#define bit(mask,i) ((mask>>i)&1)
#define pi pair<ll,ll>
#define NAME ""
using namespace std;
const int MAXN = 1e6+5;
const ll MOD = 1e9+7;
const int maxp = 2e7;
double n,a[MAXN],res,m,k,t,r[MAXN];
vector<ll> adj[MAXN];
deque<ll> deq;
double maxRadius(double x,double y,double x1) {
return ((x-x1)*(x-x1)) / (4*y);
}
void inp() {
cin >> n;
fo(i,1,n){
cin >> a[i] >> r[i];
}
}
void solve() {
fo(i,1,n) {
while(!deq.empty() && r[deq.back()]<= r[i])deq.pop_back();
double temp = r[i];
// if(!deq.empty())cout << maxRadius(a[deq.front()],r[deq.front()], a[i])<< el;
if(!deq.empty()) temp = maxRadius(a[deq.front()],r[deq.front()], a[i]);
deq.push_back(i);
r[i]=temp;
cout << setprecision(3)<<fixed << r[i] << el;
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen(NAME".INP", "r", stdin);
// freopen(NAME".OUT", "w", stdout);
inp();
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
23892 KB |
4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
23892 KB |
2nd numbers differ - expected: '252735385.4379999936', found: '1000000000.0000000000', error = '747264614.5620000362' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
23892 KB |
6th numbers differ - expected: '213.0000000000', found: '238.0000000000', error = '25.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
21 ms |
23892 KB |
2nd numbers differ - expected: '122.0020000000', found: '123.0000000000', error = '0.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
24848 KB |
2nd numbers differ - expected: '212.0010000000', found: '213.0000000000', error = '0.9990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
65 ms |
26700 KB |
2nd numbers differ - expected: '15398.0000000000', found: '24984.0000000000', error = '9586.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
121 ms |
29568 KB |
2nd numbers differ - expected: '7937.0000000000', found: '10352.0000000000', error = '2415.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
135 ms |
30380 KB |
2nd numbers differ - expected: '5059.0000000000', found: '5060.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
158 ms |
32632 KB |
2nd numbers differ - expected: '1873.0000000000', found: '1874.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
210 ms |
34868 KB |
2nd numbers differ - expected: '2961.0000000000', found: '2962.0000000000', error = '1.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |