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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <utility>
#include <functional>

using namespace std;

int main() {
	int n, m, ab[50][2], cd[50][2];

	cin >> n >> m;
	for (int i = 0; i < n; ++i)
		cin >> ab[i][0] >> ab[i][1];
	for (int i = 0; i < m; ++i)
		cin >> cd[i][0] >> cd[i][1];

	for (int i = 0; i < n; ++i) {
		pair<int, int> minp(INT_MAX, INT_MAX);
		for (int j = 0; j < m; ++j) {
			pair<int, int> t(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]), j + 1);
			minp = min(minp, t);
		}
		cout << minp.second << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: 'INT_MAX' was not declared in this scope
   22 |                 pair<int, int> minp(INT_MAX, INT_MAX);
      |                                     ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <functional>
  +++ |+#include <climits>
    9 |
Language: C++

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

class Point{
public:
    int x,y;
    void set(int x1,int y1){x=x1;y=y1;}
};

int calcDistance(Point p1, Point p2){
    return abs(p1.x-p2.x)+abs(p1.y-p2.y);
}

int main(){
    int N,M;
    vector<Point> spvec;
    cin >> N >> M;
    for(int i=0;i<N;i++){
        Point p;
        cin >> p.x >> p.y;
        spvec.push_back(p);
    }
    vector<Point> cpvec;
    for(int j=0;j<M;j++){
        Point p;
        cin >> p.x >> p.y;
        cpvec.push_back(p);
    }
    for(int i=0;i<N;i++){
        int min = INT_MAX;
        int minJ = 0;
        for(int j=0;j<M;j++){
            int distance = calcDistance(spvec[i],cpvec[j]);
            if(min>distance){
                min = distance;
                minJ=j;
            }
        }
        cout << minJ+1 << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: 'INT_MAX' was not declared in this scope
   33 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 | #include <limits>
Language: C++

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

class Point{
public:
    int x,y;
    void set(int x1,int y1){x=x1;y=y1;}
};

int calcDistance(Point p1, Point p2){
    return abs(p1.x-p2.x)+abs(p1.y-p2.y);
}

int main(){
    int N,M;
    vector<Point> spvec;
    cin >> N >> M;
    for(int i=0;i<N;i++){
        Point p;
        cin >> p.x >> p.y;
        spvec.push_back(p);
    }
    vector<Point> cpvec;
    for(int j=0;j<M;j++){
        Point p;
        cin >> p.x >> p.y;
        cpvec.push_back(p);
    }
    for(int i=0;i<N;i++){
        int min = INT_MAX;
        int minJ = 0;
        for(int j=0;j<M;j++){
            int distance = calcDistance(spvec[i],cpvec[j]);
            if(min>distance){
                min = distance;
                minJ=j;
            }
        }
        cout << minJ+1 << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'INT_MAX' was not declared in this scope
   32 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n,n;
    cin >> n >> m;
    vector<pair<ll int, ll int>> seito,point;
    REP(i, n){
        ll int a,b;
        cin >> a >> b;
        seito.pb(mp(a,b));
    }
    REP(i,m){
        ll int c,d;
        cin >> c >> d;
        point.pb(mp(c,d));
    }
    REP(i,n){
        int ans = 0;
        int old = 0;
        REP(j,m){
            int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
            if(j == 0){
                old = dis;
            } else{
                if(old > dis){
                    old = dis;
                    ans = j;
                }
            }
        }
        cout << ans+1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
   19 |     int n,n;
      |           ^
a.cc:19:9: note: 'int n' previously declared here
   19 |     int n,n;
      |         ^
a.cc:20:17: error: 'm' was not declared in this scope
   20 |     cin >> n >> m;
      |                 ^
Language: C++

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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n,n;
    cin >> n >> m;
    vector<pair<ll int, ll int> > seito, point;
    REP(i, n){
        ll int a,b;
        cin >> a >> b;
        seito.pb(mp(a,b));
    }
    REP(i,m){
        ll int c,d;
        cin >> c >> d;
        point.pb(mp(c,d));
    }
    REP(i,n){
        int ans = 0;
        int old = 0;
        REP(j,m){
            int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
            if(j == 0){
                old = dis;
            } else{
                if(old > dis){
                    old = dis;
                    ans = j;
                }
            }
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
   19 |     int n,n;
      |           ^
a.cc:19:9: note: 'int n' previously declared here
   19 |     int n,n;
      |         ^
a.cc:20:17: error: 'm' was not declared in this scope
   20 |     cin >> n >> m;
      |                 ^
Language: C++

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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n,n;
    cin >> n >> m;
    vector<pair<ll int, ll int>> seito,point;
    REP(i, n){
        ll int a,b;
        cin >> a >> b;
        seito.pb(mp(a,b));
    }
    REP(i,m){
        ll int c,d;
        cin >> c >> d;
        point.pb(mp(c,d));
    }
    REP(i,n){
        int ans = 0;
        int old = 0;
        REP(j,m){
            int dis = abs(seito[i].first - point[j].first) + abs(seito[i].second - point[j].second);
            if(j == 0){
                old = dis;
            } else{
                if(old > dis){
                    old = dis;
                    ans = j;
                }
            }
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: redeclaration of 'int n'
   19 |     int n,n;
      |           ^
a.cc:19:9: note: 'int n' previously declared here
   19 |     int n,n;
      |         ^
a.cc:20:17: error: 'm' was not declared in this scope
   20 |     cin >> n >> m;
      |                 ^
Language: C++

N,M = list(map(int, input().split()))
 
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
 
for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,M = list(map(int, input().split()))
      | ^
Language: C++

open System
open System.IO

let readInt () = int (Console.ReadLine())
let readInts () = (Console.ReadLine().Split(' ')) |> (Array.map int)

let read2Ints () = 
    let t = readInts()
    (t.[0], t.[1]) 
let read3Ints () = 
    let t = readInts()
    (t.[0], t.[1], t.[2]) 

let inf = 1000000000

let manhattan (x, y) (z, w) = abs(x-z) + abs(y-w)
  


[<EntryPoint>]
let main args = 
    let n,m = read2Ints()
    let s = [|for i in 1..n -> read2Ints() |]
    let p = [|for i in 1..m -> read2Ints() |]

    for i=1 to n do
        let mutable a=inf
        let mutable b=0
        for j=1 to m do
            let t = manhattan s.[i-1] p.[j-1]
            if a > t then
                a <- t
                b <- j
        done
        printfn "%d" b
    done
    0



Compiler output:
a.cc:23:24: error: too many decimal points in number
   23 |     let s = [|for i in 1..n -> read2Ints() |]
      |                        ^~~~
a.cc:24:24: error: too many decimal points in number
   24 |     let p = [|for i in 1..m -> read2Ints() |]
      |                        ^~~~
a.cc:1:1: error: 'open' does not name a type
    1 | open System
      | ^~~~
Language: C++

// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
    
    int n,m;
    
    int x,y,z;
    
    int q = 1000000000;
    
    cin >> n >> m;
    
    int a[n],b[n],c[m],d[m];
    
    int result[n];
        
    for(int i = 0; i<n; i++){
        cin >> a[i] >> b[i];
    }
    
    for(int i = 0; i<m; i++){
        cin >> c[i] >> d[i];
    }
    
    for(int i = 0; i<n; i++){
        for(int j = 0; j<m; j++){
            x = a[i] - c[j];
            y = b[i] - d[j];
            
            if(x < 0){
                x = -x;
            }
            
            if(y < 0){
                y = -y;
            }
            
            z = x + y;
            
            if(z < q){
                q = z;
            }
        }
        
        result[i] = j + 1;
    }
    
    for(int i = 0; i<n; i++){
        cout << result[i] << endl;
    }
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://msdn.microsoft.com/library/3bstk3k5.aspx
//   http://www.cplusplus.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   http://www.boost.org/doc/


Compiler output:
a.cc: In function 'int main()':
a.cc:50:21: error: 'j' was not declared in this scope
   50 |         result[i] = j + 1;
      |                     ^
Language: C

#include <stdio.h>
int Man(int x,y,z,w){
	int e = x - y;
	int f = z - w;
	if(e<<0){
		e = e * (-1);
	}
	if(f<<0){
		f = f * (-1);
	}
	int g = e + f;
	return g;
}
int main(){
	int N,M;
	int a[N],b[N],c[M],d[M];
	int S;

	scanf("%d%d",&N,&M);
	for(int i=0;i<<N;i++){
		scanf("%d%d\n",a[i],b[i]);
	}
	for(int i=0;i<<M;i++){
		scanf("%d%d",c[i],d[i]);
	}
	for(int i=0;i<<N;i++){
		S = 0;
		for(int j=0;j<<M;j++){
			if(Man(a[S],b[S],c[S],d[S])<<Man(a[i],b[i],c[j],d[j])){
				S = j;
			}
		}
		printf("%d\n",S);
	}
	return 0;
}


Compiler output:
main.c:2:15: error: unknown type name 'y'
    2 | int Man(int x,y,z,w){
      |               ^
main.c:2:17: error: unknown type name 'z'
    2 | int Man(int x,y,z,w){
      |                 ^
main.c:2:19: error: unknown type name 'w'
    2 | int Man(int x,y,z,w){
      |                   ^
main.c: In function 'main':
main.c:29:28: error: implicit declaration of function 'Man' [-Wimplicit-function-declaration]
   29 |                         if(Man(a[S],b[S],c[S],d[S])<<Man(a[i],b[i],c[j],d[j])){
      |                            ^~~
Language: C++

int main(void){
    int N,M;
    cin >> N >> M;

    const int NMMAX = 50;
    
    int A[NMMAX], B[NMMAX], C[NMMAX], D[NMMAX];
    
    for( int i = 0 ; i < N; ++i){
        cin >> A[i] >> B[i];
    }

    for( int j = 0; j < M; ++j){
        cin >> C[j] >> D[j];
    }

    for( int i = 0; i < N; ++ i){
    int min_dist = abs(A[i] - C[0]) + abs(B[i] - D[0]) , checkpoint = 1;

        for( int j = 1; j < M; ++j){
            const int cur_dist = abs(A[i] - C[j]) + abs(B[i] - D[j]);

            if( min_dist > cur_dist){
                min_dist = cur_dist;
                checkpoint = j + 1;
            }
        }

        cout << checkpoint <<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> M;
      |     ^~~
a.cc:18:20: error: 'abs' was not declared in this scope
   18 |     int min_dist = abs(A[i] - C[0]) + abs(B[i] - D[0]) , checkpoint = 1;
      |                    ^~~
a.cc:25:17: error: 'checkpoint' was not declared in this scope
   25 |                 checkpoint = j + 1;
      |                 ^~~~~~~~~~
a.cc:29:9: error: 'cout' was not declared in this scope
   29 |         cout << checkpoint <<endl;
      |         ^~~~
a.cc:29:17: error: 'checkpoint' was not declared in this scope
   29 |         cout << checkpoint <<endl;
      |                 ^~~~~~~~~~
a.cc:29:30: error: 'endl' was not declared in this scope
   29 |         cout << checkpoint <<endl;
      |                              ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
    cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
    cin >> c[j] >> d[j];}

int min[n], number[n], k, l;
for(l=1; l<=n; l++){
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++){
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
            min = abs(a[l]-c[k])+abs(b[l]-d[k]);
            number[l] = k;
        }
    }
}

cout << number << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:17: error: incompatible types in assignment of 'int' to 'int [n]'
   22 |             min = abs(a[l]-c[k])+abs(b[l]-d[k]);
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
    cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
    cin >> c[j] >> d[j];}

int min[n], number[n], k, l;
for(l=1; l<=n; l++){
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++){
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
            min = abs(a[l]-c[k])+abs(b[l]-d[k])
            number[l] = k;
        }
    }
}

cout << number << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k])){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:17: error: incompatible types in assignment of 'int' to 'int [n]'
   22 |             min = abs(a[l]-c[k])+abs(b[l]-d[k])
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
    cin >> a[i] >> b[i];}
int c[m], d[m];
for(j=1; j<=m; j++){
    cin >> c[j] >> d[j];}

int min[n], number[n], k, l;
for(l=1; l<=n; l++){
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++){
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
            min = abs(a[l]-c[k])+abs(b[l]-d[k])
            number[l] = k;
        }
    }
}

cout << number << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ')' before '{' token
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |           ~                                   ^
      |                                               )
a.cc:25:5: error: expected primary-expression before '}' token
   25 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++){
    cin >> a[i] >> b[i]};
int c[m], d[m];
for(j=1; j<=m; j++){
    cin >> c[j] >> d[j]};

int min[n], number[n], k, l;
for(l=1; l<=n; l++){
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++){
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
            min = abs(a[l]-c[k])+abs(b[l]-d[k])
            number[l] = k;
        }
    }
}

cout << number << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before '}' token
   11 |     cin >> a[i] >> b[i]};
      |                        ^
      |                        ;
a.cc:14:24: error: expected ';' before '}' token
   14 |     cin >> c[j] >> d[j]};
      |                        ^
      |                        ;
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ')' before '{' token
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |           ~                                   ^
      |                                               )
a.cc:25:5: error: expected primary-expression before '}' token
   25 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++)
    cin >> a[i] >> b[i];
int c[m], d[m];
for(j=1; j<=m; j++)
    cin >> c[j] >> d[j];

int min[n], number[n], k, l;
for(l=1; l<=n; l++)
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++)
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
            min = abs(a[l]-c[k])+abs(b[l]-d[k])
            number[l] = k;
        };
        ;

count << number << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ';' before '{' token
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |                                               ^
      |                                               ;
a.cc:25:9: error: expected primary-expression before ';' token
   25 |         ;
      |         ^
a.cc:24:11: error: expected ')' before ';' token
   24 |         };
      |           ^
      |           )
   25 |         ;
      |         ~  
a.cc:21:11: note: to match this '('
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |           ^
a.cc:27:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int [n]' to binary 'operator<<'
   27 | count << number << endl;
      | ~~~~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, m;
cin >> n >> m;
int a[n], b[n];
int i, j;
for(i=1; i<=n; i++)
    cin >> a[i] >> b[i];
int c[m], d[m];
for(j=1; j<=m; j++)
    cin >> c[j] >> d[j];

int min[n], number[n], k, l;
for(l=1; l<=n; l++)
    min[l] = abs(a[l]-c[1])+abs(b[l]-d[1]);
    number[l] = 1;
    for(k=2; k<=m; k++)
        if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
            min = abs(a[l]-c[k])+abs(b[l]-d[k])
            number[l] = k;
        }

count << number << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:47: error: expected ';' before '{' token
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |                                               ^
      |                                               ;
a.cc:26:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int [n]' to binary 'operator<<'
   26 | count << number << endl;
      | ~~~~~~^~~~~~~~~
a.cc:26:24: error: expected ')' before ';' token
   26 | count << number << endl;
      |                        ^
      |                        )
a.cc:21:11: note: to match this '('
   21 |         if(min > abs(a[l]-c[k])+abs(b[l]-d[k]){
      |           ^
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int data = 99999999;
		int check = 0;
		int min = 99999999;
		for(int i = 0;i < n;i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0;i < m;i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++){
				data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(data < min) {
					min = data;
					check = j;
				}
			}
			System.out.println(check+1);
			min = 99999999;
			check = 0;
		}
		
	}
}

Compiler output:
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
2 errors
Language: Java

import java.util.Scanner;

public class main {
	 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int min = 99999999;
		int index = 0;
		int date = 99999999;
		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0; i < m; i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n; i++){
			for(int j = 0; j < m; j++){
				date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(date < min){
					min = date;
					index = j;
				}
			}
			System.out.println(index + 1);
			min = 999999999;
			index = 0;
		}
			
	}
 
}

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 cheakpoint {
	 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int min = 99999999;
		int index = 0;
		int date = 99999999;
		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0; i < m; i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n; i++){
			for(int j = 0; j < m; j++){
				date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(date < min){
					min = date;
					index = j;
				}
			}
			System.out.println(index + 1);
			min = 999999999;
			index = 0;
		}
			
	}
 
}

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

import java.util.Scanner;

public class B_cheakpoint {
	 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int min = 99999999;
		int index = 0;
		int date = 99999999;
		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0; i < m; i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n; i++){
			for(int j = 0; j < m; j++){
				date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(date < min){
					min = date;
					index = j;
				}
			}
			System.out.println(index + 1);
			min = 999999999;
			index = 0;
		}
			
	}
 
}

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

import java.util.Scanner;
public class cheak {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int min = 100000001,index = 0,date = 100000001;
		for(int i = 0; i < n; i++){
			a[i] = scan.nextInt();
			b[i] = scan.nextInt();
		}
		
		for(int i = 0; i < m; i++){
			c[i] = scan.nextInt();
			d[i] = scan.nextInt();
		}
		
		for(int i = 0;i < n; i++){
			for(int j = 0; j < m; j++){
				date = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(date < min){
					min = date;
					index = j;
				}
			}
			System.out.println(index + 1);
			min = 999999999;
			index = 0;
		}
			
	}
 
}

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

import java.util.Scanner;
public class main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int data = 99999999;
		int check = 0;
		int min = 99999999;
		for(int i = 0;i < n;i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0;i < m;i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++){
				data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(data < min) {
					min = data;
					check = j;
				}
			}
			System.out.println(check+1);
			min = 99999999;
			check = 0;
		}
		
	}
}

Compiler output:
Main.java:2: 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 B_checkpoint {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int data = 99999999;
		int check = 0;
		int min = 99999999;
		for(int i = 0;i < n;i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		
		for(int i = 0;i < m;i++){
			c[i] = sc.nextInt();
			d[i] = sc.nextInt();
		}
		
		for(int i = 0;i < n;i++){
			for(int j = 0;j < m;j++){
				data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(data < min) {
					min = data;
					check = j;
				}
			}
			System.out.println(check+1);
			min = 99999999;
			check = 0;
		}
		
	}
}

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

import java.util.Scanner;
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int m = sc.nextInt();
	int[] a = new int[n];
	int[] b = new int[n];
	int[] c = new int[m];
	int[] d = new int[m];
	int data = 99999999,check = 0,min = 99999999;
	for(int i = 0;i < n;i++){
		a[i] = sc.nextInt();
		b[i] = sc.nextInt();
	}
	for(int i = 0;i < m;i++){
		c[i] = sc.nextInt();
		d[i] = sc.nextInt();
	}
	for(int i = 0;i < n;i++){
		for(int j = 0;j < m;j++){
			data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
			if(data < min) {
				min = data;
				check = j;
			}
		}
		System.out.println(check+1);
		min = 99999999;
		check = 0;
	}
}


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.Scanner;
public class B_checkpoint {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int data = 99999999,check = 0,min = 99999999;
		for(int i = 0;i < n;i++){
			a[i] = scan.nextInt();
			b[i] = scan.nextInt();
		}
		for(int i = 0;i < m;i++){
			c[i] = scan.nextInt();
			d[i] = scan.nextInt();
		}
		for(int i = 0;i < n;i++){
			check = 0;
			for(int j = 0;j < m;j++){
				data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(data < min) {
					min = data;
					check = j;
				}
			}
			System.out.println(check+1);
			min = 100000001;
		}
	}
}


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

package spring;
import java.util.Scanner;
public class B_checkpoint {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[m];
		int[] d = new int[m];
		int data = 0,check = 0,min = 100000001;
		for(int i = 0;i < n;i++){
			a[i] = scan.nextInt();
			b[i] = scan.nextInt();
		}
		for(int i = 0;i < m;i++){
			c[i] = scan.nextInt();
			d[i] = scan.nextInt();
		}
		for(int i = 0;i < n;i++){
			check = 0;
			for(int j = 0;j < m;j++){
				data = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(data < min) {
					min = data;
					check = j;
				}
			}
			System.out.println(check+1);
			min = 100000001;
		}
	}
}

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

#include<bits/stdc++.h>
using namespace std;
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
     x=-x;
  }
  while(x){
    f[s++]=x%10;
     x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int A[50], B[50], C[50], D[50], M, N;
int main(){
  int i, j, mn, res, tmp;
  rd(N);
  rd(M);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
      rd(B[Lj4PdHRW]);
    }
  }
  {
    int KL2GvlyY;
    for(KL2GvlyY=0;KL2GvlyY<;KL2GvlyY++){
      rd(C[KL2GvlyY]);
      rd(D[KL2GvlyY]);
    }
  }
  for(i=0;i<N;i++){
    mn = 1073709056;
    for(j=0;j<M;j++){
      tmp = abs(A[i]-C[j]) + abs(B[i]-D[j]);
      if(mn > tmp){
        mn = tmp;
         res = j;
      }
    }
    wt_L(res+1);
    putchar_unlocked('\n');
  }
  return 0;
}
// cLay varsion 20170330-1


Compiler output:
a.cc: In function 'int main()':
a.cc:56:29: error: expected primary-expression before ';' token
   56 |     for(Lj4PdHRW=0;Lj4PdHRW<;Lj4PdHRW++){
      |                             ^
a.cc:63:29: error: expected primary-expression before ';' token
   63 |     for(KL2GvlyY=0;KL2GvlyY<;KL2GvlyY++){
      |                             ^
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s=new Scanner(System.in);
		
		int N=s.nextInt();//学生
		int M=s.nextInt();//チェックポイント
		long a[]=new long[N];//学生の位置
		long b[]=new long[N];
		long c[]=new long[M];//チェックポイントの位置
		long d[]=new long[M];
		long min=0;
		int l=0;
		
		int i=0,j=0;
		
		for(i=0;i<N;i++){
			a[i]=s.nextInt();
			b[i]=s.nextInt();
		}
		for(i=0;i<M;i++){
			c[i]=s.nextInt();
			d[i]=s.nextInt();
		}
		
	    for(i=0;i<N;i++){
	    	min=Math.abs(a[i]-c[0])+Math.abs(b[i]-d[0]);
	    	l=0;
	    	for(j=0;j<M;j++){
	    		if(min>Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j])){
	    			min=Math.abs(a[i]-c[j])+Math.abs(b[i]-d[j]);
	    			l=j;
	    		}
	    	}
	    	System.out.println(l+1);
	    	
	    }

	}

}


Compiler output:
Main.java:6: error: cannot find symbol
		Scanner s=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner s=new Scanner(System.in);
		              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define MAX_N 60
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
pii students[MAX_N];
pii checkP[MAX_N];
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,m;
    cin >> n >> m;
    for (int i = 0;i < n;i++){
        cin >> students[i].F >> students[i].S;
    }
    for (int i= 0;i < m;i++){
        cin >> checkP[i].F >> checkP[i].S;

    }
    int cdist;
    for (int i= 0;i < n;i++){
        int mindist = 1e9,minin = -1;
        for (int j = 0;j < m;j++){
            cdist = (abs(students[i].F - checkP[i].F)) + (abs(students[i].A - checkP[i].S));
            if (cdist < mindist){
                mindist = cdist;
                minin = j;
            }
        }
        cout << minin + 1 << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:75: error: 'pii' {aka 'struct std::pair<int, int>'} has no member named 'A'
   27 |             cdist = (abs(students[i].F - checkP[i].F)) + (abs(students[i].A - checkP[i].S));
      |                                                                           ^
Language: Java

import java.util.*;

public class Main{
        public static void main(String[] args){
                try(Scanner sc = new Scanner(System.in) {
                        int N = sc.nextInt(), M = sc.nextInt();
                        long[] a = new long[N], b = new long[N];
                        long[] c = new long[M], d = new long[M];
                        for(int i = 0; i < N; i++) {
                                a[i] = sc.nextLong();
                                b[i] = sc.nextLong();
                        }
                        for(int i = 0; i < M; i++) {
                                c[i] = sc.nextLong();
                                d[i] = sc.nextLong();
                        }
                        for(int i = 0; i < N; i++) {
                                long len = 1e11;
                                int ans = 0;
                                for(int j = 0; j < N; j++) {
                                        if(len > Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j])) {
                                                len = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
                                                ans = j;
                                        }
                                }
                                System.out.println(ans + 1);
                        }
                }
        }
}

Compiler output:
Main.java:9: error: illegal start of type
                        for(int i = 0; i < N; i++) {
                        ^
Main.java:9: error: > or ',' expected
                        for(int i = 0; i < N; i++) {
                                            ^
Main.java:9: error: <identifier> expected
                        for(int i = 0; i < N; i++) {
                                               ^
Main.java:13: error: illegal start of type
                        for(int i = 0; i < M; i++) {
                        ^
Main.java:13: error: > or ',' expected
                        for(int i = 0; i < M; i++) {
                                            ^
Main.java:13: error: <identifier> expected
                        for(int i = 0; i < M; i++) {
                                               ^
Main.java:17: error: illegal start of type
                        for(int i = 0; i < N; i++) {
                        ^
Main.java:17: error: > or ',' expected
                        for(int i = 0; i < N; i++) {
                                            ^
Main.java:17: error: <identifier> expected
                        for(int i = 0; i < N; i++) {
                                               ^
Main.java:28: error: ')' expected
                }
                 ^
Main.java:30: error: reached end of file while parsing
}
 ^
11 errors
Language: Java

public class Main {
		public static void main(String[] args) {
				Scanner sc = new Scanner(System.in);
				int n = sc.nextInt();
				int m = sc.nextInt();
				int a[]=new int[n];
				int b[]=new int[n];
				int c[]=new int[m];
				int d[]=new int[m];
				int e[]=new int[m];
				int min[]=new int[n];
				int minIdx[]=new int[n];
				
				for(int i=0;i<n;i++){
					a[i]=sc.nextInt();
					b[i]=sc.nextInt();
				}
				for(int k=0;k<m;k++){
					c[k]=sc.nextInt();
					d[k]=sc.nextInt();
				}
				
				for(int i=0;i<n;i++){
					for(int k=0;k<m;k++){
						e[k]=Math.abs(a[i]-c[k])+Math.abs(b[i]-d[k]);
					}
					min[i]=e[0];
					for(int k=0;k<m;k++){
						if(min[i]>e[k]){
							min[i]=e[k];
							minIdx[i]=k;
						}
					}
				}
				for(int i=0;i<n;i++){
					System.out.println(minIdx[i]+1);
				}
		}		
	}

Compiler output:
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
2 errors
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    int student[N][2], check[M][2];
    for (int i = 0; i< N; i++)
        cin >> student[i][0] >> student[i][1];
    for (int i = 0; i< M; i++)
        cin >> check[i][0] >> check[i][1];
    int distance[N][M];
    for (int i = 0; i < N; i++)
        for (int j = 0; j < M; j++)
            distance[i][j] = abs(student[i][0] - check[i][0]) + abs(student[i][1] - check[i][1]);
    for (int i = 0; i < N; i++) {
        int minD = distance[i][0];
        int res = 0;
        int j = 1
        for (; j < M; j++)
            if (distance[i][j] < minD) {
                minD = distance[i][j];
                res = j;
            }
        cout << j << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected ',' or ';' before 'for'
   20 |         for (; j < M; j++)
      |         ^~~
a.cc:20:26: error: expected ';' before ')' token
   20 |         for (; j < M; j++)
      |                          ^
      |                          ;
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, M;
int A[50], B[50];
int C[50], D[50];
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> M;
  rep(i, N) cin >> A[i] >> B[i];
  rep(i, M) cin >> C[i] >> D[i];
  rep(i, N) {
    int x = A[i], y = B[i];
    int m = INT_MAX, mi = -1;
    rep(j, M) {
      int d = abs(C[j]-x) + abs(D[j]-y);
      if (d < m) {
        m = d;
        mi = j;
      }
    }
    cout << mi + 1 << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'INT_MAX' was not declared in this scope
   32 |     int m = INT_MAX, mi = -1;
      |             ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <cmath>
  +++ |+#include <climits>
   10 | using namespace std;
a.cc:37:9: error: 'mi' was not declared in this scope; did you mean 'm'?
   37 |         mi = j;
      |         ^~
      |         m
a.cc:40:13: error: 'mi' was not declared in this scope; did you mean 'm'?
   40 |     cout << mi + 1 << "\n";
      |             ^~
      |             m
Language: C++

#include<stdio.h>
int main(void)
{
	int n,m,i,j,t;
	int a[51],b[51],c[51],d[51];
	int dist[51][51];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++)
		scanf("%d %d",&a[i],&b[i]);
	for(i=0;i<m;i++)
		scanf("%d %d",&c[i],&d[i]);
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			dist[i][j]=abs(a[i]-c[j])+abs(b[i]-d[j]);
		}
		t=0;
		for(j=1;j<m;j++){
			if(dist[i][j]<dist[i][t])t=j;
		}
		printf("%d\n",t+1);
	}

	return 0;
}
			

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: 'abs' was not declared in this scope
   14 |                         dist[i][j]=abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                    ^~~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int students [] [] = new int [n] [2];
		int points [] [] = new int [m] [2];
		for (int i = 0 ; i < n ; i++) {
			students [i] [0] = scanner.nextInt();
			students [i] [1] = scanner.nextInt();
		}
		for (int j = 0 ; j < m ; j++) {
			points [j] [0] = scanner.nextInt();
			points [j] [1] = scanner.nextInt();
		}
		
		int [] result = new int [n];
		for (int i = 0 ; i < n ; i++) {
			int minDist = 10000;
			int minIndex = 0;
			for (int j = 0 ; j < m ; j++) {
				int dist = Math.abs(students [i] [0] - points [j] [0]) + Math.abs(students [i] [1] - points [j] [1]);
				if (dist < minDist) {
					minDist = dist;
					minIndex = j;
				}
			}
			result [i]= minIndex + 1;
			System.out.prntln(result [i]);
		}
	}
} 

Compiler output:
Main.java:31: error: cannot find symbol
			System.out.prntln(result [i]);
			          ^
  symbol:   method prntln(int)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int students [] [] = new int [n] [2];
		int points [] [] = new int [m] [2];
		for (int i = 0 ; i < n ; i++) {
			students [i] [0] = scanner.nextInt();
			students [i] [1] = scanner.nextInt();
		}
		for (int j = 0 ; j < m ; j++) {
			points [j] [0] = scanner.nextInt();
			points [j] [1] = scanner.nextInt();
		}
		
		int [] result = new int [n];
		for (int i = 0 ; i < n ; i++) {
			int minDist = 10000;
			int minIndex = 0;
			for (int j = 0 ; j < m ; j++) {
				int dist = Math.abs(students [i] [0] - points [j] [0]) + Math.abs(students [i] [1] - points [j] [1]);
				if (dist < minDist) {
					minDist = dist;
					minIndex = j;
				}
			}
			result [i]= minIndex + 1;
			System.out.prntln(results [i]);
		}
	}
} 

Compiler output:
Main.java:31: error: cannot find symbol
			System.out.prntln(results [i]);
			                  ^
  symbol:   variable results
  location: class Main
1 error
Language: C++

#include <iostream>
#Include <vector>
#include <algorithm>

using namespace std;

struct Point {
  int x, y;
  Point(int x, int y):x(x), y(y) { }
};

int main() {
  int N, M; cin >> N >> M;
  vector<Point> a(N);
  vector<Point> b(M);

  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    a[i] = Point(x, y);
  }

  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    b[i] = Point(x, y);
  }

  for (int i = 0; i < N; i++) {
    Point &p = a[i];
    int idx = 0;
    int minval = 1e9+10;
    for (int j = 1; j < M; j++) {
      int val = abs(p.y - b[i],y) + abs(p.x - b[i].x);
      if (val < minval) {
        idx = j;
        minval = val;
      }
    }
    cout << idx << endl;
  }
  return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #Include; did you mean #include?
    2 | #Include <vector>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:14:3: error: 'vector' was not declared in this scope
   14 |   vector<Point> a(N);
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | 
a.cc:14:15: error: expected primary-expression before '>' token
   14 |   vector<Point> a(N);
      |               ^
a.cc:14:17: error: 'a' was not declared in this scope
   14 |   vector<Point> a(N);
      |                 ^
a.cc:15:15: error: expected primary-expression before '>' token
   15 |   vector<Point> b(M);
      |               ^
a.cc:15:17: error: 'b' was not declared in this scope
   15 |   vector<Point> b(M);
      |                 ^
a.cc:34:32: error: 'y' was not declared in this scope
   34 |       int val = abs(p.y - b[i],y) + abs(p.x - b[i].x);
      |                                ^
Language: Java

import java.util.Scanner;
public class ABC057B {
	public static void main(String[] args) {
		ABC057BSolve solve = new ABC057BSolve();
		solve.main();
	}
}

class ABC057BSolve {
	
	Point[] checkPoints;
	Point[] students;
	int N;
	int M;
	
	ABC057BSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextInt();
		this.M = cin.nextInt();
		this.students = new Point[N];
		this.checkPoints = new Point[M];
		for (int i = 0; i < N; i++) {
			int a = cin.nextInt();
			int b = cin.nextInt();
			students[i] = new Point(a, b);
		}
		for (int i = 0; i < M; i++) {
			int c = cin.nextInt();
			int d = cin.nextInt();
			checkPoints[i] = new Point(c, d);
		}
	}
	
	void main() {
		for (Point student : students) {
			int point = 0;
			int min = Integer.MAX_VALUE;
			for (int i = M - 1; i >= 0; i--) {
				int distance = distance(student, checkPoints[i]);
				if (min >= distance) {
					min = distance;
					point = i + 1;
				}
			}
			System.out.println(point);
		}
	}
	
	int distance(Point a, Point b) {
		return Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
	}
	
	class Point {
		int x;
		int y;
		
		Point(int x, int y) {
			this.x = x;
			this.y = y;
		}
	}
	
}


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

public class Main {
	public static void main(String a[])
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), m = sc.nextInt();

		int s[] = new int [n * 2];
		int c[] = new int [m * 2];

		for (int i = 0; i < n; ++i)
		{
			s[i * 2] = sc.nextInt();
			s[i * 2 + 1] = sc.nextInt();
		}

		for (int i = 0; i < m; ++i)
		{
			c[i * 2] = sc.nextInt();
			c[i * 2 + 1] = sc.nextInt();
		}

		for (int i = 0; i < n; ++i)
		{
			int dist = Integer.MAX_VALUE, index = -1;

			for (int j = 0; j < m; ++j)
			{
				int tmp = (int)(Math.pow(s[i * 2] - c[j * 2], 2) + Math.pow(s[i * 2 + 1] - c[j * 2 + 1], 2));

				if (tmp < dist)
				{
					tmp = dist;
					index = j + 1;
				}
			}

			System.out.println(index);
		}
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
#include<cmath>
#define MAX 1000000007
using namespace std;
int a[55][2];
int b[55][2];

int main(){
	int n,m;
	int i,j,k;
	int s[2];
	cin>>n>>m;
	for(i=0;i<n;i++){
		cin>>a[i][0]>>a[i][1];
	}
	for(i=0;i<m;i++){
		cin>>b[i][0]>>b[i][1];
	}
	for(i=0;i<n;i++){
		s[0]=MAX,s[1]=0;
		for(j=0;j<m;j++)a{
			k=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1]);
			if(k<s[0])s[0]=k,s[1]=j;
		}
		cout<<s[1]+1<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:34: error: expected ';' before '{' token
   21 |                 for(j=0;j<m;j++)a{
      |                                  ^
      |                                  ;