Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int64_t i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REV(c) reverse((c).begin(),(c).end())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define COUTDOUBLE(d,i) cout << setprecision((i)) << (d) << endl;
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}
#define MREP(i,m) for(auto i=(m).begin(); i != (m).end(); ++i) // auto key = i->first;auto value = i->second;

using namespace std;
typedef int64_t I;
typedef pair<I,I> P;
typedef vector<I> V;

I MOD = pow(10,9)+7;
I MAX = LONG_MAX;
I MIN = LONG_MIN;

// 最大公約数
I gcd(I a, I b) {
  return b != 0 ? gcd(b, a % b) : a;
}

// 最小公倍数
I lcm(I a, I b) {
  return a * b / gcd(a, b);
}

int ctoi(char c){
  return c - '0';
}

int main(){
  I n;
  cin >> n;
  vector<pair<I, P>> xy(n);
  REP(i,n){
    I x,y;
    cin >> x >> y;
    xy.at(i).second.first = x;
    xy.at(i).second.second = y;
    xy.at(i).first = x*x + y*y;
  }
  vector<pair<I, P>> v;
  SORT(xy);
  REV(xy);
  
  //map<I,map<I,I>> mp;
  //mp[0][0] = 1;
  REP(i,n){
    I x,y;
    x = xy.at(i).second.first;
    y = xy.at(i).second.second;
    REP(j,v.size()){
      I a,b;
      a = v.at(j).second.first;
      b = v.at(i).second.second;
      v.push_back(pair<I,P>(pow(x+a,2)+pow(y+b,2),P(x+a,y+b)));
    }
    v.push_back(x*x+y*y,x,y);
    if (v.size() > 100){
      SORT(v);
      REV(v);
      vector<pair<I, P>> v2;
      REP(j,100){
        v2.at(j) = v.at(j);
      }
      v = v2;
    }
  }
  I t = 0;
  REP(j,v.size()){
    t = max(t, v.at(j).first);
  }
  /*
  vector<P> dp(4);
  dp.at(0) = P(0,0);
  dp.at(1) = P(0,0);
  dp.at(2) = P(0,0);
  dp.at(3) = P(0,0);
  REP(i,n){
    I x,y;
    x = xy.at(i).first;
    y = xy.at(i).second;
      if (pow(dp.at(0).first+x,2) + pow(dp.at(0).second+y,2) > pow(dp.at(0).first,2) + pow(dp.at(0).second,2)){
        dp.at(0).first = x;
        dp.at(0).second = y;
      }
      if (pow(dp.at(1).first+x,2) + pow(dp.at(1).second+y,2) > pow(dp.at(1).first,2) + pow(dp.at(1).second,2)){
        dp.at(1).first = x;
        dp.at(1).second = y;
      }
      if (pow(dp.at(2).first+x,2) + pow(dp.at(2).second+y,2) > pow(dp.at(2).first,2) + pow(dp.at(2).second,2)){
        dp.at(2).first = x;
        dp.at(2).second = y;
      }
      if (pow(dp.at(3).first+x,2) + pow(dp.at(3).second+y,2) > pow(dp.at(3).first,2) + pow(dp.at(3).second,2)){
        dp.at(3).first = x;
        dp.at(3).second = y;
      }
  }
  double t = 0.0;
  t = max(t,pow(dp.at(0).first,2) + pow(dp.at(0).second,2));
  t = max(t,pow(dp.at(1).first,2) + pow(dp.at(1).second,2));
  t = max(t,pow(dp.at(2).first,2) + pow(dp.at(2).second,2));
  t = max(t,pow(dp.at(3).first,2) + pow(dp.at(3).second,2));
  */
  COUTDOUBLE(sqrt(t), 15);
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:64:16: error: no matching function for call to 'std::vector<std::pair<long int, std::pair<long int, long int> > >::push_back(I, I&, I&)'
   64 |     v.push_back(x*x+y*y,x,y);
      |     ~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long int, std::pair<long int, long int> >; _Alloc = std::allocator<std::pair<long int, std::pair<long int, long int> > >; value_type = std::pair<long int, std::pair<long int, long int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long int, std::pair<long int, long int> >; _Alloc = std::allocator<std::pair<long int, std::pair<long int, long int> > >; value_type = std::pair<long int, std::pair<long int, long int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 3 provided