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

#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  ll n,m;
  cin >>n>>m;
  vector<pair<ll,ll>> a(n);
  vector<pair<ll,ll>> c(m);
  vector<ll> ans(n);
  rep(i,n) cin >>a[i].first>>a[i].second;
  rep(i,m) cin >>b[i].first>>b[i].second;
  rep(i,n) ans[i]=abs(a[i].first-b[0].first)+abs(a[i].second-b[0].second);
  rep(i,n){
    rep(j,m-1){
      if(abs(a[i].first-b[i].first)+abs(a[i].second-b[i].second)<(abs(a[i].first-b[i+1].first)+abs(a[i].second-b[i+1].second)){
        ans[i]=abs(a[i].first-b[i+1].first)+abs(a[i].second-b[i+1].second);
      }
         }
         }
         rep(i,n) cout <<amns[i]<<endl;
         
        

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: 'b' was not declared in this scope
   27 |   rep(i,m) cin >>b[i].first>>b[i].second;
      |                  ^
a.cc:28:34: error: 'b' was not declared in this scope
   28 |   rep(i,n) ans[i]=abs(a[i].first-b[0].first)+abs(a[i].second-b[0].second);
      |                                  ^
a.cc:31:25: error: 'b' was not declared in this scope
   31 |       if(abs(a[i].first-b[i].first)+abs(a[i].second-b[i].second)<(abs(a[i].first-b[i+1].first)+abs(a[i].second-b[i+1].second)){
      |                         ^
a.cc:31:127: error: expected ')' before '{' token
   31 |       if(abs(a[i].first-b[i].first)+abs(a[i].second-b[i].second)<(abs(a[i].first-b[i+1].first)+abs(a[i].second-b[i+1].second)){
      |         ~                                                                                                                     ^
      |                                                                                                                               )
a.cc:34:10: error: expected primary-expression before '}' token
   34 |          }
      |          ^
a.cc:36:26: error: 'amns' was not declared in this scope; did you mean 'ans'?
   36 |          rep(i,n) cout <<amns[i]<<endl;
      |                          ^~~~
      |                          ans
a.cc:36:40: error: expected '}' at end of input
   36 |          rep(i,n) cout <<amns[i]<<endl;
      |                                        ^
a.cc:20:11: note: to match this '{'
   20 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <alogorithm>

using namespace std;
using ll = long long int;
using pll = pair<ll,ll>;

ll dist(pll a, pll b){
  return max(abs(a.first-b.first),abs(a.second-b.second));
}

int main(){
  int n,m; cin >> n >> m;
  vector<pll> stu,chk;
  for(int i=0;i<n;i++){
  	ll a,b; cin >> a >> b;
    stu.emplace_back(a-b,a+b);
  }
  for(int i=0;i<m;i++){
  	ll a,b; cin >> a >> b;
    chk.emplace_back(a-b,a+b);
  }
  vector<int> ans;
  for(int i=0;i<n;i++){
    vector<pll> dsc;
    for(int j=0;j<m;j++){
      dsc.emplace_back(dist(stu[i],chk[j]),j+1);
    }
    auto itr = min_element(dsc.begin(),dsc.end());
    ans.push_back(itr->second);
  }
  for(auto a:ans) cout << a << "\n";
  return 0;
}

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

n,m = gets.split.map(&:to_i)

l = []
o = []

n.times do 
    a,b = gets.split.map(&:to_i)
    l << a
    o << b
end

p = []
q = []
m.times do
    c,d = gets.split.map(&:to_i)
    p << c
    q << d
end

(0..n - 1).each do |i|
    k = 100000000000000
    point = 0
    (0..m - 1).each do |j|
        dist = (p[j] - l[i]).abs + (q[j] - o[i]).abs
        if dist < k
            point = j + 1
            k = dist
        end
    end
    puts point
end

Compiler output:
a.cc:20:2: error: too many decimal points in number
   20 | (0..n - 1).each do |i|
      |  ^~~~
a.cc:23:6: error: too many decimal points in number
   23 |     (0..m - 1).each do |j|
      |      ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = gets.split.map(&:to_i)
      | ^
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  long int a,b,c=0;
  cin>>a>>b;
  vector<pair<long int,long int>>d(a);
  vector<pair<long int,long int>>e(b);
  rep(i,a)cin>>d[i].first>>d[i].second;
  rep(i,b)cin>>e[i].first>>d[i].second;
  rep(i,a){
    long int f=LONG_MAX,g;
    rep(o,b){
      g=ads(d[i].first-e[o].first)+ads(d[i].second-e[o].second);
      f=min(g,f);
    }
    c+=f;
  }
  cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'ads' was not declared in this scope; did you mean 'abs'?
   15 |       g=ads(d[i].first-e[o].first)+ads(d[i].second-e[o].second);
      |         ^~~
      |         abs
Language: C++

N, M = map(int,input().split())
ab = []
cd = []
for _ in range(N): ab.append(list(map(int,input().split())))
for _ in range(M): cd.append(list(map(int,input().split())))

def distance(x1, x2, y1, y2):
    return abs(x1 - x2) + abs(y1 - y2)

ans_distance = [float('inf')] * N
ans = [float('inf')] * N
for i in range(N):
    for j in range(M):
        #print(distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1]))
        if ans_distance[i] > distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1]):
            ans_distance[i] = distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1])
            ans[i] = j+1

for i in range(N):
    print(ans[i])

Compiler output:
a.cc:10:23: warning: multi-character character constant [-Wmultichar]
   10 | ans_distance = [float('inf')] * N
      |                       ^~~~~
a.cc:11:14: warning: multi-character character constant [-Wmultichar]
   11 | ans = [float('inf')] * N
      |              ^~~~~
a.cc:14:10: error: invalid preprocessing directive #print
   14 |         #print(distance(ab[i][0], cd[j][0], ab[i][1], cd[j][1]))
      |          ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = map(int,input().split())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(void){
    int N,M;
cin >> N >> M;
    const int NMMAX=50;
    int A[NMMAX],B[NMMAX],C[NMMAX],D[NMMAX];
1
8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    for(int i=0;i<N;++i){
        cin >> A[i] >> B[i];
}
    for(int j=0;j<M;++j){
        cin >> C[j] >> D[j];
    }
    for(int i=0;i<N;++i){
int min_dist=abs(A[i]-C[0])+abs(B[i]-D[0]),checkpoint=1;
for(int j=1;j<M;++j){
const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]); if(min_dist>cur_dist){
min_dist=cur_dist;
                checkpoint=j+1;
            }
}
        cout << checkpoint << endl;
    }
return 0; }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: expected ';' before numeric constant
    8 | 1
      |  ^
      |  ;
    9 | 8
      | ~ 
a.cc:11:17: error: 'i' was not declared in this scope
   11 |     for(int i=0;i<N;++i){
      |                 ^
Language: C++

int main(void){
    int N,M;
cin >> N >> M;
    const int NMMAX=50;
    int A[NMMAX],B[NMMAX],C[NMMAX],D[NMMAX];
1
8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    for(int i=0;i<N;++i){
        cin >> A[i] >> B[i];
}
    for(int j=0;j<M;++j){
        cin >> C[j] >> D[j];
    }
    for(int i=0;i<N;++i){
int min_dist=abs(A[i]-C[0])+abs(B[i]-D[0]),checkpoint=1;
for(int j=1;j<M;++j){
const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]); if(min_dist>cur_dist){
min_dist=cur_dist;
                checkpoint=j+1;
            }
}
        cout << checkpoint << endl;
    }
return 0; }

Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
    3 | cin >> N >> M;
      | ^~~
a.cc:6:2: error: expected ';' before numeric constant
    6 | 1
      |  ^
      |  ;
    7 | 8
      | ~ 
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=0;i<N;++i){
      |                 ^
a.cc:16:14: error: 'abs' was not declared in this scope
   16 | int min_dist=abs(A[i]-C[0])+abs(B[i]-D[0]),checkpoint=1;
      |              ^~~
a.cc:20:17: error: 'checkpoint' was not declared in this scope
   20 |                 checkpoint=j+1;
      |                 ^~~~~~~~~~
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << checkpoint << endl;
      |         ^~~~
a.cc:23:17: error: 'checkpoint' was not declared in this scope
   23 |         cout << checkpoint << endl;
      |                 ^~~~~~~~~~
a.cc:23:31: error: 'endl' was not declared in this scope
   23 |         cout << checkpoint << endl;
      |                               ^~~~
Language: C++

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
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: C++

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

int main() {
  int n,m;cin>>n>>m;
  ll an[n],bn[n], cn[m],dn[m];
  rep(i,n) cin>>an[i]>>bn[i];
  rep(j,m) cin>>cn[j]>>dn[j];
  ll d, dmin, dx;
  rep(i,n) {
    dmin=INF;
    rep(j,m) {
      d = abs(c[j]-an[i]) + abs(d[j]-bn[i]);
      if (d < dmin) {
        dmin = d;
        dx = j+1;
      }
    }
    cout << dx << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'c' was not declared in this scope
   16 |       d = abs(c[j]-an[i]) + abs(d[j]-bn[i]);
      |               ^
a.cc:16:34: error: invalid types 'll {aka long long int}[int]' for array subscript
   16 |       d = abs(c[j]-an[i]) + abs(d[j]-bn[i]);
      |                                  ^
Language: C++

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

int main() {
  int n,m; cin >> n >> m;
  vettor<vector<int>> ab(2,n),cd(2,m);
  for(int i=0; i<n; i++){
    cin >> ab[0][i] >> ab[1][i];
  }
  for(int i=0; i<m; i++){
    cin >> cd[0][i] >> cd[1][i];
  }
  
  vector<int> ans(n);
  for(int i=0; i<n; i++){
    int x,y;
    x = ab[0][i] - cd[0][0]; if(x<0) x*=(-1);
    y = ab[1][i] - cd[1][0]; if(y<0) y*=(-1);
    ans[i] = x+y;
    
    for(int j=1; j<m; j++){
      x = ab[0][i] - cd[0][j]; if(x<0) x*=(-1);
      y = ab[1][i] - cd[1][j]; if(y<0) y*=(-1);
      if(x+y < ans[i]) ans[i] = x+y;
    }
    cout << ans[i] << endl;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vettor' was not declared in this scope
    6 |   vettor<vector<int>> ab(2,n),cd(2,m);
      |   ^~~~~~
a.cc:6:20: error: expected primary-expression before '>' token
    6 |   vettor<vector<int>> ab(2,n),cd(2,m);
      |                    ^~
a.cc:6:23: error: 'ab' was not declared in this scope; did you mean 'abs'?
    6 |   vettor<vector<int>> ab(2,n),cd(2,m);
      |                       ^~
      |                       abs
a.cc:6:31: error: 'cd' was not declared in this scope
    6 |   vettor<vector<int>> ab(2,n),cd(2,m);
      |                               ^~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using P = pair<int,int>;
int absi(int x){
  return int(abs(x));
}
int main(){
  int D,n,m,p1,p2;
  cin >> n >> m;
  vector<P> DaN(n);
  vector<P> sts(n);
  for(int i=0;i<n;i++){
    cin >> sts[i].first >> sts[i].second;
    DaN.first = 1e9;
    DaN.second = 0;
  }
  for(int i = 0;i<m;i++){
    cin >> p1 >> p2;
    for(int j=0;j<n;j++){
      D = absi(p1-sts[j].first)+absi(p2-sts[j].second);
      if(D<DaN[j].first){
        DaN[j].first = D;
        DaN[j].second = i;
      }
    }
  }
  for(int i=0;i<n;i++){
    cout << DaN[i].second+1 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   15 |     DaN.first = 1e9;
      |         ^~~~~
a.cc:16:9: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   16 |     DaN.second = 0;
      |         ^~~~~~
Language: C++

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>>vvi;


int main(){
  int n,m;
  cin>>n>>m;
  vi a(n);
  vi b(n);
  vi c(m);
  vi d(m);
  vi ans(n);
  for(int i=0;i<n;i++)cin>>a[i]>>b[i];
  for(int i-0;i<m;i++)cin>>c[i]>>d[i];
  for(int i=0;i<n;i++){
    int MIN=INF;
    for(int j=0;j<m;j++){
      int d=ads(c[j]-a[i])+ads(b[i]-d[j]);
      if(d<MIN){
        MIN=d;
        ans[i]=j+1;
      }
    }
  }
  for(int i=0;i<n;i++)cout<<ans[i]<<endl;
}
        
      

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected ';' before '-' token
   21 |   for(int i-0;i<m;i++)cin>>c[i]>>d[i];
      |            ^
      |            ;
a.cc:21:18: error: expected ')' before ';' token
   21 |   for(int i-0;i<m;i++)cin>>c[i]>>d[i];
      |      ~           ^
      |                  )
a.cc:21:19: error: 'i' was not declared in this scope
   21 |   for(int i-0;i<m;i++)cin>>c[i]>>d[i];
      |                   ^
a.cc:25:13: error: 'ads' was not declared in this scope; did you mean 'ans'?
   25 |       int d=ads(c[j]-a[i])+ads(b[i]-d[j]);
      |             ^~~
      |             ans
a.cc:25:38: error: invalid types 'int[int]' for array subscript
   25 |       int d=ads(c[j]-a[i])+ads(b[i]-d[j]);
      |                                      ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] x1 = new int [a];
        int [] y1 = new int [a];
        int [] x2 = new int [a];
        int [] y2 = new int [a];
        int [] ans = new int [a];
      
        for(int i=0;i<a;i++){x1[i] = sc.nextInt();
                             y1[i] = sc.nextInt();
                             x2[i] = sc.nextInt();
                             y2[i] = sc.nextInt();
                            }
       
        for(int i=0;i<a;i++){int b = 0; int c = Long.MAX_VALUE;
        for(int j=0;j<a;j++){Long d = c-c; 
                             d+=Math.abs(x1[i]-x2[j]);
                             d+=Math.abs(y1[i]-y2[j]);
                             if(d<c){b=j;c=d;}
                             if(j==a-1){ans[i]+=b+1;}        
                            } 
                            }        
        for(int i=0;i<a;i++){System.out.println(ans[i]);}		
	}
}



Compiler output:
Main.java:18: error: incompatible types: possible lossy conversion from long to int
        for(int i=0;i<a;i++){int b = 0; int c = Long.MAX_VALUE;
                                                    ^
Main.java:19: error: incompatible types: int cannot be converted to Long
        for(int j=0;j<a;j++){Long d = c-c; 
                                       ^
Main.java:22: error: incompatible types: Long cannot be converted to int
                             if(d<c){b=j;c=d;}
                                           ^
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] x1 = new int [a];
        int [] y1 = new int [a];
        int [] x2 = new int [a];
        int [] y2 = new int [a];
        int [] ans = new int [a];
      
        for(int i=0;i<a;i++){x1[i] = sc.nextInt();
                             y1[i] = sc.nextInt();
                            }
        for(int i=0;i<a;i++){x2[i] = sc.nextInt();
                             y2[i] = sc.nextInt();
                            }
        int b,c;
        Long d;
        for(int i=0;i<a;i++){b = 0; c = 1000000000;
        for(int j=0;j<a;j++){d = 0; 
                             d+=Math.abs(x1[i]-x2[j]);
                             d+=Math.abs(y1[i]-y2[j]);
                             if(d<c){b=j;c=d;}
                             if(j==a-1){ans[i]+=b+1;}        
                            } 
                            }        
        for(int i=0;i<a;i++){System.out.println(ans[i]);}		
	}
}



Compiler output:
Main.java:21: error: incompatible types: int cannot be converted to Long
        for(int j=0;j<a;j++){d = 0; 
                                 ^
Main.java:24: error: incompatible types: Long cannot be converted to int
                             if(d<c){b=j;c=d;}
                                           ^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double [] x1 = new double [a];
        double [] y1 = new double [a];
        double [] x2 = new double [a];
        double [] y2 = new double [a];
        int [] ans = new int [a];
      
        for(int i=0;i<a;i++){x1[i] = sc.nextDouble();
                             y1[i] = sc.nextDouble();
                             x2[i] = sc.nextDouble();
                             y2[i] = sc.nextDouble();
                            }
        int b = 0;
        for(int i=0;i<a;i++){double c = 1000000000;
        for(int j=0;j<a;j++){double d = 0; 
                             d+=Math.pow(x1[i]-x2[j]);
                             d+=Math.pow(y1[i]-y2[j]);
                             if(d<c){b=j;c=d;}
                             if(j==a-1){b=ans[i];}        
                            } 
                            }        
        for(int i=0;i<a;i++){System.out.println(ans[i]);}		
	}
}



Compiler output:
Main.java:20: error: method pow in class Math cannot be applied to given types;
                             d+=Math.pow(x1[i]-x2[j]);
                                    ^
  required: double,double
  found:    double
  reason: actual and formal argument lists differ in length
Main.java:21: error: method pow in class Math cannot be applied to given types;
                             d+=Math.pow(y1[i]-y2[j]);
                                    ^
  required: double,double
  found:    double
  reason: actual and formal argument lists differ in length
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] x1 = new int [a];
        int [] y1 = new int [a];
        int [] x2 = new int [a];
        int [] y2 = new int [a];
        int [] ans = new int [a];
      
        for(int i=0;i<a;i++){x1[i] = sc.nextInt();
                             y1[i] = sc.nextInt();
                             x2[i] = sc.nextInt();
                             y2[i] = sc.nextInt();
                            }
        int b = 0;
        for(int i=0;i<a;i++){int c = 1000000000;
        for(int j=0;j<a;j++){int d = 0; 
                             d+=Math.pow(x1[i]-x2[j]);
                             d+=Math.pow(y1[i]-y2[j]);
                             if(d<c){b=j;c=d;}
                             if(j==a-1){b=ans[i];}        
                            } 
                            }        
        for(int i=0;i<a;i++){System.out.println(ans[i]);}		
	}
}



Compiler output:
Main.java:20: error: method pow in class Math cannot be applied to given types;
                             d+=Math.pow(x1[i]-x2[j]);
                                    ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
Main.java:21: error: method pow in class Math cannot be applied to given types;
                             d+=Math.pow(y1[i]-y2[j]);
                                    ^
  required: double,double
  found:    int
  reason: actual and formal argument lists differ in length
2 errors
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);
    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 ans=0;
        int com=1e9+7;
        for(int j=0;j<m;j++){
            if(abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j))<com){
                ans=j;
                com=abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j);
            }
        }
        cout << ans+1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:61: error: expected ')' before ';' token
   23 |                 com=abs(a.at(i)-c.at(j))+abs(b.at(i)-d.at(j);
      |                                             ~               ^
      |                                                             )
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define ll int64_t
using namespace std;

bool compare_by_b(pair<string,int> a,pair<string,int> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

int main(){
    ll n,m,mini=10000000,number = 0;
    cin>>n>>m;
    vector<pair<ll,ll>> s(n);
    rep(i,n) cin>>s[i].first>>s[i].second;
    vector<pair<ll,ll>> d(m);
    rep(i,m) cin>>d[i].first>>d[i].second;
    vector<int> p;
    
    rep(i,n){
        rep(j,m){
            if(abs(s[i].first-d[j].first)+abs(s[i].second-d[j].second)<mini) {
                mini = abs(s[i].first-d[j].first)+abs(s[i].second-d[j].second);
                number = j+1;
            }
        }
        cout<<number<<endl;
        number = 0;
        mini = 10000000;
    }

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

#include <bits/stdc++.h>


int main(){
  std::cin >> N >> M;
  std::vector<long long> a(N), b(N), c(M), d(M);
  for(int i = 0; i < N; ++i){
    std::cin >> a[i] >> b[i];
  }
  for(int j = 0; j < M; ++j){
    std::cin >> c[j] >> d[j];
  }
  for(int i = 0; i < N; ++i){
    int count = -1;
    long long min_length= 1000000000000;
    for(int j = 0; j < M; ++j){
      length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      if(min_length > length){
        min_length = length;
        count = j+1;
      }
    }
    std::cout << count << std::endl;
  }
}
~                                                                                                    
~                                                                                                    
~                                                                                                    
~              

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |   std::cin >> N >> M;
      |               ^
a.cc:5:20: error: 'M' was not declared in this scope
    5 |   std::cin >> N >> M;
      |                    ^
a.cc:17:7: error: 'length' was not declared in this scope
   17 |       length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      |       ^~~~~~
a.cc: At global scope:
a.cc:27:1: error: expected class-name before '~' token
   27 | ~
      | ^
Language: C++

#include <bits/stdc++.h>


int main(){
  std::cin >> N >> M;
  std::vector<long long> a(N), b(N), c(M), d(M);
  for(int i = 0; i < N; ++i){
    std::cin >> a[i] >> b[i];
  }
  for(int j = 0; j < M; ++j){
    std::cin >> c[j] >> d[j];
  }
  for(int i = 0; i < N; ++i){
    int count = -1;
    long long min_length= 1000000000000;
    for(int j = 0; j < M; ++j){
      length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      if(min_length > length){
        min_length = langth;
        count = j+1;
      }
    }
    std::cout << count << std::endl;
  }
}
~                                                                                                    
~                                                                                                    
~        

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |   std::cin >> N >> M;
      |               ^
a.cc:5:20: error: 'M' was not declared in this scope
    5 |   std::cin >> N >> M;
      |                    ^
a.cc:17:7: error: 'length' was not declared in this scope
   17 |       length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      |       ^~~~~~
a.cc:19:22: error: 'langth' was not declared in this scope
   19 |         min_length = langth;
      |                      ^~~~~~
a.cc: At global scope:
a.cc:27:1: error: expected class-name before '~' token
   27 | ~
      | ^
Language: C++

#include <bits/stdc++.h>


int main(){
  std::cin >> N >> M;
  std::vector<long long> a(N), b(N), c(M), d(M);
  for(int i = 0; i < N; ++i){
    std::cin >> a[i] >> b[i];
  }
  for(int j = 0; j < M; ++j){
    std::cin >> c[j] >> d[j];
  }
  for(int i = 0; i < N; ++i){
    int count = -1;
    long long min_length= 1000000000000;
    for(int j = 0; j < M; ++j){
      length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      if(min_length > length)){
        min_length = langth;
        count = j+1;
      }
    }
    std::cout << count << std::endl;
  }
}
~                                                                                                    
~                                                                                                    
~        

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |   std::cin >> N >> M;
      |               ^
a.cc:5:20: error: 'M' was not declared in this scope
    5 |   std::cin >> N >> M;
      |                    ^
a.cc:17:7: error: 'length' was not declared in this scope
   17 |       length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      |       ^~~~~~
a.cc:18:30: error: expected primary-expression before ')' token
   18 |       if(min_length > length)){
      |                              ^
a.cc: At global scope:
a.cc:27:1: error: expected class-name before '~' token
   27 | ~
      | ^
Language: C++

#include <bits/stdc++.h>


int main(){
  std::cin >> N >> M;
  std::vector<long long> a(N), b(N), c(M), d(M);
  for(int i = 0; i < N; ++i){
    std::cin >> a[i] >> b[i];
  }
  for(int j = 0; j < M; ++j){
    std::cin >> c[j] >> d[j];
  }
  for(int i = 0; i < N; ++i){
    int count = -1;
    long long min_length= 1000000000000;
    for(int j = 0; j < M; ++j){
      length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      if(min_length > length)){
        min_length = langth;
        count = j+1;
      }
    }
    std::cout << count << std::endl;
}
~                                                                                                    
~                                                                                                    
~        

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'N' was not declared in this scope
    5 |   std::cin >> N >> M;
      |               ^
a.cc:5:20: error: 'M' was not declared in this scope
    5 |   std::cin >> N >> M;
      |                    ^
a.cc:17:7: error: 'length' was not declared in this scope
   17 |       length = std::abs(a[i]-c[j])+std::abs(b[i]-d[j]);
      |       ^~~~~~
a.cc:18:30: error: expected primary-expression before ')' token
   18 |       if(min_length > length)){
      |                              ^
a.cc:27:2: error: expected primary-expression at end of input
   27 | ~
      |  ^
a.cc:27:2: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int f(int a,int b,int c,int d){
  return max(a,b)+max(c,d)-min(a,b)-min(c,d);
}
int main(){
  int N,M,l,x,y;
  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++){
    x=0;
    for(int j=1;j<M;j++){
      if(f(a.at(i),b.at(i),c.at(x),d.at(x))>f(a.at(i),b.at(i),c.at(j),d.at(j))x=i;
    }
    cout<<x<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:79: error: expected ';' before 'x'
   15 |       if(f(a.at(i),b.at(i),c.at(x),d.at(x))>f(a.at(i),b.at(i),c.at(j),d.at(j))x=i;
      |                                                                               ^
      |                                                                               ;
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
a.cc:15:83: error: expected ')' before '}' token
   15 |       if(f(a.at(i),b.at(i),c.at(x),d.at(x))>f(a.at(i),b.at(i),c.at(j),d.at(j))x=i;
      |         ~                                                                         ^
      |                                                                                   )
   16 |     }
      |     ~                                                                              
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int f(int a,int b,int c,int d){
  return max(a,b)+max(c,d)-min(a,b)-min(c,d);
}
int main(){
  int N,M,l,x,y;
  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++){
    x=0,y=;
    for(int j=0;j<M;j++){
      if(y,f(a.at(i),b.at(i),c.at(j),d.at(j));
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected primary-expression before ';' token
   13 |     x=0,y=;
      |           ^
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
a.cc:15:47: error: expected ')' before '}' token
   15 |       if(y,f(a.at(i),b.at(i),c.at(j),d.at(j));
      |         ~                                     ^
      |                                               )
   16 |     }
      |     ~                                          
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int n, m, a[100], b[100], c[100], d[100], i, j, minm = 1e9, minn;
	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++)
	{
		minm = 1e9;
		for (j = 1; j <= m; j++)
			if (abs(c[j] - a[i]) + abs(d[j] - b[i]) < minv)
			{
				minm = abs(c[j] - a[i]) + abs(d[j] - b[i]);
				minn = j;
			}
		cout << minn << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:67: error: 'minv' was not declared in this scope; did you mean 'minn'?
   15 |                         if (abs(c[j] - a[i]) + abs(d[j] - b[i]) < minv)
      |                                                                   ^~~~
      |                                                                   minn
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main() {
	int n, m, a[100], b[100], c[100], d[100], i, j, minm = 1e9, minn;
	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 = 1e9;
		for (j = 1; j <= m; j++)
			if (abs(c[j] - a[i]) + abs(d[j] - b[i]) < minv)
			{
				minm = abs(c[j] - a[i]) + abs(d[j] - b[i]);
				minn = j;
			}
		cout << minn << endl;
	}
	return 0;
}

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

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

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

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

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

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

	for(int j=0;j<m;j++){
		const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]);
		if(min_dist>cur_dist){
			min_dist = cur_dist;
			checkpoint = j+1;
			}
		}
	cout << checkpoint << endl; 
	}
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #intclude; did you mean #include?
    1 | #intclude<bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n >> m;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #intclude<bits/stdc++.h>
a.cc:18:24: error: 'abs' was not declared in this scope
   18 |         int min_dist = abs(A[i]-C[0])+abs(B[i]-D[0]);
      |                        ^~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout << checkpoint << endl;
      |         ^~~~
a.cc:27:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:31: error: 'endl' was not declared in this scope
   27 |         cout << checkpoint << endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #intclude<bits/stdc++.h>
Language: C++

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

int dist(int x, int y){
  return (int)(abs(x)+abs(y));
}

int main(){
  int N,M;
  cin>>N>>M;
  vector<int> a(N),b(N);
  vector<int> 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++){
    k=0;
    for(int j=0;j<M;j++){
      if(dist(a.at(i)-c.at(j),b.at(i)-d.at(j))<dist(a.at(i)-c.at(k),b.at(i)-d.at(k))){
        k=j;
      }
    }
    cout<<k+1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'k' was not declared in this scope
   20 |     k=0;
      |     ^
Language: C++

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

int main()
{
  int N, M;
  int a[51], b[51], c[51], d[51];
  int res[51];
  cin >> N >> M;

  rep(i,N) cin >> a[i] >> b[i];
  rep(i,M) cin >> c[i] >> d[i];

  rep(i,N){
    int minmd = INF;
    rep(j,M){
      int md = abs(a[i]-c[j])+abs(b[i]-d[j]);
      if(minmd > md) {
        res[i]=j+1;
        minmd = md;
      }
    }
  }

  rep(i,N){
    cout << res[i] << endl;
  }
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> N >> M;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:17:17: error: 'INF' was not declared in this scope
   17 |     int minmd = INF;
      |                 ^~~
a.cc:19:16: error: 'abs' was not declared in this scope
   19 |       int md = abs(a[i]-c[j])+abs(b[i]-d[j]);
      |                ^~~
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << res[i] << endl;
      |     ^~~~
a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:23: error: 'endl' was not declared in this scope
   28 |     cout << res[i] << endl;
      |                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  long n,m;
  cin >> n >> m;
  long a[100],b[100],c[100],d[100];
  for(int i=1; i<=n; i++) cin >>a[i]>>b[i];
  for(int i=1; i<=m; i++) cin >>c[i]>>d[i];
  
  vector<vector<long>> e(100,vector<long>(100);
  vector<long> f(100,1000000000);
  int g[100];
 
  for(int i=1; i<=n; i++){
   for(int j=1; j<=m; j++){
    e[i][j] = abs(a[i]-c[j])+abs(b[i]-d[j]);
     if(f[i] > e[i][j]) {
       f[i] = e[i][j];
       g[i] = j;
     }
   }
  }
 for(int i=1; i<=n; i++) cout << g[i] << endl;
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:47: error: expected ')' before ';' token
   12 |   vector<vector<long>> e(100,vector<long>(100);
      |                         ~                     ^
      |                                               )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  long n,m;
  cin >> n >> m;
  long a[100],b[100],c[100],d[100];
  for(int i=1; i<=n; i++) cin >>a[i]>>b[i];
  for(int i=1; i<=m; i++) cin >>c[i]>>d[i];
  
  vector<vector<long>> e(100,vector<long>(100,);
  long f[100,1000000000];
  int g[100];
 
  for(int i=1; i<=n; i++){
   for(int j=1; j<=m; j++){
    e[i][j] = abs(a[i]-c[j])+abs(b[i]-d[j]);
     if(f[i] > e[i][j]) {
       f[i] = e[i][j];
       g[i] = j;
     }
   }
  }
  
 for(int i=1; i<=n; i++) cout << g[i] << endl;
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:42: error: expected primary-expression before '(' token
   12 |   vector<vector<long>> e(100,vector<long>(100,);
      |                                          ^
a.cc:12:47: error: expected primary-expression before ')' token
   12 |   vector<vector<long>> e(100,vector<long>(100,);
      |                                               ^
a.cc:13:13: error: expected ']' before ',' token
   13 |   long f[100,1000000000];
      |             ^
      |             ]
a.cc:13:14: error: expected unqualified-id before numeric constant
   13 |   long f[100,1000000000];
      |              ^~~~~~~~~~
a.cc:19:9: error: 'f' was not declared in this scope
   19 |      if(f[i] > e[i][j]) {
      |         ^
Language: C++

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

int main(){
  
  long n,m;
  cin >> n >> m;
  long a[100],b[100],c[100],d[100];
  for(int i=1; i<=n; i++) cin >>a[i]>>b[i];
  for(int i=1; i<=m; i++) cin >>c[i]>>d[i];
  
  vector<vector<long>> d(100,vector<long>(100,1000000000));
  long e[100],f[100];

  for(int i=1; i<=n; i++){
   for(int j=1; j<=m; j++){
    d[i][j] = abs(a[i]-c[i])+abs(b[i]-d[i]);
     if(e[i] > d[i][j]) {e[i]=d[i][j]; f[i] = j;}
   }
    for(int i=1; i<=n; i++) cout << f[i] << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: conflicting declaration 'std::vector<std::vector<long int> > d'
   12 |   vector<vector<long>> d(100,vector<long>(100,1000000000));
      |                        ^
a.cc:8:29: note: previous declaration as 'long int d [100]'
    8 |   long a[100],b[100],c[100],d[100];
      |                             ^
a.cc:17:9: error: invalid types 'long int[int]' for array subscript
   17 |     d[i][j] = abs(a[i]-c[i])+abs(b[i]-d[i]);
      |         ^
a.cc:18:20: error: invalid types 'long int[int]' for array subscript
   18 |      if(e[i] > d[i][j]) {e[i]=d[i][j]; f[i] = j;}
      |                    ^
a.cc:18:35: error: invalid types 'long int[int]' for array subscript
   18 |      if(e[i] > d[i][j]) {e[i]=d[i][j]; f[i] = j;}
      |                                   ^
Language: C++

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

int main(){

  long n, m;
  cin >> n >> m;
  long a[n], b[n];
  for(int i=0; i<n; i++) cin >> a[i] >> b[i];
  long c[n], d[n];
  for(int i=0; i<n; i++) cin >> c[i] >> d[i];
  
  long e[n][m];
  long t[n, 1000000000];
  
  for(int i=0; i<n; i++){
  	for(int j=0; j<m; j++){
    	e[i][j] = abs(a[i]-c[i]) + abs(b[i]-d[i]);
      	t[i] = min(t[i],e[i][j]);
    }
  }
  for(int i=0; i<n; i++) cout << t[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ']' before ',' token
   14 |   long t[n, 1000000000];
      |           ^
      |           ]
a.cc:14:13: error: expected unqualified-id before numeric constant
   14 |   long t[n, 1000000000];
      |             ^~~~~~~~~~
a.cc:19:9: error: 't' was not declared in this scope
   19 |         t[i] = min(t[i],e[i][j]);
      |         ^
a.cc:22:34: error: 't' was not declared in this scope
   22 |   for(int i=0; i<n; i++) cout << t[i] << endl;
      |                                  ^
Language: C++

#include<bits/stdc++.h>

typedef long long ll;

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,l,n) for(int i=(l);i<=(n);i++)

template<class T>
using vt = vector<T>;
template<class T>
using vvt = vector<vector<T>>;
template<class T>
using P = pair<int,int>

int main(){
    int N,M;
    cin >> N >> M;
    vector<P> student(N);
    vector<P> check(M);
    rep(i,N) cin >> student[i].first >> student[i].second;
    rep(i,M) cin >> check[i].first >> check[i].second;
    rep(i,N){
        int min = abs(student[0].first-check[0].first)+abs(student[0].second-check[0].first);
        rep(i,M){
            if(min > abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first)){
                min = abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first);
            }
        }
        cout << min << endl;
    }
    return 0;
}


Compiler output:
a.cc:15:11: error: two or more data types in declaration of 'type name'
   15 | using P = pair<int,int>
      |           ^~~~~~~~~~~~~
Language: C++

//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <iomanip>
#include<cmath>

using namespace std;

#define FAST       			ios_base :: sync_with_stdio(false); cin.tie(NULL); 
#define endl "\n"

typedef long long int  ll;
pair<int,int> first[51];
pair<int,int> second[51];

int dis(int i , int j)
{
    return abs(first[i].first-second[j].first) + abs(first[i].second-second[j].second);
}

int main()
{
	FAST;
	int n,m;
	cin >> n >> m;

	
	for(int i=0 ; i<n ; i++)
		cin >> first[i].first >> first[i].second;

	for(int j=0 ; j<m ; j++)
		cin >> second[j].first >> second[j].second;
	
	for(int i=0 ; i<n ; i++)
	{
		int minIndex = -1;
		for(int j=0 ; j<m ; j++)
		{
		    if(minIndex < 0 || dis(i ,j) < dis(i , minIndex))
		        minIndex = j;
		}

		cout << minIndex+1 << "\n";
	}


	return 0;

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

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define cy cout << "Yes" << endl
#define cn cout << "No" << endl
typedef long long ll;

void Main()
{
	ll N, M;
  	cin >> N >> M;
  	vector<ll> a(N), b(N);
	rep(i,N){
    	cin >> a[i] >> b[i];
    }
  	vector<ll> c(M), d(M);
	rep(i,M){
    	cin >> c[i] >> d[i];
    }

  	auto distance = [&](ll x1, ll y1, ll x2, ll y2){
	 	ll ans = abs(x1-x2)+abs(y1-y2);   	
		return ans;    
    }
  	  
	ll tempmax;
  	rep(i,N){
      	tempmax = 0;
		rep(j,M){
      		tempmax = max(tempmax, distance(a[i],b[i],c[j],d[j]));
        }
    	cout << tempmax << endl;
    }  
  
    return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define cy cout << "Yes" << endl
#define cn cout << "No" << endl
typedef long long ll;

void Main()
{
	ll N, M;
  	cin >> N >> M;
  	vector<ll> a(N), b(N);
	rep(i,N){
    	cin >> a[i] >> b[i];
    }
  	vector<ll> c(M), d(M);
	rep(i,M){
    	cin >> c[i] >> d[i];
    }

  	auto distance = [&](ll x1, ll y1, ll x2, ll y2){
	 	ll ans = abs(x1-x2)+abs(y1-y2);   	
		return ans;    
    }
  	  
	ll tempmax = 0;
  	rep(i,N){
		rep(j,M){
      		tempmax = max(tempmax, distance(a[i],b[i],c[j],d[j]));
        }
    	cout << tempmax << endl;
    }  
  
    return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

int main() {

  int n, m, x1[55], y1[55], x2[55], y2[55], res[55], menor = 100000, k;

  scanf("%d%d", &n, &m);

  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x1[i], &y1[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x2[i], &y2[i]);
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      res[j] = abs(x1[i]-x2[j]) + abs(y1[i]-y2[j]);
    }
    for (int j = 0; j < m; j++) {
      if(res[j] < menor){
        menor = res[j];
        k = j+1;
      }
    }
    printf("%d\n", k);
    menor = 100000;
  }

Compiler output:
main.c: In function 'main':
main.c:30:3: error: expected declaration or statement at end of input
   30 |   }
      |   ^