Language: C++

#include <bits/stdc++.h>
#define PII pair<int, int>
#define LL long long
#define double long double
using namespace std;
const int MAXN = 205;
const LL MOD = 1000000007;
const LL INF = (LL) 1e9 + 5;
 
struct Vector {
	int x, y;
	LL cross(const Vector &v) const {
		return (LL) x * v.y - (LL) y * v.x;
	}
	bool operator < (const Vector &v) const {
		int id1 = y > 0 || (y == 0 && x >= 0) ? 1 : 2;
		int id2 = v.y > 0 || (v.y == 0 && v.x >= 0) ? 1 : 2;
		if (id1 != id2) return id1 < id2;
		return cross(v) > 0;
	}
};
 
int N;
LL sumx[MAXN], sumy[MAXN];
Vector vec[MAXN];
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
 
	cin >> N;
	for (int i = 1; i <= N; i++) {
		int x, y;
		cin >> x >> y;
		vec[i] = {x, y};
	}
	sort(vec + 1, vec + 1 + N);
	for (int i = 1; i <= 2 * N; i++) {
		sumx[i] = sumx[i - 1] + vec[i].x;
		sumy[i] = sumy[i - 1] + vec[i].y;
		if (i <= N) {
			vec[i + N] = vec[i];
		}
	}
	
	double ans = 0.0;
	for (int i = 1; i <= N; i++) {
		for (int j = i; j - i + 1 <= N; j++) {
			LL vx = sumx[j] - sumx[i - 1];
			LL vy = sumy[j] - sumy[i - 1];
			ans = max(ans, sqrt(vx * vx + vy * vy));
		}
	}
	
	cout << fixed << setprecision(18) << ans << '\n';
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:34: error: no matching function for call to 'max(long double&, __gnu_cxx::__enable_if<true, double>::__type)'
   50 |                         ans = max(ans, sqrt(vx * vx + vy * vy));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:50:34: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   50 |                         ans = max(ans, sqrt(vx * vx + vy * vy));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:50:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   50 |                         ans = max(ans, sqrt(vx * vx + vy * vy));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~