Submission #925445

# Submission time Handle Problem Language Result Execution time Memory
925445 2024-02-11T16:21:02 Z BoopyTheNoob Balloons (CEOI11_bal) C++14
0 / 100
2000 ms 11024 KB
#include <bits/stdc++.h>
using namespace std;

void subtask1 (vector<pair<double, double>> info) {
    vector<double> ans(info.size());
    ans[0] = info[0].second;
    for (int i = 1; i < info.size(); i++) {
        double pans = 1e9;
        for (int j = 0; j < i; j++)
            pans = min(pans, (info[i].first - info[j].first) * (info[i].first - info[j].first) / (4 * ans[j]));
        ans[i] = min(pans, info[i].second);
    }
    for (auto x: ans) printf("%.3Lf\n", x);
}

int main (void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    vector<pair<double, double>> info(n);
    for (int i = 0; i < n; i++)
        scanf("%Lf %Lf", &info[i].first, &info[i].second);
    subtask1(info);
    return 0;
}

Compilation message

bal.cpp: In function 'void subtask1(std::vector<std::pair<double, double> >)':
bal.cpp:7:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<double, double> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for (int i = 1; i < info.size(); i++) {
      |                     ~~^~~~~~~~~~~~~
bal.cpp:13:35: warning: format '%Lf' expects argument of type 'long double', but argument 2 has type 'double' [-Wformat=]
   13 |     for (auto x: ans) printf("%.3Lf\n", x);
      |                               ~~~~^     ~
      |                                   |     |
      |                                   |     double
      |                                   long double
      |                               %.3f
bal.cpp: In function 'int main()':
bal.cpp:24:18: warning: format '%Lf' expects argument of type 'long double*', but argument 2 has type 'double*' [-Wformat=]
   24 |         scanf("%Lf %Lf", &info[i].first, &info[i].second);
      |                ~~^       ~~~~~~~~~~~~~~
      |                  |       |
      |                  |       double*
      |                  long double*
      |                %lf
bal.cpp:24:22: warning: format '%Lf' expects argument of type 'long double*', but argument 3 has type 'double*' [-Wformat=]
   24 |         scanf("%Lf %Lf", &info[i].first, &info[i].second);
      |                    ~~^                   ~~~~~~~~~~~~~~~
      |                      |                   |
      |                      long double*        double*
      |                    %lf
bal.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%Lf %Lf", &info[i].first, &info[i].second);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected double, but "nan" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected double, but "-nan" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Expected double, but "nan" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 348 KB Expected double, but "-nan" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 394 ms 1492 KB Expected double, but "nan" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2028 ms 2904 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2064 ms 5716 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2011 ms 6488 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2044 ms 8532 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2033 ms 11024 KB Time limit exceeded
2 Halted 0 ms 0 KB -