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

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

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

int main(){
  int n,m,i,j;
  cin>>n>>m;
  int a[n],b[n],c[m],d[m];
  for(i=0;i<n;i++){
    cin>>a[i]>>b[i];
  }
  for(i=0;i<m;i++){
    cin>>c[i]>>d[i];
  }
  int m[n];
  for(i=0;i<n;i++){
    m[i]=0;
    for(j=0;j<m;j++){
      if(dn(a[i],b[i],c[j],d[j])<dn(a[i],b[i],c[m[i]],d[m[i]]))m[i]=j;
      else if(dn(a[i],b[i],c[j],d[j])==dn(a[i],b[i],c[m[i]],d[m[i]])){
      	if(j<m[i])m[i]=j;
      }
    }
  }
  for(i=0;i<m;i++){
    cout<<m[i]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: conflicting declaration 'int m [n]'
   18 |   int m[n];
      |       ^
a.cc:9:9: note: previous declaration as 'int m'
    9 |   int n,m,i,j;
      |         ^
a.cc:20:6: error: invalid types 'int[int]' for array subscript
   20 |     m[i]=0;
      |      ^
a.cc:22:50: error: invalid types 'int[int]' for array subscript
   22 |       if(dn(a[i],b[i],c[j],d[j])<dn(a[i],b[i],c[m[i]],d[m[i]]))m[i]=j;
      |                                                  ^
a.cc:22:58: error: invalid types 'int[int]' for array subscript
   22 |       if(dn(a[i],b[i],c[j],d[j])<dn(a[i],b[i],c[m[i]],d[m[i]]))m[i]=j;
      |                                                          ^
a.cc:22:65: error: invalid types 'int[int]' for array subscript
   22 |       if(dn(a[i],b[i],c[j],d[j])<dn(a[i],b[i],c[m[i]],d[m[i]]))m[i]=j;
      |                                                                 ^
a.cc:23:56: error: invalid types 'int[int]' for array subscript
   23 |       else if(dn(a[i],b[i],c[j],d[j])==dn(a[i],b[i],c[m[i]],d[m[i]])){
      |                                                        ^
a.cc:23:64: error: invalid types 'int[int]' for array subscript
   23 |       else if(dn(a[i],b[i],c[j],d[j])==dn(a[i],b[i],c[m[i]],d[m[i]])){
      |                                                                ^
a.cc:24:15: error: invalid types 'int[int]' for array subscript
   24 |         if(j<m[i])m[i]=j;
      |               ^
a.cc:24:20: error: invalid types 'int[int]' for array subscript
   24 |         if(j<m[i])m[i]=j;
      |                    ^
a.cc:29:12: error: invalid types 'int[int]' for array subscript
   29 |     cout<<m[i]<<endl;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,m;
  cin >> n >> m;
  vector<int> a(n),b(n),c(n),d(n),l(n);
  int kyo;
  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 kyo=400000001;
    for(int j=0;j<m;j++){
      if(kyo>abs(a[i]-c[j])+abs(b[i]-d[j])){
        kyo=abs(a[i]-c[j])+abs(b[i]-d[j]);
        l[i]=j+1;
      }
    }
    cout << l[i] << endl;
  }
}
#include <bits/stdc++.h>
using namespace std;

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

Compiler output:
a.cc:29:5: error: redefinition of 'int main()'
   29 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;cin>>n>>m;
  vector<pair<int,int>>a(n),c(m);
  for(int i=0;i<n;i++)cin>>a.at(i).first>>a.at(i).second;
  for(int i=0;i<m;i++)cin>>c.at(i).first>>c.at(i).second;
  for(int i=0;i<n;i++){
    long int l=bebc201;int p=0
    for(int j=0;j<m;j++){
      long int x=abs(a.at(i).first-c.at(j).first)+abs(a.at(i).second-c.at(j).second);
      if(x<l){p=j;l=x;}
    }
    cout<<p+1<<endl;
  }
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'bebc201' was not declared in this scope
    9 |     long int l=bebc201;int p=0
      |                ^~~~~~~
a.cc:10:5: error: expected ',' or ';' before 'for'
   10 |     for(int j=0;j<m;j++){
      |     ^~~
a.cc:10:17: error: 'j' was not declared in this scope
   10 |     for(int j=0;j<m;j++){
      |                 ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int N, M;
	cin >> N >> M;
	int a[105], b[105], c[105], d[105];
	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 kyori == INT_MAX;
		int index = 0;
		for (int i = 0; i < M; i++) {
			int z;
			z = abs((a[i] - c[i]) + (b[i] - d[i]));
			if (z < kyori) {
				kyori = z;

				index = i;
			}
			cout << i + 1 << endl;
		}
		
		return 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: expected initializer before '==' token
   15 |                 int kyori == INT_MAX;
      |                           ^~
a.cc:20:33: error: 'kyori' was not declared in this scope
   20 |                         if (z < kyori) {
      |                                 ^~~~~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int N, M;
	cin >> N >> M;
	int a[105], b[105], c[105], d[105];
	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 kyori = INT_MAX;
		int index = 0;
		for (int i = 0; i < M; i++) {
			int z;
			z = abs((a[i] - c[i]) + (b[i] - d[i]));
			if (z < kyori) {
				kyori = z;

				index = i;
			}
			cout << i + 1 << endl;
		}
		
		return 0;
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,a[55],b[55],c[55],d[55],i,j,minn,ans;
    cin>>n>>m;
    for(i=1;i<=n;i++)
        cin>>a[i]>>b[i];
    for(i=1;i<=m;i++)
        cin>>c[i]>>d[i];
    for(i=1;i<=n;i++){
        minv=1<<30;
        for(j=1;j<=m;j++)
            if(abs(c[j]-a[i])+abs(d[j]-b[i])<minn){
                minn=abs(c[j]-a[i])+abs(d[j]-b[i]);
                ans=j;
            }
        cout<<ans<<endl;
    }
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'minv' was not declared in this scope; did you mean 'minn'?
   11 |         minv=1<<30;
      |         ^~~~
      |         minn
Language: C++

V#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define ll long long
ll a[60], b[60], c[60], d[60];
int main()
{
	int N, M;
	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];
	ll min = 0;
	int p = 0;
	for (int i = 0; i < N; i++) {
		min = mod;
		for (int j = 0; j < M; j++) {
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
				min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				p = j;
			}
		}
		cout << p + 1 << endl;
	}
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | V#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'V' does not name a type
    1 | V#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> N >> M;
      |         ^~~
a.cc:17:29: error: 'abs' was not declared in this scope
   17 |                         if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
      |                             ^~~
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << p + 1 << endl;
      |                 ^~~~
a.cc:22:34: error: 'endl' was not declared in this scope
   22 |                 cout << p + 1 << endl;
      |                                  ^~~~
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}

int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  int N, M;
	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];
	long long min = 0;
	int p = 0;
	for (int i = 0; i < N; i++) {
		min = 100000000;
		for (int j = 0; j < M; j++) {
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
				min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				p = j;
			}
		}
		cout << p + 1 << endl;
	}
  
  
  
  
  
}
///////////////////////////



Compiler output:
a.cc: In function 'int main()':
a.cc:33:44: error: 'a' was not declared in this scope
   33 |         for (int i = 0; i < N; i++) cin >> a[i] >> b[i];
      |                                            ^
a.cc:33:52: error: 'b' was not declared in this scope
   33 |         for (int i = 0; i < N; i++) cin >> a[i] >> b[i];
      |                                                    ^
a.cc:34:44: error: 'c' was not declared in this scope
   34 |         for (int i = 0; i < M; i++) cin >> c[i] >> d[i];
      |                                            ^
a.cc:34:52: error: 'd' was not declared in this scope
   34 |         for (int i = 0; i < M; i++) cin >> c[i] >> d[i];
      |                                                    ^
a.cc:40:33: error: 'a' was not declared in this scope
   40 |                         if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
      |                                 ^
a.cc:40:40: error: 'c' was not declared in this scope
   40 |                         if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
      |                                        ^
a.cc:40:52: error: 'b' was not declared in this scope
   40 |                         if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
      |                                                    ^
a.cc:40:59: error: 'd' was not declared in this scope
   40 |                         if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
      |                                                           ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int64_t minn(int64_t a,int64_t b){
    if(a >= b) return b;
    else return a;
}
int main(){
    int N,M;
    cin >> N>>M;
    vector<int64_t> A(N);
    vector<int64_t> B(N);
    vector<int64_t> C(M);
    vector<int64_t> 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 = 12345678; int num = 0;
        for(int j = 0;j < M;j++){
            if(ans > abs(A[i] - C[j]) + abs(B[i] - D[j])){
            ans = abs(A[i] - C[j]) + abs(B[i] - D[j]);
            num = j + 1;
            }
        }
        cout << num << endl;
    }
}

}

Compiler output:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  
  vector<int> a(n), b(n), c(m), d(m);
  for (int i=0; i<n; i++){
    cin >> a.at(i) >> b.at(i);
  }
  for (int i=0; i<m; i++){
    cin >> c.at(i) >> d.at(i);
  }
  
  for (int i=0; i<n; i++){
    int md = MAX_INT;
    int num;
    for (int j=0; j<m; j++){
      if(md > abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j))){
        num = j;
        md =abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j));
      }
    }
    cout << num << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'MAX_INT' was not declared in this scope; did you mean 'MAX_INPUT'?
   17 |     int md = MAX_INT;
      |              ^~~~~~~
      |              MAX_INPUT
Language: C++

#include<bits/stdc++.h>

#define REPI(i, n) for(int i = 0; i < n; i++)
#define REPJ(j, n) for(int j = 0; j < n; j++)

using namespace std;

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

    int n, m; cin >> n >> m;
    int a[n], b[n], minimum[n], ans[n], x[m], y[m];
    REPI(i, n){
        cin >> a[i] >> b[i];
        ans[i] = 0;
        minimum[i] = 2 * 100000000;
    }
    REPI(i, m){
        cin >> x[i] >> y[i];
    }

    REPI(i, n){
        REPJ(j, m){
            int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);


Compiler output:
a.cc: In function 'int main()':
a.cc:25:63: error: expected '}' at end of input
   25 |             int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);
      |                                                               ^
a.cc:24:19: note: to match this '{'
   24 |         REPJ(j, m){
      |                   ^
a.cc:25:63: error: expected '}' at end of input
   25 |             int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);
      |                                                               ^
a.cc:23:15: note: to match this '{'
   23 |     REPI(i, n){
      |               ^
a.cc:25:63: error: expected '}' at end of input
   25 |             int man_dis = abs(a[i] - x[j]) + abs(b[i] - y[j]);
      |                                                               ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[60], b[60], c[60], d[60];
int main()
{
	int N, M;
	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];
	ll min = 0;
	int p = 0;
	for (int i = 0; i < N; i++) {
		min = mod;
		for (int j = 0; j < M; j++) {
			if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
				min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
				p = j;
			}
		}
		cout << p + 1 << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'mod' was not declared in this scope; did you mean 'modf'?
   14 |                 min = mod;
      |                       ^~~
      |                       modf
Language: C++

#include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = int64_t;
#define int ll
#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()
using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(n);
    vector<int> c(m), d(m);
    REP(i, n) {
        cin >> a[i] >> b[i];
    }
    REP(i, m) {
        cin >> c[i] >> d[i];
    }

    REP(i, n) {
        int min = 4e8 + 1;
        int ans = 0;
        REP(j, m) {
            int dis = abs(a[i] - c[j]) + abs(b[i] - d[j]);
            if (dis < min) {
                min = dis;
                ans = j + 1;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc:5:13: error: '::main' must return 'int'
    5 | #define int ll
      |             ^~
a.cc:16:1: note: in expansion of macro 'int'
   16 | int main() {
      | ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  
  vector<pair<long long int, long long int>> Students(N);
  vector<pair<long long int, long long int>> Points(N);
  
  for(int i = 0;i < N; i++){
    long long int a, b;
    cin >> a >> b;
    Students[i] = make_pair(a, b);
  }
  
  for(int i = 0;i < M; i++){
    long long int a, b;
    cin >> a >> b;
    Points[i] = make_pair(a, b);
  }
  
  vector<int> ans;
  
  for(int i = 0; i < N; i++){
    long long int tdist = 1000000000, tptnr = 100;
    for(int j = 0; i < M; j++){
      int td, tp;
      td = abs(Students[i].first - Points[j].first);
      tp = j+1;
      if(td < tdist) td = tdist, tptnr = tp;
      else if(td == tdist) tptnr = tp;
      else continue;
    }
    ans.push_back(tp);
  }
  
  for(int i = 0; i < N; i++) cout << ans[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:19: error: 'tp' was not declared in this scope; did you mean 'tm'?
   38 |     ans.push_back(tp);
      |                   ^~
      |                   tm
Language: C++

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

int main()
{
    int n, m;
    cin >> n >> m;
    int64_t 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];
    }

    int64_t min_j = 0;
    for (int i = 0; i < n; i++) {
        int min = 4e8q2 + 1;
        for (int j = 0; j < m; j++) {
            if (abs(a[i] - c[j]) + abs(b[i] - d[j]) < min) {
                min = abs(a[i] - c[j]) + abs(b[i] - d[j]);
                min_j = j + 1;
            }
        }
        cout << min_j << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: unable to find numeric literal operator 'operator""q2'
   18 |         int min = 4e8q2 + 1;
      |                   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,N;
  cin >> N >> M;
  vector<vector<int>> v1(N,vector<int>(2));
  vector<vector<int>> v2(M,vector<int>(2));
  for (int i=0;i<N;i++){
    cin >> v1.at(i).at(0) >> v1.at(i).at(1);
  }
  for (int j=0;j<N;j++){
    cin >> v2.at(j).at(0) >> v2.at(j).at(1);
  }
  for (int i=0;i<N;i++){
    int ans,count=1000000000;
    for (int j=0;j<M;j++){
      int count2;
      int x=v1.at(i).at(0)-v2.at(j).at(0),y=v1.at(i).at(1)-v2.at(j).at(1);
      if (x<0){
        x*=-1;
      }
      if (y<0){
        y*=-1;
      }
      count2=x+y;
      if (count2<count){
        count=count2;
        ans=j+1;
      }
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: redeclaration of 'int N'
    5 |   int N,N;
      |         ^
a.cc:5:7: note: 'int N' previously declared here
    5 |   int N,N;
      |       ^
a.cc:6:15: error: 'M' was not declared in this scope
    6 |   cin >> N >> M;
      |               ^
Language: C++

/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

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

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

int main(void){
    int n, m;
    cin >> n >> m;
    vector<pair<int,int>> s(n), c(m);
    for(int i = 0; i < n; i++){
        cin >> s[i].first >> s[i].second;
    }    
    for(int i = 0; i < m; i++){
        cin >> c[i].first >> c[i].second;
    }
 
    for(int i = 0; i < n; i++){
        ll shortest = INF;
        int ans = 0;
        for(int j = 0; j < m; j++){
            ll tmp = abs(s[i].first - c[j].first) + abs(s[i].second - c[j].second);
            if(shortest > tmp){
                shortest = tmp;
                ans = j;
            }
        }
        cout << ans + 1 << endl;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;
// ||

int main() {
  ll n, m; cin >> n >> m;
  vll a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];
  vll c(m), d(m);
  REP(i, m) cin >> c[i] >> d[i];
  REP(i, n) {
    ll maxj=0, mind=abs(a[i]-c[0])+abs(b[i]-d[0]);
    rep(j, 1, m) {
      ll tmpd = abs(a[i]-c[j])+abs(b[i]-d[j]);
      if (tmpd < mind) {
        maxj = j; mind=tmpd;
      }
    }
    cout << j+1 << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: 'j' was not declared in this scope
   47 |     cout << j+1 << endl;
      |             ^
Language: C++

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

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

  for(int i = 0; i < n; i++){
    int min = abs(a[i]-c[0]) + abs(b[i]-d[0]);
    int min_ind = 0;
    for(int j = 1; j < m; j++){
      int l = abs(a[i]-c[j]) + abs(b[i]-d[j]);
      if(l < min){
        min = l;
        min_ind = j;
      }
    }
    cout << min_ind << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'c' was not declared in this scope
   12 |     cin >> c[i] >> d[i];
      |            ^
a.cc:12:14: error: 'i' was not declared in this scope
   12 |     cin >> c[i] >> d[i];
      |              ^
a.cc:12:20: error: 'd' was not declared in this scope
   12 |     cin >> c[i] >> d[i];
      |                    ^
a.cc:16:24: error: 'c' was not declared in this scope
   16 |     int min = abs(a[i]-c[0]) + abs(b[i]-d[0]);
      |                        ^
a.cc:16:41: error: 'd' was not declared in this scope
   16 |     int min = abs(a[i]-c[0]) + abs(b[i]-d[0]);
      |                                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int a[60],b[60],c[60],d[60];
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
  }
    return i+1;
  }
int main(){
  
  cin>>n>>m;
   
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:23:12: error: 'i' was not declared in this scope
   23 |     return i+1;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int a[60],b[60],c[60],d[60];
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
    return i+1;
  }
int main(){
  
  cin>>n>>m;
   
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   24 | int main(){
      |         ^~
a.cc:24:9: note: remove parentheses to default-initialize a variable
   24 | int main(){
      |         ^~
      |         --
a.cc:24:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:24:11: error: a function-definition is not allowed here before '{' token
   24 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:14:16: note: to match this '{'
   14 | int func(int x){
      |                ^
a.cc:32:2: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      |  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
    return i+1;
  }
int main(){
  
  cin>>n>>m;
   int a[60],b[60],c[60],d[60];
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:17:12: error: 'a' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |            ^
a.cc:17:17: error: 'c' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                 ^
a.cc:17:27: error: 'b' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                           ^
a.cc:17:32: error: 'd' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                                ^
a.cc:23:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   23 | int main(){
      |         ^~
a.cc:23:9: note: remove parentheses to default-initialize a variable
   23 | int main(){
      |         ^~
      |         --
a.cc:23:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:23:11: error: a function-definition is not allowed here before '{' token
   23 | int main(){
      |           ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:13:16: note: to match this '{'
   13 | int func(int x){
      |                ^
a.cc:31:2: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      |  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int n,m;
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
    return i+1;
  }
int main(){
  
  cin>>n>>m;
    vector<int>a(60),b(60),c(60),d(60);
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:17:12: error: 'a' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |            ^
a.cc:17:17: error: 'c' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                 ^
a.cc:17:27: error: 'b' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                           ^
a.cc:17:32: error: 'd' was not declared in this scope
   17 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                                ^
a.cc:23:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   23 | int main(){
      |         ^~
a.cc:23:9: note: remove parentheses to default-initialize a variable
   23 | int main(){
      |         ^~
      |         --
a.cc:23:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:23:11: error: a function-definition is not allowed here before '{' token
   23 | int main(){
      |           ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:13:16: note: to match this '{'
   13 | int func(int x){
      |                ^
a.cc:31:2: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      |  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int func(int x){
  int best=INF;
  int ans;
  rep(i,m){
    if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      best=abs(a[x]-c[i])+abs(b[x]-d[i]);
      ans=i;
    }
    return i+1;
  }
int main(){
  int n,m;
  cin>>n>>m;
    vector<int>a(60),b(60),c(60),d(60);
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,m)cin>>c[i]>>d[i];
  rep(i,n)
  cout<<func(i)<<endl;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:15:9: error: 'm' was not declared in this scope
   15 |   rep(i,m){
      |         ^
a.cc:4:38: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                      ^
a.cc:16:12: error: 'a' was not declared in this scope
   16 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |            ^
a.cc:16:17: error: 'c' was not declared in this scope
   16 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                 ^
a.cc:16:27: error: 'b' was not declared in this scope
   16 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                           ^
a.cc:16:32: error: 'd' was not declared in this scope
   16 |     if(abs(a[x]-c[i])+abs(b[x]-d[i])<best){
      |                                ^
a.cc:22:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   22 | int main(){
      |         ^~
a.cc:22:9: note: remove parentheses to default-initialize a variable
   22 | int main(){
      |         ^~
      |         --
a.cc:22:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:22:11: error: a function-definition is not allowed here before '{' token
   22 | int main(){
      |           ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:12:16: note: to match this '{'
   12 | int func(int x){
      |                ^
a.cc:30:2: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      |  ^
Language: C++

#include<iostream>
using namespace std;
int n,m;
set<int>q;
int dis(int x1,int y1,int x2,int y2)
{
    return abs(x1-x2)+abs(y1-y2);
}
int a1[10000],b1[100000],a2[10000],b2[100000];
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>a1[i]>>b1[i];
    }
    for(int i=1;i<=m;i++)
    {
        cin>>a2[i]>>b2[i];
    }
    for(int i=1;i<=n;i++)
    {
        int pos;
        int Max=(1<<31)-1;
        for(int j=1;j<=m;j++)
        {
            int ans=dis(a1[i],b1[i],a2[j],b2[j]);
            if(ans<Max)
            {
                pos=j;
                Max=ans;
            }
        }
        cout<<pos<<endl;
    }
    return 0;
}


Compiler output:
a.cc:4:1: error: 'set' does not name a type
    4 | set<int>q;
      | ^~~
a.cc: In function 'int main()':
a.cc:24:24: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   24 |         int Max=(1<<31)-1;
      |                 ~~~~~~~^~
Language: C++

#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
struct D{
	int x, y;
};
int main(){
	int n, m, i, j, C[51] = {0}, t;
	D b[51], e[51];
	cin >> n >> m;
	for(i = 0; i < n; i++){
		cin >> b[i].x >> b[i].y;
	}
	for(i = 0; i < m; i++){
		cin >> e[i].x >> e[i].y;
	}
	for(i = 0; i < n; i++){
		int min = 400000000;
		for(j = 0; j < m; j++){
			if(min>abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y)){
				min = abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y);
				t = j+1;
			}
		}
		C[i] = t;
	} 
	for(i = 0; i < n; i++){
		cout << C[i] << endl;
	}
	return 0;
} #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
struct D{
	int x, y;
};
int main(){
	int n, m, i, j, C[51] = {0}, t;
	D b[51], e[51];
	cin >> n >> m;
	for(i = 0; i < n; i++){
		cin >> b[i].x >> b[i].y;
	}
	for(i = 0; i < m; i++){
		cin >> e[i].x >> e[i].y;
	}
	for(i = 0; i < n; i++){
		int min = 400000000;
		for(j = 0; j < m; j++){
			if(min>abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y)){
				min = abs(b[i].x-e[j].x)+abs(b[i].y-e[j].y);
				t = j+1;
			}
		}
		C[i] = t;
	} 
	for(i = 0; i < n; i++){
		cout << C[i] << endl;
	}
	return 0;
} 

Compiler output:
a.cc:32:3: error: stray '#' in program
   32 | } #include<iostream>
      |   ^
a.cc:32:4: error: 'include' does not name a type
   32 | } #include<iostream>
      |    ^~~~~~~
a.cc:36:8: error: redefinition of 'struct D'
   36 | struct D{
      |        ^
a.cc:5:8: note: previous definition of 'struct D'
    5 | struct D{
      |        ^
a.cc:39:5: error: redefinition of 'int main()'
   39 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int n = 0, m = 0;
  cin >> n >> m;
  vector<pair<long long, long long>> a(n), b(m);
  for (int i=0; i<n; i++) cin >> a.at(i).first >> a.at(i).second;
  for (int i=0; i<m; i++) cin >> b.at(i).first >> b.at(i).second;
  for (int i=0; i<n; i++) {
    long long min = 10000000000, num = 0;
    for (int j=0; j<m; j++) {
      long long buf = abs(a.at(i).first - b.at(j).first) + abs(a.at(i).second - b.at(j).second);
      if (buf < min) {
        min = buf;
        num = j+1;
      }
    }
    cout << num << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<pair<long long, long long>> a(n), b(m);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <cmath>
  +++ |+#include <vector>
    3 | 
a.cc:9:35: error: expected primary-expression before '>' token
    9 |   vector<pair<long long, long long>> a(n), b(m);
      |                                   ^~
a.cc:9:38: error: 'a' was not declared in this scope
    9 |   vector<pair<long long, long long>> a(n), b(m);
      |                                      ^
a.cc:9:44: error: 'b' was not declared in this scope
    9 |   vector<pair<long long, long long>> a(n), b(m);
      |                                            ^
Language: C++

// --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char* argv[]) {

	long double N, M;
	long double min, cnt;

	cin >> N >> M;

	vector<long double>a(N), b(N);
	vector<long double>c(N), 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++) {
		min = 10e8;
		cnt = 0;
		for (int j = 0; j < M; j++) {
			if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
				min = abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j]);
				cnt = j + 1;
			}
		}
		cout << cnt << endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:14:9: error: 'vector' was not declared in this scope
   14 |         vector<long double>a(N), b(N);
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cmath>
  +++ |+#include <vector>
    4 | 
a.cc:14:16: error: expected primary-expression before 'long'
   14 |         vector<long double>a(N), b(N);
      |                ^~~~
a.cc:15:16: error: expected primary-expression before 'long'
   15 |         vector<long double>c(N), d(M);
      |                ^~~~
a.cc:18:24: error: 'a' was not declared in this scope
   18 |                 cin >> a[i] >> b[i];
      |                        ^
a.cc:18:32: error: 'b' was not declared in this scope
   18 |                 cin >> a[i] >> b[i];
      |                                ^
a.cc:22:24: error: 'c' was not declared in this scope
   22 |                 cin >> c[i] >> d[i];
      |                        ^
a.cc:22:32: error: 'd' was not declared in this scope
   22 |                 cin >> c[i] >> d[i];
      |                                ^
a.cc:29:52: error: 'a' was not declared in this scope
   29 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                    ^
a.cc:29:59: error: 'c' was not declared in this scope
   29 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                           ^
a.cc:29:84: error: 'b' was not declared in this scope
   29 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                                                    ^
a.cc:29:91: error: 'd' was not declared in this scope
   29 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                                                           ^
Language: C++

// --https://kenkoooo.com/atcoder/#/table/soma62jp
#include <iostream>
using namespace std;

int main(int argc, char* argv[]) {

	long double N, M;
	long double min, cnt;

	cin >> N >> M;

	vector<long double>a(N), b(N);
	vector<long double>c(N), 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++) {
		min = 10e8;
		cnt = 0;
		for (int j = 0; j < M; j++) {
			if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
				min = abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j]);
				cnt = j + 1;
			}
		}
		cout << cnt << endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:12:9: error: 'vector' was not declared in this scope
   12 |         vector<long double>a(N), b(N);
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <iostream>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:12:16: error: expected primary-expression before 'long'
   12 |         vector<long double>a(N), b(N);
      |                ^~~~
a.cc:13:16: error: expected primary-expression before 'long'
   13 |         vector<long double>c(N), d(M);
      |                ^~~~
a.cc:16:24: error: 'a' was not declared in this scope
   16 |                 cin >> a[i] >> b[i];
      |                        ^
a.cc:16:32: error: 'b' was not declared in this scope
   16 |                 cin >> a[i] >> b[i];
      |                                ^
a.cc:20:24: error: 'c' was not declared in this scope
   20 |                 cin >> c[i] >> d[i];
      |                        ^
a.cc:20:32: error: 'd' was not declared in this scope
   20 |                 cin >> c[i] >> d[i];
      |                                ^
a.cc:27:52: error: 'a' was not declared in this scope
   27 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                    ^
a.cc:27:59: error: 'c' was not declared in this scope
   27 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                           ^
a.cc:27:84: error: 'b' was not declared in this scope
   27 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                                                    ^
a.cc:27:91: error: 'd' was not declared in this scope
   27 |                         if (min > abs((long double)a[i] - c[j]) + abs((long double)b[i] - d[j])) {
      |                                                                                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int inf=1e9;
int main(){
	int n,m;
	vector<int>a(n),b(n),c(m),d(m),ans(n);

	for(int i=0;i<n;i++){
		int dst=inf,ans=-1;
		for(int j=0;j<m;j++){
			if(dst>abs(a[i]-c[j])+abs(b[i]-d[j])ans=j+1;
	}
	}
	for(auto&& u:ans)cout<<u<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:61: error: expected ';' before 'ans'
   11 |                         if(dst>abs(a[i]-c[j])+abs(b[i]-d[j])ans=j+1;
      |                                                             ^~~
      |                                                             ;
a.cc:12:9: error: expected primary-expression before '}' token
   12 |         }
      |         ^
a.cc:11:69: error: expected ')' before '}' token
   11 |                         if(dst>abs(a[i]-c[j])+abs(b[i]-d[j])ans=j+1;
      |                           ~                                         ^
      |                                                                     )
   12 |         }
      |         ~                                                            
a.cc:12:9: error: expected primary-expression before '}' token
   12 |         }
      |         ^
Language: C

#include<bits/stdc++.h>
using namespace std;
int main(){
int N , M , ans1 , ans2=1000000000 , ans;
  cin>>N>>M;
  vector<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++){
    ans2=1000000000;
    for(int j=0;j<M;j++){
      ans1=abs(A[i]-C[j])+abs(B[i]-D[j]);
      if(ans2>ans1){
        ans2=ans1;
        ans=j;
      }
      }
      cout<<ans+1<<endl;
  }
}

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

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

using namespace std;



int a[55][2], b[55][2];
int main(){
	// freopen("input.txt", "r", stdin);
	int N, M;
	cin >> N >> M;
	for (int i = 0; i < N; ++i)
	{
		cin >> a[i][0] >> a[i][1];
	}
	for (int i = 0; i < M; ++i)
	{
		cin >> b[i][0] >> b[i][1];
	}
	for (int i = 0; i < N; ++i)
	{
		int mm = INT_MAX;
		int id;
		for (int j = 0; j < M; ++j)
		{
			int dis = abs(a[i][0]- b[j][0]) + abs(a[i][1]- b[j][1]);
			if(mm > dis){
				id = j + 1;
				mm = dis;
			}
		}
		cout << id << endl;
	}
	return 0;
}

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

import java.util.*;
 
public class Main {
  	static Scanner scanner = new Scanner(System.in);
 
    public static void main(String[]$) {
    	int n = scanner.nextInt();
    	int m = scanner.nextInt();
      	int[] a = new int[n];
      	int[] b = new int[n];
      	for (int i = 0; i < n; i++) {
        	a[i] = scanner.nextInt();
        	b[i] = scanner.nextInt();
        }
      	int[] c = new int[m];
      	int[] d = new int[m];
      	for (int i = 0; i < m; i++) {
        	c[i] = scanner.nextInt();
        	d[i] = scanner.nextInt();
        }
      	for (int i = 0; i < n; i++) {
          	int min = Integer.MAX_VALUE;
          	int index;
      		for (int j = m - 1; j >= 0; j++) {
              	int dist = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if (min >= dist) {
                  	min = dist;
                	index = j + 1;
                }
            }
          	System.out.println(index);
        }
    }
}

Compiler output:
Main.java:31: error: variable index might not have been initialized
          	System.out.println(index);
          	                   ^
1 error
Language: Java

import util.java.*;

public class Main {
  	static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
    	int n = scanner.nextInt();
    	int m = scanner.nextInt();
      	int[] a = new int[n];
      	int[] b = new int[n];
      	for (int i = 0; i < n; i++) {
        	a[i] = scanner.nextInt();
        	b[i] = scanner.nextInt();
        }
      	int[] c = new int[m];
      	int[] d = new int[m];
      	for (int i = 0; i < m; i++) {
        	c[i] = scanner.nextInt();
        	d[i] = scanner.nextInt();
        }
      	for (int i = 0; i < n; i++) {
          	int min = Integer.MAX_VALUE;
          	int index;
      		for (int j = m - 1; j >= 0; j++) {
              	int dist = Math.abs(a[i] - c[j]) + Math.abs(b[i] - d[j]);
				if (min >= dist) {
                  	min = dist;
                	index = j + 1;
                }
            }
          	System.out.println(index);
        }
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
  	static Scanner scanner = new Scanner(System.in);
  	       ^
  symbol:   class Scanner
  location: class Main
Main.java:1: error: package util.java does not exist
import util.java.*;
^
Main.java:4: error: cannot find symbol
  	static Scanner scanner = new Scanner(System.in);
  	                             ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

#include<bits/stc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<int>a(N);
  vector<int>b(N);
  vector<int>c(M);
  vector<int>d(M);
  
  for(int i=0;i<N;i++){
    cin>>a.at(i)>>b.at(i);
    
  }
  
  for(int i=0;i<M;i++){
    cin>>c.at(i)>>d.at(i);
  }
  
  
  for(int i=0;i<N;i++){
    int max=0;
    int sum=0;
    for(int j=0;j<M;j++){
      int X=abs(a.at(i)-c.at(j));
      int Y=abs(b.at(i)-d.at(j));
      
      sum=X+Y;
      if(max<sum){
        max=sum;
      }
    }
    cout<<max<<endl;
  }
}


      
      
      
      
      
      
      
      
      
      
      
  

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

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i) >> b.at(i);
    }
    vector<int> c(m);
    vector<int> d(m);
    for (int i = 0; i < m; i++)
    {
        cin >> c.at(i) >> d.at(i);
    }
    int miti;
    int hozon;
    int xxx;
    for(int i=0;i<n;i++){
        hozon=abs(a.at(0)-c.at(0))+abs(b.at(0)-d.at(0));;
        xxx=0;
        for(int j=0;j<m;j++){
            miti=abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j));
            if(hozon<=miti){
                continue;
            }
            else{
                hozon=miti;
                xxx=j;
            }
        }
        cout<<xxx+1<<endl;

}


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

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    vector<int> b(n);
    for (int i = ; i < n; i++)
    {
        cin >> a.at(i) >> b.at(i);
    }
    vector<int> c(m);
    vector<int> d(m);
    for (int i = 0; i < m; i++)
    {
        cin >> c.at(i) >> d.at(i);
    }
    int miti;
    int hozon;
    int xxx;
    for(int i=0;i<n;i++){
        hozon=0;
        for(int j=0;j<m;j++){
            miti=abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j));
            if(hozon==miti){
                
            }
            hozon=min(hozon,miti);
            if(hozon==miti){
                xxx=j;
            }
        }
        cout<<xxx<<endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected primary-expression before ';' token
   10 |     for (int i = ; i < n; i++)
      |                  ^