Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vii vector<vi>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	 //cin.tie(0);
	//ios::sync_with_stdio(false);
	std::cout << std::fixed;
	std::cout << std::setprecision(12);
	//std::cout << std::defaultfloat;
	int n;
	cin>>n;
	vector<int> x(n),y(n);
	map<LL,LL> dp[4];
	FOR(i,0,n){
		cin>>x[i]>>y[i];
		FOR(t,0,2){
			map<LL,LL> tmp;
			for(const auto& pr:dp[t]){
				LL nx=pr.ST;
				LL ny=pr.ND;
				FOR(i,0,n){
					LL xx=nx+x[i];
					LL yy=ny+y[i];
					if(t==0){
						tmp[xx]=max(tmp[xx],yy);
					}else if(t==1){
						tmp[xx]=min(tmp[xx],yy);

					}else if(t==2){
						tmp[yy]=max(tmp[yy],xx);

					}else{

					}
				}
			}
			dp[t]=tmp;
		}
	}


	double ans=0;
	FOR(t,0,2){
		for(const auto& x:dp[t]){
			LL xx=x.ST;
			LL yy=x.ND;
			ans=max(1.*xx*xx+1.*yy*yy);
		}
	}
	cout<<sqrt(ans)<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:87:32: error: no matching function for call to 'max(double)'
   87 |                         ans=max(1.*xx*xx+1.*yy*yy);
      |                             ~~~^~~~~~~~~~~~~~~~~~~
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:3:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:10:
/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:   template argument deduction/substitution failed:
a.cc:87:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   87 |                         ans=max(1.*xx*xx+1.*yy*yy);
      |                             ~~~^~~~~~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided