Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N;
    double v;
    vector<double> vs;
    for (int i=0; i < N; ++i) {
        cin >> v;
        vs.push_back(v);
    }
    if (N == 1)
        return vs[0];
    make_heap(vs.begin(), vs.end());
    while (true) {
        double v1 = vs.front();
        pop_heap(vs);
        double v2 = vs.front();
        pop_heap(vs);
        double v3 = (v1 + v2) / 2.0;
        if (vs.empty()) {
            cout << v3 << endl;
            break;
        } else
        push_heap(vs, v3);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: no matching function for call to 'pop_heap(std::vector<double>&)'
   19 |         pop_heap(vs);
      |         ~~~~~~~~^~~~
In file included from /usr/include/c++/14/bits/stl_algo.h:61,
                 from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_heap.h:283:5: note: candidate: 'template<class _RAIter> void std::pop_heap(_RAIter, _RAIter)'
  283 |     pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:283:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_heap.h:317:5: note: candidate: 'template<class _RAIter, class _Compare> void std::pop_heap(_RAIter, _RAIter, _Compare)'
  317 |     pop_heap(_RandomAccessIterator __first,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:317:5: note:   candidate expects 3 arguments, 1 provided
a.cc:21:17: error: no matching function for call to 'pop_heap(std::vector<double>&)'
   21 |         pop_heap(vs);
      |         ~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_heap.h:283:5: note: candidate: 'template<class _RAIter> void std::pop_heap(_RAIter, _RAIter)'
  283 |     pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:283:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_heap.h:317:5: note: candidate: 'template<class _RAIter, class _Compare> void std::pop_heap(_RAIter, _RAIter, _Compare)'
  317 |     pop_heap(_RandomAccessIterator __first,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:317:5: note:   candidate expects 3 arguments, 1 provided
a.cc:27:18: error: no matching function for call to 'push_heap(std::vector<double>&, double&)'
   27 |         push_heap(vs, v3);
      |         ~~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:162:5: note: candidate: 'template<class _RAIter> void std::push_heap(_RAIter, _RAIter)'
  162 |     push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:162:5: note:   template argument deduction/substitution failed:
a.cc:27:18: note:   deduced conflicting types for parameter '_RAIter' ('std::vector<double>' and 'double')
   27 |         push_heap(vs, v3);
      |         ~~~~~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:198:5: note: candidate: 'template<class _RAIter, class _Compare> void std::push_heap(_RAIter, _RAIter, _Compare)'
  198 |     push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:198:5: note:   candidate expects 3 arguments, 2 provided