Submission #863539

# Submission time Handle Problem Language Result Execution time Memory
863539 2023-10-20T14:45:06 Z Abito Balloons (CEOI11_bal) C++17
40 / 100
2000 ms 8012 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
#define int long long
#define y1 YONE
typedef unsigned long long ull;
using namespace std;
const int N=2e5+5;
double a[N],x[N],R[N];
int n;
int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    cin>>n;
    for (int i=1;i<=n;i++) cin>>x[i]>>a[i];
    for (int i=1;i<=n;i++){
        double l=0,r=a[i],mid,ans;
        for (int hhh=0;hhh<50;hhh++){
            mid=(l+r)/2;
            bool ok=true;
            for (int j=1;j<i;j++){
                if ((x[i]-x[j])*(x[i]-x[j])>=4*mid*R[j]) continue;
                ok=false;
                break;
            }
            if (ok){
                ans=mid;
                l=mid;
            }else r=mid;
        }R[i]=ans;
    }for (int i=1;i<=n;i++) cout<<fixed<<setprecision(9)<<R[i]<<endl;
    return 0;
}

Compilation message

bal.cpp: In function 'int32_t main()':
bal.cpp:37:14: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
   37 |         }R[i]=ans;
      |          ~~~~^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4440 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 4444 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 6 ms 4444 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 67 ms 4440 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Execution timed out 2057 ms 4828 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2050 ms 5588 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2053 ms 6288 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2052 ms 6564 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2003 ms 7184 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 8012 KB Time limit exceeded
2 Halted 0 ms 0 KB -