답안 #888615

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
888615 2023-12-18T02:49:35 Z a5a7 Balloons (CEOI11_bal) C++14
0 / 100
172 ms 4848 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    pair<double, double> v[n];
    for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
    stack<pair<double, double>> s;
    for (int i = 0; i < n; i++){
        double radius = v[i].second;
        double x2 = v[i].first;
        while (!s.empty()){
            double x1 = s.top().first, r1 = s.top().second;
            double r2 = (x1-x2)*(x1-x2)/(4*r1);
            radius = min(r2, radius);
            if (r2 > r1){
                s.pop();
            }else{
                break;
            }
        }
        printf("%.4Lf\n", radius);
        s.push(make_pair(x2, radius));
    }
}

Compilation message

bal.cpp: In function 'int main()':
bal.cpp:24:21: warning: format '%Lf' expects argument of type 'long double', but argument 2 has type 'double' [-Wformat=]
   24 |         printf("%.4Lf\n", radius);
      |                 ~~~~^     ~~~~~~
      |                     |     |
      |                     |     double
      |                     long double
      |                 %.4f
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st numbers differ - expected: '24.0000000000', found: '0.0000000000', error = '24.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB 1st numbers differ - expected: '247294217.0000000000', found: '0.0000000000', error = '247294217.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 452 KB 1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 344 KB 1st numbers differ - expected: '123.0000000000', found: '0.0000000000', error = '123.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 736 KB 1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 49 ms 1440 KB 1st numbers differ - expected: '15399.0000000000', found: '0.0000000000', error = '15399.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 87 ms 2576 KB 1st numbers differ - expected: '7938.0000000000', found: '0.0000000000', error = '7938.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 104 ms 2932 KB 1st numbers differ - expected: '5060.0000000000', found: '0.0000000000', error = '5060.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 137 ms 3924 KB 1st numbers differ - expected: '1874.0000000000', found: '0.0000000000', error = '1874.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 172 ms 4848 KB 1st numbers differ - expected: '2962.0000000000', found: '0.0000000000', error = '2962.0000000000'
2 Halted 0 ms 0 KB -