Submission #941471

# Submission time Handle Problem Language Result Execution time Memory
941471 2024-03-09T01:47:04 Z quan606303 Balloons (CEOI11_bal) C++14
10 / 100
2000 ms 5604 KB
///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 time Memory Grader output
1 Incorrect 1 ms 2396 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 1 ms 2396 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 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 5 ms 2552 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 320 ms 2876 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 Incorrect 1951 ms 5408 KB 3rd numbers differ - expected: '15396.0000000000', found: '9489.3930000000', error = '5906.6070000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2004 ms 4692 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2050 ms 4628 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2043 ms 4680 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2021 ms 5604 KB Time limit exceeded
2 Halted 0 ms 0 KB -