Submission #1125566

#TimeUsernameProblemLanguageResultExecution timeMemory
1125566ArtistWallBalloons (CEOI11_bal)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int PRECISION = 3; return (a.first - bx) * (a.first - bx) / (4 * a.second); } int main() { int n; cin >> n; vector<double> final_radius(n); stack<pair<double, double>> to_check; for (int i = 0; i < n; i++) { double x, r; cin >> x >> r; double max_r = r; while (!to_check.empty()) { pair<double, double> last = to_check.top(); double to_last_r = calc_r(last, x); max_r = min(max_r, to_last_r); if (max_r >= last.second) { to_check.pop(); continue; } else { break; } } to_check.push({x, max_r}); final_radius[i] = max_r; } cout << fixed << setprecision(PRECISION); for (double &r : final_radius) { cout << r << "\n"; } }

Compilation message (stderr)

bal.cpp:6:9: error: expected unqualified-id before 'return'
    6 |         return (a.first - bx) * (a.first - bx) / (4 * a.second);
      |         ^~~~~~
bal.cpp:7:1: error: expected declaration before '}' token
    7 | }
      | ^
bal.cpp: In function 'int main()':
bal.cpp:21:44: error: 'calc_r' was not declared in this scope
   21 |                         double to_last_r = calc_r(last, x);
      |                                            ^~~~~~