Submission #941471

#TimeUsernameProblemLanguageResultExecution timeMemory
941471quan606303Balloons (CEOI11_bal)C++14
10 / 100
2050 ms5604 KiB
///0-0 : what is your motivation, quan606303? ///quan606303 : Hutao /*idea : */ #include <bits/stdc++.h> #define int long long #define ll long long #define INTMAX INT_MAX #define INTMIN INT_MIN #define LONGMAX LLONG_MAX #define LONGMIN LLONG_MIN #define fi first #define se second #define memfull(a,b) memset(a,b,sizeof(a)); #define endl '\n' #define file(a) freopen(a".inp","r",stdin); freopen(a".out","w",stdout); using namespace std; const int MOD=1e9+7; const int maxn=200005; pair<double,double> a[maxn]; int n; double ans[maxn]; double sqr(long double k) { return k*k; } double cal(pair<double, double> a, double b) { return (a.fi - b) * (a.fi - b) / (4 * a.se); } void solve() { stack<pair<double,double> > st; //st.push() for (int i=1;i<=n;i++) { double r=a[i].se; for (int j=i-1;j>=1;j--) { r=min(r,cal(a[j],a[i].fi)); } ans[i]=r; } for (int i=1;i<=n;i++)cout<<setprecision(3)<<fixed<<ans[i]<<endl; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); //file(""); cin>>n; for (int i=1;i<=n;i++)cin>>a[i].fi>>a[i].se; solve(); 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...