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<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(pow(x+a,2)+pow(y+b,2),x+a,y+b);
    }
    v.push_back(x*x+y*y,x,y);
    if (v.size() > 100){
      SORT(v);
      REV(v);
      vector<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:
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: In instantiation of 'struct std::_Vector_base<long int, std::pair<long int, long int> >':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<long int, std::pair<long int, long int> >'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:48:16:   required from here
   48 |   vector<I, P> v;
      |                ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: no type named 'value_type' in 'struct std::pair<long int, long int>'
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: no type named 'value_type' in 'struct std::pair<long int, long int>'
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<long int, std::pair<long int, long int> >':
a.cc:48:16:   required from here
   48 |   vector<I, P> v;
      |                ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<long int, std::pair<long int, long int> >::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<long int, std::pair<long int, long int> >::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<long int, std::pair<long int, long int> >::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long int; _Alloc = std::pair<long int, long int>]':
a.cc:48:16:   required from here
   48 |   vector<I, P> v;
      |                ^
/usr/include/c++/14/bits/stl_vector.h:136:24: error: no type named 'value_type' in 'struct std::pair<long int, long int>'
  136 |         _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:60:13: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'at'; did you mean 'data'?
   60 |       a = v.at(j).second.first;
      |             ^~
      |             data
a.cc:61:13: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'at'; did you mean 'data'?
   61 |       b = v.at(i).second.second;
      |             ^~
      |             data
a.cc:62:18: error: no matching function for call to 'std::vector<long int, std::pair<long int, long int> >::push_back(__gnu_cxx::__promote<double>::__type, I, I)'
   62 |       v.push_back(pow(x+a,2)+pow(y+b,2),x+a,y+b);
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long int; _Alloc = std::pair<long int, long int>; value_type = 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 = long int; _Alloc = std::pair<long int, long int>; value_type = 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
a.cc:64:16: error: no matching function for call to 'std::vector<long int, std::pair<long int, long int> >::push_back(I, I&, I&)'
   64 |     v.push_back(x*x+y*y,x,y);
      |     ~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long int; _Alloc = std::pair<long int, long int>; value_type = 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 = long int; _Alloc = std::pair<long int, long int>; value_type = 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
a.cc:4:26: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'begin'
    4 | #define SORT(c) sort((c).begin(),(c).end())
      |                          ^~~~~
a.cc:66:7: note: in expansion of macro 'SORT'
   66 |       SORT(v);
      |       ^~~~
a.cc:4:38: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'end'
    4 | #define SORT(c) sort((c).begin(),(c).end())
      |                                      ^~~
a.cc:66:7: note: in expansion of macro 'SORT'
   66 |       SORT(v);
      |       ^~~~
a.cc:5:28: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'begin'
    5 | #define REV(c) reverse((c).begin(),(c).end())
      |                            ^~~~~
a.cc:67:7: note: in expansion of macro 'REV'
   67 |       REV(v);
      |       ^~~
a.cc:5:40: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'end'
    5 | #define REV(c) reverse((c).begin(),(c).end())
      |                                        ^~~
a.cc:67:7: note: in expansion of macro 'REV'
   67 |       REV(v);
      |       ^~~
a.cc:70:12: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'at'; did you mean 'data'?
   70 |         v2.at(j) = v.at(j);
      |            ^~
      |            data
a.cc:70:22: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'at'; did you mean 'data'?
   70 |         v2.at(j) = v.at(j);
      |                      ^~
      |                      data
a.cc:77:18: error: 'class std::vector<long int, std::pair<long int, long int> >' has no member named 'at'; did you mean 'data'?
   77 |     t = max(t, v.at(j).first);
      |                  ^~
      |                  data
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long int; _Alloc = std::pair<long int, long int>]':
/usr/include/c++/14/bits/stl_vector.h:314:7:   required from here
  314 |       _Vector_base() = default;
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:141:26: error: no type named 'value_type' in 'struct std::pair<long int, long int>'
  141 |         : _Tp_alloc_type()
      |                          ^