Language: C++

/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#define int long long
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
int n,x[105],y[105];
double ans,now;
double get(int X,int Y){
	if(X)return (double)Y/(double)X;
	if(Y>0)return inf;
	if(Y<0)return -inf;
}
ll quater (ll x, ll y) {
    if (x >= 0 && y > 0) {
        return 1;
    } else if (x > 0 && y <= 0) {
        return 2;
    } else if (x <= 0 && y < 0) {
        return 3;
    } else {
        return 4;
    }
}


ll cross (const pii &a, const pii &b) {
    return ll(a.X) * b.Y - ll(a.Y) * b.X;
}

bool cmp (const pii &a, const pii &b) {
    if (quater(a.X, a.Y) == quater(b.X, b.Y)) {
        return cross(b, a) > 0;
    } else {
        return quater(a.X, a.Y) < quater(b.X, b.Y);
    }
}
signed main(){
	cin>>n;
	vector<pair<double,pair<int,int> > >v;
	for(int i=1;i<=n;i++)cin>>x[i]>>y[i];
	for(int i=1;i<=n;i++)if(x[i]||y[i])v.push_back(make_pair(x[i],y[i]));
	sort(v.begin(),v.end(),cmp);
	for(int i=0;i<v.size();i++){
		int xx=0,yy=0;
		for(int L=0;L<=i;L++)for(int R=i;R<v.size();R++){
			xx=0;yy=0;
			for(int j=L;j<=R;j++)xx+=v[j].first,yy+=v[j].second;
			ans=max(ans,sqrt(xx*xx+yy*yy));
		}
	}
	printf("%.15lf\n",ans);
	return 0;
}

Compiler output:
a.cc:43:17: error: 'pii' does not name a type
   43 | ll cross (const pii &a, const pii &b) {
      |                 ^~~
a.cc:43:31: error: 'pii' does not name a type
   43 | ll cross (const pii &a, const pii &b) {
      |                               ^~~
a.cc: In function 'll cross(const int&, const int&)':
a.cc:44:17: error: request for member 'X' in 'a', which is of non-class type 'const int'
   44 |     return ll(a.X) * b.Y - ll(a.Y) * b.X;
      |                 ^
a.cc:44:24: error: request for member 'Y' in 'b', which is of non-class type 'const int'
   44 |     return ll(a.X) * b.Y - ll(a.Y) * b.X;
      |                        ^
a.cc:44:33: error: request for member 'Y' in 'a', which is of non-class type 'const int'
   44 |     return ll(a.X) * b.Y - ll(a.Y) * b.X;
      |                                 ^
a.cc:44:40: error: request for member 'X' in 'b', which is of non-class type 'const int'
   44 |     return ll(a.X) * b.Y - ll(a.Y) * b.X;
      |                                        ^
a.cc: At global scope:
a.cc:47:17: error: 'pii' does not name a type
   47 | bool cmp (const pii &a, const pii &b) {
      |                 ^~~
a.cc:47:31: error: 'pii' does not name a type
   47 | bool cmp (const pii &a, const pii &b) {
      |                               ^~~
a.cc: In function 'bool cmp(const int&, const int&)':
a.cc:48:18: error: request for member 'X' in 'a', which is of non-class type 'const int'
   48 |     if (quater(a.X, a.Y) == quater(b.X, b.Y)) {
      |                  ^
a.cc:48:23: error: request for member 'Y' in 'a', which is of non-class type 'const int'
   48 |     if (quater(a.X, a.Y) == quater(b.X, b.Y)) {
      |                       ^
a.cc:48:38: error: request for member 'X' in 'b', which is of non-class type 'const int'
   48 |     if (quater(a.X, a.Y) == quater(b.X, b.Y)) {
      |                                      ^
a.cc:48:43: error: request for member 'Y' in 'b', which is of non-class type 'const int'
   48 |     if (quater(a.X, a.Y) == quater(b.X, b.Y)) {
      |                                           ^
a.cc:51:25: error: request for member 'X' in 'a', which is of non-class type 'const int'
   51 |         return quater(a.X, a.Y) < quater(b.X, b.Y);
      |                         ^
a.cc:51:30: error: request for member 'Y' in 'a', which is of non-class type 'const int'
   51 |         return quater(a.X, a.Y) < quater(b.X, b.Y);
      |                              ^
a.cc:51:44: error: request for member 'X' in 'b', which is of non-class type 'const int'
   51 |         return quater(a.X, a.Y) < quater(b.X, b.Y);
      |                                            ^
a.cc:51:49: error: request for member 'Y' in 'b', which is of non-class type 'const int'
   51 |         return quater(a.X, a.Y) < quater(b.X, b.Y);
      |                                                 ^
a.cc: In function 'int main()':
a.cc:58:55: error: no matching function for call to 'std::vector<std::pair<double, std::pair<long long int, long long int> > >::push_back(std::pair<long long int, long long int>)'
   58 |         for(int i=1;i<=n;i++)if(x[i]||y[i])v.push_back(make_pair(x[i],y[i]));
      |                                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
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:11:
/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<double, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<double, std::pair<long long int, long long int> > >; value_type = std::pair<double, std::pair<long long int, long long int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'const std::vector<std::pair<double, std::pair<long long int, long long int> > >::value_type&' {aka 'const std::pair<double, std::pair<long long int, long long int> >&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/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<double, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<double, std::pair<long long int, long long int> > >; value_type = std::pair<double, std::pair<long long int, long long int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'std::vector<std::pair<double, std::pair<long long int, long long int> > >::value_type&&' {aka 'std::pair<double, std::pair<long long int, long long int> >&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:64:63: error: no match for 'operator+=' (operand types are 'long long int' and 'std::pair<long long int, long long int>')
   64 |                         for(int j=L;j<=R;j++)xx+=v[j].first,yy+=v[j].second;
      |                                                             ~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<double, std::pair<long long int, long long int> >*, std::vector<std::pair<double, std::pair<long long int, long long int> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<double, std::pair<long long int, long long int> >*, std::vector<std::pair<double, std::pair<long long int, long long int> > > >; _Compare = bool (*)(const int&, const int&)]':
/usr/include/c++/14/bits/stl_algo.h:1777:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&, const int&)>]'
 1777 |           if (__comp(__i, __first))
      |               ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&, const int&)>]'
 1817 |           std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&, const int&)>]'
 1908 |           std::__final_insertion_sort(__first, __last, __comp);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = bool (*)(const int&, const int&)]'
 4805 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:59:6:   required from here
   59 |         sort(v.begin(),v.end(),cmp);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: invalid initialization of reference of type 'const int&' from expression of type 'std::pair<double, std::pair<long long int, long long int> >'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair<double, std::pair<long long int, long long int> >; _Iterator = __gnu_cxx::__normal_iterator<std::pair<double, std::pair<long long int, long long int> >*, std::vector<std::pair<double, std::pair<long long int, long long int> > > >; _Compare = bool (*)(const int&, const int&)]':
/usr/include/c++/14/bits/stl_algo.h:1757:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(const int&, const int&)>]'
 1757 |       while (__comp(__val, __next))
      |              ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1785:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<double, pair<long long int, long long int> >*, vector<pair<double, pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const int&, const int&)>]'
 1785 |             std::__unguarded_linear_insert(__i,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
 1786 |                                 __gnu_cxx::__ops::__val_comp_iter(__comp));
      |