criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class E {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		ArrayList<ArrayDeque<Integer>> Date = new ArrayList<ArrayDeque<Integer>>();
		for (int i = 0; i < N; i++) {
			ArrayDeque<Integer> buf = new ArrayDeque<Integer>();
			for (int j = 0; j < N - 1; j++) {
				buf.add(scn.nextInt() - 1);
			}
			Date.add(buf);
		}

		boolean Fin[] = new boolean[N];
		boolean done[] = new boolean[N];
		boolean can = true, fin = false;
		int ans = 0;

		while (can && !fin) {
			can = false;
			Arrays.fill(done, false);
			for (int i = 0; i < N; i++) {

				if (Fin[i] || done[i])
					continue;
				if (Date.get(i).isEmpty()) {
					Fin[i] = true;
					continue;

				}
				int ene = Date.get(i).peek();

				if (Fin[ene] || done[ene])
					continue;

				int me = Date.get(ene).peek();
				if (me != i)
					continue;
				Date.get(i).poll();
				Date.get(ene).poll();
				can = true;
				done[i] = true;
				done[ene] = true;
			}
			ans++;

		}
		fin = true;
		for (int i = 0; i < N; i++) {
			fin &= Fin[i];
		}
		System.out.println((fin) ? ans - 1 : -1);

	}

}


Compiler output:
Main.java:6: error: class E is public, should be declared in a file named E.java
public class E {
       ^
1 error
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,ans=0;
  cin>>N;
  int A[N][N],B[N];
  bool CAN=false,CAN2=true,CAN3=true;
  REP(i,N){
    REP(j,N-1) cin>>A[i][j];
    B[i]=0;
  }
  
  for(k=1; k<MOD; ++k){
    CAN3=true;
    
  	for(i=0; i<N-1; ++i){
    	for(int j=i+1; j<N; ++j){
      		if(A[i][B[i]]==A[j][B[j]]){
        		A[i][B[i]]=0;
        		A[j][B[j]]=0;
        		B[i]++;
        		B[j]++;
                CAN=true;
      		}
    	}
  	}
    
    for(int i=0; i<N; ++i){
      if(B[i]!=0) CAN3=false;
    }
    if(CAN3){
      ans=k;
      break;
    }
    if(CAN) CAN2=false;
    if(CAN2){
      cout<<-1<<endl;
      return 0;
    }
  }
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: 'k' was not declared in this scope
   29 |   for(k=1; k<MOD; ++k){
      |       ^
a.cc:32:13: error: 'i' was not declared in this scope
   32 |         for(i=0; i<N-1; ++i){
      |             ^
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,ans=0;
  cin>>N;
  int A[N][N],B[N];
  bool CAN=false,CAN2=true,CAN3=true;
  REP(i,N){
    REP(j,N-1) cin>>A[i][j];
    B[i]=0;
  }
  
  for(k=1; k<MOD; ++k){
    CAN3=true;
    
  	for(i=0; i<N-1; ++i){
    	for(j=i+1; j<N; ++j){
      		if(A[i][B[i]]==A[j][B[j]]){
        		A[i][B[i]]=0;
        		A[j][B[j]]=0;
        		B[i]++;
        		B[j]++;
                CAN=true;
      		}
    	}
  	}
    
    for(int i=0; i<N; ++i){
      if(B[i]!=0) CAN3=false;
    }
    if(CAN3){
      ans=k;
      break;
    }
    if(CAN) CAN2=false;
    if(CAN2){
      cout<<-1<<endl;
      return 0;
    }
  }
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: 'k' was not declared in this scope
   29 |   for(k=1; k<MOD; ++k){
      |       ^
a.cc:32:13: error: 'i' was not declared in this scope
   32 |         for(i=0; i<N-1; ++i){
      |             ^
a.cc:33:13: error: 'j' was not declared in this scope
   33 |         for(j=i+1; j<N; ++j){
      |             ^
Language: C++

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

int n;
int A[1005][1005];
int L[1005];
bool uda[1005];
int main(){
  cin >> n;
  for(int i=1;i<=n;i++){
    for(int j=1;j<n;j++){
      cin >> A[i][j];
    }
    L[i] = 1;
  }
  bool beda = 1;
  int cnt = 0;
  while(beda){
   	beda = 0;
    cnt++;
    memset(uda,0,sizeof(uda));
    for(int i=1;i<=n;i++){
      if(uda[i]) continue;
      	int tmp = A[i][L[i]];
		if(L[i]<n && tmp == A[tmp][L[tmp]]){
          L[i]++;
          L[tmp]++;
          beda = 1;
        }
    }
  }
  for(int i=1;i<=n;i++){
    if(L[i]!=n){
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
using pll=pair<long long,long long>;
const long double pi=atan2l(0,-1);

int N;

pair<long long,long long> operator+(pair<long long,long long> &a,pair<long long,long long> &b) {
  return make_pair(a.first+b.first,a.second+b.second);
}

int main() {
  cin >> N;
  vector<pll> A(N);
  for (int i=0;i<N;i++) {
    cin >> A[i].first >> A[i].second;
  }
  vector<pair<long double,int>> arg(2*N);
  for (int i=0;i<N;i++) {
    arg[i]=make_pair(atan2(A[i].second,A[i].first),i);
    arg[i+N]=make_pair(atan2(A[i].second,A[i].first)+2*pi,i);
  }
  sort(arg.begin(),arg.end());
  long double ans=0;
  for (int i=0;i<N;i++) {
    int j=i;pair<long long,long long> X=make_pair(A[arg[i].second].first,A[arg[i].second].second);
    while (((X.first+A[arg[j+1].second].first)*A[arg[j+1].second].first+(X.second+A[arg[j+1].second].second)*A[arg[j+1].second].second>=
            -1*X.first*A[arg[j+1].second].first-X.second*A[arg[j+1].second].second && arg[j+1].first-atan2(X.second,X.first)<pi)
           && (X.first*A[arg[j+1].second].first+X.second*A[arg[j+1].second].second>=0 && j+1<i+N) {
      j++;
      X=X+A[arg[j].second];
    }
    long long x=0LL,y=0LL;
    for (int k=i;k<=j;k++) {
      x+=A[arg[k].second].first;
      y+=A[arg[k].second].second;
    }
    long double d=sqrt(x*x+y*y);
    ans=max(ans,d);
  }
  cout << setprecision(20) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:98: error: expected ')' before '{' token
   29 |            && (X.first*A[arg[j+1].second].first+X.second*A[arg[j+1].second].second>=0 && j+1<i+N) {
      |                                                                                                  ^~
      |                                                                                                  )
a.cc:27:11: note: to match this '('
   27 |     while (((X.first+A[arg[j+1].second].first)*A[arg[j+1].second].first+(X.second+A[arg[j+1].second].second)*A[arg[j+1].second].second>=
      |           ^
Language: C++

#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
// URLD
long double dx[4]={0,1,-1,0};
long double dy[4]={1,0,0,-1};
long long double eps = 1e-6;
long long double pi = acos(-1);

long double f(long double x,long double y){
    return x*x+y*y;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(30);

    
   int n;
   cin>>n;
   array<long double,3> a[n];
   for(int i=0;i<n;i++){
       long double x,y;
       cin>>x>>y;
       a[i] = {atan2(y,x),x,y};
   }
   sort(a,a+n);
   int r = 0;
   long double x=0,y=0;
   long double ans = 0;
   long double now = 0;
   for(int i=0;i<n;i++){
       chmax(r,i);
       while(r<n+i && f(x+a[r%n][1],y+a[r%n][2]) > now){
           x += a[r%n][1];
           y += a[r%n][2];
           now = f(x,y);
           chmax(ans,now);
           r++;
       }
       cerr << "a " << x << " " << y << endl;
       chmax(ans,f(x,y));
       x -= a[i][1];
       y -= a[i][2];
       now = f(x,y);
   }
   cout << sqrt(ans) << endl;

}

Compiler output:
a.cc:9:6: error: 'long long' specified with 'double'
    9 | long long double eps = 1e-6;
      |      ^~~~
a.cc:10:6: error: 'long long' specified with 'double'
   10 | long long double pi = acos(-1);
      |      ^~~~
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <utility>
#include <algorithm>
#include <numeric>
#include <set>
#include <cmath>
#include <iomanip>
 
using namespace std;
 
pair <long long, long long> xy[100];
 
long long cross(long long x1, long long y1, long long x2, long long y2){
  return x1 * y2 - x2 * y1;
}

int get_quad(long long x, long long y){
  if(x >= 0 && y >= 0){
    return 1;
  } else if(x < 0 && y >= 0){
    return 2;
  } else if(x < 0 && y < 0){
    return 3;
  }
  return 4
}

bool vec_comp(pair <long long, long long> xy1, pair<long long, long long> xy2){
  if(get_quad(xy1.first, xy1.second) != get_quad(xy2.second, xy2.second)){
    return get_quad(xy1.first, xy1.second) < get_quad(xy2.first, xy2.second);
  }
 return (cross(xy1.first, xy1.second, xy2.first, xy2.second) > 0);
}
 
int main(){
   int N;
   cin >> N;
 
   int new_xy_size = 0;
   for(int i = 0; i < N; i++){
     int tmp_x;
     int tmp_y;
     cin >> tmp_x >> tmp_y;
     if(tmp_x == 0 && tmp_y == 0){
       continue;
     }
     xy[new_xy_size].first = tmp_x;
     xy[new_xy_size].second = tmp_y;
     new_xy_size ++;
   }
   N = new_xy_size;
 
   long long total_x = 0;
   long long total_y = 0;
   for(int i = 0; i < N; i++){
     total_x += xy[i].first;
     total_y += xy[i].second;
   }
   
   sort(xy, xy + N, vec_comp);
   long long ans = 0;
   for(int i = 0; i < N; i++){
     for(int j = i + 1; j < N + 1; j++){
       long long tmp_total_x = 0;
       long long tmp_total_y = 0;
       for(int k = i; k < j; k++){
         tmp_total_x += xy[k].first;
         tmp_total_y += xy[k].second;
       }
       ans = max(ans, tmp_total_x * tmp_total_x + tmp_total_y * tmp_total_y);
       long long left_total_x = total_x - tmp_total_x;
       long long left_total_y = total_y - tmp_total_y;
       ans = max(ans, left_total_x * left_total_x + left_total_y * left_total_y);
     }
   }
   cout << setprecision(15) << sqrt(ans) << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int get_quad(long long int, long long int)':
a.cc:27:11: error: expected ';' before '}' token
   27 |   return 4
      |           ^
      |           ;
   28 | }
      | ~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>

using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
const int MOD=1000000007;
const int INTMAX=1001001000;
const ll LLMAX=1010010010010010000;

bool comp(vll a,vll b){
    return pow(a[0],2)+pow(a[1],2)>pow(b[0],2)+pow(b[1],2);
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    ll N;
    cin>>N;
    vvll A(N,vll(N-1));
    vvll xy(N,vll(2));
    for(int i=0;i<N;i++) cin>>xy[i][0]>>xy[i][1];
    
    sort(xy.begin(),xy.end(),comp);
    
    ll ans[2]={xy[0][0],xy[0][1]};
    for(int i=1;i<xy.size();i++){
        ll dist1=ans[0]*ans[0]+ans[1]*ans[1];
        ll dist2=pow(ans[0]+xy[i][0],2)+pow(ans[1]+xy[i][1],2);
        if(dist1<dist2){
            ans[0]+=xy[i][0];
            ans[1]+=xy[i][1];
        }
    }
    
    cout<<setprecision(32)<<sqrt(ans[0]*ans[0]+ans[1]*ans[1])<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:11: error: 'setprecision' was not declared in this scope
   44 |     cout<<setprecision(32)<<sqrt(ans[0]*ans[0]+ans[1]*ans[1])<<endl;
      |           ^~~~~~~~~~~~
a.cc:8:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    7 | #include <queue>
  +++ |+#include <iomanip>
    8 |
Language: C++

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

int N;
long double x[100], y[100];
pair<long double, pair<long double, long double>> a[200];

signed main(){
	cin >> N;
	rep(i, N){
		cin >> x[i] >> y[i];
		a[i] = mp(atan2(y[i], x[i]), mp(x[i], y[i]));
	}
	sort(a, a+N);
	rep(i, N) a[N+i] = a[i];

	long double ans = 0;
	rep(i, N){
		rep(j, N){
			long double X = 0, Y = 0;
			rep(k, j+1){
				X += a[i+k].second.first;
				Y += a[i+k].second.secondt;
			}
			ans = max(ans, X*X+Y+Y);
		}
	}
	cout << fixed << setprecision(16) << sqrt(ans) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:52: error: 'struct std::pair<long double, long double>' has no member named 'secondt'; did you mean 'second'?
   36 |                                 Y += a[i+k].second.secondt;
      |                                                    ^~~~~~~
      |                                                    second
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 900000;
const int K = 60;
const int mod = 1e9 + 7;
int a[N], used[N], cnt[N], s[N], n, m, b[N], ip = 1, qq[N], ans[N];
vector < int > q[N];
bool cmp1(pair < int, int > p1, pair < int, int > p2){
    if ((p1.S > 0 || (p1.S == 0 && p1.F > 0)) && ((p2.F < 0 && p2.S == 0) || p2.S < 0)) return 0;
    if ((p2.S > 0 || (p2.S == 0 && p2.F > 0)) && ((p1.F < 0 && p1.S == 0) || p1.S < 0)) return 1;
    return (p1.S * p2.F > p1.F * p2.S);
}
pair < int, int > p[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> p[i].F >> p[i].S;
    }
    sort(p, p + n, cmp);
    double ans = 0;
    for (int i = 1; i <= n; i++){
        for (int l = 0; l < n; l++){
            int x = 0;
            int y = 0;
            for (int j = l; j < l + i; j++){
                x += p[j % n].F;
                y += p[j % n].S;
            }
          //  cout << x << " -- " << y << " " << i << " " << l << endl;
            ans = max(ans, (double) (x * x + y * y));
        }
    }
    cout <<  fixed << setprecision(20) << sqrt(ans);
}


Compiler output:
a.cc:27:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   27 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:36:20: error: 'cmp' was not declared in this scope; did you mean 'cmp1'?
   36 |     sort(p, p + n, cmp);
      |                    ^~~
      |                    cmp1
Language: C++

int n;
LL x[101], y[101];
 
map<LL, LL> big, sml;
 
int main(){
    cin >> n;
    REP(i, n)cin >> x[i] >> y[i];
    vector<pair<double, pair<LL, LL>>> vec;
    vec.emplace_back(make_pair(0, make_pair(0, 0)));
    REP(i, n){
        vector<pair<double, pair<LL, LL>>> nxt;
        for(auto base : vec){
            LL nx = base.second.first + x[i];
            LL ny = base.second.second + y[i];
            nxt.emplace_back(make_pair(sqrt(nx * nx + ny * ny), make_pair(nx, ny)));
        }
        for(auto base : vec)nxt.emplace_back(base);
        sort(ALL(nxt));
        UNIQUE(nxt);
        reverse(ALL(nxt));
        vec.erase(ALL(vec));
        REP(j, min((int)nxt.size(), 1000000))vec.emplace_back(nxt[j]);
    }
    cout << vec[0].first << endl;
}

Compiler output:
a.cc:2:1: error: 'LL' does not name a type
    2 | LL x[101], y[101];
      | ^~
a.cc:4:1: error: 'map' does not name a type
    4 | map<LL, LL> big, sml;
      | ^~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n;
      |     ^~~
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     REP(i, n)cin >> x[i] >> y[i];
      |         ^
a.cc:8:5: error: 'REP' was not declared in this scope
    8 |     REP(i, n)cin >> x[i] >> y[i];
      |     ^~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<pair<double, pair<LL, LL>>> vec;
      |     ^~~~~~
a.cc:9:12: error: 'pair' was not declared in this scope
    9 |     vector<pair<double, pair<LL, LL>>> vec;
      |            ^~~~
a.cc:9:17: error: expected primary-expression before 'double'
    9 |     vector<pair<double, pair<LL, LL>>> vec;
      |                 ^~~~~~
a.cc:10:5: error: 'vec' was not declared in this scope
   10 |     vec.emplace_back(make_pair(0, make_pair(0, 0)));
      |     ^~~
a.cc:10:35: error: 'make_pair' was not declared in this scope
   10 |     vec.emplace_back(make_pair(0, make_pair(0, 0)));
      |                                   ^~~~~~~~~
a.cc:10:22: error: 'make_pair' was not declared in this scope
   10 |     vec.emplace_back(make_pair(0, make_pair(0, 0)));
      |                      ^~~~~~~~~
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << vec[0].first << endl;
      |     ^~~~
a.cc:25:29: error: 'endl' was not declared in this scope
   25 |     cout << vec[0].first << endl;
      |                             ^~~~
Language: C++

/*
[abc139] F - Engines
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()


ll solve() {


    return ans;
}

int main() {


    cout << solve() << endl;

    return 0;

}


Compiler output:
a.cc: In function 'll solve()':
a.cc:17:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     return ans;
      |            ^~~
      |            abs
Language: C++

#include <bits/stdc++.h>	
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ld long double
#define pii pair <int, int>
#define sz(a) (int)(a.size()) 
#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
 
// random_device rd; mt19937 g(rd());
 
using namespace std;
 
void Fast_Read_Out()
{
    ios_base::sync_with_stdio(0);
    cin.tie(), cout.tie();
}
 
void Random()
{
    unsigned int seed;                                                                        
    asm("rdtsc" : "=A" (seed));
    srand(seed);        
}
 
unsigned int Time()
{
     unsigned int time = clock() / 1000.00;                           
     return time;
}
 
const int mod = (int)1e9 + 7;
const int N = (int)1e3;
const ld eps = 1e-9;
const ld pi = acos(-1.0);
 
bool Less(ld a, ld b)
{
	return a + eps < b;
}
 
struct Point
{
	ld x, y, angle;
 
	Point() { }
 
	Point(ld _x, ld _y, ld _angle) { x = _x, y = _y, angle = _angle; }
 
	ld Scalar_Product(Point a)
	{
		ld curx = a.x * x;
		ld cury = a.y * y;
		return curx + cury;
	}
 
	ld Module()
	{
		ld curx = x * x;
		ld cury = y * y;
		ld cur = curx + cury;
		return sqrt(cur);
	}
 
	ld Angle(Point x = Point(1, 0, 0))
	{
		ld Module_All = Module() * x.Module();
		ld alpha = acos(Scalar_Product(x) / Module_All);
		if(Less(y, 0)) alpha = pi + pi - alpha;
		return alpha;	
	}
 
	void Read() { cin >> x >> y, angle = Angle(); }
 
}a[N];
 
ld ans;
 
bool cmp(Point a, Point b)
{
	return Less(a.angle, b.angle);
}
 
 
int main ()
{
	#ifdef JUDGE
		freopen("input.txt", "r", stdin);
	#endif		
	Fast_Read_Out();
	Random();   
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) a[i].Read();
	sort(a + 1, a + n + 1, &cmp);
	for(int i = 1; i <= n; i++)
	{
		Point cur = a[i];
		for(int j = i + 1; j <= n; j++) 
		{
			Point ncur = cur;
			ncur.x += a[j].x, ncur.y += a[j].y;
			if(Less(cur.Module(), ncur.Module())) cur = ncur;
			ans = max(ans, cur.Module());
		}
		for(int j = 1; j < i; j++)
		{
			Point ncur = cur;
			ncur.x += a[j].x, ncur.y += a[j].y;
			if(Less(cur.Module(), ncur.Module())) cur = ncur;
			ans = max(ans, cur.Module);
		}
	}
	cout << fixed << setprecision(10) << ans << endl;
}    

Compiler output:
a.cc: In function 'int main()':
a.cc:115:44: error: invalid use of non-static member function 'long double Point::Module()'
  115 |                         ans = max(ans, cur.Module);
      |                                        ~~~~^~~~~~
a.cc:61:12: note: declared here
   61 |         ld Module()
      |            ^~~~~~
Language: Java

import java.util.*;

public class Make {
	Scanner sc;
	int N;
	Vec[] v;
	
	static class Vec implements Comparable<Vec> {
		double x,y;
		double theta() {
			if (x == 0d && y == 0d) return 0d;
			return Math.atan2(y, x);
		}
		@Override public int compareTo(Vec t) {
			return Double.compare(theta(), t.theta());
		}
	}
	public Make() {
		sc = new Scanner(System.in);
	}
	
	void calc() {
		N = sc.nextInt();
		v = new Vec[N];
		for (int i = 0; i < N; i++) {
			v[i] = new Vec();
			v[i].x = sc.nextInt();
			v[i].y = sc.nextInt();
		}
		
		Arrays.sort(v);
		double max = -1;
		for (int a = 0; a < N; a++) {
			for (int b = a+1; b < a+1+N; b++) {
				double len = len(a, b);
				if (len > max) max = len;
			}
		}
		System.out.println(max);
	}
	
	double len(int a, int b) {
		double x = 0d;
		double y = 0d;
		for (int i = a; i < b; i++) {
			x += v[i%N].x;
			y += v[i%N].y;
		}
		return Math.sqrt(x*x + y*y);
	}
	
	public static void main(String[] args) {
		new Make().calc();
	}

}

Compiler output:
Main.java:3: error: class Make is public, should be declared in a file named Make.java
public class Make {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef node
{
	ll x;
	ll y;
}a[1000];
int cmp(node a,node b)
{
	return atan2(a.x,a.y)<atan2(b.x,b.y);
}
int mian()
{
	ll n,x,y,sum=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i].x>>a[i].y;
	}
	for(int i=0;i<n;i++)
	{
		x=a[i].x,y=a[i].y;
		sum=max(sum,x*x+y*y);
		for(int j=(i+1)%n;j!=i;j=(j+1)%n)
		{
			x+=a[i].x,y+=a[i].y;
			sum=max(sum,x*x+y*y);
		}
	 } 
	 double ans=sqrt(sum);
	 printf("%.13lf\n",ans);
	 return 0;
 } 

Compiler output:
a.cc:4:9: error: 'node' does not name a type
    4 | typedef node
      |         ^~~~
a.cc:8:2: error: 'a' does not name a type
    8 | }a[1000];
      |  ^
a.cc:9:9: error: 'node' was not declared in this scope
    9 | int cmp(node a,node b)
      |         ^~~~
a.cc:9:16: error: 'node' was not declared in this scope
    9 | int cmp(node a,node b)
      |                ^~~~
a.cc:9:22: error: expression list treated as compound expression in initializer [-fpermissive]
    9 | int cmp(node a,node b)
      |                      ^
a.cc: In function 'int mian()':
a.cc:19:22: error: 'a' was not declared in this scope
   19 |                 cin>>a[i].x>>a[i].y;
      |                      ^
a.cc:23:19: error: 'a' was not declared in this scope
   23 |                 x=a[i].x,y=a[i].y;
      |                   ^
Language: C++


#include<iostream>
#include<algorithm>
#include<string.h>
#include<queue>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long double ll;
struct node {
	ll x, y;
friend bool operator <(node a, node b) {
	return atan2(a.x, a.y) < atan2(b.x, b.y);
}

}r[1234567];


int main() {
	int n,sss,asa;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> r[i].x >> r[i].y;
	}
	sort(r, r + n, cmp);
	ll x, y, ans = 0;
	for (int i = 0; i < n; i++) {
		x = r[i].x; y = r[i].y;
		ans = max(ans, r[i].x * r[i].x + r[i].y * r[i].y);
		for (int j = (i + 1) % n; j != i; j = (j+1)%n) {
			x += r[j].x; y += r[j].y;
			ans = max(ans, x * x + y * y);
		}
	
	}
	cout << fixed << setprecision(30) << ((long double)sqrt(ans)) << '\n';
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: 'cmp' was not declared in this scope; did you mean 'bcmp'?
   25 |         sort(r, r + n, cmp);
      |                        ^~~
      |                        bcmp
Language: C++

#include<iostream>
#include<queue>
#include<memory>
#include<map>
#include<set>
#include<unordered_map>
#include<array>
#include<vector>
#include<algorithm>
#include<list>
#include<limits>
#include<stdio.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using lst = list<int>;


class Arrow
{
public:
	ll x=0, y=0;
	bool operator<(const Arrow& another)const
	{
		return atan2(y, x) < atan2(another.y, another.x);
	}
};


int main()
{
	int N;
	cin >> N;
	
	vector<Arrow> ary(N);

	for (int i = 0; i < N; ++i)
	{
		cin >> ary[i].x >> ary[i].y;
	}

	sort(ary.begin(), ary.end());


	double ans = 0;

	for (int i = 0; i < N; ++i)
	{
		for (int j = i; ; )
		{
			Arrow arw;
			for (int k = i;; k = (k + 1) % N)
			{
				arw.x += ary[k].x;
				arw.y += ary[k].y;
				if (k == j)break;
			}
			
			ans = max(ans, sqrt(arw.x*arw.x + arw.y*arw.y));
			

			j = (j + 1) % N;
			if (j == i)break;
		}
	}
	
	printf("%.10f\n", ans);

	return 0;
}

Compiler output:
a.cc: In member function 'bool Arrow::operator<(const Arrow&) const':
a.cc:27:24: error: 'atan2' was not declared in this scope
   27 |                 return atan2(y, x) < atan2(another.y, another.x);
      |                        ^~~~~
a.cc: In function 'int main()':
a.cc:61:40: error: 'sqrt' was not declared in this scope
   61 |                         ans = max(ans, sqrt(arw.x*arw.x + arw.y*arw.y));
      |                                        ^~~~
Language: C++


#include<iostream>
#include<algorithm>
#include<string.h>
#include<queue>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long ll;
struct node {
	ll x, y;

}r[1234567];
bool cmp1(node a, node b) {
	return a.y - a.x > b.y - b.x;
}
bool cmp2(node a, node b) {
	return a.y - a.x < b.y - b.x;
}
int main() {
	ll n;
	cin >> n;
	for (ll i = 0; i < n; i++) {
		cin >> r[i].x >> r[i].y;
	}
	ll x, y, ans = 0;
	sort(r, r + n, cmp1);
		x = r[0].x; y = r[0].y;
		for (ll j = 0; j < n; j++) {
			if (j == i) continue;
			ll nx = x + r[j].x;
			ll ny = y + r[j].y;
			if (nx * nx + ny * ny > x * x + y * y) x = nx, y = ny;
			else if (nx * nx + ny * ny > x * x + y * y) {
				int g = rand() % 2;
				if (g) x = nx; y = ny;
			}
		}
		ans = max(ans, x * x + y * y);
		sort(r, r + n, cmp2);
		x = r[0].x; y = r[0].y;
		for (ll j = 0; j < n; j++) {
			if (j == i) continue;
			ll nx = x + r[j].x;
			ll ny = y + r[j].y;
			if (nx * nx + ny * ny > x * x + y * y) x = nx, y = ny;
			else if (nx * nx + ny * ny > x * x + y * y) {
				int g = rand() % 2;
				if (g) x = nx; y = ny;
			}
		}
		ans = max(ans, x * x + y * y);
	cout << fixed << setprecision(30) << ((long double)sqrt(ans)) << '\n';
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:30:34: error: 'i' was not declared in this scope
   30 |                         if (j == i) continue;
      |                                  ^
a.cc:43:34: error: 'i' was not declared in this scope
   43 |                         if (j == i) continue;
      |                                  ^
Language: C++


#include<iostream>
#include<algorithm>
#include<string.h>
#include<queue>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
typedef long long ll;

struct node{
	ll x, y;
	bool friend operator < (node a, node b) {
		if (a.x == b.x) return a.b < b.y;
		return a.x < b.x;
	}
}r[1234567],w;


int main() {
	ll n;
	cin >> n;
	for (ll i = 0; i < n; i++) {
		cin >> r[i].x >> r[i].y;
	}
	ll x, y, ans = 0;
	for (ll i = 0; i < n; i++) {
		w.x = r[i].x; w.y = r[i].y;
		queue<node> q;
		map<node, ll>ma;
		q.push(w);
		for (ll j = 0; j < n; j++) {
			if (j == i) continue;
			int l = q.size();
			while (l--) {
				w = q.front(); q.pop();
				ll nx = w.x + r[j].x;
				ll ny = w.y + r[j].y;
				if (nx * nx + ny * ny > w.x * w.x + w.y * w.y) {
					w.x = nx; w.y = ny;
					if (!ma[w]) {
						q.push(w);
						ma[w] = 1;
					}
				}
				else if (nx * nx + ny * ny == w.x * w.x + w.y * w.y) {
					if (!ma[w]) {
						q.push(w);
						ma[w] = 1;
					}
					w.x = nx; w.y = ny;
					if (!ma[w]) {
						q.push(w);
						ma[w] = 1;
					}
				}
			}
			ans = max(ans, w.x * w.x + w.y * w.y);
		}
		
	}
	ans = max(ans, w.x * w.x + w.y * w.y);
	cout << fixed << setprecision(30) << ((long double)sqrt(ans)) << '\n';
	return 0;
}




Compiler output:
a.cc: In function 'bool operator<(node, node)':
a.cc:15:42: error: 'struct node' has no member named 'b'
   15 |                 if (a.x == b.x) return a.b < b.y;
      |                                          ^
Language: C

#include <algorithm>
#include <vector>

#include <math.h>
#include <stdio.h>

using namespace std;

typedef long long ll;

#define MAX_N 100
#define DIST_TWICE(x, y) ((x) * (x) + (y) * (y))

class Point {
    public:
        ll x;
        ll y;
};

int n;
vector<Point> rockets(MAX_N * 2);

int main(void) {
    scanf("%d\n", &n);

    for (int i = 0; i < n; i++) {
        ll x, y;
        scanf("%lld", &x);
        scanf("%lld", &y);
        rockets[i].x = x;
        rockets[i].y = y;
    }

    sort(&rockets[0], &rockets[n], [](const Point &a, const Point &b) {
            return atan2(a.y, a.x) < atan2(b.y, b.x);
    });

    for (int i = 0; i < n; i++) {
        rockets[n + i] = rockets[i];
    }

    ll max = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < i + 1 + n; j++) {
            // printf("%d, %d\n", i, j);

            Point acc;
            acc.x = 0;
            acc.y = 0;
            for (int k = i; k < j; k++) {
                acc.x += rockets[k].x;
                acc.y += rockets[k].y;
            }

            // printf("acc: %lld\n", DIST_TWICE(acc.x, acc.y));

            if (DIST_TWICE(acc.x, acc.y) > max) {
                max = DIST_TWICE(acc.x, acc.y);
            }
        }
    }

    printf("%11.11f\n", sqrt(max));

    return 0;
}


Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

    }

    ll max = DIST_TWICE(one);
    if (max < DIST_TWICE(two)) {
        max = DIST_TWICE(two);
    }
    if (max < DIST_TWICE(three)) {
        max = DIST_TWICE(three);
    }
    if (max < DIST_TWICE(four)) {
        max = DIST_TWICE(four);
    }

    printf("%11.11f\n", sqrt(max));

    return 0;
}


Compiler output:
main.c:1:5: error: expected identifier or '(' before '}' token
    1 |     }
      |     ^
main.c:3:5: error: unknown type name 'll'
    3 |     ll max = DIST_TWICE(one);
      |     ^~
main.c:3:14: error: implicit declaration of function 'DIST_TWICE' [-Wimplicit-function-declaration]
    3 |     ll max = DIST_TWICE(one);
      |              ^~~~~~~~~~
main.c:3:25: error: 'one' undeclared here (not in a function)
    3 |     ll max = DIST_TWICE(one);
      |                         ^~~
main.c:4:5: error: expected identifier or '(' before 'if'
    4 |     if (max < DIST_TWICE(two)) {
      |     ^~
main.c:7:5: error: expected identifier or '(' before 'if'
    7 |     if (max < DIST_TWICE(three)) {
      |     ^~
main.c:10:5: error: expected identifier or '(' before 'if'
   10 |     if (max < DIST_TWICE(four)) {
      |     ^~
main.c:14:12: error: expected declaration specifiers or '...' before string constant
   14 |     printf("%11.11f\n", sqrt(max));
      |            ^~~~~~~~~~~
main.c:14:25: error: unknown type name 'sqrt'
   14 |     printf("%11.11f\n", sqrt(max));
      |                         ^~~~
main.c:16:5: error: expected identifier or '(' before 'return'
   16 |     return 0;
      |     ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
   17 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/random.hpp>
using namespace std;
using namespace boost::numeric;

const bool DEBUG = false;

int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  ublas::vector<double> x(N), y(N);
  for (size_t i = 0; i < N; i++) cin >> x[i] >> y[i];

  if (DEBUG) {
    cout << "x: " << x << endl;
    cout << "y: " << y << endl;
  }

  auto sigma = outer_prod(x, x) + outer_prod(y, y);

  boost::random::mt19937 gen;
  boost::random::uniform_real_distribution<double> dist(-0.1, 0.1);
  ublas::vector<double> theta(N), prev_theta(N);
  for (size_t i = 0; i < N; i++) theta[i] = dist(gen) + 0.2;
  prev_theta = theta;

  const int iteration = 5 * 10000;
  for (size_t t = 0; t < iteration; t++) {
    if (DEBUG) cout << "t=" << t << ": " << theta << endl;
    auto gradient = prod(sigma, theta);
    theta += 0.1 * gradient / sqrt(t + 1);
    transform(theta.begin(), theta.end(), theta.begin(),
              [](double elem) { return min(max(0.0, elem), 1.0); });
    if (t < iteration / 2)
      transform(theta.begin(), theta.end(), theta.begin(),
                [&](double elem) { return elem + 3 * dist(gen) / sqrt(t); });
    // bool converged = true;
    // for (size_t i = 0; i < N; i++) {
    //   if (theta[i] != prev_theta[i]) {
    //     converged = false;
    //     continue;
    //   }
    // }
    // if (converged) {
    //   if (DEBUG) cout << "converged!" << endl;
    //   break;
    // }
    prev_theta = theta;
  }
  transform(theta.begin(), theta.end(), theta.begin(),
            [](double elem) { (elem < 0.5) ? 0.0 : 1.0 });

  auto length = sqrt(inner_prod(theta, prod(sigma, theta)));
  cout << setprecision(20) << length << endl;

  return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/numeric/ublas/io.hpp: No such file or directory
    2 | #include <boost/numeric/ublas/io.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/random.hpp>
using namespace std;
using namespace boost::numeric;

const bool DEBUG = false;

int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  ublas::vector<double> x(N), y(N);
  for (size_t i = 0; i < N; i++) cin >> x[i] >> y[i];

  if (DEBUG) {
    cout << "x: " << x << endl;
    cout << "y: " << y << endl;
  }

  auto sigma = outer_prod(x, x) + outer_prod(y, y);

  boost::random::mt19937 gen;
  boost::random::uniform_real_distribution<double> dist(-0.1, 0.1);
  ublas::vector<double> theta(N), prev_theta(N);
  for (size_t i = 0; i < N; i++) theta[i] = dist(gen) + 0.2;
  prev_theta = theta;

  const int iteration = 5 * 10000;
  for (size_t t = 0; t < iteration; t++) {
    if (DEBUG) cout << "t=" << t << ": " << theta << endl;
    auto gradient = prod(sigma, theta);
    theta += 0.1 * gradient / sqrt(t + 1);
    transform(theta.begin(), theta.end(), theta.begin(),
              [](double elem) { return min(max(0.0, elem), 1.0) + dist(gen); });
    // bool converged = true;
    // for (size_t i = 0; i < N; i++) {
    //   if (theta[i] != prev_theta[i]) {
    //     converged = false;
    //     continue;
    //   }
    // }
    // if (converged) {
    //   if (DEBUG) cout << "converged!" << endl;
    //   break;
    // }
    prev_theta = theta;
  }
  auto length = sqrt(inner_prod(theta, prod(sigma, theta)));
  cout << setprecision(20) << length << endl;

  return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/numeric/ublas/io.hpp: No such file or directory
    2 | #include <boost/numeric/ublas/io.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <cmath>
#include <map>
#include <random>
#include <climit>
using namespace std;

class xor128{
  public:
    static constexpr unsigned min(){ return 0u; }
    static constexpr unsigned max(){ return UINT_MAX; }
    unsigned operator()(){ return random(); }
    xor128(){ random_device rd; w = rd(); }
    xor128(unsigned s){ w = s; }
  private:
    unsigned x=123456789u,y=362436069u,z=521288629u,w;
    unsigned random() {
      unsigned t;
      t = x ^ (x << 11);
      x = y; y = z; z = w;
      return w = (w ^ (x >> 19)) ^ (t ^ (t >> 8));
    }
};

int n;
double x[100], y[100];

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  cin >> n;
  for(int i = 0; i < n; ++i) cin >> x[i] >> y[i];

  double ans = 0.0;
  xor128 xs = 1;
  uniform_real_distribution<double> real(-1.0, 1.0);
  for(int unko = 0; unko < 10000; ++unko) {
    x[n] = real(xs), y[n] = real(xs);

    double px = 0.0, py = 0.0;
    for(int i = 0; i < n; ++i)
      if(x[i]*x[n] + y[i]*y[n] >= 0) px += x[i], py += y[i];
    ans = max(ans, px*px + py*py);
  }
  cout << fixed << setprecision(15) << sqrt(ans);
  return 0;
}

Compiler output:
a.cc:9:10: fatal error: climit: No such file or directory
    9 | #include <climit>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <cmath>
#include <map>
#include <random>
using namespace std;

class xor128{
  public:
    static constexpr unsigned min(){ return 0u; }
    static constexpr unsigned max(){ return UINT_MAX; }
    unsigned operator()(){ return random(); }
    xor128(){ random_device rd; w = rd(); }
    xor128(unsigned s){ w = s; }
  private:
    unsigned x=123456789u,y=362436069u,z=521288629u,w;
    unsigned random() {
      unsigned t;
      t = x ^ (x << 11);
      x = y; y = z; z = w;
      return w = (w ^ (x >> 19)) ^ (t ^ (t >> 8));
    }
};

int n;
double x[100], y[100];

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  cin >> n;
  for(int i = 0; i < n; ++i) cin >> x[i] >> y[i];

  double ans = 0.0;
  xor128 xs = 1;
  uniform_real_distribution<double> real(-1.0, 1.0);
  for(int unko = 0; unko < 10000; ++unko) {
    x[n] = real(xs), y[n] = real(xs);

    double px = 0.0, py = 0.0;
    for(int i = 0; i < n; ++i)
      if(x[i]*x[n] + y[i]*y[n] >= 0) px += x[i], py += y[i];
    ans = max(ans, px*px + py*py);
  }
  cout << fixed << setprecision(15) << sqrt(ans);
  return 0;
}

Compiler output:
a.cc: In static member function 'static constexpr unsigned int xor128::max()':
a.cc:14:45: error: 'UINT_MAX' was not declared in this scope
   14 |     static constexpr unsigned max(){ return UINT_MAX; }
      |                                             ^~~~~~~~
a.cc:9:1: note: 'UINT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <random>
  +++ |+#include <climits>
    9 | using namespace std;
Language: C++

#include <iostream>
#include<map>
#include<cstdio>
#include<vector>
#include<cmath>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
typedef long double ld;
typedef pair<ld,int> P;
int x[105],y[105];

signed main(){
    int n;cin>>n;
    rep(i,n)cin>>x[i]>>y[i];
    vector<P>V;
    rep(i,n){
        if(x[i]==0&&y[i]==0)continue;
        ld theta=atan2(y[i],x[i]);
        V.push_back(P(theta,i));
    }
    sort(V.begin(),V.end());
    ld ans=0;
    n=V.size();
    rep(i,n){
        rep(j,n){
            int sx=0,sy=0;
            if(i<j){
                for(int k=i;k<=j;k++){
                sx+=x[V[k].second];
                sy+=y[V[k].second]; 
                }
            }
            else{
                for(int l=i;l<=n+j;l++){
                    k=l%n;
                     sx+=x[V[k].second];
                sy+=y[V[k].second];
                }
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   22 |     sort(V.begin(),V.end());
      |     ^~~~
      |     sqrt
a.cc:36:21: error: 'k' was not declared in this scope
   36 |                     k=l%n;
      |                     ^
Language: C++

#include <cmath>
#include <iostream>
#include <iomanip>
#include <vector>
#include <tuple>
#include <vector>

using lli=long long int;
const double PI=4*std::atan(1);

struct p{
  p(int _x, int _y, double _t): x(_x),y(_y),t(_t) {}
  int x,y;
  double t;
};

int main(){
  int N;
  std::cin >> N;

  std::vector<p> p_arr;
  for(int i = 0; i < N; i++){
    int x,y;
    std::cin >> x >> y;
    double t = std::atan2(x,y);
    p_arr.emplace_back(x,y,t);
  }

  std::sort(p_arr.begin(), p_arr.end(), [](p& l, p& r){ return l.t < r.t; });
  std::vector<p> p2_arr(p_arr);
  p2_arr.insert(p2_arr.end(), p_arr.begin(), p_arr.end());
  std::vector<p> sum_arr;
  lli xs=0, ys=0;
  sum_arr.emplace_back(xs, ys, 0.0);
  for(auto&& it: p2_arr){
    xs += it.x;
    ys += it.y;
    sum_arr.emplace_back(xs, ys, 0.0);
  }
  lli r2_max = 0;
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N; j++){
      lli xd = sum_arr[i+j].x-sum_arr[i].x;
      lli yd = sum_arr[i+j].y-sum_arr[i].y;
      r2_max = std::max(r2_max, xd*xd+yd*yd);
    }
  }

  std::cout << std::setprecision(40) << std::fixed << std::sqrt(1.0*r2_max) << std::endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'sort' is not a member of 'std'; did you mean 'sqrt'?
   29 |   std::sort(p_arr.begin(), p_arr.end(), [](p& l, p& r){ return l.t < r.t; });
      |        ^~~~
      |        sqrt
Language: C++

#include <cmath>
#include <iostream>
#include <iomanip>
#include <vector>
#include <tuple>

using lli=long long int;
const double PI=4*std::atan(1);

struct p{
  p(int _x, int _y, double _t): x(_x),y(_y),t(_t) {}
  int x,y;
  double t;
};

int main(){
  int N;
  std::cin >> N;

  std::vector<p> p_arr;
  for(int i = 0; i < N; i++){
    int x,y;
    std::cin >> x >> y;
    double t = std::atan2(x,y);
    p_arr.emplace_back(x,y,t);
  }

  std::sort(p_arr.begin(), p_arr.end(), [](p& l, p& r){ return l.t < r.t; });
  std::vector<p> p2_arr(p_arr);
  p2_arr.insert(p2_arr.end(), p_arr.begin(), p_arr.end());
  std::vector<p> sum_arr;
  lli xs=0, ys=0;
  sum_arr.emplace_back(xs, ys, 0.0);
  for(auto&& it: p2_arr){
    xs += it.x;
    ys += it.y;
    sum_arr.emplace_back(xs, ys, 0.0);
  }
  lli r2_max = 0;
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N; j++){
      lli xd = sum_arr[i+j].x-sum_arr[i].x;
      lli yd = sum_arr[i+j].y-sum_arr[i].y;
      r2_max = std::max(r2_max, xd*xd+yd*yd);
    }
  }

  std::cout << std::setprecision(40) << std::fixed << std::sqrt(1.0*r2_max) << std::endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: 'sort' is not a member of 'std'; did you mean 'sqrt'?
   28 |   std::sort(p_arr.begin(), p_arr.end(), [](p& l, p& r){ return l.t < r.t; });
      |        ^~~~
      |        sqrt
Language: C++

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const double pi=acos(-1);
int N;
int X[111],Y[111];

signed main(){
	cin>>N;
	rep(i,N)cin>>X[i]>>Y[i];

	vector<tuple<double,int,int>>ev;
	rep(i,N){
		if(X[i]==0&&Y[i]==0)continue;
		double a=atan2(Y[i],X[i);
		ev.pb(make_tuple(a,Y[i],X[i]));
		ev.pb(make_tuple(a+pi,-Y[i],-X[i]));
		ev.pb(make_tuple(a+2*pi,Y[i],X[i]));
		ev.pb(make_tuple(a+3*pi,-Y[i],-X[i]));
	}

	sort(all(u));
	double ans=0.0;
	int sx,sy;
	rep(i,ev.size()){
		double a;
		int y,x;
		tie(a,y,x)=ev[i];
		sy+=y;sx+=x;
		chmax(ans,sqrt(y*y+x*x));
	}
	printf("%.20lf\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: expected ']' before ')' token
   29 |                 double a=atan2(Y[i],X[i);
      |                                        ^
      |                                        ]
a.cc:36:18: error: 'u' was not declared in this scope
   36 |         sort(all(u));
      |                  ^
a.cc:8:17: note: in definition of macro 'all'
    8 | #define all(v) (v).begin(),(v).end()
      |                 ^
Language: C++

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const double pi=acos(-1);
int N;
int X[111],Y[111];

signed main(){
	cin>>N;
	rep(i,N)cin>>X[i]>>Y[i];

	vector<pair<double,int>>u;
	rep(i,N){
		u.pb(make_pair(atan2(Y[i],X[i]),i));
		u.pb(make_pair(atan2(Y[i],X[i])+2*pi,i));
	}

	sort(all(u));reverse(all(u));
	int cur=0;

	double ans=0.0;
	rep(i,N){
		while(u[i].fi+pi+EPS>u[cur].fi)cur++;

		int sx=0,sy=0;
		for(int j=i;j<cur;j++){
			sx+=X[u[j].se];
			sy+=Y[u[j].se];
		}
		chmax(ans,sqrt(sx*sx+sy*sy));
	}
	printf("%.20lf\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:34: error: 'EPS' was not declared in this scope
   37 |                 while(u[i].fi+pi+EPS>u[cur].fi)cur++;
      |                                  ^~~
Language: C++

#include <cstdio>
#include <cmath>
#include <algorithm>	//

using namespace std;

#define MAX_N 	101	// エンジン個数の最大値
#define MP(x,y) make_pair((x), (y))

#define INF (1 << 30)

/* -----------------------------------------------------------------------------
	型とクラス定義
----------------------------------------------------------------------------- */
typedef pair<double,double> pdw;
typedef pair<double,pdw> tdw;

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
int 	N;				// エンジン個数
tdw 	dist[2*MAX_N];	// 距離関数(距離，最短路数)


int main () {
	double x,y,xs,ys;
	double pi = atan(1.0) * 4;
	int s,t;
	double dist_max;

	// 
	scanf("%d", &N);
	// 
	for(int i = 1; i <= N; i++) {
		scanf("%lf %lf", &x,&y);
		if(x >= 0 && y == 0) dist[i] = MP(0,MP(x,y));
		else if(x > 0 && y > 0) dist[i] =MP(atan(y/x), MP(x,y));
		else if(x == 0 && y > 0) dist[i] = MP(pi /2, MP(x,y));
		else if(x < 0 && y > 0) dist[i] = MP(atan(y/x)+pi, MP(x,y));
		else if(x < 0 && y == 0) dist[i] = MP(pi, MP(x,y));
		else if(x < 0 && y < 0) dist[i] = MP(atan(y/x)+pi, MP(x,y));
		else if(x == 0 && y < 0) dist[i] = MP(3 * pi / 2, MP(x,y));				
		else if(x > 0 && y < 0) dist[i] = MP(atan(y/x)+2*pi, MP(x,y));
	}

	std::sort(dist + 1, dist + 1 + N);
	for(int i = 1; i <= N; i++) dist[i+N] = dist[i];
	
/*
	for(int i = 1; i <= N; i++) {
		printf("%f,%d,%d\n", 
			dist[i].first, dist[i].second.first, dist[i].second.second);
	}
*/
	x = y = 0;	//　初期位置
	s = t = 1;
	dist_max = 0;

	while(t <= N) {
		xs = x + dist[s].second.first;	
		ys = y + dist[s].second.second;

		if(x*x + y*y <= xs*xs + ys*ys && s < t + N) {
			x = xs; y = ys; s++;
			if(x*x + y*y) > dist_max) dist_max = x*x + y*y;
		} else {
			x -= dist[t].second.first;	
			y -= dist[t].second.second;			
			t++;
		}
	}
	printf("%.100lf\n", sqrt(dist_max));

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:39: error: expected primary-expression before '>' token
   65 |                         if(x*x + y*y) > dist_max) dist_max = x*x + y*y;
      |                                       ^