Submission #969995

# Submission time Handle Problem Language Result Execution time Memory
969995 2024-04-26T04:22:25 Z Aiperiii Balloons (CEOI11_bal) C++14
20 / 100
2000 ms 6880 KB
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
signed main(){
    ios_base::sync_with_stdio();
    cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    vector <int> r(n),x(n);
    vector <long double> ans;
    for(int i=0;i<n;i++)cin>>x[i]>>r[i];
    ans.pb(r[0]);
    vector <pair <int,int> > R;
    R.pb({r[0],1});
    for(int i=1;i<n;i++){
        int a=r[i],b=1;
        for(int j=0;j<i;j++){
            if(a*4*R[j].ff>b*(x[i]-x[j])*(x[i]-x[j])*R[j].ss){
                a=(x[i]-x[j])*(x[i]-x[j])*R[j].ss;
                b=4*R[j].ff;
            }
            int x=__gcd(a,b);
            a/=x;
            b/=x;
        }
        R.pb({a,b});
        ans.pb((long double)a/b);
    }
    for(auto x : ans)cout<<fixed<<setprecision(3)<<x<<"\n";
}
/*
 
3
0 9
8 1
13 7
 
*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 572 KB 377th numbers differ - expected: '216.0520000000', found: '3006.6940000000', error = '2790.6420000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 174 ms 496 KB 14th numbers differ - expected: '108.0020000000', found: '0.4110000000', error = '107.5910000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 1704 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2045 ms 2072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 134 ms 3780 KB Execution killed with signal 8
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2061 ms 2896 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 223 ms 5480 KB Execution killed with signal 8
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 90 ms 6880 KB Execution killed with signal 8
2 Halted 0 ms 0 KB -