criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

bool comparg(const P& p1, const P& p2){
    if(p1.first >= 0 && p2.first < 0) return true;
    if(p1.first < 0 && p2.first >= 0) return false;
    if(p1.first == 0 && p2.first == 0){
        if(p1.second < 0 && p2.second > 0) return true;
        if(p1.second > 0 && p2.second < 0) return false;
    }
    if(p1.second * p2.first == p1.first * p2.second) return p1.first + p1.second < p2.first + p2.second;
    return p1.second * p2.first < p1.first * p2.second;
}

int main()
{
    int n;
    cin >> n;
    ll x[103], y[103];
    P p[103];
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
        p[i] = P(x[i], y[i]);
    }
    ll ans = 0;
    sort(p, p + n, comparg);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            ll xsum = 0, ysum = 0;
            for(int k = 0; k <= j; k++){
                xsum += p[(i + k) % n].first;
                ysum += p[(i + k) % n].second;
            }
            ans = max(ans, xsum * xsum + ysum * ysum);
        }
    }
    cout << fixed << setprecision(15) << sqrt(ans) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   31 |     sort(p, p + n, comparg);
      |     ^~~~
      |     sqrt
Language: C++

#include <iostream>
#include <iomanip>
#include <utility>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

bool comparg(const P& p1, const P& p2){
    if(p1.first >= 0 && p2.first < 0) return true;
    if(p1.first < 0 && p2.first >= 0) return false;
    if(p1.first == 0 && p2.first == 0){
        if(p1.second < 0 && p2.second > 0) return true;
        if(p1.second > 0 && p2.second < 0) return false;
    }
    if(p1.second * p2.first == p1.first * p2.second) return p1.first + p1.second < p2.first + p2.second;
    return p1.second * p2.first < p1.first * p2.second;
}

int main()
{
    int n;
    cin >> n;
    ll x[103], y[103];
    P p[103];
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
        p[i] = P(x[i], y[i]);
    }
    sort(p, p + n, comparg);
    vector<P> v;
    for(int i = n - 1; i >= 0; i--){
        if(p[i].first == 0 && p[i].second == 0) n--;
        else if(i > 0 && 
                p[i].first * p[i - 1].second == p[i].second * p[i - 1].first &&
                p[i].first * p[i - 1].first > 0){
            p[i - 1].first += p[i].first;
            p[i - 1].second += p[i].second;
            n--;
        }
        else v.push_back(p[i]);
    }
    sort(v.begin(), v.end(), comparg);
    if(n == 0){
        cout << 0 << endl;
        return 0;
    }
    if(n == 1){
        cout << fixed << setprecision(15) << sqrt(v[0].first * v[0].first + v[0].second * v[0].second) << endl;
        return 0;
    }
    int r = 0, l = 0;
    ll nowx = 0, nowy = 0;
    ll ans = 0;
    while(true){
        while(true){
            if(l != r && l % n == r) break;
            nowx += v[l % n].first;
            nowy += v[l % n].second;
            ans = max(ans, nowx * nowx + nowy * nowy);
            l++;
            if(v[r].second * v[l % n].first > v[r].first * v[l % n].second) break;
        }
        while(true){
            nowx -= v[r].first;
            nowy -= v[r].second;
            ans = max(ans, nowx * nowx + nowy * nowy);
            r++;
            if(r >= n) break;
            if(v[r].second * v[l % n].first >= v[r].first * v[l % n].second) break;
        }
        if(r >= n) break;
    }
    cout << fixed << setprecision(15) << sqrt(ans) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   31 |     sort(p, p + n, comparg);
      |     ^~~~
      |     sqrt
Language: C++

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

#define _USES_MATH_DEFINES

#define x first
#define y second

int cmp(pair<int, int> a, pair<int, int> b) {
    return f(atan2l(a.y, a.x)) < f(atan2l(b.y, b.x));
}

int main() {
    int n; cin >> n;
    vector< pair<int, int> > P (n, {0, 0});
    for(int i = 0; i < n; i++) {
        cin >> P[i].x >> P[i].y;
    }
    //
    sort(P.begin(), P.end(), cmp);

    long long answer = 0;
    for( int L = 0; L < n; L++ ) {
        long long X = P[L].x, Y = P[L].y;
        answer = max(answer, X*X + Y*Y);
        for(int i = 1; i < n; i++) {
            int R = (L + i) % n;
            X += P[R].x;
            Y += P[R].y;
            answer = max(answer, X*X + Y*Y);
        }
    }
    //
    cout << fixed << setprecision(50) << sqrtl(answer);
}

Compiler output:
a.cc: In function 'int cmp(std::pair<int, int>, std::pair<int, int>)':
a.cc:10:12: error: 'f' was not declared in this scope
   10 |     return f(atan2l(a.y, a.x)) < f(atan2l(b.y, b.x));
      |            ^
Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <iomanip>

using namespace std;

struct C
{
	int64_t x = 0;
	int64_t y = 0;

	void Clear() 
	{
		x = y = 0;
	}

	friend C operator+(const C& a, const C& b)
	{
		C result;
		result.x = a.x + b.x;
		result.y = a.y + b.y;
		return result;
	}

	int64_t CalcWeight()
	{
		return abs(x) + abs(y);
	}

	double CaclDistance()
	{
		double xd = x;
		double yd = y;
		return sqrt(xd*xd + yd*yd);
	}
};

int main() 
{
	int n;
	vector<C> vals;

	cin >> n;
	vals.resize(n);

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

	C total;
	C totalTest;
	C maxTotal;

	for (int i=0; i<n; ++i)
	{
		total = total + vals[i];

		for (int j=i+1; j<n; ++j)
		{
			totalTest = total + vals[j];

			if (total.CalcWeight() < totalTest.CalcWeight())
			{
				total = totalTest;
			}
		}

		if (maxTotal.CalcWeight() < total.CalcWeight())
		{
			maxTotal = total;
		}

		total.Clear();
	}

	cout << fixed;
	cout << setprecision(20);
	cout << maxTotal.CaclDistance() << endl;

	return 0;
}

Compiler output:
a.cc: In member function 'double C::CaclDistance()':
a.cc:36:24: error: 'sqrt' was not declared in this scope
   36 |                 return sqrt(xd*xd + yd*yd);
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define MAXN 110
#define INF 1e9
#define LL long long
int n;
pair<LL, LL> c[MAXN];
class fastio {
public:
    fastio() {
        ios_base::sync_with_stdio(false);
        cout.tie(nullptr);
        cin.tie(nullptr);
    }
} __fastio;
void solve() {
    cin >> n;
    int x, y;
    for(int i=0; i<n; i++) {
        cin >> c[i].first >> c[i].second;
    }
    int i,k;
    long long maxi;
    for(k = maxi = 0; k<100000; k++) {
        random_shuffle(c, c+n);
        x = y = 0;
        for(i = 0; i<n; i++) {
            if((LL)(x + c[i].first) * (x + c[i].first) + (LL)(y + c[i].second) * (y + c[i].second) > (LL)(x * x) + (LL)(y * y)) {
                x += c[i].first;
                y += c[i].second;
            }
        }
        maxi = max(maxi, (LL) x*x + (LL) y*y);
    }
    printf("%.15Lf\n", sqrt((long double)o));
}
int main() {
  //__fastio;
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = pair<long long int, long long int>*]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   25 |         random_shuffle(c, c+n);
      |         ~~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4492:5: note: declared here
 4492 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
a.cc:35:42: error: 'o' was not declared in this scope
   35 |     printf("%.15Lf\n", sqrt((long double)o));
      |                                          ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
	int n;
	vector<int> x, y;
	vector<double> ans;
	
	cin >> n;
	x.resize(n); y.resize(n); ans.resize(n);
	for(int i = 0;i < n; i++)
	{
		cin >> x[i] >> y[i];
	}
	
	for(int i = 0; i < n; i++)
	{
		double sx = x[i], sy = y[i];
		for(int j = 0; j < n; j++)
		{
			if (i == j) continue;
			
			if (x[i]*x[j]+y[i]*y[j] >= 0) {
				sx += x[j];
				sy += y[j];
			}
		}
		ans[i] = sx*sx+sy*sy;
	}
	
	double m = *max_element(ans.begin(), ans.end());
	
	printf("%lf\n", sqrt(m));
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'max_element' was not declared in this scope
   35 |         double m = *max_element(ans.begin(), ans.end());
      |                     ^~~~~~~~~~~
Language: C++

p $<.to_a[1..-1].map{|x|
	Complex(*x.split.map(&:to_i))
}.product([*0...30]).select{|x|
	(x[0]/Complex.polar(1,2*Math::PI/x[1])).arg.abs<=Math::PI/2
}.group_by{|x|x[1]}.map{|x|
	x[1].map{|y|y[0]}.inject(:+).abs
}.max


Compiler output:
a.cc:1:11: error: too many decimal points in number
    1 | p $<.to_a[1..-1].map{|x|
      |           ^~~
a.cc:3:13: error: too many decimal points in number
    3 | }.product([*0...30]).select{|x|
      |             ^~~~~~
a.cc:1:1: error: 'p' does not name a type
    1 | p $<.to_a[1..-1].map{|x|
      | ^
a.cc:3:2: error: expected unqualified-id before '.' token
    3 | }.product([*0...30]).select{|x|
      |  ^
a.cc:5:2: error: expected unqualified-id before '.' token
    5 | }.group_by{|x|x[1]}.map{|x|
      |  ^
a.cc:5:20: error: expected unqualified-id before '.' token
    5 | }.group_by{|x|x[1]}.map{|x|
      |                    ^
a.cc:7:2: error: expected unqualified-id before '.' token
    7 | }.max
      |  ^
Language: C++

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

class ArgSort{
public:
  //complex<T>(x, y)またはpair<T, T>(x, y)の入力に対して偏角ソートする。
  template<typename T>
  static vector<T> Sort(vector<T> A){
    sort(A.begin(), A.end(), [&](const auto &p1,const auto &p2){
        long double a, b; tie(a, b) = p1;
        long double c, d; tie(c, d) = p2;
        return atan2(b, a) < atan2(d, c);
      });
    return A;
  }
};

void ABC139_F(){
  using Int = long long;
  using Double = long double;
  using P = pair<Int, Int>;

  Int N;
  cin>>N;
  vector<P> A(N);
  for(int i=0;i<N;i++){
    int x, y;
    cin>>x>>y;
    A[i] = P(x, y);
  }

  A = ArgSort::Sort(A);

  Int ans = 0;
  for(Int i=0;i<N;i++)
    for(Int j=0;j<N;j++){
      Int idx = i;
      Int x = 0, y = 0;
      while(1){
        x += A[idx].first;
        y += A[idx].second;
        Max(ans, x * x + y * y);
        if(idx == j) break;
        idx = (idx + 1)%N;
      }
    }

  cout<<sqrt((Double)ans)<<endl;


}

signed main(){

  ABC139_F();

  return 0;
}


Compiler output:
a.cc: In function 'void ABC139_F()':
a.cc:42:9: error: 'Max' was not declared in this scope
   42 |         Max(ans, x * x + y * y);
      |         ^~~
Language: C++

// Created by AboAbdoMC
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const int OO = 1e9+7;
const int MOD = 1e9+7;
const int N = 1e2+7;

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

double f(int i,double curx,double cury)
{
	if (i == n) return sqrt(curx*curx+cury*cury);
	double ret1 = f(i+1,curx,cury);
	double ret2 = sqrt(curx*curx+cury*cury);
	curx += x[i];
	cury += y[i];
	if (sqrt(curx*curx+cury*cury) > ret2) ret2 = f(i+1,curx,cury);
	return max(ret1,ret2);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n;
    rep(i,n) cin >> x[i] >> y[i];
    cout << fixed << setpericison(10);
    cout << f(0,0,0) << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:22: error: 'setpericison' was not declared in this scope
   48 |     cout << fixed << setpericison(10);
      |                      ^~~~~~~~~~~~
Language: C++

// Created by AboAbdoMC
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const int OO = 1e9+7;
const int MOD = 1e9+7;
const int N = 1e2+7;

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

double f(int i,double curx,double cury)
{
	if (i == n) return sqrt(curx*curx+cury*cury);
	double ret1 = f(i+1,curx,cury);
	double ret2 = sqrt(curx*curx+cury*cury);
	curx += x[i];
	cury += y[i];
	if (sqrt(curx*curx+cury*cury) > ret2) ret2 = f(i+1,curx,cury);
	return max(ret1,ret2);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    cin >> n;
    rep(i,n) cin >> x[i] >> y[i];
    cout << fixed << setpricison(10);
    cout << f(0,0,0) << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:22: error: 'setpricison' was not declared in this scope
   48 |     cout << fixed << setpricison(10);
      |                      ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> PII;
typedef long long ll;

bool cmp1(PII p1, PII p2) {
	if (p1.first < p2.first) return true;
	if (p1.first > p2.first) return false;
	return p1.second < p2.second;
}

bool cmp2(PII p1, PII p2) {
	if (p1.first > p2.first) return true;
	if (p1.first < p2.first) return false;
	return p1.second > p2.second;
}

ll mul(PII p1, PII p2, PII o) {
	return 1LL * (p1.first - o.first) * (p2.second - o.second) - 1LL * (p2.first - o.first) * (p1.second - o.second);
}

vector<PII> getHalf(vector<PII> &p) {
	vector<PII> res;
	res.push_back(p.front());
	for (int i = 1; i < p.size(); i++) {
		while (res.size() > 1 && mul(res[res.size() - 1], p[i], res[res.size() - 2]) <= 0) res.pop_back();
		res.push_back(p[i]);
	}
	return res;
}

vector<PII> getConvex(vector<PII> &p) {
	sort(p.begin(), p.end(), cmp1);
	vector<PII> res=getHalf(p);
	res.pop_back();
	sort(p.begin(), p.end(), cmp2);
	vector<PII> h=getHalf(p);
	h.pop_back();
	for (int i=0;i<h.size(); i++) res.push_back(h[i]);
	return res;
}

int main() {
	vector<PII> p;
	p.push_back(make_pair(0, 0));
	int n;
	cin>>n;
	for (int i=0; i<n; i++) {
		int x,y;
		cin>>x>>y;
		vector<PII> np;
		for (int j=0;;j<p.size();j++) {
			PII e=p[j];
			np.push_back(e);
			np.push_back(make_pair(e.first + x, e.second + y));
		}
		p=getConvex(np);
		// for (auto e: p) {
		// 	cout << e.first << " " << e.second << endl;
		// }
		// cout << endl;
	}
	ll ans = 0;
	for (auto e: p) {
		ans = max(1LL * e.first * e.first + 1LL * e.second * e.second, ans);
	}
	cout << setprecision(15) << sqrt(ans) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:41: error: expected ')' before ';' token
   54 |                 for (int j=0;;j<p.size();j++) {
      |                     ~                   ^
      |                                         )
a.cc:54:42: error: 'j' was not declared in this scope
   54 |                 for (int j=0;;j<p.size();j++) {
      |                                          ^
Language: C++

#include<iostream>
#include<algorithm>
#include<iomanip>
using namespace std;
struct point
{
	int x, y;
}pos[105];
double cross(double x1, double y1, double x2, double y2)
{
	return (x1 * y2 - x2 * y1);
}
double compare(point a, point b, point c)//计算极角
{
	return cross((b.x - a.x), (b.y - a.y), (c.x - a.x), (c.y - a.y));
}
bool cmp(point a, point b)
{
	point c;//原点
	c.x = 0;
	c.y = 0;
	if (compare(c, a, b) == 0)
		return a.x < b.x;
	else return compare(c, a, b) > 0;
}
int px[105], py[105];
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> pos[i].x >> pos[i].y;
	sort(pos + 1, pos + n + 1, cmp);
	for (int i = 1; i <= n; i++)
		px[i] = px[i - 1] + pos[i].x, py[i] = py[i - 1] + pos[i].y;
	double ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = i; j <= n; j++)
		{
			ans = max(ans, sqrt(1ll * (px[j] - px[i - 1]) * (px[j] - px[i - 1]) + 1ll * (py[j] - py[i - 1]) * (py[j] - py[i - 1])));
		}
	cout << fixed << setprecision(20) << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:40: error: 'sqrt' was not declared in this scope
   40 |                         ans = max(ans, sqrt(1ll * (px[j] - px[i - 1]) * (px[j] - px[i - 1]) + 1ll * (py[j] - py[i - 1]) * (py[j] - py[i - 1])));
      |                                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
#define all(a) (a).begin(), (a).end()

int N;

struct V {
  ll x, y;

  V(ll x = 0, ll y = 0): x(x), y(y) {};

  ll r2() const {
    return dot(*this);
  }

  V& operator += (const V &v) {
    x += v.x;
    y += v.y;
    return *this;
  }

  ll cross(const V& that) const {
    return x * that.y - that.x * y;
  }

  ll dot(const V& that) const {
    return x * that.x + y * that.y;
  }

  bool operator < (const V &that) const {
    retrun atan(y, x) < atan(that.y, that.x);
    // if(x == 0 && y == 0) return true;

    // ll c = cross(that);
    // if(c != 0) return c > 0;
    // if(dot(that) > 0) return r2() < that.r2();
    // if(y == 0) return x > 0;
    // return y > 0;
  }
};

vector<V> x;

int main () {
  cin >> N;

  rep(i,N) {
    ll a, b;
    cin >> a >> b;
    x.emplace_back(a, b);
  }

  sort(all(x));

  ll ans = 0;
  rep(i,N) {
    V c(0, 0);
    rep(j,N) {
      c += x[(i+j)%N];
      ans = max(ans, c.r2());
    }
  }

  cout << fixed << setprecision(12) << sqrt(ans) << endl;

  return 0;
}


Compiler output:
a.cc: In member function 'bool V::operator<(const V&) const':
a.cc:33:5: error: 'retrun' was not declared in this scope
   33 |     retrun atan(y, x) < atan(that.y, that.x);
      |     ^~~~~~
a.cc:41:3: warning: no return statement in function returning non-void [-Wreturn-type]
   41 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
#define all(a) (a).begin(), (a).end()

int N;

struct V {
  ll x, y, t;

  V(ll x = 0, ll y = 0): x(x), y(y) {};

  ll r2() const {
    return x*x + y*y;
  }

  V& operator += (const V &v) {
    x += v.x;
    y += v.y;
    return *this;
  }

  ll cross(const V& that) const {
    return x*that.y - that.x*y;
  }

  bool operator < (const V &that) const {
    if(x == 0 && y == 0) return true;

    ll c = cross(that);
    if(c != 0) c > 0;
    if(dot(that) > 0) return r2() < that.r2();
    if(y == 0) return x > 0;
    return y > 0;
  }
};

vector<V> x;

int main () {
  cin >> N;

  rep(i,N) {
    ll a, b;
    cin >> a >> b;
    x.emplace_back(a, b);
  }

  sort(all(x));

  ll ans = 0;
  rep(i,N) {
    V c(0, 0);
    rep(j,N) {
      c += x[(i+j)%N];
      ans = max(ans, c.r2());
    }
  }

  cout << fixed << setprecision(12) << sqrt(ans) << endl;

  return 0;
}


Compiler output:
a.cc: In member function 'bool V::operator<(const V&) const':
a.cc:33:8: error: 'dot' was not declared in this scope
   33 |     if(dot(that) > 0) return r2() < that.r2();
      |        ^~~
Language: Java

import java.util.*;

class Main{
  static Scanner sc = new Scanner(System.in);
  public static void main(String[] args){
    int  n = sc.nextInt();
    List<Xy> l = new ArrayList<>(n);
    for(int i=0;i<n;i++){
      l.add(new Xy(sc.nextInt(),sc.nextInt()));
    }
    Collections.sort(l,(s1,s2));
//    for(Xy xy:l){
//      System.out.println(xy);
//    }
    double max=0;
    for(int i=0;i<n;i++){
      int rx=0;
      int ry=0;
      for(int j=0;j<n;j++){
        rx+=l.get(j).x;
        ry+=l.get(j).y;
        max=Math.max(Math.hypot(rx,ry),max);
      }
      Xy r=l.remove(0);
      l.add(r);
    }
    System.out.println(max);
  }
  static class Xy implements Comparable{
    int x;
    int y;
    Xy(int x,int y){
      this.x=x;
      this.y=y;
    }
    public String toString(){
      return "["+x+","+y+"]";
    }
    static int hencom(Xy s1,Xy s2){
      return (int)Math.signum(Math.atan2(s1.y,s1.x)-Math.atan2(s2.y,s1.x));
    }
    public int compareTo(Object o){
      return (int)Math.signum(Math.atan2(y,x)-Math.atan2((Xy)o.y,(Xy)o.x));
    }
  }
}


Compiler output:
Main.java:11: error: -> expected
    Collections.sort(l,(s1,s2));
                              ^
1 error
Language: Java

import java.util.*;

class Main{
  static Scanner sc = new Scanner(System.in);
  public static void main(String[] args){
    int  n = sc.nextInt();
    List<Xy> l = new ArrayList<>(n);
    for(int i=0;i<n;i++){
      l.add(new Xy(sc.nextInt(),sc.nextInt()));
    }
    Collections.sort(l);
//    for(Xy xy:l){
//      System.out.println(xy);
//    }
    double max=0;
    for(int i=0;i<n;i++){
      int rx=0;
      int ry=0;
      for(int j=0;j<n;j++){
        rx+=l.get(j).x;
        ry+=l.get(j).y;
        max=Math.max(Math.hypot(rx,ry),max);
      }
      Xy r=l.remove(0);
      l.add(r);
    }
    System.out.println(max);
  }
  static class Xy{
    int x;
    int y;
    Xy(int x,int y){
      this.x=x;
      this.y=y;
    }
    public String toString(){
      return "["+x+","+y+"]";
    }
    static int hencom(Xy s1,Xy s2){
      return (int)Math.signum(Math.atan2(s1.y,s1.x)-Math.atan2(s2.y,s1.x));
    }
    public int compareTo(Object o){
      return (int)Math.signum(Math.atan2(y,x)-Math.atan2((Xy)o.y,(Xy)o.x));
    }
  }
}


Compiler output:
Main.java:11: error: no suitable method found for sort(List<Xy>)
    Collections.sort(l);
               ^
    method Collections.<T#1>sort(List<T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: Xy
        upper bounds: Comparable<? super T#1>)
    method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
    T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:43: error: cannot find symbol
      return (int)Math.signum(Math.atan2(y,x)-Math.atan2((Xy)o.y,(Xy)o.x));
                                                              ^
  symbol:   variable y
  location: variable o of type Object
Main.java:43: error: cannot find symbol
      return (int)Math.signum(Math.atan2(y,x)-Math.atan2((Xy)o.y,(Xy)o.x));
                                                                      ^
  symbol:   variable x
  location: variable o of type Object
Main.java:43: error: incompatible types: Xy cannot be converted to double
      return (int)Math.signum(Math.atan2(y,x)-Math.atan2((Xy)o.y,(Xy)o.x));
                                                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>

using namespace std;

int N;
vector < pair <int, int> > v;

long double maxAns;

inline bool cmp(const pair <int, int> A, const pair <int, int> B)
{
    return (1LL * A.second * B.first) < (1LL * B.second * A.first);
}

int main()
{
    cin >> N;

    for(int i = 1; i <= N; i++)
    {
        int x, y;
        cin >> x >> y;
        v.push_back({x, y});
    }

    cout << v.size() << '\n';

    sort(v.begin(), v.end(), cmp);

    for(int i = 0; i < v.size(); i++)
        v.push_back(v[i]);

    for(int start = 0; start < v.size(); start++)
    {
        long long x = 0LL, y = 0LL;

        for(int l = 1; l <= N; l++)
        {
            x += v[start + l - 1].first;
            y += v[start + l - 1].second;

            maxAns = max(maxAns, sqrtl(1LL * x * x + y * y));
        }
    }

    cout << fixed << setprecision(30) << maxAns << '\n';
    return 0;
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector < pair <int, int> > v;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:26:9: error: 'v' was not declared in this scope
   26 |         v.push_back({x, y});
      |         ^
a.cc:29:13: error: 'v' was not declared in this scope
   29 |     cout << v.size() << '\n';
      |             ^
Language: C++

#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;


// long long vector
struct vli2{

    ll x,y;

    explicit vli2(ll x_=0,ll y_=0):x(x_),y(y_)
    {}

    bool operator == (const vli2 &rhs)const{
        return x==rhs.x&y==rhs.y;
    }
    bool operator < (const vli2 &rhs)const{
        return x!=rhs.x?x<rhs.x:y<rhs.y;
    }

    vli2 operator + (const vli2& rhs)const{
        return vli2(x+rhs.x,y+rhs.y);
    }

    vli2 operator - (const vli2& rhs)const{
        return vli2(x-rhs.x,y-rhs.y);
    }
    vli2 operator * (ll rhs){
        return vli2(x*rhs,y*rhs);
    }

    ll norm() const{return x*x+y*y;}
    // not sqrt

    ll dot(const vli2& rhs)const {
        return x*rhs.x+y*rhs.y;
    }
    ll cross(const vli2& rhs)const {
        return x*rhs.y-y*rhs.x;
    }
};

ll ccw(vli2 a,vli2 b)
{
    ll res = a.cross(b);
    if(res>0)return 1LL;
    else if(res<0)return -1LL;
    else return 0;
}

vli2 c = vli2(1,0);

bool cmp(vli2 a,vli2 b)
{
    if(a.y<0&&b.y<0) return (ccw(a,b)>=0);
    else if(a.y<0)return false;
    else if(b.y<0)return true;
    else {
        if(a.y==0)return (a.x>0);
        if(b.y==0)return (b.x<0);
        return (ccw(a,b)>=0);
    }
}

vli2 A[MAXN];

int main()
{
    int n,m,k,q,a,b;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;

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

    sort(A,A+n,cmp);

    ll curx = 0;
    ll cury = 0;
    ll xsum = 0;
    ll ysum = 0;
    ll res = 0;


    for(int i=0;i<sz;i++)
    {
        xsum+=A[i].x;
        ysum+=A[i].y;
    }

    for(int i=0;i<n;i++){
        curx = 0;
        cury = 0;
        for(int j=i;j<n;j++){
            curx+=A[j].x;
            cury+=A[j].y;
            //cout<<curx<<" "<<cury<<"\n";
            res = max(res,curx*curx+cury*cury);
            res = max(res,(xsum-curx)*(xsum-curx)+(ysum-cury)*(ysum-cury));
        }
    }

    long double ans = sqrtl(res);

    cout<<fixed;
    cout.precision(20);
    cout<<ans<<"\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:112:19: error: 'sz' was not declared in this scope; did you mean 's'?
  112 |     for(int i=0;i<sz;i++)
      |                   ^~
      |                   s
Language: C++

/**
 *      purpose : 
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <fstream>
#include <iostream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstring>
#include <chrono>
#include <functional>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = long long;
using uint64 = unsigned long long;
using vi = std::vector<int>;
using vl = std::vector<int64>;
using pii = std::pair<int, int>;
using pii = std::pair<int, int>;
using pll = std::pair<int64, int64>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(_) (_).begin(), (_).end()
#define rall(_) (_).rbegin(), (_).rend()
#define print(_) std::cout << (_) << '\n'
#define debug(_) std::cerr << #_ << ": " << (_) << '\n'
#define dbg(vec) for (size_t _ = 0; _ < vec.size(); ++_){std::cerr << #vec << "[" << _ << "] : " << vec[_] << '\n';}
// variadic template
template<typename T> inline void chmin(T &a, T b) {if (a > b) a = b; return;}
template<typename T> inline void chmax(T &a, T b) {if (a < b) a = b; return;}
// constant
const int INF = (1<<30) - 1;  // 1.073741823e9
const int64 INF64 = (1LL<<62) - 1;  // 4.611686018427387903e18
const int MOD = 1000000007;

const double pi = 3.141592653589793;
vector<double> x(101), y(101);
int n; 

inline double naiseki(const double& x1, const double& y1, const double& x2, const double& y2) {
  return x1 * x2 + y1 * y2;
}

// 角度 theta の方向を最終的に向くとして計算
// theta は radian
double calc(const double& theta) {
  double res = 0.0;
  double dx = cos(theta), dy = sin(theta);
  for (int i = 0; i < n; ++i) {
    res += max(0.0, naiseki(dx, dy, x[i], y[i]));
  }
  return res;
}

int main(){
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  auto start = chrono::system_clock::now();

  cin >> n;
  rep(i, n) cin >> x[i] >> y[i];

  int step = 7777777;

  double ans = 0.0;
  /*
  for (int i = 0; i < step; ++i) {
    double theta = 2.0 * pi * i / step;
    chmax(ans, calc(theta));
  }
  */
  random_device rnd;
  mt19937 mt(rnd());
  uniform_int_distribution<> r(0, step);

  auto msec = 0.0;

  do {
    ++loop;
    double theta = 2.0 * pi * r(mt) / step;
    chmax(ans, calc(theta));
    auto end = chrono::system_clock::now();
    auto dur = end - start;
    msec = chrono::duration_cast<chrono::milliseconds>(dur).count();
  } while (msec <= 1950);

  cout << setprecision(15) << ans << '\n';

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:107:7: error: 'loop' was not declared in this scope
  107 |     ++loop;
      |       ^~~~
Language: C++


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<vector>
#include<cstring>
#include<cmath>
#include<cstring>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#define db double
#define ui unsigned int
#define ll long long
#define ull unsiged ll
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define per(i,r,l)for(int i=r;i>=l;i--)
#define boots ios::sync_with_stdio(0); cin.tie(0)
#define pb push_back
#define pp pop_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mod 1000000007
#define vii vector<int>
#define vll vector<ll>
#define vpp vector<pii>
#define inf  0x3f3f3f3f
#define lnf LLONG_MAX
#define mii map<int,int>
#define mll map<ll,ll>
#define mil map<int,ll>
#define umii unordered_map<char,int>
#define umll unordered_map<ll,ll>
#define umcc unordered_map<char,char>
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define pf(n) printf("%lld\n",n)
#define sz size()
using namespace std;
const db pi = 3.1415926535898;
const int MX = 1e3 + 7;
const int esp = 1e-6;
ll INV2, INV6;
ll modulo(ll num, ll MOD = mod) { return ((num%MOD) + MOD) % MOD; }
ll gcd(ll a, ll b) { return ((b == 0) ? a : gcd(b, a%b)); }
unordered_map<ui, ll>mp1, mp;
vector<int> pri;
vector<bool> isp(MX, true);

int n;
ll qpow(ll a, ll b)
{
	ll ans = 1;
	while (b)
	{
		if (b & 1)
			ans = ans * a%mod;
		a = a * a%mod;
		b >>= 1;
	}
	return ans;
}
ll INV(ll n)
{
	return qpow(n, mod - 2);
}
ll get_sum(ll d)
{
	if (d == 1)return k - 1;
	return d * d%mod*(qpow(d, k )*INV(d) - 1) % mod*INV(d - 1) % mod;
}
ll get_sum2(int n)
{
	return n * (n + 1) % mod*(2 * n + 1) % mod*INV6%mod;
}
struct node
{
	double x, y;
	void get() {
		cin >> x >> y;
	}
}a[MX];
node operator + (node a, node b) {
	return { a.x + b.x, a.y + b.y };
}
double dis(node a)//计算距离
{
	return sqrt(a.x*a.x+a.y*a.y);
}
double cross(node a, node b, node c)//计算叉积
{
	return (b.x - a.x)*(c.y - a.y) - (c.x - a.x)*(b.y - a.y);
}

bool cmp(node a, node b)//极角排序
{
	node c;
	c.x = 0;
	c.y = 0;
	ll m = cross(c, a, b);
	if (m > 0)
		return 1;
	else if (m == 0 && (a.x-b.x) < 0)
		return 1;
	else return 0;
}
int main()
{
	//boots;
	cin >> n;
	rep(i, 0, n-1)a[i].get();
	sort(a, a + n, cmp);
	db ans = 0;
	//cout << ans << endl;
	rep(i, 0, n-1)
	{
		node b;
		b.x = a[i].x, b.y = a[i].y;
		db sum = dis(b);
		for (int j = (i + 1) % n, e = 1; e < n; e++, j=(++j) % n)
		{
			db ant = dis(b + a[j]);
			if (ant >= sum)
			{
				b = b + a[j];
				sum = ant;
			}
		}
		ans = max(sum, ans);	
	}
	printf("%.20f\n", ans);

}

Compiler output:
a.cc: In function 'long long int get_sum(long long int)':
a.cc:70:27: error: 'k' was not declared in this scope
   70 |         if (d == 1)return k - 1;
      |                           ^
a.cc:71:35: error: 'k' was not declared in this scope
   71 |         return d * d%mod*(qpow(d, k )*INV(d) - 1) % mod*INV(d - 1) % mod;
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, N) for (int i = 0; i < N; ++i)

const double EPS = 1e-10;
struct V {
	double x, y;
	V(double x = 0, double y = 0) : x(x), y(y) {}
	int ort() const {
		if (x < EPS and y < EPS) return 0;
		if (x > 0 and y >= 0) return 1;
		if (x <= 0 and y > 0) return 2;
		if (x < 0 and y <= 0) return 3;
		if (x >= 0 and y < 0) return 4;
		return -1;
	}
	V& operator+=(const V& v) { x += v.x; y += v.y; return *this;}
	V operator+(const V& v) const { return V(*this) += v;}
	V& operator-=(const V& v) { x -= v.x; y -= v.y; return *this;}
	V operator-(const V& v) const { return V(*this) -= v;}
	V& operator*=(double s) { x *= s; y *= s; return *this;}
	V operator*(double s) const { return V(*this) *= s;}
	V& operator/=(double s) { x /= s; y /= s; return *this;}
	V operator/(double s) const { return V(*this) /= s;}
	double dot(const V& v) const { return x * v.x + y * v.y; }
	double cross(const V& v) const { return x * v.y - y * v.x; }
	double norm2() const { return x * x + y * y; }
	double norm() const { return sqrt(norm2()); }
	bool operator<(const V& v) const {
		if (ort() != v.ort()) return ort() < v.ort();
		return cross(v) >= 0;
	}
	friend ostream &operator<<(ostream &os, const V &v) { return os << "(" << v.x << ", " << v.y << ")"; }
	friend istream &operator>>(istream &is, V &v) { return is >> v.x >> v.y; }
};

void chmax(V& v1, const V& v2) { if (v1.norm2() < v2.norm2()) v1 = v2; }

int main() {
	int N;	cin >> N;
	vector<V> engines(N);
	REP(i, N) cin >> engines[i];
	sort(engines.begin(), engines.end());
	V res;
	for (int l = 0; l < N; ++l) {
		V cand;
		for (int r = l, i = 0; i < N; ++i, r = (r + 1) % N) {
			cand += engines[r];
			chmax(res, cand);
		}
	}
	cout << fixed << setprecision(12) << res.norm() << endl;
}c

Compiler output:
a.cc:53:2: error: 'c' does not name a type
   53 | }c
      |  ^
Language: C++

#include<iostream>
#include<math>
using namespace std;
int main()
{
  int d;
  cin>>d;
  int x[d];
  int y[d];
  int sumx=0;
  int sumy=0;
  int sumx1=0;
  int sumy1=0;
  for (int i=0;i<d;i++)
  {cin>>x[i]>>y[i];
   if (x[i]>0&&y[i]>0)
    { sumx=sumx+x[i];
     sumy=sumy+y[i];
    }
   else 
    {
     sumx1=sumx1+x[i];
     sumy1=sumy1+y[i];
    }
   }
  
  int n=sqrt(pow(sumx,2)+pow(sumy,2));
  int m=sqrt(pow(sumx1,2)+pow(sumy1,2));
  n>m ? cout<<n:cout<<m;
  return 0;





}


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

#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
struct node{
	double x,y;
}rec[N];
bool cmp(node a,node b){
	return atan2(a.y,a.x) < atan2(b.y,b.x);
}
int main(){
	cin >> n;
	for(int i = 1;i <= n;i++) cin >> rec[i].x >> rec[i].y;
	sort(rec+1,rec+n+1,cmp);
	double ans = 0;
	for(int i = 1;i <= n;i++){
		double a,b;
		a = 0;
		b = 0;
		int k = i;
		do{
			a += rec[k].x;
			b += rec[k].y;
			ans = max(ans,a*a+b*b);
			k = (k+1) % n;
		}while(i != j);
	}
	cout << setprecision(15) << (long double)sqrt(ans) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:29: error: 'j' was not declared in this scope
   26 |                 }while(i != j);
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 


using namespace std;

int main(){

    int n;
    cin >> n;
    vector<tuple<double,ll,ll>> v;

    rep(i,n){
        ll tmpx,tmpy;
        cin >> tmpx >> tmpy;

        double angle;

        double tmpd = sqrt((double)(tmpy * tmpy + tmpx * tmpx));

        if(tmpd < 1.0){
            angle = 0.0;
        }else{
            if(tmpy >= 0){
                angle = acos(((double)tmpx) / tmpd);
            }else{
                angle = 2 * PI - acos(((double)tmpx) / tmpd);
            }
        }

        v.pback(make_tuple(angle,tmpx, tmpy));
    }

    sort(ALL(v));

    rep(i,n){
        double tmpa = get<0>(v[i]);
        ll tmpx = get<1>(v[i]);
        ll tmpy = get<2>(v[i]);

        tmpa = tmpa + 2 * PI;

        v.pback(make_tuple(tmpa,tmpx,tmpy));
    }  

    ll bestd = 0;

    for(int l = 0; l < n; l++){
        for(int i = 1, i <= n; i++){
            ll tmpx = 0;
            ll tmpy = 0;

            rep(j,i){
                tmpx += get<1>(v[l + j]);
                tmpy += get<2>(v[l + j]);
            }

            bestd = max(bestd, tmpx * tmpx + tmpy * tmpy);
        }
    }

    double ans = (double)bestd;
    ans = sqrt(ans);

    cout << setprecision(52) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:25: error: expected ';' before '<=' token
   56 |         for(int i = 1, i <= n; i++){
      |                         ^~~
      |                         ;
a.cc:56:26: error: expected primary-expression before '<=' token
   56 |         for(int i = 1, i <= n; i++){
      |                          ^~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 


using namespace std;

int main(){

    int n;
    cin >> n;
    vector<tuple<double,ll,ll>> v;

    rep(i,n){
        ll tmpx,tmpy;
        cin >> tmpx >> tmpy;

        double angle;

        double tmpd = sqrt((double)(tmpy * tmpy + tmpx * tmpx));

        if(tmpd < 1.0){
            angle = 0.0;
        }else{
            if(tmpy >= 0){
                angle = acos(tmpx / tmpd);
            }else{
                angle = 2 * PI - acos(tmpx / tmpd)
            }
        }

        v.pback(make_tuple(angle,tmpx, tmpy));
    }

    sort(ALL(v));

    rep(i,n){
        double tmpa = get<0>(v[i]);
        ll tmpx = get<1>(v[i]);
        ll tmpy = get<2>(v[i]);

        tmpa = tmpa + 2 * PI;

        v.pback(make_tuple(tmpa,tmpx,tmpy));
    }

    int r = 1;
    
    ll tmpx = get<1>(v[0]);
    ll tmpy = get<2>(v[0]);

    ll bestd = tmpx * tmpx + tmpy * tmpy;

    for(int l = 0; l < n; l++){

        while(r <= 2 * n - 1 && get<0>(v[r]) - get<0>(v[l]) < PI){
            tmpx = tmpx + get<1>(v[r]);
            tmpy = tmpy + get<2>(v[r]);
            r++;
        }

        ll tmpd = tmpx * tmpx + tmpy * tmpy;

        bestd = max(bestd,tmpd);

        tmpx = tmpx - get<1>(v[l]);
        tmpy = tmpy - get<2>(v[l]);
    }

    double ans = (double)bestd;
    ans = sqrt(ans);

    cout << setprecision(52) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:51: error: expected ';' before '}' token
   34 |                 angle = 2 * PI - acos(tmpx / tmpd)
      |                                                   ^
      |                                                   ;
   35 |             }
      |             ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int Maxn = 200010;
typedef long long ll;
inline ll Max(const ll &a, const ll &b) {
    return a > b ? a : b;
}
inline char get(void) {
    static char buf[1000000], *p1 = buf, *p2 = buf;
    if (p1 == p2) {
        p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
        if (p1 == p2) return EOF;
    }
    return *p1++;
}
inline void read(ll &x) {
    x = 0; static char c; bool f = 0;
    for (; !(c >= '0' && c <= '9'); c = get()) if (c == '-') f = 1;
    for (; c >= '0' && c <= '9'; x = x * 10 + c - '0', c = get()); if (f) x = -x;
}
struct P {
    ll x, y;
    P(void) {}
    P(const int &x, const int &y) : x(x), y(y) {}
    inline void init(void) {
        read(x), read(y);
    }
    friend P operator + (P a, P b) {
        return P(a.x + b.x, a.y + b.y);
    }
    friend P operator - (P a, P b) {
        return P(a.x - b.x, a.y - b.y);
    }
    friend bool operator < (P a, P b) {
        if (a.x == b.x && a.y == b.y) return 0;
        return atan2(a.y, a.x) < atan2(b.y, b.x);
    }
    ll len(void) {
        return x * x + y * y;
    }
    friend ll cross(P a, P b) {
        return a.x * b.y - a.y * b.x;
    }
} p[Maxn], now;
ll n, ans;
int main(void) {
    //freopen("in.txt", "r", stdin);
    read(n);
    for (int i = 1; i <= n; i++) p[i].init();
    sort(p + 1, p + 1 + n);
    for (int i = 1; i <= n; i++) p[i + n] = p[i];
    now = p[1];
    for (int i = 1, j = 1; i <= n; i++) {
        while (j + 1 < i + n && cross(p[i], p[j + 1]) >= 0) now = now + p[++j], ans = Max(ans, now.len());
        now = now - p[i];
        ans = Max(ans, now.len());
    }
    printf("%.16Lf\n", sqrtl((long double(ans))));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:31: error: expected primary-expression before 'long'
   58 |     printf("%.16Lf\n", sqrtl((long double(ans))));
      |                               ^~~~
a.cc:58:31: error: expected ')' before 'long'
   58 |     printf("%.16Lf\n", sqrtl((long double(ans))));
      |                              ~^~~~
      |                               )
Language: C++

#include <stdio.h>
#include <algorithm>
#include <vector>

#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))

using namespace std;

int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);

    const double PI=acos((double)-1);
    const double eps=1e-14;
    vector<pair<double, pair<int,int> > > z(n);
    int i,j;
    for(i=0; i<n; i++) {
        int x,y;
        scanf("%d%d", &x, &y);
        double t=0;
        if(x!=0 || y!=0) {
            t=atan2((double)y,(double)x);
            if(t<-PI+eps) t+=2*PI;
        }
        z[i]=make_pair(t, make_pair(x,y));
    }
    sort(z.begin(), z.end());

    vector<double> sx(n+1,0), sy(n+1,0);
    for(i=0; i<n; i++) {
        sx[i+1]=sx[i]+z[i].second.first;
        sy[i+1]=sy[i]+z[i].second.second;
    }

    vector<double> args;
    for(i=0; i<n; i++) {
        double tmp=z[i].first;
        args.push_back(tmp);
        args.push_back(tmp>eps? tmp-PI: tmp+PI);
    }
    
    double ans=0;
    for(i=0; i<(int)args.size(); i++) {
        j=lower_bound(z.begin(),z.end(),make_pair(args[i]-eps, make_pair(0,0)))-z.begin();
        int k=lower_bound(z.begin(),z.end(),make_pair(args[i]+PI-eps, make_pair(0,0)))-z.begin();
        double sumx=sx[k]-sx[j];
        double sumy=sy[k]-sy[j];
        double ans0=sumx*sumx+sumy*sumy;
        ans=MAX(ans,ans0);

        sumx=sx[n]-sumx;
        sumy=sy[n]-sumy;
        ans0=sumx*sumx+sumy*sumy;
        ans=MAX(ans,ans0);
    }
    printf("%.16lf\n", sqrt(ans));

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:21: error: 'acos' was not declared in this scope
   15 |     const double PI=acos((double)-1);
      |                     ^~~~
a.cc:24:15: error: 'atan2' was not declared in this scope
   24 |             t=atan2((double)y,(double)x);
      |               ^~~~~
a.cc:58:24: error: 'sqrt' was not declared in this scope
   58 |     printf("%.16lf\n", sqrt(ans));
      |                        ^~~~
Language: C++

#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

int main() {
    ll N;
    cin >> N;
    struct Point {
        double x, y, rad;
    };

    const double PI = acos(-1);
    vector<Point> points(N);
    for (Point &p : points) {
        cin >> p.x >> p.y;
        double x = p.x / sqrt(pow(p.x, 2) + pow(p.y, 2));
        (p.rad = p.y >= 0 ? acos(x) : acos(x) + PI);
    }

    sort(points.begin(), points.end(), [](Point &lhs, Point &rhs) {
        return lhs.rad < rhs.rad;
    });

    double ans = 0;
    for (ll i = 0; i < N; i++) {
        for (ll j = 1; j <= N; j++) {
            //iからj個使う
            double x = 0, y = 0;

            for (ll k = 0; k < j; k++) {
                x += points[(i + k) % N].x;
                y += points[(i + k) % N].y;
            }

            double curr = sqrt(pow(x, 2) + pow(y, 2));
            ans = max(ans, curr);
        }
 }

    cout << setprecision(15) << ans << endl;
}v

Compiler output:
a.cc:41:2: error: 'v' does not name a type
   41 | }v
      |  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i , l , r) for(int i = (l) , ___ = (r) ; i <= ___ ; ++i)
#define per(i , r , l) for(int i = (r) , ___ = (l) ; i >= ___ ; --i)

#define DEBUG(...) fprintf(stderr , __VA_ARGS__)

template<typename T>inline int chkmin(T &x , const T &y){ return x > y ? x = y , 1 : 0; }
template<typename T>inline int chkmax(T &x , const T &y){ return x < y ? x = y , 1 : 0; }

template<typename T>inline T read(T &f)
{
	f = 0 ; int x = 1 ; char c = getchar();
	while(!isdigit(c)) x = c == '-' ? -1 : 1 , c = getchar();
	while(isdigit(c)) (f *= 10) += c & 15 , c = getchar();
	return f *= x;
}

using int64 = long long;
using uint64 = unsigned long long;

const int N = 400 + 5;

struct Node
{
	int64 x , y; double theta;
	int operator < (const Node &rhx) const
	{
		return x * rhx.y - y * rhx.x < 0;
	}
	int64 operator *(const Node &rhx) const
	{
		return theta < thx.theta;
	}
} A[N];

int n ;

int64 sX[N] , sY[N];

int main()
{
	read(n);
	rep(i , 1 , n)
	{
		read(A[i].x);
		read(A[i].y);
		A[i].theta = atan2(A[i].x , A[i].y);
	}
	sort(A + 1 , A + 1 + n);
	rep(i , 1 , n) A[i + n] = A[i];
	int64 Ans = 0;
	rep(i , 1 , n * 2)
	{
		sX[i] = sX[i - 1] + A[i].x;
		sY[i] = sY[i - 1] + A[i].y;
	}
	rep(i , 1 , n)
	rep(j , i , i + n - 1)
	{
		int64 X = sX[j] - sX[i - 1];
		int64 Y = sY[j] - sY[i - 1];
		chkmax(Ans , X * X + Y * Y);
	}
	printf("%.15lf\n" , sqrt(Ans)); // ret); // sqrt(Ans));
	// printf("%.12f\n" , fabs(static_cast<long double>(Ans) - ret * ret));	
	return 0;
}


Compiler output:
a.cc: In member function 'int64 Node::operator*(const Node&) const':
a.cc:35:32: error: 'thx' was not declared in this scope; did you mean 'rhx'?
   35 |                 return theta < thx.theta;
      |                                ^~~
      |                                rhx