Submission #837691

# Submission time Handle Problem Language Result Execution time Memory
837691 2023-08-25T14:12:00 Z Xiaoyang Balloons (CEOI11_bal) C++17
10 / 100
2000 ms 8764 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=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;
	cout<<fixed<<" "<<setprecision(3);
	rep(i,0,n){
		ll x;cin>>x;
		long double r;cin>>r;
		alist.pb(MP(x,r));
	}
	sort(ALL(alist));
	rep(i,0,n){
		long double r=alist[i].se;
		for(ll j=i-1;j>=0;j--){
			r=min(r,calc(j,i));
		}
		cout<<r<<endl;
	}
	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 840 ms 1492 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 2025 ms 2636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2051 ms 4496 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2031 ms 4556 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2047 ms 8764 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2057 ms 8640 KB Time limit exceeded
2 Halted 0 ms 0 KB -