Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  int N;
  double ans=0;
  cin>>N;
  vector<pair<int,int> A,B,C;
  REP(i,N){
    int a,b;
    cin>>a>>b;
    A.push_back(make_pair(a,b));
    B.push_back(make_pair(b,a));
    C.push_back(make_pair(a,b));
  }
  
  SORT(A);
  for(int i=0; i<A.size(); ++i){
    if(A[i].first>=0){
      if(A[i].second>0) break;
    }
    X+=A[i].first;
    Y+=A[i].second;
    ans=max(ans,X*X+Y*Y);
  }
  
  REVERSE(A);
  for(int i=0; i<A.size(); ++i){
    if(A[i].first<=0){
      if(A[i].second<0) break;
    }
    X+=A[i].first;
    Y+=A[i].second;
    ans=max(ans,X*X+Y*Y);
  }
  
  SORT(B);
  for(int i=0; i<B.size(); ++i){
    if(B[i].first>=0){
      if(B[i].second>0) break;
    }
    X+=B[i].first;
    Y+=B[i].second;
    ans=max(ans,X*X+Y*Y);
  }
  
  REVERSE(B);
  for(int i=0; i<B.size(); ++i){
    if(B[i].first<=0){
      if(B[i].second<0) break;
    }
    X+=B[i].first;
    Y+=B[i].second;
    ans=max(ans,X*X+Y*Y);
  }
  
  cout<<setprecision(10)<<sqrt(ans)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: template argument 1 is invalid
   23 |   vector<pair<int,int> A,B,C;
      |                            ^
a.cc:23:28: error: template argument 2 is invalid
a.cc:27:5: error: 'A' was not declared in this scope
   27 |     A.push_back(make_pair(a,b));
      |     ^
a.cc:28:5: error: 'B' was not declared in this scope
   28 |     B.push_back(make_pair(b,a));
      |     ^
a.cc:29:5: error: 'C' was not declared in this scope
   29 |     C.push_back(make_pair(a,b));
      |     ^
a.cc:32:8: error: 'A' was not declared in this scope
   32 |   SORT(A);
      |        ^
a.cc:13:23: note: in definition of macro 'SORT'
   13 | #define SORT(V) sort((V).begin(),(V).end())
      |                       ^
a.cc:37:5: error: 'X' was not declared in this scope
   37 |     X+=A[i].first;
      |     ^
a.cc:38:5: error: 'Y' was not declared in this scope
   38 |     Y+=A[i].second;
      |     ^
a.cc:47:5: error: 'X' was not declared in this scope
   47 |     X+=A[i].first;
      |     ^
a.cc:48:5: error: 'Y' was not declared in this scope
   48 |     Y+=A[i].second;
      |     ^
a.cc:52:8: error: 'B' was not declared in this scope
   52 |   SORT(B);
      |        ^
a.cc:13:23: note: in definition of macro 'SORT'
   13 | #define SORT(V) sort((V).begin(),(V).end())
      |                       ^
a.cc:57:5: error: 'X' was not declared in this scope
   57 |     X+=B[i].first;
      |     ^
a.cc:58:5: error: 'Y' was not declared in this scope
   58 |     Y+=B[i].second;
      |     ^
a.cc:67:5: error: 'X' was not declared in this scope
   67 |     X+=B[i].first;
      |     ^
a.cc:68:5: error: 'Y' was not declared in this scope
   68 |     Y+=B[i].second;
      |     ^