Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <math.h> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

//F
//遠くにいく
//X,Yのabsの最大
int main(){
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll N;
    cin >> N;

    ll x[N],y[N];

    long double iMax = 0.0;

    REP(i,N)
    {
      cin >> x[i] >> y[i];
    }

    for(int bit = 1; bit < (1 << N); ++bit)
    {
      ll cur_x = 0;
      ll cur_y = 0;

      for(int i = 0; i < N; ++i)
      {
        if(bit & (1<<i))
        {
          cur_x += x[i];
          cur_y += y[i];
        }
      }
      iMax = max(iMax,sqrt(cur_x*cur_x + cur_y*cur_y));

    }

    //cout << res << endl;

    printf("%.12f\n",iMax);

    return 0;    

}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: no matching function for call to 'max(long double&, __gnu_cxx::__enable_if<true, double>::__type)'
   45 |       iMax = max(iMax,sqrt(cur_x*cur_x + cur_y*cur_y));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:45:17: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   45 |       iMax = max(iMax,sqrt(cur_x*cur_x + cur_y*cur_y));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:45:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   45 |       iMax = max(iMax,sqrt(cur_x*cur_x + cur_y*cur_y));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~