Submission #837740

#TimeUsernameProblemLanguageResultExecution timeMemory
837740XiaoyangBalloons (CEOI11_bal)C++17
10 / 100
2057 ms8768 KiB
#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; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...