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

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#define mod 1000000007
using namespace std;

int main() {
	int n, m;
	int a[50], b[50], c[50], d[50];
	cin >> n >> m;
	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++) {
		int min = INT_MAX;
		int mem;
		for (int j = 0; j < m; j++) {
			if (min > abs(a[i] - c[j]) + abs(b[i] - d[j])) {
				min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				mem = j + 1;
			}
		}
		cout << mem << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: 'INT_MAX' was not declared in this scope
   18 |                 int min = INT_MAX;
      |                           ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include "cmath"
  +++ |+#include <climits>
    6 | #define mod 1000000007
Language: C++

#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int64 INF = 1LL << 60;

int main() {
  int64 N, M, A[50], B[50], C[50], D[50];
  cin >> N >> M;
  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++) {
    int near = INF;
    for(int j = 0; j < M; j++) {
      near = min(near, abs(A[i] - C[j]) + abs(B[i] - D[j]));
    }
    for(int j = 0; j < M; j++) {
      if(near == abs(A[i] - C[j]) + abs(B[i] - D[j])) {
        cout << j + 1 << endl;
        break;
      }
    }
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: warning: overflow in conversion from 'long long int' to 'int' changes value from '1152921504606846976' to '0' [-Woverflow]
   14 |     int near = INF;
      |                ^~~
a.cc:16:17: error: no matching function for call to 'min(int&, long long int)'
   16 |       near = min(near, abs(A[i] - C[j]) + abs(B[i] - D[j]));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included 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/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:16:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   16 |       near = min(near, abs(A[i] - C[j]) + abs(B[i] - D[j]));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:16:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |       near = min(near, abs(A[i] - C[j]) + abs(B[i] - D[j]));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <queue>
using namespace std;
#define ll long long
#define kd int
#define fors(i,a,b) for(int i=(a);i<=(b);++i)
inline kd read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
	while(c>='0'&&c<='9') {x=(x<<3)+(x<<1)+c-'0';c=getchar();}
	return x*=f;
}
inline void write(kd x){
	if(x<0) {putchar('-');x=-x;}
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
inline min(int x,int y){
	return x>y ? y:x;
}
const int maxn=1<<25;
int main(){
	register int n,m,a[100001],b[100001],x[100001],y[100001];
	n=read(),m=read();
	fors(i,1,n)
		a[i]=read(),b[i]=read();
	fors(i,1,m)
		x[i]=read(),y[i]=read();
	fors(i,1,n){
	int ans=maxn;
	fors(j,1,m){
		int tmp=abs(b[m]-y[m])+abs(a[m]-x[m]);
		ans=min(ans,tmp);
	}
	cout<<ans<<endl;
}
    return 0;
}

Compiler output:
a.cc:23:8: error: ISO C++ forbids declaration of 'min' with no type [-fpermissive]
   23 | inline min(int x,int y){
      |        ^~~
a.cc: In function 'int main()':
a.cc:28:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                      ^
a.cc:28:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                        ^
a.cc:28:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                          ^
a.cc:28:36: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                                    ^
a.cc:28:46: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                                              ^
a.cc:28:56: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         register int n,m,a[100001],b[100001],x[100001],y[100001];
      |                                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int n,m,x; cin>>n>>m; 
	int a[n][2],b[n],c[n][2];
	for(int i=0;i<n;i++){
		for(int j=0;j<2;j++){
			cin>>a[i][j];
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<2;j++){
			cin>>c[i][j];
		}
	}
	for(int k=0;k<n;k++){
		b[k]=0
		for(int l=0;l<n;l++){
			x=abs(a[k][0]-c[l][0])+abs(a[k][1]-c[l][1]);
			if(b[k]>x||l==0) b[k]=x
		}
	}
	for(int y=0;y<n;y++){
		cout<<b[y]<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before 'for'
   18 |                 b[k]=0
      |                       ^
      |                       ;
   19 |                 for(int l=0;l<n;l++){
      |                 ~~~    
a.cc:19:29: error: 'l' was not declared in this scope
   19 |                 for(int l=0;l<n;l++){
      |                             ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int M,N;
int a[60],b[60],c[60],d[60];

int main(){
    cin>>N>>M;
    int i;
    for(i=0;i<N;i++)cin>>a[i]>>b[i];
    for(i=0;i<M;i++)cin>>c[i]>>d[i];
    for(i=0;i<N;i++)cout<<func[i]<<endl;
    return 0;
}
int func(int id){
    int best=(1<<29);
    int ans=-1;
    for (int i=0;i<M;i++){
        int dist=abs(a[id]-c[id])+abs(b[id]-d[id]);
        if(dist<best){
            best=dist;
            ans=i;
        }
    }
    return ans+1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'func' was not declared in this scope
   11 |     for(i=0;i<N;i++)cout<<func[i]<<endl;
      |                           ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;

int main (void) {
  int N,M;
  ll ans=0;
  ll dis=1000000000;
  cin >> N >>M;
  ll a[50], b[50],c[50] d[50];
  
  for (ll i=0; i<N; i++) {
    cin >> a[i] >> b[i];
  }
  for (ll i=0; i<M; i++) {
    cin >> c[i] >> d[i];
  }
  for (ll i=0; i<N; i++) {
    dis=1000000000
      for (ll j=0; j<M; j++) {
        if (abs(a[i]-c[j])+abs(b[i]-d[j]))<dis){
          ans=j;
          dis=abs(a[i]-c[j])+abs(b[i]-d[j]));
        }
      cout << ans;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected initializer before 'd'
   16 |   ll a[50], b[50],c[50] d[50];
      |                         ^
a.cc:22:12: error: 'c' was not declared in this scope
   22 |     cin >> c[i] >> d[i];
      |            ^
a.cc:22:20: error: 'd' was not declared in this scope
   22 |     cin >> c[i] >> d[i];
      |                    ^
a.cc:25:19: error: expected ';' before 'for'
   25 |     dis=1000000000
      |                   ^
      |                   ;
   26 |       for (ll j=0; j<M; j++) {
      |       ~~~          
a.cc:26:20: error: 'j' was not declared in this scope
   26 |       for (ll j=0; j<M; j++) {
      |                    ^
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:11:17: note: to match this '{'
   11 | int main (void) {
      |                 ^
Language: C++

import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt();
		int[] a = new int[N];
		int[] b = new int[N];
		int[] c = new int[M];
		int[] d = new int[M];
		for(int i = 0; i < N; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
		for(int j = 0; j < M; j++) {
			c[j] = sc.nextInt();
			d[j] = sc.nextInt();
		}
		for(int i = 0; i < N; i++) {
			int min = 0, man = 0,minn=0;
			for(int j = 0; j < M; j++) {
				man = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if(man < min || j == 0) {
					min = man;
					minn = j;
					//System.out.println(man);
				}
				man = 0;
			}
			System.out.println(minn + 1);
		}
	}
 
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[] s = new int[2*N];
  int[] c = new int[2*M];
  for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
  for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
  for(int i = 0;i < 2*N;i += 2){
    long min = 99999999999;
    int ans = 0;
    for(int j = 0;j < 2*M;j +=2){
      if(Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]) < min){
        min = Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]);
        ans = j+1;
      }
    }
    System.out.println(ans);
  }
}}


Compiler output:
Main.java:12: error: integer number too large
    long min = 99999999999;
               ^
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[] s = new int[2*N];
  int[] c = new int[2*M];
  for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
  for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
  for(int i = 0;i < 2*N;i += 2){
    double min = 99999999999;
    int ans = 0;
    for(int j = 0;j < 2*M;j +=2){
      if(Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]) < min){
        min = Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]);
        ans = j+1;
      }
    }
    System.out.println(ans);
  }
}}


Compiler output:
Main.java:12: error: integer number too large
    double min = 99999999999;
                 ^
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[] s = new int[2*N];
  int[] c = new int[2*M];
  for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
  for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
  for(int i = 0;i < 2*N;i += 2){
    int min = 99999999999;
    int ans = 0;
    for(int j = 0;j < 2*M;j +=2){
      if(Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]) < min){
        min = Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]);
        ans = j+1;
      }
    }
    System.out.println(ans);
  }
}}


Compiler output:
Main.java:12: error: integer number too large
    int min = 99999999999;
              ^
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[] s = new int[2*N];
  int[] c = new int[2*M];
  for(int i = 0;i < 2*N;i++)s[i] = sc.nextInt();
  for(int i = 0;i < 2*M;i++)c[i] = sc.nextInt();
  for(int i = 0;i < 2*N;i += 2){
    int min = Math.pow(2.50);
    int ans = 0;
    for(int j = 0;j < 2*M;j +=2){
      if(Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]) < min){
        min = Math.abs(s[i]-c[j])+Math.abs(s[i+1]-c[j+1]);
        ans = j+1;
      }
    }
    System.out.println(ans);
  }
}}

Compiler output:
Main.java:12: error: method pow in class Math cannot be applied to given types;
    int min = Math.pow(2.50);
                  ^
  required: double,double
  found:    double
  reason: actual and formal argument lists differ in length
1 error
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[N], b[N], c[M], d[M];
	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++){
		int min_dist=abs(a[i]-c[0])+abs(b[i]-d[0]);
		for(int j=1; j<M; j++){
			int cur_dist=abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(min_dist>cur_dist){
				min_dist = cur_dist;
				ans=j;
			}
		}
		cout << ans+1 << endl;
	}
}


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

#include <algorithm>
#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[N], b[N], c[M], d[M];
	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++){
		int x=0, a;
		for(int j=0; j<M; j++){
			int l=abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(x>l){
				x=l;
				a=j;
			}
		}
		cout << a << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:36: error: invalid types 'int[int]' for array subscript
   18 |                         int l=abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                    ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[N], b[N], c[M], d[M];
	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++){
		int x=0, a;
		for(int j=0; j<M; j++){
			int l;
			l=abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(x>l){
				x=l;
				a=j;
			}
		}
		cout << a << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:32: error: invalid types 'int[int]' for array subscript
   18 |                         l=abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[N], b[N], c[M], d[M];
	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++){
		int x=0, a;
		for(int j=0; j<M; j++){
			int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(x>l){
				x=l;
				a=j;
			}
		}
		cout << a << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: invalid types 'int[int]' for array subscript
   17 |                         int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                      ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[N], b[N], c[M], d[M];
	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++){
		int x=0, a;
		for(int j=0; j<M; j++){
			int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(x>l){
				x=l;
				a=j;
			}
		}
		cout << j << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: invalid types 'int[int]' for array subscript
   17 |                         int l = abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                      ^
a.cc:23:25: error: 'j' was not declared in this scope
   23 |                 cout << j << endl;
      |                         ^
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
#define INF 1000000000
#define MAX 50
typedef long long ll;
typedef pair<ll, ll> P;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z


int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

void solve(void){
    int n, m;
    cin >> n >> m;
    P students[MAX];
    P checkpoints[MAX];
    rep(n, i) scanf("%lld%lld\n", &students[i].first, &students[i].second);
    rep(m, i) scanf("%lld%lld\n", &checkpoints[i].first, &checkpoints[i].second);
    rep(n, i){
        ll man_len = INF;
        int index = 0;
        rep(m, j) {
            if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
                man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
                index = j;
            }
        }
        cout << index+1;
    }
    cout << '\n';
}

int main(void){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:39:63: error: request for member 'first' in 'students', which is of non-class type 'P [50]' {aka 'std::pair<long long int, long long int> [50]'}
   39 |             if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
      |                                                               ^~~~~
a.cc:39:109: error: request for member 'second' in 'students', which is of non-class type 'P [50]' {aka 'std::pair<long long int, long long int> [50]'}
   39 |             if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
      |                                                                                                             ^~~~~~
a.cc:40:63: error: request for member 'first' in 'students', which is of non-class type 'P [50]' {aka 'std::pair<long long int, long long int> [50]'}
   40 |                 man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
      |                                                               ^~~~~
a.cc:40:109: error: request for member 'second' in 'students', which is of non-class type 'P [50]' {aka 'std::pair<long long int, long long int> [50]'}
   40 |                 man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
      |                                                                                                             ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)
#define INF 1000000000

typedef long long ll;
typedef pair<ll, ll> P;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z


int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

void solve(void){
    int n, m;
    cin >> n >> m;
    P students[n];
    P checkpoints[m];
    rep(n, i) scanf("%lld%lld\n", &students[i].first, &students[i].second);
    rep(m, i) scanf("%lld%lld\n", &checkpoints[i].first, &checkpoints[i].second);
    rep(n, i){
        ll man_len = INF;
        int index = 0;
        rep(m, j) {
            if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
                man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
                index = j;
            }
        }
        cout << index+1;
    }
    cout << '\n';
}

int main(void){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:39:63: error: request for member 'first' in 'students', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   39 |             if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
      |                                                               ^~~~~
a.cc:39:109: error: request for member 'second' in 'students', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   39 |             if (man_len > abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second)) {
      |                                                                                                             ^~~~~~
a.cc:40:63: error: request for member 'first' in 'students', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   40 |                 man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
      |                                                               ^~~~~
a.cc:40:109: error: request for member 'second' in 'students', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
   40 |                 man_len = abs(checkpoints[j].first - students.first) + abs(checkpoints[j].second - students.second);
      |                                                                                                             ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  long long i,j,n,m;
  cin >> n >> m;
  for(i=0;i<n;i++)cin >> a[i] >> b[i];
  for(i=0;i<n;i++)cin >> c[i] >> d[i];
  for(i=0;i<n;i++){
    long long ret = 1e16;
    long long ans = -1;
    for(j=0;j<m;i++){
      if(ret>(abs(a[i]-c[i])+abs(b[i]-d[i]))){
        ret = abs(a[i]-c[i])+abs(b[i]-d[i]);
        ans = j+1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'a' was not declared in this scope
    8 |   for(i=0;i<n;i++)cin >> a[i] >> b[i];
      |                          ^
a.cc:8:34: error: 'b' was not declared in this scope
    8 |   for(i=0;i<n;i++)cin >> a[i] >> b[i];
      |                                  ^
a.cc:9:26: error: 'c' was not declared in this scope
    9 |   for(i=0;i<n;i++)cin >> c[i] >> d[i];
      |                          ^
a.cc:9:34: error: 'd' was not declared in this scope
    9 |   for(i=0;i<n;i++)cin >> c[i] >> d[i];
      |                                  ^
a.cc:14:19: error: 'a' was not declared in this scope
   14 |       if(ret>(abs(a[i]-c[i])+abs(b[i]-d[i]))){
      |                   ^
a.cc:14:24: error: 'c' was not declared in this scope
   14 |       if(ret>(abs(a[i]-c[i])+abs(b[i]-d[i]))){
      |                        ^
a.cc:14:34: error: 'b' was not declared in this scope
   14 |       if(ret>(abs(a[i]-c[i])+abs(b[i]-d[i]))){
      |                                  ^
a.cc:14:39: error: 'd' was not declared in this scope
   14 |       if(ret>(abs(a[i]-c[i])+abs(b[i]-d[i]))){
      |                                       ^
Language: C++

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> PP;

struct edge {
	int to, cost;
	edge(int t,int c):to(t),cost(c) {}
};


//-----------------------------------------------------------------------------

int n,m;
int a[50],b[50],c[50],d[50];

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

	cin>>n>>m;
	REP(i,n) cin>>a[i]>>b[i];
	REP(i,m) cin>>c[i]>>d[i];

	REP(i,n) {
		int pos,d=INF;
		REP(j,m) {
			if(abs(a[i]-c[j])+abs(b[i]-d[j])<d) pos=j+1,d=abs(a[i]-c[j])+abs(b[i]-d[j]);
		}
		cout<<pos<<endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:53: error: invalid types 'int[int]' for array subscript
   43 |                         if(abs(a[i]-c[j])+abs(b[i]-d[j])<d) pos=j+1,d=abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                                     ^
a.cc:43:96: error: invalid types 'int[int]' for array subscript
   43 |                         if(abs(a[i]-c[j])+abs(b[i]-d[j])<d) pos=j+1,d=abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                                                                                                ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
#define Rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
 int ans=1;
 int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
 Rep(m,M){
  if(abs(a[n]-c[m])+abs(b[n]-d[m])<mn){
   mn=abs(a[n]-c[m])+abs(b[n]-d[m]);
   ans=m+1
  }
 }
 cout<<ans<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: expected ';' before '}' token
   21 |    ans=m+1
      |           ^
      |           ;
   22 |   }
      |   ~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
 int ans=1;
 int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
 Rep(m,M){
  if(abs(a[n]-c[m])+abs(b[n]-d[m])<mn){
   mn=abs(a[n]-c[m])+abs(b[n]-d[m]);
   ans=m+1
  }
 }
 cout<<ans<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'i' was not declared in this scope
   13 | Rep(i,N)cin>>a[i]>>b[i];
      |     ^
a.cc:13:1: error: 'Rep' was not declared in this scope; did you mean 'rep'?
   13 | Rep(i,N)cin>>a[i]>>b[i];
      | ^~~
      | rep
a.cc:15:5: error: 'n' was not declared in this scope
   15 | Rep(n,N){
      |     ^
Language: C++

#include <iostream>
#include <math>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int a[50];
int b[50];
int c[50];
int d[50];
int main(void)
{
int N,M;
cin>>N>>M;
Rep(i,N)cin>>a[i]>>b[i];
Rep(i,M)cin>>c[i]>>d[i];
Rep(n,N){
 int ans=1;
 int mn=abs(a[n]-c[0])+abs(b[n]-d[0]);
 Rep(m,M){
  if(abs(a[n]-c[m])+abs(b[n]-d[m])<mn){
   mn=abs(a[n]-c[m])+abs(b[n]-d[m]);
   ans=m+1
  }
 }
 cout<<ans<<endl;
}
return 0;
}

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

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

typedef long long ll;

int main () {
    ll N,M; cin >> N >> M;
    ll x[N],y[N],a[M],b[M];

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

    for(int i=0; i<M; i++) {
	ll ans = INT_MAX;
	ll ind = 0;
	for(int j=0; j<N; j++) {
	    if( ans <  abs(x[i] - a[j]) + abs(y[i] - b[j]) ) ) {
		ans =  abs(x[i] - a[j]) + abs(y[i] - b[j]) );
		ind = j;
	    }
	}
	cout << ind+1 << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:62: error: expected primary-expression before ')' token
   21 |             if( ans <  abs(x[i] - a[j]) + abs(y[i] - b[j]) ) ) {
      |                                                              ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int plus(int a){
  if(a<0)
    a=-a;
  return a;
}
int main(){
  int n,m;
  cin>>n>>m;
  vector<pair<int,int> >pii;
  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    pii.pb(mp(a,b));
  }
  vector<int>ans;
  for(int i=0;i<m;i++){
    int a,b;
    int min=INF;
    cin>>a>>b;
    int flag=-1;
    for(int j=0;j<pii.size();j++){
      int c=plus((a-pii[i].F));
      int d=plus((b-pii[i].S));
      if(min>c+d){
	min=c+d;
	flag=j+1;
      }
    }
    ans.pb(flag);
  }
  for(int i=0;i<ans.size();i++){
    cout<<ans[i]<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: reference to 'plus' is ambiguous
   37 |       int c=plus((a-pii[i].F));
      |             ^~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:16:5: note:                 'int plus(int)'
   16 | int plus(int a){
      |     ^~~~
a.cc:38:13: error: reference to 'plus' is ambiguous
   38 |       int d=plus((b-pii[i].S));
      |             ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:16:5: note:                 'int plus(int)'
   16 | int plus(int a){
      |     ^~~~
Language: C++

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

inline cal(int a,int b,int c,int d){
    return abs(a-c) + abs(b-d);
}

int main()
{
    int n,m,x,y;
    cin >> n >> m;
    vector < pair < int , int > > st;
    vector < pair < int , int > > chk;
    for(int i=0;i<n;i++){
        cin >> x >> y;
        st.push_back(make_pair(x,y));
    }
    for(int j=0;j<m;j++){
        cin >> x >> y;
        chk.push_back(make_pair(x,y));
    }
    for(int i=0;i<n;i++){
        int res = INT_MAX,idx = m;
        for(int j=m-1;j>=0;j--){
            int temp = cal(st[i].first,st[i].second,chk[j].first,chk[j].second);
            if(res >= temp){
                res = temp;
                idx = j;
            }
        }
        cout << idx+1 << endl;
    }
    return 0;
}


Compiler output:
a.cc:4:8: error: ISO C++ forbids declaration of 'cal' with no type [-fpermissive]
    4 | inline cal(int a,int b,int c,int d){
      |        ^~~
Language: C++

#include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
#include<string>
#include<set>
#include<numeric>
#include<functional>
#include<unordered_map>
#include<cmath>
#include<cstdlib>
#include<cassert>
using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	vector<long long> a(N), b(N), c(M), d(M);
	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++) {
		int ans = -1, min_distance = INT_MAX;
		for (int j = 0; j < M; j++) {
			int distance = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if (distance < min_distance) {
				ans = j + 1;
				min_distance = distance;
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:46: error: 'INT_MAX' was not declared in this scope
   24 |                 int ans = -1, min_distance = INT_MAX;
      |                                              ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include<cassert>
  +++ |+#include <climits>
   13 | using namespace std;
Language: C++

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

#define fi first
#define se second
#define MAX 40000000000000001

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

int N,M;
pii A[100],B[100];

int main()
{
    scanf("%d%d",&N,&M);
    for(int i = 0; i < N; i++)scanf("%d%d",&A[i].fi ,&A[i].se);
    for(int i = 0; i < M; i++)scanf("%d%d",&B[i].fi ,&B[i].se);

    for(int i = 0; i < N; i++)
    {
        ll MIN = MAX;int ans = 0;
        for(int j = 0; j < M; j++)
        {
            if(abs(A[i].fi - B[j].fi) + abs(A[i].se - B[j].se) < MIN)
            {
                MIN = abs(A[i].fi - B[j].fi) + abs(A[i].se - B[j].se);
                ans = j + 1;
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}


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

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

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

    int cp, dis, dmin;
    for(int i=0; i<n; i++){
        dmin = 1000000007
        for(int j=0; j<m; j++){
            dis = fabs(c[j]-a[i]) + fabs(d[j]-b[i]);
            if(dis < dmin){
                dmin = dis;
                cp = j + 1;
            }
        }
        cout << cp << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: expected ';' before 'for'
   17 |         dmin = 1000000007
      |                          ^
      |                          ;
   18 |         for(int j=0; j<m; j++){
      |         ~~~               
a.cc:18:22: error: 'j' was not declared in this scope
   18 |         for(int j=0; j<m; j++){
      |                      ^
Language: C++

#include "iostream"
using namespace std;
int main(){
long long int N,M,a,b,c,d,min=200000001;
cin>>N>>M;
for(int i=1;i<=N;i++){
cin>>a>>b;
}
for(int j=1;j<=M;j++){
cin>>c>>d;
}
for(int k=1;k<=N;k++){
if(min>abs(a-b)+abs(c-d)){
for(int l=1;l<=M;l++){
min=abs(a-b)+abs(c-d);
}
cout<<min<<endl;
}
return 0;
}

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

#include "iostream"
using namespace std;
int main(){
long long int N,M,a,b,c,d,min=200000001;
cin>>N>>M;
for(int i=1;i<=N;i++){
cin>>a>>b;
}
for(int j=1;j<=M;j++){
cin>>c>>d;
}
for(int k=1;k<=N;k++){
if(min>abs(a-b)+abs(c-d)){
for(int l=1;l<=M;l++){
min=abs(a-b)+abs(c-d);
}
cout<<mim<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'mim' was not declared in this scope; did you mean 'min'?
   17 | cout<<mim<<endl;
      |       ^~~
      |       min
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
 
using namespace std;
 
int main(){
int n, m;
vector<long long> a, b, c, d;
cin >> n >> m;
a.resize(n);
b.resize(n);
c.resize(m);
d.resize(m);
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++){
long long m = 10000000000;
int id= 0;
for (int j=0; j < m; j++) if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < m){
m = abs(a[i] - c[j]) + abs(b[i] - d[j]);
id = j;
}
cout << id+1<< endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'vector' was not declared in this scope
    7 | vector<long long> a, b, c, d;
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | 
a.cc:7:8: error: expected primary-expression before 'long'
    7 | vector<long long> a, b, c, d;
      |        ^~~~
a.cc:9:1: error: 'a' was not declared in this scope
    9 | a.resize(n);
      | ^
a.cc:10:1: error: 'b' was not declared in this scope
   10 | b.resize(n);
      | ^
a.cc:11:1: error: 'c' was not declared in this scope
   11 | c.resize(m);
      | ^
a.cc:12:1: error: 'd' was not declared in this scope
   12 | d.resize(m);
      | ^
Language: C++


#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>

using namespace std;
using ll = long long;
using ull = unsigned long long;
#define out(S) cout<<(S)<<endl;
#define REP(i,b) for(size_t i=0;i<(b);i++)
#define rREP(i,b) for(int i=(b)-1;i>=0;i--)
#define FOR(i,a,b) for(size_t i=(a);i<(b);i++)
#define rFOR(i,a,b) for(int i=(b)-1;i>=0;i--)
#define Foreach(item,collection) for(auto item:collection)
#define mod(i) ((i) % (ll)(1e9 + 7))
ll modpow(ll i, ll j) { ll tmp = 1; while (j) { if (j % 2)tmp = mod(tmp*i); i = mod(i*i); j /= 2; }return tmp; }
#define divmod(a,b) (mod(a * modpow((ll)b,(ll)(1e9 + 5))))
#define Yes out("Yes")
#define No out("No")
#define NO out("NO")
#define YES out("YES")
#define INF INT_MAX/2
#define ShowAll(collection) for(auto i:collection){out(i);}
#define IfOut(condition,text) if((condition)){out(text);return 0;}
#define IfeOut(condition,itext,etext) if(condition){out(itext);return 0;}else{out(etext);return 0;}
#define Select(collection,condition,result) Foreach(i,collection){result+=condition;}
template<typename T> pair<vector<T>,int> getAuto() {int N; cin >> N; pair<vector<T>, int> rt;rt.first.resize(N);rt.second = N;REP(i, N) cin >> rt.first[i];return rt;}
void removeAt(string& s, int index) { s.erase(index, 1); }
template<typename T> void removeAt(vector<T>& v, int index) { v.erase(v.begin() + index); }
ll manhattanDistance(ll x1, ll y1, ll x2, ll y2) { return (abs(x2 - x1) + abs(y2 - y1)); }


int main() {
	int N, M;
	cin >> N >> M;
	vector<ll> a, b, c, d;
	a.resize(N); b.resize(N);
	c.resize(M); d.resize(M);
	REP(i, N) { cin >> a[i] >> b[i]; }
	REP(i, M) { cin >> c[i] >> d[i]; }
	REP(n, N) {
		int _min = INF;
		int index = 0;
		REP(m, M) {
			int distance = manhattanDistance(a[n], b[n], c[m], d[m]);
			if (_min > distance) { index = m; _min = distance; } 
		}
		out(index+1);
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 'INT_MAX' was not declared in this scope
   26 | #define INF INT_MAX/2
      |             ^~~~~~~
a.cc:46:28: note: in expansion of macro 'INF'
   46 |                 int _min = INF;
      |                            ^~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <algorithm>
  +++ |+#include <climits>
    8 | #include <tuple>
Language: C++

#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  long long int a[n],b[n];
  for(int i=0;i<n;i++) cin >> a[i] >> b[i];
  int c[m],d[m];
  for(int i=0;i<m;i++) cin >> c[i] >> d[i];
  for(int i=0;i<n;i++){
    long long int minl=200000001,minn=51;
    for(int j=0;j<m;j++){
      if(minl>=abs(a[i]-c[j])+abs(b[i]-d[j])){
        if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
        else minn=j+1;
        minl=abs(a[i]-c[j])+abs(b[i]-d[j]);
      }      
    }
    cout << minn << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:56: error: no matching function for call to 'min(long long int&, int)'
   16 |         if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
      |                                                     ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:16:56: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   16 |         if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
      |                                                     ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:16:56: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   16 |         if(minl==abs(a[i]-c[j])+abs(b[i]-d[j]))minn=min(minn,j+1);
      |                                                     ~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<limits>
#include<cmath>
using namespace std;
int N,M;
int n[51],m[51];
int nx[51],ny[51];
int cx[51],cy[51];
int main(){
	cin>>N>>M;
	for(int i=0;i<N;i++){
		cin>>nx[i]>>ny[i];
	}
	for(int i=1;i<=M;i++){
		cin>>cx[i]>>cy[i];
	}
	for(int i=0;i<N;i++){
		int mi,mid=INT_MAX;
		for(int j=1;j<=M;j++){
			if(abs(nx[i]-cx[j])+abs(ny[i]-cy[j])<mid){
				mid=abs(nx[i]-cx[j])+abs(ny[i]-cy[j]);
				mi=j;
				
			}
		}
		cout<<mi<<endl;
	}
	return 0;
}

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

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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> a(N, 0), b(N, 0), c(M, 0), d(M, 0);
    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 n = 0; n != N; ++n){
        int dist = 1000000000;
        int ans = 0;
        for (int m = 0; m != M; ++m){
            int d = abs(a[n] - c[m]) + abs(b[n] - d[m]);
            if (d < dist) {
                dist = d;
                ans = m;
            }
        }
        cout << ans <<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:52: error: invalid types 'int[int]' for array subscript
   15 |             int d = abs(a[n] - c[m]) + abs(b[n] - d[m]);
      |                                                    ^
Language: C++

N, M = map(int, input().split(" "))

student = [];
pos = [];
for i in range(N) :
	a, b = map(int, input().split(" "))
	student.append((a, b))

for i in range(M) :
	a, b = map(int, input().split(" "))
	pos.append((a,b))

for st in student :
	ans = -1;
	score = 100000000;
	for i in range(M) :
		tmpscore = abs(st[0] - pos[i][0]) + abs(st[1] - pos[i][1])
		if score > tmpscore :
			score = tmpscore;
			ans = i;
	print(ans+1);


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = map(int, input().split(" "))
      | ^
a.cc:4:1: error: 'pos' does not name a type
    4 | pos = [];
      | ^~~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for i in range(N) :
      | ^~~
a.cc:15:9: error: 'score' does not name a type
   15 |         score = 100000000;
      |         ^~~~~
a.cc:16:9: error: expected unqualified-id before 'for'
   16 |         for i in range(M) :
      |         ^~~
a.cc:20:25: error: 'ans' does not name a type
   20 |                         ans = i;
      |                         ^~~
a.cc:21:14: error: expected constructor, destructor, or type conversion before '(' token
   21 |         print(ans+1);
      |              ^
Language: Java

import java.util.Scanner;

public Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int human = scan.nextInt();
		int checkPoint = scan.nextInt();
		
		int[] humanx = new int[human];
		int[] humany = new int[human];
		int[] checkPointX = new int[checkPoint];
		int[] checkPointY = new int[checkPoint];
		
		for (int i = 0; i < humanx.length; i++) {
			humanx[i] = scan.nextInt();
			humany[i] = scan.nextInt();
		}
		
		for (int i = 0; i < checkPointX.length; i++) {
			checkPointX[i] = scan.nextInt();
			checkPointY[i] = scan.nextInt();
		}
		
		for (int i = 0; i < humanx.length; i++) {
			int p = 0;
			int ans = 10000000;
			for (int j = 0; j < checkPointX.length; j++) {
				int leng = Math.abs((humanx[i] - checkPointX[j])) + Math.abs((humany[i] - checkPointY[j]));
				if (ans > leng) {
					ans = leng;
					 p = j + 1;
				}
			}
			System.out.println(p);
		}
		scan.close();
	}

}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:4: 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)
Main.java:40: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include<iostream>
#include<vector>
#include<cstdlib>
#include<algorithm>
#include<functional>

using namespace std;

void main() {
	int N, M;
	typedef pair<long, long> p;
	vector<p> n, m;
	vector<int> res;

	cin >> N >> M;

	for (int i = 0;i < N;i++) {
		long a, b;
		cin >> a >> b;
		n.push_back(make_pair(a, b));
	}

	for (int i = 0;i < M;i++) {
		long c, d;
		cin >> c >> d;
		m.push_back(make_pair(c, d));
	}

	for (int i = 0;i < n.size();i++) {
		int near = 51;
		long min = 1000000000;
		for (int j = 0;j < m.size();j++) {
			long d = abs(n[i].first - m[j].first) + abs(n[i].second - m[j].second);

			if (d < min) {
				near = j;
				min = d;
			}
		}
		cout <<near+1 << endl;
	}
	return;
}

Compiler output:
a.cc:9:1: error: '::main' must return 'int'
    9 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:42:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   42 |         return;
      |         ^~~~~~