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

#include<stdio.h>
int main(void)
{
	int n,m,x,hi[1001],i,j,cnt[1001],temp,max=-1;
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++){
		scanf("%d",&hi[i]);
		cnt[i]=0;
	}
	for(i=0;i<m;i++){
		scanf("%d",&x);
		for(j=1;j<=n;j++){
			if(x>=hi[j]){
				cnt[j]++;
				break;
			}
		}
	}
//	for(j=1;j<=n;j++){
		printf(":%d\n",cnt[j]);
	}
	for(i=1;i<=n;i++) {
		if(max<cnt[i]) {
			max=cnt[i];
			temp=i;
		}
	}
	printf("%d\n",temp);
	return 0;
}

Compiler output:
a.cc:22:9: error: expected unqualified-id before 'for'
   22 |         for(i=1;i<=n;i++) {
      |         ^~~
a.cc:22:17: error: 'i' does not name a type
   22 |         for(i=1;i<=n;i++) {
      |                 ^
a.cc:22:22: error: 'i' does not name a type
   22 |         for(i=1;i<=n;i++) {
      |                      ^
a.cc:28:15: error: expected constructor, destructor, or type conversion before '(' token
   28 |         printf("%d\n",temp);
      |               ^
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define ZERO(a) memset(a,0,sizeof(a))
#define pb push_back

int rank[1020];

int main() {
    int n, m;
    ZERO(rank);
    cin >> n >> m;
    vector<int> v;
    rep(i,n) {
        int cost; scanf("%d",&cost);
        v.pb(cost);
    }

    rep(i,m) {
        int c; scanf("%d",&c);
        rep(j,n) if(c >= v[j]) {
            rank[j+1]++; break;
        }
    }

    int ans = 0, m = 0;
    rep(i,1001) if(m < rank[i]) {
        m = rank[i];
        ans = i;
    }
    cout << ans << "\n";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: reference to 'rank' is ambiguous
   13 |     ZERO(rank);
      |          ^~~~
a.cc:6:24: note: in definition of macro 'ZERO'
    6 | #define ZERO(a) memset(a,0,sizeof(a))
      |                        ^
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [1020]'
    9 | int rank[1020];
      |     ^~~~
a.cc:13:10: error: reference to 'rank' is ambiguous
   13 |     ZERO(rank);
      |          ^~~~
a.cc:6:35: note: in definition of macro 'ZERO'
    6 | #define ZERO(a) memset(a,0,sizeof(a))
      |                                   ^
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [1020]'
    9 | int rank[1020];
      |     ^~~~
a.cc:24:13: error: reference to 'rank' is ambiguous
   24 |             rank[j+1]++; break;
      |             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [1020]'
    9 | int rank[1020];
      |     ^~~~
a.cc:28:18: error: redeclaration of 'int m'
   28 |     int ans = 0, m = 0;
      |                  ^
a.cc:12:12: note: 'int m' previously declared here
   12 |     int n, m;
      |            ^
a.cc:29:24: error: reference to 'rank' is ambiguous
   29 |     rep(i,1001) if(m < rank[i]) {
      |                        ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [1020]'
    9 | int rank[1020];
      |     ^~~~
a.cc:30:13: error: reference to 'rank' is ambiguous
   30 |         m = rank[i];
      |             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:9:5: note:                 'int rank [1020]'
    9 | int rank[1020];
      |     ^~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,m,a[101],b,z[101],i,j,w,d;
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		z[i]=0;
	}
	for(i=0;i<m;i++){
		scanf("%d",&b);
		for(j=0;j<n;j++){
			if(b<=a[j]){
				z[i]++;
				break;
			}
		}
	}
	d=0;
	for(i=0;i<n;i++){
		if(d<z[i]){
			d=z[i];
			w=i;
	}
	printf("%d\n",w);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int n,m,a[101],b,z[101],i,j,w,d;
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		z[i]=0;
	}
	for(i=0;i<m;i++){
		scanf("%d",&b);
		for(j=0;j<n;j++){
			if(b<=a[j]){
				z[i]++;
				break;
			}
		}
	}
	d=0;
	for(i=0;i<n;i++){
		if(d<z[i]){
			d=z[i];
			w=i;
		}
	}
	printf("%d\n",w);
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
   27 |         return 0;
      |                  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
int n,m,a[1005],p[1005];
int main(){
	cin>>n>>m;for(int i=0;i<n;i++){cin>>a[i];}
	for(int i=0;i<m;i++){
		int b;cin>>b;
		for(int j=0;j<n;j++){
			if(a[j]<=b){p[j]++;break;}
		}
	}
	int maxn=0,maxid=0;
	for(int i=0;i<n;i++){
		if(maxn<p[j]){maxn=p[j];maxid=j;}
	}
	cout<<maxid+1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'j' was not declared in this scope
   14 |                 if(maxn<p[j]){maxn=p[j];maxid=j;}
      |                           ^
Language: C++

#include<iostream>
using namespace std;
int Mx = 0, num;
int A [1001], B[1001], K[1001;
int main(){
    int N, M;
    int i, j;
    cin >> N >> M;
    for (j=1; j<=M; j++) { K[j] = 0; }
    for (i=1; i<=N; i++) { cin >> A[i]; }
    for (j=1; j<=M; j++) { cin >> B[j]; }
    for (j=1; J<=M; j++) {
        for (i=1; i<=N; i++) {
            if(A[i] <= B[j]) {
                K[i]++;
                if( Mx < K[i] ){ Mx = K[i]; num = i; }
                break;
            }
        }
    }
    cout << num << endl;
    return 0; 
}

Compiler output:
a.cc:4:30: error: expected ']' before ';' token
    4 | int A [1001], B[1001], K[1001;
      |                              ^
      |                              ]
a.cc: In function 'int main()':
a.cc:9:28: error: 'K' was not declared in this scope
    9 |     for (j=1; j<=M; j++) { K[j] = 0; }
      |                            ^
a.cc:12:15: error: 'J' was not declared in this scope
   12 |     for (j=1; J<=M; j++) {
      |               ^
a.cc:15:17: error: 'K' was not declared in this scope
   15 |                 K[i]++;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int Mx = 0, num;
int A [1001], B[1001], K[1001];
int main(){
    int N, M;
    int i, j;
    cin >> N >> M;
    for (j=1; j<=M; j++) { K[j] = 0; }
    for (i=1; i<=N; i++) { cin >> A[i]; }
    for (j=1; j<=M; j++) { cin >> B[j]; }
    for (j=1; J<=M; j++) {
        for (i=1; i<=N; i++) {
            if(A[i] <= B[j]) {
                K[i]++;
                if( Mx < K[i] ){ Mx = K[i]; num = i; }
                break;
            }
        }
    }
    cout << num << endl;
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'J' was not declared in this scope
   12 |     for (j=1; J<=M; j++) {
      |               ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<alorithm>
using namespace std;
int p[1001]={0},h[1001]={0};
int main(){
int n,m,i,j,l,k,a,b
cin>>n>>m;
for(i=1;i<=n;i++)cin>>h[i];
for(i=0;i<m;i++){
	cin>>l;
	for(j=1;j<=n;j++){
		if(l<=h[j])p[j]++;
	}
}
k=0;
for(i=1;i<n;i++){
	if(h[k]<h[i])k=i;
}
cout<<k<<endl;
return 0;
}

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

#include<stdio.h>
#include<iostream>
#include<alorithm>
using namespace std;
int p[1001]={0},h[1001]={0};
int main(){
int n,m,i,j,l,k,a,b;
cin>>n>>m;
for(i=1;i<=n;i++)cin>>h[i];
for(i=0;i<m;i++){
	cin>>l;
	for(j=1;j<=n;j++){
		if(l<=h[j])p[j]++;
	}
}
k=0;
for(i=1;i<n;i++){
	if(h[k]<h[i])k=i;
}
cout<<k<<endl;
return 0;
}

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

#include<stdio.h>
#include <iostream>
#include<string>
#include<algorithm>
#include<sstream>
#include<math.h>
#define FOR(i,a) for(int i=0;i<a;i++)
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	int a[n];
	int b[m];
	int ans[n];
	int maxcount = 0;
	FOR(i, n) {
		cin >> a[i];
		ans[i] = 0;
	}
	FOR(i, m) {
		cin >> b[i];
		FOR(j, n) {
			if (a[j] <= b[i]) {
				ans[j]++;
			}
		}
	}
	int pos = 0;
	FOR(i, n) {
		if (maxcount < ans[i]) {
			maxcount = ans[i];
			pos = i;
		}
	}
	cout << pos + 1; << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: error: expected primary-expression before '<<' token
   35 |         cout << pos + 1; << endl;
      |                          ^~
Language: C++

#include<iostream>
#include<string>
#include<set>
#include<utility>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

int main(){
	/*
	//数あて
	int n;
	cin >> n;
	int p[200][3];

	for(int i=0;i<n;i++)
	{
		cin >> p[i][0] >> p[i][1] >> p[i][2];
	}

	int _p;
	for(int k=0;k<3;k++)
	{
		for(int i=0;i<n;i++)
		{
			_p = p[i][k];
			for(int j=i+1;j<n;j++)
			{
				if(_p == p[j][k])
				{
					p[i][k] = 0;
					p[j][k] = 0;
				}
			}
		}
	}

	for(int i=0;i<n;i++)
	{
		cout << p[i][0] + p[i][1] + p[i][2] << endl;
	}
	*/

	/*
	//得点
	int ai,am,as,ae,bi,bm,bs,be;
	cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
	int answer=ai+am+as+ae;
	if(answer < bi+bm+bs+be)
	{
	/	answer=bi+bm+bs+be;
	}
	cout << answer << endl;
	*/
	
	//おつり
/*	int onum;
	while(true){
		int N;
		cin >> N;
		if(N == 0) break;
		onum=0;
		int oturi = 1000-N;
		if(oturi >= 500)
		{
			onum++;
			oturi -= 500;
		}
		while(oturi>=100)
		{
			onum++;
			oturi -= 100;
		}
		if(oturi >= 50)
		{
			onum++;
			oturi -= 50;
		}
		while(oturi>=10)
		{
			onum++;
			oturi -= 10;
		}
		if(oturi >= 5)
		{
			onum++;
			oturi -= 5;
		}
		while(oturi>=1)
		{
			onum++;
			oturi -= 1;
		}
		 cout << onum << endl;
	}
   */

	//レシート
	/*
	while(true){
		int N;
		cin >> N;
		if(N==0) break;
		int a[9];
		for(int i=0;i<9;i++){
			cin >> a[0];
		}

	}
	
	/*
	int N;
	int i = 0;
	while(i<N){
		i++;
	}
	for(int i=0; i<N; i++)
	*/
	/*
	int N;
	int x;
	set<int> a;
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> x;
		a.insert(x);
	}
	cout << a.size() << endl;
	*/
	
	//投票
	/*
	int N,M;
	cin >> N >> M;
	int a;
	int A[1000];
	int B[1000];
	int X[1000][2];
	
	for(int i=0; i<N; i++){
		cin >> A[i];
		X[i][0] = i;
		X[i][1] = 0;
	}
	for(int j=0; j<M;j++){
		cin >> B[j];
	}
	for(int j=0; j<M; j++){
		for(int i=0; i<N; i++){
			if(A[i] < B[j]){
				X[i][1]++;
				break;
			}
		}
	}
	for(int i=1; i<N; i++){
		if(X[i-1][1]<X[i][1])
			X[i-1][0] = X[i][0];
	}
	cout << X[0][0]+1 << endl;
	*/

	int N,M;
	cin >> N >> M;
	int A[1000];
	int vote[1000];
	for(int i; i<N; i++){
		cin >> A[i];
		vote[i] =0;
	}
	int B;
	for(int i=0; i<M; i++){
		cin >> B;
		for(int j=0; j<N; j++){
			if(A[j]<=B){
				vote[j] = A[j];
				break;
			}
		}
	}
	int temps = 0;
	int ans;
	for(int i=0; i<N; i++){
		if(vote[i] > temps){
			temps = temps[i];
			ans = i;
		}
	cout << ans+1 << endl;
	}

	return 0;
}
/*
int max(int i,int j){
	if(i < j) i=j;
	return i;
}
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:187:38: error: invalid types 'int[int]' for array subscript
  187 |                         temps = temps[i];
      |                                      ^
Language: C++

#include<iostream>
using namespace std;

int main() {
	int n, m, x, y, z;
	cin >> n >> m;
	int A[n];
	int B[m];
	int C[m];
	 y = 0;

	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < m; i++) {
		cin >> B[i];
		for (int j = 0; j < n; j++) {
			if (B[i] >= A[j]) {
				C[i] = j;
				break;
			}
		}
	}
	for (int i = 0; i < n; i++) {
		x = C.count(i);
		y = max(x, y);
	}
	for (int i = 0;i < n;i++) {
		if (C.count(i) = y) {
			z = i;
			break;
		}
	}
	cout << z << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]'
   25 |                 x = C.count(i);
      |                       ^~~~~
a.cc:29:23: error: request for member 'count' in 'C', which is of non-class type 'int [m]'
   29 |                 if (C.count(i) = y) {
      |                       ^~~~~
Language: Java

import java.util.Scanner;
public class Main2014C {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int W = sc.nextInt();

		int H = sc.nextInt();

		int N = sc.nextInt();

		int[] X = new int[N];

		int[] Y = new int[N];

		int ans = 0;

		for(int i=0;i<N;i++) {

			X[i] = sc.nextInt();

			Y[i] = sc.nextInt();
		}

		int x0 = X[0];

		int y0 = Y[0];

		int x1, y1;

		for(int i=1;i<N;i++) {

			x1 = X[i];

			y1 = Y[i];

			if(x0==x1) {

				ans += Math.abs(y0-y1);

				x0 = x1;

				y0 = y1;

			}else if(y0==y1) {

				ans += Math.abs(x0-x1);

				x0 = x1;

				y0 = y1;

			}else if(x0-x1 == y0-y1) {

				ans += Math.abs(x0-x1);

				x0 = x1;

				y0 = y1;

			}else {

				ans += Math.abs(x0-x1);

				ans += Math.abs(y0-y1);

				if(y1>y0) {

					ans -= Math.abs(x0-x1);
				}

				x0 = x1;

				y0 = y1;
			}

		}

		System.out.println(ans);
	}

}



Compiler output:
Main.java:2: error: class Main2014C is public, should be declared in a file named Main2014C.java
public class Main2014C {
       ^
1 error
Language: Java

import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public sttic void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputSteamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
StringTokenizer st1=new StringTokenizer(line);
int w=Integer.parseInt(st1.nextToken());
int h=Integer.parseInt(st1.nextToken());
int n=Integer.parseInt(st1.nextToken());
int[] x=new int[n];
int[] y=new int[n];
for(int i=0;i<n;i++){
line=br.readLine();
StringTokenizer st2=new StringTokenizer(line);
x[i]=Integer.parseInt(st2.nextToken());
y[i]=Integer.parseInt(st2.nextToken());
}
int cnt=0;
for(int i=0;i<n-1;i++){
cnt+=minRoad(x[i],y[i],x[i+1],y[i+1]);
}
out.println(cnt);
}
}
private static int minRoad(int a,int b,int c,int d){
if(a==c) return Math.abs(b-d);
if(b==d) return Math.abs(a-c);
int x=a-c;
int y=b-d;
if(x*y>0){
x=Math.abs(x);
y=Math.abs(y);
return Math.max(x,y);
}
x=Math.abs(x);
y=Math.abs(y);
return x+y;
}
}

Compiler output:
Main.java:8: error: <identifier> expected
public sttic void main(String[] args) throws IOException{
            ^
1 error
Language: Java

import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputSteamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
StringTokenizer st1=new StringTokenizer(line);
int w=Integer.parseInt(st1.nextToken());
int h=Integer.parseInt(st1.nextToken());
int n=Integer.parseInt(st1.nextToken());
int[] x=new int[n];
int[] y=new int[n];
for(int i=0;i<n;i++){
line=br.readLine();
StringTokenizer st2=new StringTokenizer(line);
x[i]=Integer.parseInt(st2.nextToken());
y[i]=Integer.parseInt(st2.nextToken());
}
int cnt=0;
for(int i=0;i<n-1;i++){
cnt+=minRoad(x[i],y[i],x[i+1],y[i+1]);
}
out.println(cnt);
}
}
private static int minRoad(int a,int b,int c,int d){
if(a==c) return Math.abs(b-d);
if(b==d) return Math.abs(a-c);
int x=a-c;
int y=b-d;
if(x*y>0){
x=Math.abs(x);
y=Math.abs(y);
return Math.max(x,y);
}
x=Math.abs(x);
y=Math.abs(y);
return x+y;
}
}

Compiler output:
Main.java:9: error: cannot find symbol
BufferedReader br=new BufferedReader(new InputSteamReader(System.in));
                                         ^
  symbol:   class InputSteamReader
  location: class Main
1 error
Language: Java

//============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
char chr;
int W,H,N;
int X[10001],Y[10001];
int main() {
	cin>>W>>H>>N;

	for(int i=0;i<N;i++){
		cin>>X[i]>>Y[i];
	}
	int S=0;
	int R=0;
	for(int i=0;i<N-1;i++){
		if(X[i]==X[i+1])S=fabs(Y[i+1]-Y[i]);
		if(Y[i]==Y[i+1])S=fabs(X[i+1]-X[i]);
		if((X[i]-X[i+1])*(Y[i]-Y[i+1])>0)S=max(fabs(X[i+1]-X[i]),fabs(Y[i+1]-Y[i]));
		if((X[i]-X[i+1])*(Y[i]-Y[i+1])<0)S=fabs(X[i+1]-X[i])+fabs(Y[i+1]-Y[i]);

		R+=S;

	}


	cout<<R<<endl;
	return 0;
}

Compiler output:
Main.java:9: error: illegal character: '#'
#include <iostream>
^
Main.java:9: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:11: error: unnamed classes are a preview feature and are disabled by default.
char chr;
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: class, interface, enum, or record expected
int W,H,N;
^
Main.java:13: error: class, interface, enum, or record expected
int X[10001],Y[10001];
^
Main.java:15: error: not a statement
	cin>>W>>H>>N;
	         ^
Main.java:18: error: not a statement
		cin>>X[i]>>Y[i];
		         ^
Main.java:33: error: not a statement
	cout<<R<<endl;
	       ^
8 errors
Language: Java

//============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
char chr;
int W,H,N;
int X[10001],Y[10001];
int main() {
	cin>>W>>H>>N;

	for(int i=0;i<N;i++){
		cin>>X[i]>>Y[i];
	}
	int S=0;
	int R=0;
	for(int i=0;i<N-1;i++){
		if(X[i]==X[i+1])S=abs(Y[i+1]-Y[i]);
		if(Y[i]==Y[i+1])S=abs(X[i+1]-X[i]);
		if((X[i]-X[i+1])*(Y[i]-Y[i+1])>0)S=max(abs(X[i+1]-X[i]),abs(Y[i+1]-Y[i]));
		if((X[i]-X[i+1])*(Y[i]-Y[i+1])<0)S=abs(X[i+1]-X[i])+abs(Y[i+1]-Y[i]);

		R+=S;

	}


	cout<<R<<endl;
	return 0;
}

Compiler output:
Main.java:9: error: illegal character: '#'
#include <iostream>
^
Main.java:9: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:11: error: unnamed classes are a preview feature and are disabled by default.
char chr;
^
  (use --enable-preview to enable unnamed classes)
Main.java:12: error: class, interface, enum, or record expected
int W,H,N;
^
Main.java:13: error: class, interface, enum, or record expected
int X[10001],Y[10001];
^
Main.java:15: error: not a statement
	cin>>W>>H>>N;
	         ^
Main.java:18: error: not a statement
		cin>>X[i]>>Y[i];
		         ^
Main.java:33: error: not a statement
	cout<<R<<endl;
	       ^
8 errors
Language: Java

import java.util.Scanner;

public class AOJ0594 {
	 public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int w = sc.nextInt();
	        int h = sc.nextInt();
	        int n = sc.nextInt();
	        int result,x,result2,y;
	        int mov = 0;
	        int go[][] = new int[n][2];
	        for(int i = 0; i < n; i++){
	            for(int k = 0; k < 2; k++){
	                go[i][k] = sc.nextInt();
	            }
	        }
	        for(int i = 1; i < n; i++){
	            result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

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

public class AOJ0594 {
	 public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int w = sc.nextInt();
	        int h = sc.nextInt();
	        int n = sc.nextInt();
	        int result,x,result2,y;
	        int mov = 0;
	        int go[][] = new int[n][2];
	        for(int i = 0; i < n; i++){
	            for(int k = 0; k < 2; k++){
	                go[i][k] = sc.nextInt();
	            }
	        }
	        for(int i = 1; i < n; i++){
	            result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

Compiler output:
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java
public class AOJ0594 {
       ^
Main.java:3: error: cannot find symbol
	        Scanner sc = new Scanner(System.in);
	        ^
  symbol:   class Scanner
  location: class AOJ0594
Main.java:3: error: cannot find symbol
	        Scanner sc = new Scanner(System.in);
	                         ^
  symbol:   class Scanner
  location: class AOJ0594
3 errors
Language: Java

public class AOJ0594 {
	 public static void main(String[] args) {
		 java.util.Scanner sc = new java.util.Scanner(System.in);
	        int w = sc.nextInt();
	        int h = sc.nextInt();
	        int n = sc.nextInt();
	        int result,x,result2,y;
	        int mov = 0;
	        int go[][] = new int[n][2];
	        for(int i = 0; i < n; i++){
	            for(int k = 0; k < 2; k++){
	                go[i][k] = sc.nextInt();
	            }
	        }
	        for(int i = 1; i < n; i++){
	            result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

Compiler output:
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java
public class AOJ0594 {
       ^
1 error
Language: Java

public class AOJ0594 {
	 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int go[][] = new int[n][2];
        for(int i = 0; i < n; i++){
        	for(int k = 0; k < 2; k++){
        		go[i][k] = sc.nextInt();
        		}
        	}
	        for(int i = 1; i < n; i++){
	        	result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

Compiler output:
Main.java:1: error: class AOJ0594 is public, should be declared in a file named AOJ0594.java
public class AOJ0594 {
       ^
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class AOJ0594
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class AOJ0594
3 errors
Language: Java

public class main {
	 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int go[][] = new int[n][2];
        for(int i = 0; i < n; i++){
        	for(int k = 0; k < 2; k++){
        		go[i][k] = sc.nextInt();
        		}
        	}
	        for(int i = 1; i < n; i++){
	        	result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

Compiler output:
Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class main
3 errors
Language: Java

import java.util.Scanner;

public class AOJ0594 {
	 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int go[][] = new int[n][2];
        for(int i = 0; i < n; i++){
        	for(int k = 0; k < 2; k++){
        		go[i][k] = sc.nextInt();
        		}
        	}
	        for(int i = 1; i < n; i++){
	        	result = go[i][0] - go[i-1][0];
	            x = Math.abs(result);
	            result2 = go[i][1] - go[i-1][1];
	            y = Math.abs(result2);
	            mov = mov + x + y;
	            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
	                if(x <= y){
	                    mov = mov - x;
	                }else{
	                    mov = mov - y;
	                }
	            }
	        }
	        System.out.println(mov);
	    }
	}

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

import java.util.Scanner;

public class AOJ0594{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int go[][] = new int[n][2];
        for(int i = 0; i < n; i++){
            for(int k = 0; k < 2; k++){
               go[i][k] = sc.nextInt();
            }
        }
        for(int i = 1; i < n; i++){
            result = go[i][0] - go[i-1][0];
            x = Math.abs(result);
            result2 = go[i][1] - go[i-1][1];
            y = Math.abs(result2);
            mov = mov + x + y;
            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
                if(x <= y){
                    mov = mov - x;
                }else{
                    mov = mov - y;
                }
            }
        }
        System.out.println(mov);
    }
}

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

import java.util.Scanner;

public class AOJ0594{
    public static void AOJ0594(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int go[][] = new int[n][2];
        for(int i = 0; i < n; i++){
            for(int k = 0; k < 2; k++){
               go[i][k] = sc.nextInt();
            }
        }
        for(int i = 1; i < n; i++){
            result = go[i][0] - go[i-1][0];
            x = Math.abs(result);
            result2 = go[i][1] - go[i-1][1];
            y = Math.abs(result2);
            mov = mov + x + y;
            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
                if(x <= y){
                    mov = mov - x;
                }else{
                    mov = mov - y;
                }
            }
        }
        System.out.println(mov);
    }
}

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

import java.util.Scanner;

public class AOJ0594{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int gowhere[][] = new int[n][2];
        for(int i = 0; i < n; i++){
            for(int k = 0; k < 2; k++){
            	gowhere[i][k] = sc.nextInt();
            }
        }
        for(int i = 1; i < n; i++){
            result = gowhere[i][0] - gowhere[i-1][0];
            x = Math.abs(result);
            result2 = gowhere[i][1] - gowhere[i-1][1];
            y = Math.abs(result2);
            mov = mov + x + y;
            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
                if(x <= y){
                    mov = mov - x;
                }else{
                    mov = mov - y;
                }
            }
        }
        System.out.println(mov);
    }
}

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

import java.util.Scanner;

public class main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int gowhere[][] = new int[n][2];
        for(int i = 0; i < n; i++){
            for(int k = 0; k < 2; k++){
            	gowhere[i][k] = sc.nextInt();
            }
        }
        for(int i = 1; i < n; i++){
            result = gowhere[i][0] - gowhere[i-1][0];
            x = Math.abs(result);
            result2 = gowhere[i][1] - gowhere[i-1][1];
            y = Math.abs(result2);
            mov = mov + x + y;
            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
                if(x <= y){
                    mov = mov - x;
                }else{
                    mov = mov - y;
                }
            }
        }
        System.out.println(mov);
    }
}

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

import java.util.Scanner;
 
public class AOJ0594{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int n = sc.nextInt();
        int result,x,result2,y;
        int mov = 0;
        int ikisaki[][] = new int[n][2];
        for(int i = 0; i < n; i++){
            for(int k = 0; k < 2; k++){
                ikisaki[i][k] = sc.nextInt();
            }
        }
        for(int i = 1; i < n; i++){
            result = ikisaki[i][0] - ikisaki[i-1][0];
            x = Math.abs(result);
            result2 = ikisaki[i][1] - ikisaki[i-1][1];
            y = Math.abs(result2);
            mov = mov + x + y;
            if(result > 0 && result2 > 0 || result < 0 && result2 < 0){
                if(x <= y){
                    mov = mov - x;
                }else{
                    mov = mov - y;
                }
            }
        }
        System.out.println(mov);
    }
}

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

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

int main(){
  int i;
  int W,H,N,sum;
  int x,y,dx,dy;
  scanf("%d %d %d",&W,&H,&N);
  scanf("%d %d",&x,&y);
  sum=0;

  for(i=0;i<N-1;i++){
    scanf("%d %d",&dx,&dy);
    dx=dx-x;
    dy=dy-y;
    if(0<=dx&&0<=dy){
      if(dx>dy){
	sum=sum+dx;
      }else{
	sum=sum+dy;
      }
    }else if(dx<=0&&0<=dy){
      dx=-dx;
      sum=sum+dx+dy;
    }else if(dx<=0&&dy<=0){
      dx=-dx;
      dy=-dy;
      if(dx>dy){
	sum=sum+dx;
      }else{
	sum=sum+dy;
      }
    }else if(0<=dx&&dy<=0){
      dy=-dy;
      sum=sum+dx+dy;
    }
  }
  cout<<sum<<endl;
}

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

#include <stdio.h>

int main(void)
{
	int W,H,N,i,j,ans;
	ans=0;
	scanf("%d %d %d",&W,&H,&N);
	int xs,ys,xg,yg,xnow,ynow;
	scanf("%d %d",&xs,&ys);
	for(i=1;i<N;i++){
		if(i==1){
			xnow=xs;
			ynow=ys;
		}
		else {
			xnow=xg;
			ynow=yg;
		}
		scanf("%d %d",&xg,&yg);  //goal scan
		while(!(xnow==xg&&ynow==yg)){
			if(xnow<xg){
				if(ynow<yg){//??????
					xnow++;
					ynow++;
				}
				else if(ynow>yg){//??????
					ynow--;
				}
				else {//???
					xnow++;
				}
			}


			if(xnow>xg){
				if(ynow==yg){  //???
					xnow--;
				}
				else if(ynow<yg){  //??????
					ynow++;
				}
				else {//??????
					xnow--;
					ynow--;
				}

			else {
				if(xnow==xg&&ynow<yg){//???
					ynow--;
				}	
				else {  //???
					ynow++;
				}

			ans++;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:47:25: error: expected '}' before 'else'
   47 |                         else {
      |                         ^~~~
main.c:60:1: error: expected declaration or statement at end of input
   60 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int W,H,N,i,j,ans;
	ans=0;
	scanf("%d %d %d",&W,&H,&N);
	int xs,ys,xg,yg,xnow,ynow;
	scanf("%d %d",&xs,&ys);
	xnow=xs;
	ynow=ys;
		
		scanf("%d %d",&xg,&yg);  //goal scan
		while(!(xnow==xg&&ynow==yg)){
			if(xnow<xg){
				if(ynow<yg){//??????
					xnow++;
					ynow++;
				}
				else if(ynow>yg){//??????
					ynow--;
				}
				else {//???
					xnow++;
				}
			}


			if(xnow>xg){
				if(ynow==yg){  //???
					xnow--;
				}
				else if(ynow<yg){  //??????
					ynow++;
				}
				else {//??????
					xnow--;
					ynow--;
				}
			}

			else {
				if(xnow==xg&&ynow<yg){//???
					ynow--;
				}	
				else {  //???
					ynow++;
				}
			}

			ans++;
		}
	}



	for(i=2;i<N;i++){
			xnow=xg;
			ynow=yg;
		scanf("%d %d",&xg,&yg);  //goal scan
		while(!(xnow==xg&&ynow==yg)){
			if(xnow<xg){
				if(ynow<yg){//??????
					xnow++;
					ynow++;
				}
				else if(ynow>yg){//??????
					ynow--;
				}
				else {//???
					xnow++;
				}
			}


			if(xnow>xg){
				if(ynow==yg){  //???
					xnow--;
				}
				else if(ynow<yg){  //??????
					ynow++;
				}
				else {//??????
					xnow--;
					ynow--;
				}
			}

			else {
				if(xnow==xg&&ynow<yg){//???
					ynow--;
				}	
				else {  //???
					ynow++;
				}
			}

			ans++;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c:57:9: error: expected identifier or '(' before 'for'
   57 |         for(i=2;i<N;i++){
      |         ^~~
main.c:57:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   57 |         for(i=2;i<N;i++){
      |                  ^
main.c:57:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   57 |         for(i=2;i<N;i++){
      |                      ^~
main.c:101:16: error: expected declaration specifiers or '...' before string constant
  101 |         printf("%d\n",ans);
      |                ^~~~~~
main.c:101:23: error: unknown type name 'ans'
  101 |         printf("%d\n",ans);
      |                       ^~~
main.c:102:9: error: expected identifier or '(' before 'return'
  102 |         return 0;
      |         ^~~~~~
main.c:103:1: error: expected identifier or '(' before '}' token
  103 | }
      | ^
Language: C

#include <stdio.h>

int main(void)
{
	int W,H,N,i,j,ans;
	ans=0;
	scanf("%d %d %d",&W,&H,&N);
	int xs,ys,xg,yg;
	scanf("%d %d",&xs,&ys);
	scanf("%d %d",&xg,&yg);  //goal scan

	if(xs<xg&&xy<yg){
		if(xg-xs<yg-ys){
			ans=yg-ys;
		}
		else {
			ans=xg-xs;
		}
	}

	if(xs>xg&&xy>yg){
		if(xs-xg<ys-yg){
			ans=ys-yg;
		}
		else {
			ans=xs-xg;
		}
	}

	if(xs>=xg&&xy<=yg){
		ans=(xs-xg)+(yg-ys);
	}

	if(xs<=xg&&xy>=yg){
		ans=(xg-xs)+(ys-yg);
	}


	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:19: error: 'xy' undeclared (first use in this function); did you mean 'xg'?
   12 |         if(xs<xg&&xy<yg){
      |                   ^~
      |                   xg
main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <iostream>
#include <stdafx.h>
#include <stdio.h>
#define fo(i,a) for(i=0;i<a;i++)
using namespace std;

int main()
{
	int i, n, x, y, ans, w[1000000], h[1000000];
	scanf("%d", &n);
	fo(i, n) scanf("%d%d", &w[i], &h[i] );
	fo(i, n) {
		if ((w[i] > w[i] && h[i] < h[i - 1]) || (w[i] < w[i - 1] && h[i] < h[i - 1]))
			ans += max(abs(w[i] - w[i - 1]), abs(h[i] - h[i - 1]));
		else
			ans = abs(w[i] - w[i - 1]) + abs(h[i] - h[i - 1]);
	}
	printf("%d\n", ans);
	return 0;
}


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

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

int main(void)
{
	int w, h, n, i, j, cost = 0;
	int sx,  sy, gx, gy;
	
	scanf("%d %d %d", &w, &h, &n);
	
	scanf("%d %d", &sx, &sy);
	
	for (i = 1; i < n; i++){
		
		scanf("%d %d", &gx, &gy);
		
		if (sx < gx && sy < gy){
			if (gx - sx < gy - sy){
				cost += gx - sx;
				sy += gx - sx;
				sx = gx;
			}
			else{
				cost += gy - sy;;
				sx += gy - sy;
				sy = gy;
			}
		}
		else if (sx > gx && sy > gy){
			if (sx - gx < sy - gy){
				cost += sx - gx;
				sy += sx - gx;
				sx = gx;
			}
			else{
				cost += sy - gy;;
				sx -= sy - gy;
				sy = gy;
			}
		}
		cost += max(sx - gx, gx - sx);
		cost += max(sy - gy, gy - sy);
		sx = gx;sy = gy;
	}
	printf("%d\n", cost);
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: 'max' was not declared in this scope; did you mean 'std::max'?
   41 |                 cost += max(sx - gx, gx - sx);
      |                         ^~~
      |                         std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
	int n,m,q;
	cin>>m>>n>>q;
	int x,y;
	cin>>y>>x;
	int sum=0;
	rep(i,q-1){
		int a,b;
		cin>>b>>a;
		int c=a-x,d=b-y;
		if(c<0){c*=-1;d*=-1;}
		if(c==0)sum+=abs(d);
		else if(d<0)sum+=c-d;
		else sum+=max(c,d);
		x=a;
		y=b;
	}
	cout<<sum<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: expected '}' at end of input
   36 |         cout<<sum<<endl;
      |                         ^
a.cc:19:11: note: to match this '{'
   19 | int main(){
      |           ^
Language: C++

// JOI13-quest3.cpp : Defines the entry point for the console application.
//

#include <stdio.h>

int absolute(int *n) {

	if (*n >= 0) {
		return *n;
	}
	else {
		*n *= -1;
		return *n;
	}
}

int big(int n, int m) {
	int max;

	absolute(&n);
	absolute(&m);

	if (n >= m) {
		max = n;
	}
	else {
		max = m;
	}

	return max;
}

int _tmain(int argc, _TCHAR* argv[])
{
	int width, height, number;

	scanf("%d %d %d", &width, &height, &number);

	int x1, y1, x2, y2, minus_x, minus_y, sum = 0;
	scanf("%d %d", &x1, &y1);

	for (int i = 0; i < number - 1; i++) {
		scanf("%d %d", &x2, &y2);
		minus_x = x1 - x2;
		minus_y = y1 - y2;

		if ((minus_x > 0 && minus_y > 0) || (minus_x < 0 && minus_y < 0)) {
			sum += big(minus_x, minus_y);
		}
		else if (minus_x == 0) {
			absolute(&minus_y);
			sum += minus_y;
		}
		else if (minus_y == 0) {
			absolute(&minus_x);
			sum += minus_x;
		}
		else {
			absolute(&minus_x);
			absolute(&minus_y);
			sum += (minus_x + minus_y);
		}

		x1 = x2;
		y1 = y2;
	}

	printf("%d\n", sum);

	return 0;
}

Compiler output:
a.cc:33:22: error: '_TCHAR' has not been declared
   33 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<sum<<endl;}

Compiler output:
a.cc:3:33: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<sum<<endl;}
      |                                 ^~~~
a.cc:3:276: error: 'cout' does not name a type
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<sum<<endl;}
      |                                                                                                                                                                                                                                                                                    ^~~~
a.cc:3:292: error: expected declaration before '}' token
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<sum<<endl;}
      |                                                                                                                                                                                                                                                                                                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<s<<endl;}

Compiler output:
a.cc:3:33: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<s<<endl;}
      |                                 ^~~~
a.cc:3:276: error: 'cout' does not name a type
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<s<<endl;}
      |                                                                                                                                                                                                                                                                                    ^~~~
a.cc:3:290: error: expected declaration before '}' token
    3 | int h,w,n,c,s,x[10000],y[10000];main(){cin>>h>>w>>n;x[0]=1;y[0]=1;for(int i=1;i<=n;i++){cin>>x[i]>>y[i];}for(int i=1;i<n;i++){c=((x[i+1]>=x[i] && y[i+1]>=y[i]) || (x[i+1]<=x[i] && y[i+1]<=y[i]))?max(abs(x[i+1]-x[i]),abs(y[i+1]-y[i])):abs(x[i]-x[i+1])+abs(y[i]-y[i+1]);}s+=c;}cout<<s<<endl;}
      |                                                                                                                                                                                                                                                                                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    int w, h, n;
 
    cin >> w >> h >> n;
 
    int a[10000], b[10000];
    for (int i = 0, i < n; i++){
        int c, d;
        cin >> c >> d;
        a[i] = c;
        b[i] = d;
    }
 
    int sum = 0;
    for (int i = 0, i < n - 1; i++){
        if (a[i] < a[i + 1] && b[i] < b[i + 1]){
            sum += max(a[i + 1] - a[i], b[i + 1] - b[i]);
        }
        else if (a[i] > a[i + 1] && b[i] > b[i + 1]){
            sum += max(a[i] - a[i + 1], b[i] - b[i + 1]);
        }
        else {
            sum += abs(a[i + 1] - a[i]) + abs(b[i + 1] - b[i]);
        }
    }
 
    CL(sum);
     
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '<' token
   11 |     for (int i = 0, i < n; i++){
      |                      ^~
      |                      ;
a.cc:11:23: error: expected primary-expression before '<' token
   11 |     for (int i = 0, i < n; i++){
      |                       ^
a.cc:19:22: error: expected ';' before '<' token
   19 |     for (int i = 0, i < n - 1; i++){
      |                      ^~
      |                      ;
a.cc:19:23: error: expected primary-expression before '<' token
   19 |     for (int i = 0, i < n - 1; i++){
      |                       ^
a.cc:31:5: error: 'CL' was not declared in this scope
   31 |     CL(sum);
      |     ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
int main()
{
    int w, h, n;
  
    cin >> w >> h >> n;
  
    int a[10000], b[10000];
    for (int i = 0, i < n; i++){
        int c, d;
        cin >> c >> d;
        a[i] = c;
        b[i] = d;
    }
  
    int sum = 0;
    for (int i = 0, i < n - 1; i++){
        if (a[i] < a[i + 1] && b[i] < b[i + 1]){
            sum += max(a[i + 1] - a[i], b[i + 1] - b[i]);
        }
        else if (a[i] > a[i + 1] && b[i] > b[i + 1]){
            sum += max(a[i] - a[i + 1], b[i] - b[i + 1]);
        }
        else {
            sum += abs(a[i + 1] - a[i]) + abs(b[i + 1] - b[i]);
        }
    }
  
    cout << sum << endl;
      
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '<' token
   11 |     for (int i = 0, i < n; i++){
      |                      ^~
      |                      ;
a.cc:11:23: error: expected primary-expression before '<' token
   11 |     for (int i = 0, i < n; i++){
      |                       ^
a.cc:19:22: error: expected ';' before '<' token
   19 |     for (int i = 0, i < n - 1; i++){
      |                      ^~
      |                      ;
a.cc:19:23: error: expected primary-expression before '<' token
   19 |     for (int i = 0, i < n - 1; i++){
      |                       ^