답안 #1119482

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1119482 2024-11-27T05:12:52 Z Miquella_ Balloons (CEOI11_bal) C++14
0 / 100
190 ms 30024 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define S second
#define F first
#define all(x) (x).begin(), (x).end()
#define el "\n"
#define fo(i,a,b) for(int i =a;i<=b;i++)
#define fo1(i,a,b) for(int i =a;i>=b;i--)
#define bit(mask,i) ((mask>>i)&1)
#define pi pair<ll,ll>
#define NAME ""
using namespace std;

const int MAXN = 1e6+5;
const ll MOD = 1e9+7;
const int maxp = 2e7;

double n,a[MAXN],res,m,k,t,r[MAXN];
vector<ll> adj[MAXN];
deque<ll> deq;

double maxRadius(double x,double y,double x1) {
    return ((x-x1)*(x-x1)) / (4*y);
}

void inp() {
    cin >> n;
    fo(i,1,n){
        cin >> a[i] >> r[i];
    }
}

void solve() {
    fo(i,1,n) {
        while(!deq.empty() && r[deq.back()]<= r[i])deq.pop_back();
        double temp = r[i];
//        if(!deq.empty())cout << maxRadius(a[deq.front()],r[deq.front()], a[i])<< el;
        if(!deq.empty()) temp = min(temp,maxRadius(a[deq.back()],r[deq.back()], a[i]));
        deq.push_back(i);
        r[i]=temp;
        cout << setprecision(3)<<fixed << r[i] << el;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
//    freopen(NAME".INP", "r", stdin);
//    freopen(NAME".OUT", "w", stdout);
    inp();
    solve();
    return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 23956 KB 4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 23736 KB 2nd numbers differ - expected: '252735385.4379999936', found: '1000000000.0000000000', error = '747264614.5620000362'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 23888 KB 6th numbers differ - expected: '213.0000000000', found: '238.0000000000', error = '25.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 23888 KB 2nd numbers differ - expected: '122.0020000000', found: '123.0000000000', error = '0.9980000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 33 ms 24400 KB 2nd numbers differ - expected: '212.0010000000', found: '213.0000000000', error = '0.9990000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 52 ms 25168 KB 2nd numbers differ - expected: '15398.0000000000', found: '24984.0000000000', error = '9586.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 96 ms 27184 KB 2nd numbers differ - expected: '7937.0000000000', found: '10352.0000000000', error = '2415.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 123 ms 27776 KB 2nd numbers differ - expected: '5059.0000000000', found: '5060.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 147 ms 28840 KB 2nd numbers differ - expected: '1873.0000000000', found: '1874.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 190 ms 30024 KB 2nd numbers differ - expected: '2961.0000000000', found: '2962.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -