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

public class Main {

	public static void main(String[] args) {
		// 入力
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		List<Vector2d> p = new ArrayList<>();
		for (int i=0; i<n; i++) {
			double x = sc.nextDouble();
			double y = sc.nextDouble();
			p.add(new Vector2d(x, y));
		}
		sc.close();
		System.out.println(solve(p));
	}

	static class Vector2d {
		Vector2d(Double x, Double y){
			this.x = x;
			this.y = y;
		}
		Double x;
		Double y;
		public String toString() {
			return String.format("%1$.10f %2$.10f", x, y);
		}
	}

	public static Vector2d sub(Vector2d v1, Vector2d v2){
		return new Vector2d(v2.x - v1.x, v2.y - v1.y);
	}

	public static int solve(List<Vector2d> p) {
		boolean ans = true;
		int s = p.size();
		for (int i=0; i<s; i++) {
			Vector2d a = sub(p.get(i), p.get((i+1)%s));
			Vector2d b = sub(p.get((i+1)%s), p.get((i+2)%s));
			ans = ans && ((a.x * b.y - a.y * b.x) >= 0);
		}
		return ans ? 1 : 0;
	}
}



Compiler output:
Main.java:33: error: cannot find symbol
	public static int solve(List<Vector2d> p) {
	                        ^
  symbol:   class List
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
		List<Vector2d> p = new ArrayList<>();
		^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
		List<Vector2d> p = new ArrayList<>();
		                       ^
  symbol:   class ArrayList
  location: class Main
5 errors
Language: C

#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#include<cstdio>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
#define prev(P, i) P[(i+P.size()-1) % P.size()]

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }
};

typedef point Vector;

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

double norm(point a){
  return sqrt(dot(a,a));
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( point p0, point p1, point p2 ){
  Vector a=p1-p0;
  Vector b=p2-p0;
  if (cross(a,b)>EPS) return COUNTER_CLOCKWISE;
  if (cross(a,b)<-EPS) return CLOCKWISE;
  if (dot(a, b)<-EPS) return ONLINE_BACK;
  if (norm(a)<norm(b)) return ONLINE_FRONT;
  return ON_SEGMENT;
}

bool is_convex(vector<point> pol){
  for(int i=0;i<pol.size();i++){
    int res=ccw(prev(pol,i),curr(pol,i),next(pol,i));
    if(res!=1 && res!=-2)return false;
  }
  return true;
}
int main(void){
  int n;
  cin >> n;
  vector<point>pol(n);

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

  if(is_convex(pol))cout << 1 << endl;
  else cout << 0 << endl;

  return 0;
}

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

#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;

template <class T> void readVal(vector<T>& vec, int idx) {
    T input;
    std::cin >> input;
    vec[idx] = input;
}

int main()
{
    int size;
    cin >> size;
    vector<int> x(size); 
    vector<int> y(size);
    for (int i = 0; i < size; i++) {
        readVal(x, i);
        readVal(y, i);
    }
    int ans(1), dir(0), vecx(0), vecy(0), new_vecx(0), new_vecy(0);
    for (int i = 0; i <= size; i++) {
        new_vecx = x[(i + 1) % size] - x[i % size];
        new_vecy = y[(i + 1) % size] - y[i % size];
        int cross_prod = (vecx * new_vecy - vecy * new_vecx);
        if (cross_prod != 0) {
            if ((dir = cross_prod * dir) >= 0) {
                dir \= abs(dir);
            }
            else {
                ans = 0;
                break;
            }
        }
        vecx = new_vecx;
        vecy = new_vecy;
    }
    cout << ans << "\n";
    return 0;
}




Compiler output:
a.cc:29:21: error: stray '\' in program
   29 |                 dir \= abs(dir);
      |                     ^
Language: C++

// CGL_3_B.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <cstdlib>

using namespace std;

template <class T> void readVal(vector<T>& vec, int idx) {
    T input;
    std::cin >> input;
    vec[idx] = input;
}

int main()
{
    int size;
    cin >> size;
    vector<int> x(size); 
    vector<int> y(size);
    for (int i = 0; i < size; i++) {
        readVal(x, i);
        readVal(y, i);
    }
    int ans(1), dir(0), vecx(0), vecy(0), new_vecx(0), new_vecy(0);
    for (int i = 0; i <= size; i++) {
        new_vecx = x[(i + 1) % size] - x[i % size];
        new_vecy = y[(i + 1) % size] - y[i % size];
        int cross_prod = (vecx * new_vecy - vecy * new_vecx);
        if (cross_prod != 0) {
            if ((dir *= cross_prod) >= 0) {
                dir /= abs(dir)
            }
            else {
                ans = 0;
                break;
            }
        }
        vecx = new_vecx;
        vecy = new_vecy;
    }
    cout << ans << "\n";
    return 0;
}




Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

//
//  main.cpp
//  Computational_Geometry
//
//  Created by ?????£??? on 2017/8/2.
//  Copyright ?? 2017??´ ?????£???. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAX=1e1;

int sgn(double x)
{
    if (fabs(x)<eps) return 0;
    if (x<0) return -1;
    else return 1;
}

struct Point
{
    double x,y;
    Point(){}
    Point(double _x,double _y){
        x=_x;y=_y;
    }
    Point operator -(const Point &b)const{
        return Point(x-b.x,y-b.y);
    }
    double operator ^(const Point &b)const{
        return x*b.y - y*b.x;
    }
    double operator *(const Point &b)const{
        return x*b.x - y*b.y;
    }
    void transXY(double B){
        double tx=x,ty=y;
        x=tx*cos(B) - ty*sin(B);
        y=tx*sin(B) + ty*cos(B);
    }
};

double CalcArea(Point p[],int n)
{
    double res=0;
    for (int i=0; i<n; i++) {
        res+=(p[i]^p[(i+1)%n])/2;
    }
    return fabs(res);
}

bool isconvex(Point poly[],int n)
{
    bool s[3];
    memset(s, false, sizeof(s));
    for (int i=0; i<n; i++) {
        s[sgn((poly[(i+1)%n]-poly[i])^(poly[(i+2)%n]-poly[i]))+1]=true;
        if (s[0] && s[2]) return false;
    }
    return true;
}
Point p[MAX];
int main(void) {
    //freopen("/Users/mac/Desktop/C++?¨????/Computational_Geometry/Computational_Geometry/test.txt", "r", stdin);
    int n;
    scanf("%d\n",&n);
    for (int i=0; i<n; i++) {
        scanf("%lf%lf\n",&p[i].x,&p[i].y);
    }
    printf("%d\n",isconvex(p, n)?1:0);
    return 0;
}

Compiler output:
a.cc: In function 'bool isconvex(Point*, int)':
a.cc:60:5: error: 'memset' was not declared in this scope
   60 |     memset(s, false, sizeof(s));
      |     ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <algorithm>
  +++ |+#include <cstring>
   13 | using namespace std;
Language: C++

//
//  main.cpp
//  Computational_Geometry
//
//  Created by ?????£??? on 2017/8/2.
//  Copyright ?? 2017??´ ?????£???. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cmath>
#include <memory>
#include <string>
#include <algorithm>
using namespace std;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAX=1e1;

int sgn(double x)
{
    if (fabs(x)<eps) return 0;
    if (x<0) return -1;
    else return 1;
}

struct Point
{
    double x,y;
    Point(){}
    Point(double _x,double _y){
        x=_x;y=_y;
    }
    Point operator -(const Point &b)const{
        return Point(x-b.x,y-b.y);
    }
    double operator ^(const Point &b)const{
        return x*b.y - y*b.x;
    }
    double operator *(const Point &b)const{
        return x*b.x - y*b.y;
    }
    void transXY(double B){
        double tx=x,ty=y;
        x=tx*cos(B) - ty*sin(B);
        y=tx*sin(B) + ty*cos(B);
    }
};

double CalcArea(Point p[],int n)
{
    double res=0;
    for (int i=0; i<n; i++) {
        res+=(p[i]^p[(i+1)%n])/2;
    }
    return fabs(res);
}

bool isconvex(Point poly[],int n)
{
    bool s[3];
    memset(s, false, sizeof(s));
    for (int i=0; i<n; i++) {
        s[sgn((poly[(i+1)%n]-poly[i])^(poly[(i+2)%n]-poly[i]))+1]=true;
        if (s[0] && s[2]) return false;
    }
    return true;
}
Point p[MAX];
int main(void) {
    //freopen("/Users/mac/Desktop/C++?¨????/Computational_Geometry/Computational_Geometry/test.txt", "r", stdin);
    int n;
    scanf("%d\n",&n);
    for (int i=0; i<n; i++) {
        scanf("%lf%lf\n",&p[i].x,&p[i].y);
    }
    printf("%d\n",isconvex(p, n)?1:0);
    return 0;
}

Compiler output:
a.cc: In function 'bool isconvex(Point*, int)':
a.cc:62:5: error: 'memset' was not declared in this scope
   62 |     memset(s, false, sizeof(s));
      |     ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include <algorithm>
  +++ |+#include <cstring>
   15 | using namespace std;
Language: C++

#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

typedef vector<P> G;

#define curr(P, i) P[(i+1) % P.size()]
#define next(P, i) P[(i+2) % P.size()]
#define prev(P, i) P[(i) % P.size()]
bool isconvex(const G &P){
  for(int i = 0; i < P.size(); ++i){
    int d=ccw(prev(P, i), curr(P, i), next(P, i))
	if(d==-1||d==2) return false;
  }
  return true;
}

int main(){
	G poly;
	P p;
	int n;
	double x,y;
	for(scanf("%d",&n);n--;poly.push_back(p))scanf("%lf%lf",&x,&y),p=P(x,y);
	printf("%d\n",isconvex(poly));
}

Compiler output:
a.cc: In function 'bool isconvex(const G&)':
a.cc:38:9: error: expected ',' or ';' before 'if'
   38 |         if(d==-1||d==2) return false;
      |         ^~
Language: C++

#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

typedef vector<P> G;

#define curr(P, i) P[(i+1) % P.size()]
#define next(P, i) P[(i+2) % P.size()]
#define prev(P, i) P[(i) % P.size()]
bool isconvex(const G &P){
  for(int i = 0; i < P.size(); ++i){
    int d=ccw(prev(P, i), curr(P, i), next(P, i))
	if(d==-1) return false;
  }
  return true;
}

int main(){
	G poly;
	P p;
	int n;
	double x,y;
	for(scanf("%d",&n);n--;poly.push_back(p))scanf("%lf%lf",&x,&y),p=P(x,y);
	printf("%d\n",isconvex(poly));
}

Compiler output:
a.cc: In function 'bool isconvex(const G&)':
a.cc:38:9: error: expected ',' or ';' before 'if'
   38 |         if(d==-1) return false;
      |         ^~
Language: C++

#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#include<cstdio>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
#define prev(P, i) P[(i+P.size()-1) % P.size()]

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }
};

typedef point Vector;

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

double norm(point a){
  return sqrt(dot(a,a));
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( point p0, point p1, point p2 ){
  Vector a=p1-p0;
  Vector b=p2-p0;
  if (cross(a,b)>0) return COUNTER_CLOCKWISE;
  if (cross(a,b)<0) return CLOCKWISE;
  if (dot(a, b)<0) return ONLINE_BACK;
  if (norm(a)<norm(b)) return ONLINE_FRONT;
  return ON_SEGMENT;
}

bool is_convex(vector<point> pol){
  for(int i=0;i<pol.size();i++){
    int res=ccw(prev(pol,i),curr(pol,i),next(pol,i));
    if(res!=1 && res!=-2)return false;
  }
  return true;
}
bool is_convex(vector<point> pol){
  for(int i=0;i<pol.size();i++){
    int res=ccw(prev(pol,i),curr(pol,i),next(pol,i));
    if(res!=1 && res!=-2)return false;
  }
  return true;
}

int main(void){
  int n;
  cin >> n;
  vector<point>pol(n);

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

  if(is_convex(pol))cout << 1 << endl;
  else cout << 0 << endl;

  return 0;
}

Compiler output:
a.cc:77:6: error: redefinition of 'bool is_convex(std::vector<point>)'
   77 | bool is_convex(vector<point> pol){
      |      ^~~~~~~~~
a.cc:70:6: note: 'bool is_convex(std::vector<point>)' previously defined here
   70 | bool is_convex(vector<point> pol){
      |      ^~~~~~~~~
Language: C

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

typedef struct{
	double x;
	double y;
}POINT;

double dot(POINT a,POINT b){//??????
	return a.x*b.y + a.y*b.x;
}
double cross(POINT a,POINT b){//??????
	return (a.x*a.x + a.y*a.y)*(b.x*b.x + b.y*b.y) - dot(a,b)*dot(a,b);
}
POINT make_vec(POINT a,POINT b){//a->b
	POINT ans;
	ans.x = b.x-a.x;
	ans.y = b.y-a.y;
	return ans;
}

int main(){
	int i,j,k,l,m,n;
	double w,e,r,t,y;
	double rad = 0;
	POINT g[101];//n
	POINT q[1000];//m
	int ans[1000] = {0};

	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%d%d",&g[i].x,&g[i].y);
	}
	g[n] = g[0];
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf("%d%d",&q[i].x,&q[i].y);
		for(j = 0;j < n;j++){
			if(g[j].x == q[i].x && g[j].y == q[i].y){
				ans[i] = 1;
			}
		}
	}

	for(j = 0;j < m;j++){
		if(ans[j] == 1)continue;
		for(i = 0;i < n;i++){
			w = atan2(cross(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i:1]))
				/dot(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i:1]))
				));//q[j],g[i],g[i+1]
			rad += w;
			if(w == 3.1415926535 || w == -3.1415926535)ans[j] = 1;
		}
		if(ans[j] != 1){
			if(rad == 3.1415926535 * 2){//2??
				ans = 2;//in!
			}
		}
	}
	for(i = 0;i < m;i++)printf("%d?\n",ans[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:50:50: error: expected ']' before ':' token
   50 |                                 make_vec(q[j],g[i:1]))
      |                                                  ^
      |                                                  ]
main.c:53:50: error: expected ']' before ':' token
   53 |                                 make_vec(q[j],g[i:1]))
      |                                                  ^
      |                                                  ]
main.c:48:29: error: too few arguments to function 'atan2'
   48 |                         w = atan2(cross(
      |                             ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note: declared here
   59 | __MATHCALL_VEC (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
      | ^~~~~~~~~~~~~~
main.c:54:34: error: expected ';' before ')' token
   54 |                                 ));//q[j],g[i],g[i+1]
      |                                  ^
      |                                  ;
main.c:54:34: error: expected statement before ')' token
main.c:60:37: error: assignment to expression with array type
   60 |                                 ans = 2;//in!
      |                                     ^
Language: C

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

typedef struct{
	double x;
	double y;
}POINT;

double dot(POINT a,POINT b){//??????
	return a.x*b.y + a.y*b.x;
}
double cross(POINT a,POINT b){//??????
	return (a.x*a.x + a.y*a.y)*(b.x*b.x + b.y*b.y) - dot(a,b)*dot(a,b);
}
POINT make_vec(POINT a,POINT b){//a->b
	POINT ans;
	ans.x = b.x-a.x;
	ans.y = b.y-a.y;
	return ans;
}

int main(){
	int i,j,k,l,m,n;
	double w,e,r,t,y;
	double rad = 0;
	POINT g[101];//n
	POINT q[1000];//m
	int ans[1000] = {0};

	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%d%d",&g[i].x,&g[i].y);
	}
	g[n] = g[0];
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf("%d%d",&q[i].x,&q[i].y);
		for(j = 0;j < n;j++){
			if(g[j].x == q[i].x && g[j].y == q[i].y){
				ans[i] = 1;
			}
		}
	}

	for(j = 0;j < m;j++){
		if(ans[j] == 1)continue;
		for(i = 0;i < n;i++){
			w = atan2(cross(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i+1]))
				/dot(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i+1]))
				));//q[j],g[i],g[i+1]
			rad += w;
			if(w == 3.1415926535 || w == -3.1415926535)ans[j] = 1;
		}
		if(ans[j] != 1){
			if(rad == 3.1415926535 * 2){//2??
				ans = 2;//in!
			}
		}
	}
	for(i = 0;i < m;i++)printf("%d?\n",ans[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:48:29: error: too few arguments to function 'atan2'
   48 |                         w = atan2(cross(
      |                             ^~~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note: declared here
   59 | __MATHCALL_VEC (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
      | ^~~~~~~~~~~~~~
main.c:54:34: error: expected ';' before ')' token
   54 |                                 ));//q[j],g[i],g[i+1]
      |                                  ^
      |                                  ;
main.c:54:34: error: expected statement before ')' token
main.c:60:37: error: assignment to expression with array type
   60 |                                 ans = 2;//in!
      |                                     ^
Language: C

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

typedef struct{
	double x;
	double y;
}POINT;

double dot(POINT a,POINT b){//??????
	return a.x*b.y + a.y*b.x;
}
double cross(POINT a,POINT b){//??????
	return (a.x*a.x + a.y*a.y)*(b.x*b.x + b.y*b.y) - dot(a,b)*dot(a,b);
}
POINT make_vec(POINT a,POINT b){//a->b
	POINT ans;
	ans.x = b.x-a.x;
	ans.y = b.y-a.y;
	return ans;
}

int main(){
	int i,j,k,l,m,n;
	double w,e,r,t,y;
	double rad = 0;
	POINT g[101];//n
	POINT q[1000];//m
	int ans[1000] = {0};

	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%d%d",&g[i].x,&g[i].y);
	}
	g[n] = g[0];
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf("%d%d",&q[i].x,&q[i].y);
		for(j = 0;j < n;j++){
			if(g[j].x == q[i].x && g[j].y == q[i].y){
				ans[i] = 1;
			}
		}
	}

	for(j = 0;j < m;j++){
		if(ans[j] == 1)continue;
		for(i = 0;i < n;i++){
			w = atan2(cross(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i+1]))
				,dot(
				make_vec(q[j],g[i]),
				make_vec(q[j],g[i+1]))
				);//q[j],g[i],g[i+1]
			rad += w;
			if(w == 3.1415926535 || w == -3.1415926535)ans[j] = 1;
		}
		if(ans[j] != 1){
			if(rad == 3.1415926535 * 2){//2??
				ans = 2;//in!
			}
		}
	}
	for(i = 0;i < m;i++)printf("%d?\n",ans[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:60:37: error: assignment to expression with array type
   60 |                                 ans = 2;//in!
      |                                     ^
Language: C++

#include "zpw.h"
using namespace std;
int main(){
	Polygon g;
	Point p ,t;
	int n, q;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf %lf", &t.x, &t.y);
		g.push_back(t);
	}
	cin>>q;
	for (int i = 0; i < q; i++) {
		cin>>p.x>>p.y;
		cout<<contains(g, p)<<endl;
	}
	return 0;
}


Compiler output:
a.cc:1:10: fatal error: zpw.h: No such file or directory
    1 | #include "zpw.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef vector<P> vec;

double eps=1e-5;
bool eq(double a,double b){return (b-a<eps&&a-b<eps);}
double dot(P a,P b){return real(b*conj(a));}
double cross(P a,P b){return imag(b*conj(a));}
P project(P a,P b,P c){b-=a;c-=a;return a+b*real(c/b);}
P reflect(P a,P b,P c){b-=a;c-=a;return a+conj(c/b)*b;}
int ccw(P a,P b,P c){
  b-=a,c-=a,a=c*conj(b);
  if(a.imag()>eps)return 1;//ccw
  if(a.imag()<-eps)return -1;//cw
  if(a.real()<-eps)return 2;//ob
  if(abs(b)+eps<abs(c))return -2;//of
  return 0;//os
}

//segment ab , point c
double dist(P a,P b,P c){
  if(dot(b-a,c-a)<0)return abs(c-a);
  if(dot(a-b,c-b)<0)return abs(c-b);
  return abs(cross(b-a,c-a))/abs(b-a);
}

bool isintersect(P a,P b,P c,P d){
  return ((ccw(a,b,c)*ccw(a,b,d)<=0)&&(ccw(c,d,a)*ccw(c,d,b)<=0));
}

//segment ab , segment cd
P intersect(P a,P b,P c,P d){
  a-=d;b-=d;c-=d;
  return d+a+(b-a)*imag(a/c)/imag(a/c-b/c);
}

double dist(P a,P b,P c,P d){
  if(isintersect(a,b,c,d))return 0;
  double ab=min(dist(a,b,c),dist(a,b,d));
  double cd=min(dist(c,d,a),dist(c,d,b));
  return min(ab,cd);
}

double calcArea(vec &t){
  double res=0;
  int n=t.size();
  for(int i=0;i<n;i++)res+=cross(t[i],t[(i+1==n?0:i+1)]);
  return abs(res/2.0);
}


double Arg(P a,P b,P c){
  b-=a,c-=a;
  double res=acos( max(-1.0min(1.0,dot(b,c)/abs(b)/abs(c))) );
  if(cross(b,c)<0)res*=-1.0;
  return res;
}

int inPolygon(vec &t,P p){
  int n=t.size();
  double sum=0;
  for(int i=0;i<n;i++){
    P a=t[i],b=t[(i+1==n?0:i+1)];
    if( ccw(a,b,p) == 0 )return 1;
    sum+= Arg(p,a,b);
  }
  if( abs(sum) < 0.5 )return 0;
  else  return 2;
}

int main(){
  int n;
  cin>>n;
  vec t;
  double x,y;
  for(int i=0;i<n;i++){
    cin>>x>>y;
    t.push_back(P(x,y));
  }
  int q;
  cin>>q;
  while(q--){
    cin>>x>>y;
    cout<<inPolygon(t,P(x,y))<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'double Arg(P, P, P)':
a.cc:55:31: error: no match for call to '(std::chrono::duration<long double, std::ratio<60> >) (double, double)'
   55 |   double res=acos( max(-1.0min(1.0,dot(b,c)/abs(b)/abs(c))) );
      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
#define EPS (1e-10)
class Point {
public:int x, y;Point(int x, int y) : x(x), y(y) { }
    Point operator -(Point p) {return Point(x - p.x, y - p.y);}};
typedef vector<Point> Polygon;
double dot(Point p1, Point p2) {
    return p1.sx * p2.x + p1.y * p2.y;
}
double cross(Point p1, Point p2) {
    return p1.x * p2.y - p1.y * p2.x;
}
double norm(Point p) {
    return p.x * p.x + p.y * p.y;
}
double abs(Point p) {
    return sqrt(norm(p));
}

int contains(Polygon g, Point p) {
    int n = g.size();
    bool x = false;
    for (int i = 0; i < n; ++i) {
        Point a = g[i] - p, b = g[(i + 1) % n] - p;
        if (abs(cross(a, b)) < EPS && dot(a, b) < EPS) {return 1;}
        if (a.y > b.y) { swap(a, b);}
        if (a.y < EPS && EPS < b.y && cross(a, b) > EPS) {x = !x;}
    }
    return x ? 2 : 0;
}

int main() {
    int n;
    scanf("%d", &n);
    Polygon g;
    for (int i = 0; i < n; ++i) {
        int x, y;
        scanf("%d %d", &x, &y);
        Point p(x, y);
        g.push_back(p);
    }
    int q;
    scanf("%d", &q);
    for (int i = 0; i < q; ++i) {
        int x, y;
        scanf("%d %d", &x, &y);
        Point p(x, y);
        cout << contains(g, p) << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'double dot(Point, Point)':
a.cc:13:15: error: 'class Point' has no member named 'sx'; did you mean 'x'?
   13 |     return p1.sx * p2.x + p1.y * p2.y;
      |               ^~
      |               x
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
using namespace std;

enum POSITION{ONLINE_BACK = -2, CCW = -1, ON_SEGMENT = 0,
              CW = 1, ONLINE_FRONT = 2};

struct Point{
    long x;
    long y;
    Point(long x, long y) : x(x), y(y) {}
    Point(){}
    Point operator-(Point p){
        return Point(x - p.x, y - p.y);
    }
    pprint(){
        cout << "(" << x << "," << y << ") ";
    }
};
typedef Point Vector;
double cross(Vector v1, Vector v2){
    return v1.x * v2.y - v1.y * v2.x;
}
double dot(Vector v1, Vector v2){
    return v1.x * v2.x + v1.y * v2.y;
}

struct Segment{
    Point p1;
    Point p2;
    Segment(Point p1, Point p2) : p1(p1), p2(p2) {}
    Segment(){}
};
typedef vector<Point> Polygon;

POSITION get_position(Segment s, Point p){
    double c = cross(s.p2 - s.p1, p - s.p1);
// cout << c << endl;
    if (c > 0) return CCW;
    if (c < 0) return CW;
    double d = dot(s.p2 - s.p1, p - s.p1);
    if (d < 0) return ONLINE_BACK;
    if (d > dot(s.p2 - s.p1, s.p2 - s.p1)) return ONLINE_FRONT;
    return ON_SEGMENT;
}

bool intersect(Segment s1, Segment s2){
// cout << get_position(s1, s2.p1) << " " << get_position(s1, s2.p2)  << endl;
    if (get_position(s1, s2.p1) * get_position(s1, s2.p2) != -1) {
        return false;
    }
// cout << endl;
// cout << get_position(s2, s1.p1) << " " << get_position(s2, s1.p2)  << endl;
    if (get_position(s2, s1.p1) * get_position(s2, s1.p2) != -1) {
        return false;
    }
    return true;
}

int determine_containment(Point p, Polygon poly){
    for (int i = 0, n = poly.size(); i < n; i++) {
        if (get_position(Segment(poly[i], poly[(i+1)%n]), p) == ON_SEGMENT) {
            return 1;
        }
    }
    Segment s_right(p, Point(p.x + 1e5, p.y));
    int count = 0;
    for (int i = 0, n = poly.size(); i < n; i++) {
        if (intersect(s_right, Segment(poly[i], poly[(i+1)%n]))) {
            // poly[i].pprint();
            // poly[(i+1)%n].pprint();
            // cout << endl;
            count++;
        }
    }
// cout << "s " << count << endl;
    for (int i = 0, n = poly.size(); i < n; i++) {
        if (get_position(s_right, poly[i]) == ON_SEGMENT) {
            int i_pre = (i == 0 ? n - 1 : i - 1);
            if (get_position(s_right, poly[i_pre]) * get_position(s_right, poly[(i+1)%n]) == -1) {
                count++;
            }
        }
    }
// cout << "p " << count << endl;
    if (count % 2) return 2;
    return 0;
}
int main(){
    int q;
    cin >> q;
    Polygon poly(q);
    for (int i = 0; i < q; i++) {
        int x, y;
        cin >> x >> y;
        poly[i].x = x;
        poly[i].y = y;
    }
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        cout << determine_containment(Point(x, y), poly) << endl;
    }
    return 0;
}



Compiler output:
a.cc:17:5: error: ISO C++ forbids declaration of 'pprint' with no type [-fpermissive]
   17 |     pprint(){
      |     ^~~~~~
a.cc: In member function 'int Point::pprint()':
a.cc:19:5: warning: no return statement in function returning non-void [-Wreturn-type]
   19 |     }
      |     ^
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define INF 200000000

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;

struct OwnVector2
{
	double x, y;
	OwnVector2(double x, double y) :x(x), y(y) {}
	OwnVector2() :OwnVector2(0, 0) {}
	OwnVector2 operator+(const OwnVector2& v)const
	{
		return OwnVector2(x + v.x, y + v.y);
	}
	OwnVector2 operator-(const OwnVector2& v)const
	{
		return OwnVector2(x - v.x, y - v.y);
	}
	OwnVector2 operator*(const double v)const
	{
		return OwnVector2(x*v, y*v);
	}
	bool operator==(const OwnVector2& v)const
	{
		return abs(x - v.x) <= 0.0000000000001&&abs(y - v.y) <= 0.00000000000001;
	}
	bool operator!=(const OwnVector2& v)const
	{
		return abs(x - v.x) > 0.0000000000001 || abs(y - v.y) > 0.00000000000001;
	}

	double dot(const OwnVector2& v)const
	{
		return x*v.x + y*v.y;
	}
	double cross(const OwnVector2& v)const
	{
		return x*v.y - y*v.x;
	}
	double length()const
	{
		return sqrt(x*x + y*y);
	}
	double length2()const
	{
		return x*x + y*y;
	}
};

OwnVector2 vertices[100];

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		double x, y;
		cin >> x >> y;
		vertices[i] = OwnVector2(x, y);
	}

	int q;
	cin >> q;

	for (int i = 0; i < q; i++)
	{
		double px, py;
		cin >> px >> py;
		OwnVector2 p(px, py);

		int type = 2;
		for (int k = 0; k < n; k++)
		{
			OwnVector2 v1, v2;
			v1 = vertices[k] - p;
			v2 = vertices[(k + 1) % n] - p;
			double cross = v1.cross(v2);
			double dot = v1.dot(v2);
			if ((v1.length2<=0.00000000000001||v2.length2<=0.00000000001)||(abs(cross) <= 0.000000000000001&&dot<0))
			{
				type = 1;
				break;
			}
			else if (cross < 0)
			{
				type = 0;
				break;
			}
		}
		printf("%d\n", type);
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:33: error: invalid use of member function 'double OwnVector2::length2() const' (did you forget the '()' ?)
  106 |                         if ((v1.length2<=0.00000000000001||v2.length2<=0.00000000001)||(abs(cross) <= 0.000000000000001&&dot<0))
      |                              ~~~^~~~~~~
      |                                        ()
a.cc:106:63: error: invalid use of member function 'double OwnVector2::length2() const' (did you forget the '()' ?)
  106 |                         if ((v1.length2<=0.00000000000001||v2.length2<=0.00000000001)||(abs(cross) <= 0.000000000000001&&dot<0))
      |                                                            ~~~^~~~~~~
      |                                                                      ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef complex<double> Point;
typedef pair<Point, Point> Line;
typedef vector<Point> Poly; 
const double EPS = 1e-10;

// 外積、符号付面積の２倍　|a||b|sinθ
double cross(Point a, Point b){
	// return a.real() * b.imag() - a.imag() * b.real();
	return (conj(a) * b).imag();
}
int in_poly(Poly p, Point x){
    int n = p.size();
    bool in = false;
    for(int i = 0; i < n; i++){
        Point a = p[i] - x, b = p[(i + 1) % n] - x;
        if(imag(a) > imag(b)) swap(a, b);
        if(imag(a) <= 0 && 0 < imag(b)){
            if(cross(a, b) < 0) in = !in;
        }
        // 線上判定
        if(cross(a, b) == 0 && dot(a, b) <= 0) return 2;
    }
    return in;
}

int main(){
    int n;
    cin >> n;
    Poly pl(n);
    for(int i = 0; i < n; i++){
        double x, y;
        cin >> x >> y;
        pl[i] = {x, y};
    }
    int q;
    cin >> q;
    for(int i = 0; i < q; i++){
        double x, y;
        cin >> x >> y;
        int res = in_poly(pl, {x, y});
        if(res == 1) res++;
        else if(res == 2) res--;
        cout << res << endl;
    }
}


Compiler output:
a.cc: In function 'int in_poly(Poly, Point)':
a.cc:23:32: error: 'dot' was not declared in this scope
   23 |         if(cross(a, b) == 0 && dot(a, b) <= 0) return 2;
      |                                ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>

/*??????????±???????????????°??????*/
typedef struct {
  long x;
  long y;
} point_t;

int main()
{
    long n; 
    long i;
    point_t* apPoints[100000];
    point_t*** out_hull;
    long* h;


    scanf("%d", n);
    for (i = 0; i < n; i++){
        scanf("%d %d", apPoints[i]->x, apPoints[i]->y);
    }
/*y??§?¨???§?????????*/
    qsort(apPoints, n, sizeof(point_t), compare);
/*??????????±???????*/
    convex_hull(*apPoints, n, out_hull, h);

    printf("%d\n", &h);
    for(i = 0; i < *h -1; i++){
         printf("%d %d\n", *(out_hull+ 2 * i * sizeof(point_t)), *(out_hull+ 2 * i * sizeof(point_t) + 2));
    }

    return 0;
}
/* ????????¢??° */
int compare( const void *c1, const void *c2 )
{
    point_t t1 = *(point_t *)c1;
    point_t t2 = *(point_t *)c2;

    if(t1.y < t2.y){            /*y??§?¨???§?????????*/
        return -1;
    }else if(t1.y > t2.y){
        return 1;
    }else return 0;
}
/* Three points are a counter-clockwise turn if ccw > 0, clockwise if
 * ccw < 0, and collinear if ccw = 0 because ccw is a determinant that
 * gives the signed area of the triangle formed by p1, p2 and p3.
 */
static long
ccw(point_t* p1, point_t* p2, point_t* p3)
{
    return (p2->x - p1->x)*(p3->y - p1->y) - (p2->y - p1->y)*(p3->x - p1->x);
}

/* Returns a list of points on the convex hull in counter-clockwise order.
 * Note: the last point in the returned list is the same as the first one.
 */
void
convex_hull(point_t* points, long npoints, point_t*** out_hull, long* out_hullsize)
{
    point_t** hull;
    long i, t, k = 0;

    hull = *out_hull;

/* lower hull */
    for (i = 0; i < npoints; ++i) {
      while (k >= 2 && ccw(hull[k-2], hull[k-1], &points[i]) <= 0) --k;
      hull[k++] = &points[i];
    }

/* upper hull */
    for (i = npoints-2, t = k+1; i >= 0; --i) {
      while (k >= t && ccw(hull[k-2], hull[k-1], &points[i]) <= 0) --k;
      hull[k++] = &points[i];
    }

    *out_hull = hull;
    *out_hullsize = k;
}

Compiler output:
main.c: In function 'main':
main.c:24:41: error: 'compare' undeclared (first use in this function)
   24 |     qsort(apPoints, n, sizeof(point_t), compare);
      |                                         ^~~~~~~
main.c:24:41: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:5: error: implicit declaration of function 'convex_hull' [-Wimplicit-function-declaration]
   26 |     convex_hull(*apPoints, n, out_hull, h);
      |     ^~~~~~~~~~~
main.c: At top level:
main.c:61:1: warning: conflicting types for 'convex_hull'; have 'void(point_t *, long int,  point_t ***, long int *)'
   61 | convex_hull(point_t* points, long npoints, point_t*** out_hull, long* out_hullsize)
      | ^~~~~~~~~~~
main.c:26:5: note: previous implicit declaration of 'convex_hull' with type 'void(point_t *, long int,  point_t ***, long int *)'
   26 |     convex_hull(*apPoints, n, out_hull, h);
      |     ^~~~~~~~~~~
Language: C

/** @Cain*/
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <cstdlib>
#define PI acos(-1.0)
#define ll long long int
#define db double
#define ull unsigned long long int
#define Fill(x,y) memset(x,y,sizeof(x))
#define bug printf("!!!!!!\n");
using namespace std;
const int mod = 1e9+7;
const db eps=1e-6;
const int inf=1e9;
const ll INF=1e15;
int cas=1;
const int maxn=1e5+5;
struct point
{
    int x,y;
    point(int x=0,int y=0):x(x),y(y){}
    friend int operator * (const point& a,const point& b){
        return a.x*b.y - a.y*b.x;
    }

    bool operator < (const point &a) const {  //先?x小的排前面,然后再?y小的排前面.
        if(a.x == x) return a.y>y;
        return a.x>x;
    }

}tb[maxn],po[maxn];

point xl(const point& a,const point& b)  //向量b->a
{         //???参就是快. 没有其他?子意思
    return point(a.x-b.x,a.y-b.y);
}

void solve()
{
    int n; scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&po[i].x,&po[i].y);
    }
    sort(po+1,po+n+1);
   /* for(int i=1;i<=n;i++){
        printf("%d %d\n",po[i].x,po[i].y);
    }
    bug;*/
    int m = 0; //看此?的?有多少个元素.
    for(int i=1;i<=n;i++){   //画一个?以后?会?????完一遍后,只形成了半个凸包.
        while(m>1 && xl(po[i],tb[m-2]) * xl(tb[m-1],tb[m-2]) > 0) m--;  //等于号是判共?的.
        tb[m++] = po[i]; //意思是当前?个点如果在前一个点的右?,?前一个点就不要.
    }                    //?住我?判要不要的点都是判的前一个点. 而不是当前?个点.
    int tmp = m;
    for(int i=n-1;i>=1;i--){  //所以?要反着?一遍,??一?.
        while(m>tmp && xl(po[i],tb[m-2]) * xl(tb[m-1],tb[m-2]) > 0) m--; //?道例?共?是要的.
        tb[m++] = po[i];
    }
    if(n>2) m--; // 起点被加了?次.
    printf("%d\n",m);
    for(int i=0;i<m;i++){
        printf("%d %d\n",tb[i].x,tb[i].y);
    }
}

int main()
{
    // freopen("in.txt","r",stdin);
    //  freopen("out.txt","w",stdout);
    int t = 1 ;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ", cas++);
        solve();
        //printf("\n");
    }
}

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

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

inline double add(double a, double b){
    return abs(a+b)<(1e-10)*(abs(a)+abs(b)) ? 0.0 : a+b;
}

struct vec{
    double x,y;
    vec operator-(vec b){
        return (vec){add(x,-b.x),add(y,-b.y)};
    }
    vec operator+(vec b){
        return (vec){add(x,b.x),add(y,b.y)};
    }
    vec operator*(double d){
        return (vec){x*d,y*d};
    }
    double dot(vec v){
        return add(x*v.x,y*v.y);
    }
    double cross(vec v){
        return add(x*v.y,-y*v.x);
    }
    double norm(){
        return sqrt(x*x+y*y);
    }
};

int ccw(vec& a, vec& b, vec& c){
    vec ab = b-a, ac = c-a;
    double o = ab.cross(ac);
    if(o>0) return 1; //CCW
    if(o<0) return -1; //CW
    if(ab.dot(ac)<0){
        return 2; //C-A-B
    }else{
        if(ab.dot(ab)<ac.dot(ac)){
            return -2; //A-B-C
        }else{
            return 0; //A-C-B
        }
    }
}

int main(){
    int n;
    cin >> n;
    vec v;
    vector<vec> V,C1,C2;
    vector<vec>::iterator ite;
    while(n--){
        cin >> v.x >> v.y;
        V.push_back(v);
    }
    sort(V.begin(),V.end(),[](const vec& a, const vec& b){return a.x==b.x ? a.y < b.y : a.x< b.x;});
    C1.push_back(V[0]),C1.push_back(V[1]);
    for(auto i=V.begin()+2; i!=V.end();++i){
        C1.push_back(*i);        
        while(ite=C1.end()-1, C1.size()>2&&ccw(*(ite-2),*(ite-1),*ite)==-1){
            C1.erase(ite-1);
        }
    }
    C1.pop_back();

    sort(V.begin(),V.end(),[](const vec& a, const vec& b){return a.x==b.x ? a.y < b.y : a.x>b.x;});
    C2.push_back(V[0]),C2.push_back(V[1]);
    for(auto i=V.begin()+2; i!=V.end();++i){
        C2.push_back(*i);
        while(ite=C2.end()-1, C2.size()>2&&ccw(*(ite-2),*(ite-1),*ite)==-1){
            C2.erase(ite-1);
        }
    }
    C2.pop_back();
    
    cout << C1.size()+C2.size() << endl;
    for(auto& i : C1) cout << i.x << " " << i.y << endl;
    for(auto& i : C2) cout << i.x << " " << i.y << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   58 |     sort(V.begin(),V.end(),[](const vec& a, const vec& b){return a.x==b.x ? a.y < b.y : a.x< b.x;});
      |     ^~~~
      |     sqrt
Language: C++

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

using namespace std;

#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

class Point {
public:
  double x, y;
  Point() {};
  Point(double x, double y): x(x), y(y) {}

  Point operator + (const Point &p) { return Point(x + p.x, y + p.y); }
  Point operator - (const Point &p) { return Point(x - p.x, y - p.y); }
  Point operator * (double d) { return Point(d * x, d * y); }
  Point operator / (double d) { return Point(x / d, y / d); }

  bool operator < (const Point &p) const {
    return (x == p.x ? y < p.y : x < p.x);
  }

  bool operator == (const Point &p) const {
    return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
  }

  friend ostream& operator << (ostream &os, Point &p) {
    return os << "Point(" << p.x << ", " << p.y << ")";
  }
};

double cross (Point p1, Point p2) {
  return p1.x * p2.y - p1.y * p2.x;
}

class Segment {
public:
  Point p1, p2;
  Segment(Point p1, Point p2): p1(p1), p2(p2) {}
};

bool cw(Segment s, Point p2) {
  if (cross(s.p2 - s.p1, p2 - s.p1) < EPS) return true;
  return false;
}

vector<Point> PS;
vector<Point> U; // upper part
vector<Point> L; // lower part

void andrew() {
  sort(PS.begin(), PS.end());

  for (int i = 0; i < 2; i++) {
    U.push_back(PS[i]);
    L.push_back(PS[PS.size()-i-1]);
  }

  for (int i = 2; i < PS.size(); i++) {
    for (int n = U.size(); n >= 2; n--) {
      if (cw(Segment(U[n-2], U[n-1]), PS[i])) break;
      else U.pop_back();
    }
    U.push_back(PS[i]);
  }

  for (int i = PS.size() - 3; i >= 0; i--) {
    for (int n = L.size(); n >= 2 ; n--) {
      if (cw(Segment(L[n-2], L[n-1]), PS[i])) break;
      else L.pop_back();
    }
    L.push_back(PS[i]);
  }

  reverse(L.begin(), L.end());
  for (int i = U.size() - 2; i >= 1; i--) L.push_back(U[i]);
}

int main() {
  int n; cin >> n;

  for (int i = 0; i < n; i++) {
    int x, y; cin >> x >> y;
    PS.push_back(Point(x, y));
  }

  andrew();

  cout << L.size() << endl;
  for (vector<Point>::iterator it = L.begin(); it != L.end(); it++)
    cout << (*it).x << ' ' << (*it).y << endl;
}

Compiler output:
a.cc: In function 'void andrew()':
a.cc:56:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   56 |   sort(PS.begin(), PS.end());
      |   ^~~~
      |   sqrt
a.cc:79:3: error: 'reverse' was not declared in this scope
   79 |   reverse(L.begin(), L.end());
      |   ^~~~~~~
Language: C++

#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

// Problem Specific Parameter:

// Description: ????????????
// Verifyed: various problem 
const R INF = 1E40L;
const R PI = acos(-1.0L);
using P=complex<R>;
const P O=0.0L;
using L=struct{P s,t;};
using VP=vector<P>;
using C=struct{P p;R c;};

istream& operator >> (istream& is,P& p){ R x,y;is >> x >> y; p=P(x,y); return is;}
ostream& operator << (ostream& os,P& p){ os << real(p) << " " << imag(p); return os;}

inline R dot(P o,P a,P b){return real(conj(a-o)*(b-o));}
inline R det(P o,P a,P b){return imag(conj(a-o)*(b-o));}
inline int sdot(P o,P a,P b){return sgn(dot(o,a,b));}
inline int sdet(P o,P a,P b){return sgn(det(o,a,b));}

//projection verify AOJ CGL_1_A
P proj(L l,P p){ R u=real((p-l.s)/(l.t-l.s)); return (1-u)*l.s+u*l.t;}

// convex_hull Verify AOJ CGL_4_A
VP convex_hull(VP pol){
	int n=pol.size(),k=0;
	sort(begin(pol),end(pol),[](P a,P b)->bool{return sgn(real(a)-real(b))?sgn(rael(a)-real(b))<0:sgn(imag(a)-imag(b)<0);});
	VP res(2*n);

	// down
	rep(i,n){
		while(k>1&&sdet(O,res[k-1]-res[k-2],pol[i]-res[k-1])>=1) k--;
		res[k++]=pol[i];
	}
	
	// up
	int t=k;
	rrep(i,n-1){
		while(k>t&&sdet(O,res[k-1]-res[k-2],pol[i]-res[k-1])>=1) k--;
		res[k++]=pol[i];
	}
	res.resize(k-1);
	return res;
}

int main(void){
	int n;
	cin >> n;
	VP pol;
	rep(i,n){
		P p;
		cin >> p;
		pol.push_back(p); 
	}
	VP res=convex_hull(pol);
	int m=res.size(),idx=0;
	rep(i,m){
		if(imag(res[i])<imag(res[idx])) idx=i;
		if(imag(res[i])==imag(res[idx])&&real(res[i])<real(res[idx])) idx=i;
	}
	cout << m << endl;
	rep(i,m) cout << res[(idx-i+m)%m] << endl;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:59:84: error: 'rael' was not declared in this scope
   59 |         sort(begin(pol),end(pol),[](P a,P b)->bool{return sgn(real(a)-real(b))?sgn(rael(a)-real(b))<0:sgn(imag(a)-imag(b)<0);});
      |                                                                                    ^~~~
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }

bool lessComp(xy_t left, xy_t right){
  return left.real() < right.real();
}

void dump(xy_t a){
  cout << a.real() << ", " << a.imag() << endl;
}

int main(){
  int n;
  cin >> n;
  vector<xy_t> p(n);
  for(int i = 0; i < n; i++){
    int x,y;
    cin >> x >> y;
    p[i] = xy_t(x,y);
  }

  sort(p.begin(), p.end(), lessComp);

  vector<xy_t> ue;
  ue.push_back(p[0]);
  ue.push_back(p[1]);
  for(int i = 2; i < n; i++){
    xy_t p1 = *(ue.end()-2), p2 = *(ue.end()-1), p3 = p[i];
    // ???????????????OK
    // ???????????????, ???????????????????¶????
    if(cross_product(p2-p1, p3-p1) > 0){
      ue.pop_back();
      i--;
    }else{
      ue.push_back(p3);
    }
  }

  vector<xy_t> shita;
  shita.push_back(p[0]);
  shita.push_back(p[1]);
  for(int i = 2; i < n; i++){
    xy_t p1 = *(shita.end()-2), p2 = *(shita.end()-1), p3 = p[i];

    // dump(p1);
    // dump(p2);
    // dump(p3);
    //       cout << "cross: " << cross_product(p2-p1, p3-p1) << endl;
    // ???????????????OK
    // ???????????????, ???????????????????¶????
    if(cross_product(p2-p1, p3-p1) < 0){
      shita.pop_back();
      i--;
    }else{
      shita.push_back(p3);
    }
  }

  // cout << "??????" << endl;

  cout << shita.size() + ue.size() - 2 << endl;
  for(int i = 0; i < shita.size(); i++){
    cout << shita[i].real() << " " << shita[i].imag() << endl;
  }

  // cout << "??????" << endl;

  for(int i = ue.size()-2; i > 0; i--){
    cout << ue[i].real() << " " << ue[i].imag() << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   28 |   sort(p.begin(), p.end(), lessComp);
      |   ^~~~
      |   sqrt