Language: C++

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define int long long
//for set
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;   
// for multiset
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_multiset;


#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
// #define PI 3.1415926535897932384626433832795
#define PI acos(-1.0)
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
int __unset(int b, int i) {return b&!(1<<i);}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mul(int a, int b) {return ((a%MOD)*(b%MOD))%MOD;}
int add(int a, int b) {return (a+b)%MOD;}
int sub(int a, int b) {return (((a-b)%MOD)+MOD)%MOD;}
int __div(int a, int b) {return mul(a, powmod(b, MOD-2, MOD));} //if MOD is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

bool cmp(ii a, ii b) {
	return (atan2((double)a.ss, (double)a.ff)-atan2((double)b.ss, (double)b.ff))<0;
}
int32_t main(void)
{
	IOS;
	int n; cin>>n;
	vii> a;
	int ind=0;
	for(int i = 0; i < n; i++) {
		int x, y; cin>>x>>y;
		if(!x && !y) continue;
		a.pb({x,y}); ind++;
	}
	n=a.size();
	if(n==0) {
		cout<<0<<endl;
		return 0;
	}
	sort(all(a), cmp);

	ii pre[n];
	pre[0]={a[0].ff,a[0].ss};
	for(int i = 1; i < n; i++) {
		pre[i]={pre[i-1].ff+a[i].ff, pre[i-1].ss+a[i].ss};
	}
	ii dp[n][n];
	for(int i = 1; i <= n; i++) {
		for(int j = 0; j <= n-i; j++) {
			if(j==0) {
				dp[j][j+i-1]=pre[j+i-1];
			} else {
				dp[j][j+i-1]={pre[j+i-1].ff-pre[j-1].ff, pre[j+i-1].ss-pre[j-1].ss};
			}
		}
	}
	int ans=0;
	for(int i = 1; i <= n; i++) {
		for(int j = 0; j <= n-i; j++) {
			ans=max(ans,dp[j][j+i-1].ff*dp[j][j+i-1].ff+dp[j][j+i-1].ss*dp[j][j+i-1].ss);
		}
	}
	cout<<setprecision(40)<<sqrtl(ans)<<endl;
	time();
	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:53:12: error: expected unqualified-id before '>' token
   53 |         vii> a;
      |            ^
a.cc:58:17: error: 'a' was not declared in this scope
   58 |                 a.pb({x,y}); ind++;
      |                 ^
a.cc:60:11: error: 'a' was not declared in this scope
   60 |         n=a.size();
      |           ^
a.cc:68:32: error: no match for 'operator=' (operand types are 'ii' {aka 'std::pair<long long int, long long int>'} and '<brace-enclosed initializer list>')
   68 |         pre[0]={a[0].ff,a[0].ss};
      |                                ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = long long int; _T2 = long long int]'
  946 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:946:9: note:   template argument deduction/substitution failed:
a.cc:68:32: note:   couldn't deduce template parameter '_U1'
   68 |         pre[0]={a[0].ff,a[0].ss};
      |                                ^
/usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = long long int; _T2 = long long int]'
  957 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:957:9: note:   template argument deduction/substitution failed:
a.cc:68:32: note:   couldn't deduce template parameter '_U1'
   68 |         pre[0]={a[0].ff,a[0].ss};
      |                                ^
/usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = long long int; _T2 = long long int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<long long int, long long int>&]'
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:923:65: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, const std::pair<long long int, long long int>&, const std::__nonesuch&>' {aka 'const std::pair<long long int, long long int>&'}
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  922 |                                        is_copy_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  923 |                                 const pair&, const __nonesuch&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = long long int; _T2 = long long int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<long long int, long long int>&&]'
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:933:55: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, std::pair<long long int, long long int>&&, std::__nonesuch&&>' {aka 'std::pair<long long int, long long int>&&'}
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  932 |                                        is_move_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  933 |                                 pair&&, __nonesuch&&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:70:65: error: no match for 'operator=' (operand types are 'ii' {aka 'std::pair<long long int, long long int>'} and '<brace-enclosed initializer list>')
   70 |                 pre[i]={pre[i-1].ff+a[i].ff, pre[i-1].ss+a[i].ss};
      |                                                                 ^
/usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = long long int; _T2 = long long int]'
  946 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:946:9: note:   template argument deduction/substitution failed:
a.cc:70:65: note:   couldn't deduce template parameter '_U1'
   70 |                 pre[i]={pre[i-1].ff+a[i].ff, pre[i-1].ss+a[i].ss};
      |                                                                 ^
/usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = long long int; _T2 = long long int]'
  957 |         operator=(pair<_U1, _U2>&& __p)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:957:9: note:   template argument deduction/substitution failed:
a.cc:70:65: note:   couldn't deduce template parameter '_U1'
   70 |                 pre[i]={pre[i-1].ff+a[i].ff, pre[i-1].ss+a[i].ss};
      |                                                                 ^
/usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = long long int; _T2 = long long int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<long long int, long long int>&]'
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:923:65: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, const std::pair<long long int, long long int>&, const std::__nonesuch&>' {aka 'const std::pair<long long int, long long int>&'}
  921 |       operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  922 |                                        is_copy_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  923 |                                 const pair&, const __nonesuch&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = long long int; _T2 = long long int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<long long int, long long int>&&]'
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:933:55: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::__conditional_t<true, std::pair<long long int, long long int>&&, std::__nonesuch&&>' {aka 'std::pair<long long int, long long int>&&'}
  931 |       operator=(__conditional_t<__and_<is_move_assignable<_T1>,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  932 |                                        is_move_assignable<_T2>>::value,
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  933 |                                 pair&&, __nonesuch&&> __p)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~^~~