답안 #952388

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
952388 2024-03-23T16:46:20 Z veljko Balloons (CEOI11_bal) C++17
10 / 100
2000 ms 4248 KB
/*****from dust I have come, dust I will be*****/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define forn(i,n) for(int i=0;i<n;i++)
int dx[8] = { 1, 0, -1, 0, -1, 1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, -1, 1, 1, -1 };
int ceil_div(int a, int b) {return a % b == 0 ? a / b : a / b + 1;}
 
const int MOD = 1000000007;
//const int MOD = 998244353;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
 
/*
int k = A.order_of_key(p[i].second);
A.erase(A.find_by_order(k));
erase element from pbds multiset
*/


void solve(){
    int n; cin >> n;
    vector<pair<double, double>>a(n);
    for (auto &t : a) cin >> t.first>>t.second;
    vector<double>ans;
    ans.push_back(a[0].second);
    for (int i=1;i<n;i++){
        double mn = 1e15;
        for (int j=0;j<i;j++){
            mn = min(mn, (a[i].first - a[j].first) * (a[i].first - a[j].first) / (4.0 * a[j].second));
        }
        mn = min(mn, a[i].second);
        ans.push_back(mn);
    }
    for (auto t : ans){
        cout << fixed <<setprecision(3);
        cout <<t<<'\n';
    }
}
 
 
int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 

 
    int t = 1; //cin >>t;
    for (int i=1;i<=t;i++){
        solve();
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB 5th numbers differ - expected: '17.1630000000', found: '4.3710000000', error = '12.7920000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB 2 numbers
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 5th numbers differ - expected: '0.1170000000', found: '0.0830000000', error = '0.0340000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 348 KB 3rd numbers differ - expected: '121.0000000000', found: '120.0180000000', error = '0.9820000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 321 ms 1104 KB 3rd numbers differ - expected: '211.0000000000', found: '210.0110000000', error = '0.9890000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1952 ms 2376 KB 3rd numbers differ - expected: '15396.0000000000', found: '9489.3930000000', error = '5906.6070000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2058 ms 2908 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2037 ms 3144 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2049 ms 3796 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2062 ms 4248 KB Time limit exceeded
2 Halted 0 ms 0 KB -