Language: C++

#include <bits/stdc++.h>
using namespace std;

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin >> n;
  vll x(n),y(n);
  REP(i,n)
    cin >> x[i] >> y[i];
  
  vector<vector<pll>> dp(n, vector<pll>(n));
  REP(i, n){
    for(ll j = 0; j <= i; j++){
      if(pow(dp[i-1][j-1].FI+x[i], 2) + pow(dp[i-1][j-1].SE+y[i], 2) > pow(dp[i-1][j].FI, 2) + pow(dp[i-1][j].SE, 2)){
        dp[i][j].FI = dp[i-1][j-1].FI+x[i];
        dp[i][j].SE = dp[i-1][j-1].SE+y[i];
      }
      else{
        dp[i][j].FI = dp[i-1][j].FI;
        dp[i][j].SE = dp[i-1][j].SE;
      }
    }
  }

  ll ans = 0;
  REP(i, n){
    REP(j, i+1)
      ans = max(ans, pow(dp[i][j].FI, 2)+pow(dp[i][j].SE, 2))
  }

  cout << Decimal;
  cout << sqrt(ans) << endl;

  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:16: error: no matching function for call to 'max(ll&, __gnu_cxx::__promote<double>::__type)'
   65 |       ans = max(ans, pow(dp[i][j].FI, 2)+pow(dp[i][j].SE, 2))
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:65:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'})
   65 |       ans = max(ans, pow(dp[i][j].FI, 2)+pow(dp[i][j].SE, 2))
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:65:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   65 |       ans = max(ans, pow(dp[i][j].FI, 2)+pow(dp[i][j].SE, 2))
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~