Submission #837751

# Submission time Handle Problem Language Result Execution time Memory
837751 2023-08-25T15:42:23 Z Xiaoyang Balloons (CEOI11_bal) C++17
50 / 100
2000 ms 3012 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<long double,long double>>alist;
long double calc(long double a,long double b){
	return a*a/(4*b);
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n;cin>>n;
	cout<<fixed<<setprecision(10);
	while(n--){
		long double x,r;cin>>x>>r;
		for(auto p:alist){
			r=min(r,calc(x-p.fi,p.se));
		}
		alist.pb(MP(x,r));
		cout<<r<<endl;
	}
	return 0;
}

# 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 2 ms 340 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 10 ms 488 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 764 ms 1708 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Execution timed out 2029 ms 1992 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2048 ms 2984 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2057 ms 2104 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2041 ms 3012 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2036 ms 1900 KB Time limit exceeded
2 Halted 0 ms 0 KB -