Language: C++

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

typedef long long LL;
typedef pair<LL,LL> point;

/*

 Q1  | Q0
-------
 Q2  | Q3

*/

int n;
int dx[4] = {1,-1,-1,1};
int dy[4] = {1,1,-1,-1};
vector<point> quad[5];
vector<point> y0,x0;

LL sq(LL x){
	return x*x;
}

bool uda[105];

LL solve(int id){
	LL tx = 0LL;
	LL ty = 0LL;
	for(int i=0;i<quad[id].size();i++){
		tx+=quad[id][i].first;
		ty+=quad[id][i].second;
	}
	for(int i=0;i<x0.size();i++){
		if(x0[i].second*dy[id] >= 0){
			ty+=x0[i].second;
		}
	}
	for(int i=0;i<y0.size();i++){
		if(y0[i].first*dx[id] >= 0){
			tx+=y0[i].first;
		}
	}
	LL ret = sq(tx)+sq(ty);
	memset(uda,0,sizeof(uda));
	for(int k=0;k<100;k++){	
		for(int i=0;i<quad[(id+1)%4].size();i++){
			if(uda[i]) continue;
			point tmp = quad[(id+1)%4][i];
			LL tr = sq(tx+tmp.first)+sq(ty+tmp.second);
			if(tr > ret){
				ret = tr;
				tx+=tmp.first;
				ty+=tmp.second;
				uda[i] = 1;
			}
		}
	}
	
	memset(uda,0,sizeof(uda));
	for(int k=0;k<100;k++){	
		for(int i=0;i<quad[(id+3)%4].size();i++){
			if(uda[i]) continue;
			point tmp = quad[(id+3)%4][i];
			LL tr = sq(tx+tmp.first)+sq(ty+tmp.second);
			if(tr > ret){
				ret = tr;
				tx+=tmp.first;
				ty+=tmp.second;
				uda[i] = 1;
			}
		}
	}
	
	return ret;
}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		LL x,y;
		scanf("%lld%lld",&x,&y);
		if(y==0){
			y0.push_back(make_pair(x,y));
		} else if(x==0){
			x0.push_back(make_pair(x,y));
		} else {
			for(int j=0;j<4;j++){
				if(x*dx[j] >= 0 && y*dy[j]>=0){
					quad[j].push_back(make_pair(x,y));
					break;
				}
			}
		}
	}
	LL ans = 0LL;
	for(int i=0;i<4;i++){
		ans = max(ans,solve(i));
	}
	printf("%.15lf\n",sqrt((double)ans));
	return 0;
}


Compiler output:
a.cc:19:15: error: 'std::vector<std::pair<long long int, long long int> > y0' redeclared as different kind of entity
   19 | vector<point> y0,x0;
      |               ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:256:1: note: previous declaration 'double y0(double)'
  256 | __MATHCALL (y0,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'LL solve(int)':
a.cc:39:26: error: request for member 'size' in 'y0', which is of non-class type 'double(double) noexcept'
   39 |         for(int i=0;i<y0.size();i++){
      |                          ^~~~
a.cc:40:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   40 |                 if(y0[i].first*dx[id] >= 0){
      |                        ^
a.cc:40:26: error: request for member 'first' in '*(y0 + ((sizetype)i))', which is of non-class type 'double(double) noexcept'
   40 |                 if(y0[i].first*dx[id] >= 0){
      |                          ^~~~~
a.cc:41:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                         tx+=y0[i].first;
      |                                 ^
a.cc:41:35: error: request for member 'first' in '*(y0 + ((sizetype)i))', which is of non-class type 'double(double) noexcept'
   41 |                         tx+=y0[i].first;
      |                                   ^~~~~
a.cc: In function 'int main()':
a.cc:84:28: error: request for member 'push_back' in 'y0', which is of non-class type 'double(double) noexcept'
   84 |                         y0.push_back(make_pair(x,y));
      |                            ^~~~~~~~~