# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
837741 |
2023-08-25T15:17:06 Z |
Xiaoyang |
Balloons (CEOI11_bal) |
C++17 |
|
2000 ms |
8676 KB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl
#define pq priority_queue
#define inf 1ll<<60
#define rep(i,a,b) for (int i=a;i<(b);i++)
#define MP make_pair
#define SZ(x) (int(x.size()))
#define mod 1000000007
#define ALL(x) x.begin(),x.end()
#define endl "\n"
void inc(ll &a,ll b) {a=(a+b)%mod;}
void dec(ll &a,ll b) {a=(a-b+mod)%mod;}
int lowbit(ll x) {return x&(-x);}
vector<pair<ll,long double>>alist;
long double calc(ll a,ll b){
long double d=abs(alist[a].fi-alist[b].fi);
long double r=d*d/(4.0*alist[a].se);
return r;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll n;cin>>n;
rep(i,0,n){
ll x;cin>>x;
long double r;cin>>r;
alist.pb(MP(x,r));
}
vector<long double>ans;
rep(i,0,n){
long double r=alist[i].se;
for(ll j=i-1;j>=0;j--){
r=min(r,calc(j,i));
}
ans.pb(r);
}
cout<<fixed<<" "<<setprecision(3);
for(auto x:ans)cout<<x<<" ";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
5th numbers differ - expected: '17.1630000000', found: '4.3710000000', error = '12.7920000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
5th numbers differ - expected: '0.1170000000', found: '0.0830000000', error = '0.0340000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
468 KB |
3rd numbers differ - expected: '121.0000000000', found: '120.0180000000', error = '0.9820000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
778 ms |
1880 KB |
3rd numbers differ - expected: '211.0000000000', found: '210.0110000000', error = '0.9890000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2060 ms |
3112 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2027 ms |
4480 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2076 ms |
5004 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2087 ms |
8676 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2064 ms |
8580 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |