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

#include<stdio.h>

int degits(long long a){
	if(a<10) return 1;
	return 1+degit(a/10);
}

int F(long long a,long long b){
	int ad,bd;
	ad=degits(a);
	bd=degits(b);
	return ((ad>bd)?ad:bd);
}

int main(int argc, char const *argv[]){
	long long n,i;
	int min;
	scanf("%lld",&n);
	min=degits(n);
	for(i=2;i*i<=n;i++){
		if(n%i==0){
			min=(F(i,n/i)<min)?F(i,n/i):min;
		}
	}
	printf("%d",min)
	return 0;
}

Compiler output:
main.c: In function 'degits':
main.c:5:18: error: implicit declaration of function 'degit'; did you mean 'degits'? [-Wimplicit-function-declaration]
    5 |         return 1+degit(a/10);
      |                  ^~~~~
      |                  degits
main.c: In function 'main':
main.c:25:25: error: expected ';' before 'return'
   25 |         printf("%d",min)
      |                         ^
      |                         ;
   26 |         return 0;
      |         ~~~~~~
Language: Java

import java.util.*;
class Main{
    public static void main(String[]args){
        Scanner cin=new Scanner(System.in);
        int result;

            int nowT=Integer.paseInt(cin.next());
            int addT=Integer.paseInt(cin.next());

            if(nowT+addT>23){
                result = nowT+addT-24;
            }else{
                result = nowT+addT;
            }
            System.out.println(result);
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
            int nowT=Integer.paseInt(cin.next());
                            ^
  symbol:   method paseInt(String)
  location: class Integer
Main.java:8: error: cannot find symbol
            int addT=Integer.paseInt(cin.next());
                            ^
  symbol:   method paseInt(String)
  location: class Integer
2 errors
Language: Java

import java.util.*;
class Main{
    public static void main(String[]args){
        Scanner cin=new Scanner(System.in);
        int result;

            int nowT=Integer.paserInt(cin.next());
            int addT=Integer.paserInt(cin.next());

            if(nowT+addT>23){
                result = nowT+addT-24;
            }else{
                result = nowT+addT;
            }
            System.out.println(result);
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
            int nowT=Integer.paserInt(cin.next());
                            ^
  symbol:   method paserInt(String)
  location: class Integer
Main.java:8: error: cannot find symbol
            int addT=Integer.paserInt(cin.next());
                            ^
  symbol:   method paserInt(String)
  location: class Integer
2 errors
Language: C++

#include<iostream>
 
int main(){
int a,b;
 
cin>>a>>b;
a=a+b;
if(a>23)a=a%24;
 
cout<<a<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<<a<<"\n";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
 
int main(){
int a,b;
 
cin>>a>>b;
a=a+b;
if(a>=24)a=a%24;
 
cout<<a<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<<a<<"\n";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;
class Main{
    public static void main(String[]args){
        Scanner cin=new Scanner(System.in);
        int nowT;
        int addT;
        int result;
            nowT=Integer.paserInt(cin.next());
            addT=Integer.paserInt(cin.next());

            if(nowT+addT>23){
                result = nowT+addT-24;
            }else{
                result = nowT+addT;
            }
            System.out.println(result);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
            nowT=Integer.paserInt(cin.next());
                        ^
  symbol:   method paserInt(String)
  location: class Integer
Main.java:9: error: cannot find symbol
            addT=Integer.paserInt(cin.next());
                        ^
  symbol:   method paserInt(String)
  location: class Integer
2 errors
Language: C++

#include<iostream>

int main(){
int a,b;

cin>>a>>b;
a=a+b;
if(a>24)a=a%24;

cout<<a<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<<a<<"\n";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;

public class Q1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] input = scanner.nextLine().trim().split(" ");
        int a = Integer.parseInt(input[0]);
        int b = Integer.parseInt(input[1]);
        System.out.println((a + b) % 24);
    }
}

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

#include <iostream>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    cout<<(a+b)%24
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected ';' before '}' token
    6 |     cout<<(a+b)%24
      |                   ^
      |                   ;
    7 | }
      | ~
Language: Java


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

public class TestClass {

	static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s[] = in.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		out.println((a+b)%24);
		out.close();
	}

}


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


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

int main()
{
  // freopen("in.txt","r",stdin); 
   int a, b;
   while (~scanf("%d%d", &a, &b))
   {
     a += b;
     a %= 24
     printf("%d\n", a);
   }
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected ';' before 'printf'
   12 |      a %= 24
      |             ^
      |             ;
   13 |      printf("%d\n", a);
      |      ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
  a += b;
  if (a >= 24) {
    a -= 24;
  }
  cout << a << endl;
}

Compiler output:
a.cc:3:1: error: extended character   is not valid in an identifier
    3 |  
      | ^
a.cc:3:1: error: '\U000000a0' does not name a type
    3 |  
      | ^
Language: C++

#include <iostream>
using namespace std;
int a. b;
int main() {
  cin >> a >> b;
  cout << (a + b) % 24;
  return 0;
}

Compiler output:
a.cc:3:6: error: expected initializer before '.' token
    3 | int a. b;
      |      ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |   cin >> a >> b;
      |          ^
a.cc:5:15: error: 'b' was not declared in this scope
    5 |   cin >> a >> b;
      |               ^
Language: C++

#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (a + b <= 23) cout << a + b << endl;
	else cout << a + b - 24 << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>

int main() {
  int A, B;
  scanf("%d %d%*c", &A, &B);
  printf("%d\n", (A + B) % 24;
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:30: error: expected ')' before ';' token
   10 |   printf("%d\n", (A + B) % 24;
      |         ~                    ^
      |                              )
main.c:11:12: error: expected ';' before '}' token
   11 |   return 0;
      |            ^
      |            ;
   12 | }
      | ~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (a + b <= 23) cout << a + b << endl;
	else cout << a + b - 24 << endl;;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
int main(){
 int a,b;cin>>a>>b>>;
 cout<<(a+b)%24<<endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:21: error: expected primary-expression before ';' token
    4 |  int a,b;cin>>a>>b>>;
      |                     ^
Language: C++

$include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define R(i,a,n) for(int i=a;i<n;i++)
int main(){
  int n,a,b;
  string s;
  cin>>a>>b;
  a+=b;
  if(a>23)a-=23;
  cout<<a<<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:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>a>>b;
      |   ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout<<a<<endl;
      |   ^~~~
a.cc:11:12: error: 'endl' was not declared in this scope
   11 |   cout<<a<<endl;
      |            ^~~~
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <chrono>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T>inline bool chmax(T &a, T b){return (a < b ? a = b, true : false);}
template<typename T>inline bool chmin(T &a, T b){return (a > b ? a = b, true : false);}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const long double EPS = 1e-9;

int main() {
	int a, b;
	cin >> a > >b;
	cout << (a + b) % 24 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:20: error: expected primary-expression before '>' token
   67 |         cin >> a > >b;
      |                    ^
Language: C++

signed main()
{
    //入力の高速化用のコード
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);

    ll n, m;
    cin >> n >> m;
    ll a[n], b[n], c[m], d[m];
    rep(i, n)
    {
        cin >> a[i] >> b[i];
    }
    rep(i, m)
    {
        cin >> c[i] >> d[i];
    }
    ll dif_min;
    ll count;
    rep(i, n)
    {
        dif_min = MOD;
        count=-1;
        rep(j, m)
        {
            if (dif_min > abs(a[i] - c[j]) + abs(b[i] - d[j]))
            {
                count = j + 1;
                dif_min =abs(a[i] - c[j]) + abs(b[i] - d[j]);
            }
        }
        cout << count << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll n, m;
      |     ^~
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> n >> m;
      |     ^~~
a.cc:8:12: error: 'n' was not declared in this scope
    8 |     cin >> n >> m;
      |            ^
a.cc:8:17: error: 'm' was not declared in this scope
    8 |     cin >> n >> m;
      |                 ^
a.cc:9:7: error: expected ';' before 'a'
    9 |     ll a[n], b[n], c[m], d[m];
      |       ^~
      |       ;
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     rep(i, n)
      |         ^
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i, n)
      |     ^~~
a.cc:18:7: error: expected ';' before 'dif_min'
   18 |     ll dif_min;
      |       ^~~~~~~~
      |       ;
a.cc:19:7: error: expected ';' before 'count'
   19 |     ll count;
      |       ^~~~~~
      |       ;
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int m = scn.nextInt();
		int[][] a = new int[n][2];
		for(int i=0; i<n; i++){
          for(int j=0; j<2; j++){
			a[i][j] = scn.nextInt();
          }
		}
      	int[][] c = new int[m][2];
		for(int i=0; i<m; i++){
          for(int j=0; j<2; j++){
			c[i][j] = scn.nextInt();
          }
		}
      	for(int i=0; i<n; i++) {
    		int min = Math.pow(10, 8);
    		int min2 = 0;
    		for(int j=0; j<m; j++) {
      			int x =  Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
      			if(x<min) {
        			min = x;
        			min2 = j;
      			}
    		}
    		System.out.println(min2 + 1);
        }
	}
}


Compiler output:
Main.java:21: error: incompatible types: possible lossy conversion from double to int
    		int min = Math.pow(10, 8);
    		                  ^
1 error
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int m = scn.nextInt();
		int[][] a = new int[n][2];
		for(int i=0; i<n; i++){
          for(int j=0; j<2; j++){
			a[i][j] = scn.nextInt();
          }
		}
      	int[] c = new int[m][2];
		for(int i=0; i<m; i++){
          for(int j=0; j<2; j++){
			c[i][j] = scn.nextInt();
          }
		}
      	for(int i=0; i<n; i++) {
    		int min = Math.pow(10, 8);
    		int min2 = 0;
    		for(int j=0; j<m; j++) {
      			int x =  Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
      			if(x<min) {
        			min = x;
        			min2 = j;
      			}
    		}
    		System.out.println(min2 + 1);
        }
	}
}


Compiler output:
Main.java:14: error: incompatible types: int[][] cannot be converted to int[]
      	int[] c = new int[m][2];
      	          ^
Main.java:17: error: array required, but int found
			c[i][j] = scn.nextInt();
			    ^
Main.java:21: error: incompatible types: possible lossy conversion from double to int
    		int min = Math.pow(10, 8);
    		                  ^
Main.java:24: error: array required, but int found
      			int x =  Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
      			                              ^
Main.java:24: error: array required, but int found
      			int x =  Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
      			                                                        ^
5 errors
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	int m = scn.nextInt();
		int[][] a = new int[n][2];
		for(int i=0; i<n; i++){
          for(int j=0; j<2; j++){
			a[i][j] = scn.nextInt();
          }
		}
      	int[] c = new int[m][2];
		for(int i=0; i<m; i++){
          for(int j=0; j<2; j++){
			c[i][j] = scn.nextInt();
          }
		}
      	for(int i=0; i<n; i++) {
    		int min = Math.pow(10, 8);
    		int min2 = 0;
    		for(int j=0; j<m; j++) {
      		int x =  Math.abs(a[i][0]-c[j][0])+Math.abs(a[i][1]-c[j][1]);
      		if(x<min) {
        		min = x;
        		min2 = j;
      		}
    	}
    	System.out.println(min2 + 1);
	}
}

Compiler output:
Main.java:32: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: expected '}' at end of input
   21 |     cout << check << endl;
      |                           ^
a.cc:11:25: note: to match this '{'
   11 |   for(int i=0; i<N; i++){
      |                         ^
a.cc:21:27: error: expected '}' at end of input
   21 |     cout << check << endl;
      |                           ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

int man(int x1, int x2, int y1, int y2) {
  return abs(x1-x2)+abs(y1-y2);
}

void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<int,int>> 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) {
    int min=100, d, ans=0;
    for(int j=0; j<n; ++j) {
      d = man(a.at(i).first, b.at(j).first, a.at(i).second, b.at(j).second);
      if(min>d) {
#include <bits/stdc++.h>
using namespace std;

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

int man(int x1, int x2, int y1, int y2) {
  return abs(x1-x2)+abs(y1-y2);
}

void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<int,int>> 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) {
    int min=100, d, ans=0;
    for(int j=0; j<m; ++j) {
      d = man(a.at(i).first, b.at(j).first, a.at(i).second, b.at(j).second);
      if(min>d) {
        min=d; ans=j+1;
      }
    }
    cout << ans << endl;
  }

  return;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}
        min=d; ans=j+1;
      }
    }
    cout << ans << endl;
  }

  return;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:29:1: error: a template declaration cannot appear at block scope
   29 | template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
      | ^~~~~~~~
a.cc:35:14: error: a function-definition is not allowed here before '{' token
   35 | void solve() {
      |              ^
a.cc:56:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   56 | signed main() {
      |            ^~
a.cc:56:12: note: remove parentheses to default-initialize a variable
   56 | signed main() {
      |            ^~
      |            --
a.cc:56:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:56:15: error: a function-definition is not allowed here before '{' token
   56 | signed main() {
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N,M;
  cin>>N>>M;
 vector<vector<ll>> A(2,vector<ll>(N));
  for(ll i=0;i<N;i++) {
cin>>vec[0][i]>>vec[1][i];
  }
  vector<vector<ll>> B(2,vector<ll>(M));
  for(ll i=0;i<M;i++) {
cin>>B[0][i]>>B[1][i];
  }
  
  for(ll i=0;i<N;i++) {
    ll place;
    ll L=10000000000;
    
for(ll j=0;j<M;j++) {
  if(L>abs(A[0][i]-B[0][j])+abs(A[1][i]-B[1][j]) {
place=j+1;
    L=abs(A[0][i]-B[0][j])+abs(A[1][i]-B[1][j];
                               }
                               }
cout<<place<<endl;
                               }
                               }

  
  
  
  
  
  
  
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'vec' was not declared in this scope
   11 | cin>>vec[0][i]>>vec[1][i];
      |      ^~~
a.cc:23:49: error: expected ')' before '{' token
   23 |   if(L>abs(A[0][i]-B[0][j])+abs(A[1][i]-B[1][j]) {
      |     ~                                           ^~
      |                                                 )
a.cc:27:32: error: expected primary-expression before '}' token
   27 |                                }
      |                                ^
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[i] >> B[i] ;
  }
   vector<int> C(N) ;
  vector <int> D(N) ;
    for ( int i=0 ; i<M ; i++){
    cin >> C[i] >> D[i] ;
  }
  vector<int> p(N) ;
  vector<int> md(N,2000000000) ;
  
    for ( int i=0 ; i<N ; i++){
    for ( int j=0 ; j<M ; j++){
   if (md[i]>abs(C[j]-A[i])+abs(D[j]-B[i])){
     p[i]=j ;
     md[i]=abs(C[j]-A[i])+abs(D[j]-B[i])  ;
   }
    }  
  }
 cout << p[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: 'i' was not declared in this scope
   28 |  cout << p[i] << endl;
      |            ^
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[i] >> B[i] ;
  }
   vector<int> C(N) ;
  vector <int> D(N) ;
    for ( int i=0 ; i<M ; i++){
    cin >> C[i] >> D[i] ;
  }
  vector<int> p(N) ;
  vector<int> md(N,2000000000) ;
  
    for ( int i=0 ; i<N ; i++){
    for ( int j=0 ; j<M ; j++){
   if (md[i]>abs(C[j]-A[i])+abs(D[j]-B[i])){
     p[i]=j ;
     md[i]=abs(C[j]-A[i])+abs(D[j]-B[i]  ;
   }
    }  
  }
 cout << p[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:40: error: expected ')' before ';' token
   24 |      md[i]=abs(C[j]-A[i])+abs(D[j]-B[i]  ;
      |                              ~         ^ ~
      |                                        )
a.cc:28:12: error: 'i' was not declared in this scope
   28 |  cout << p[i] << endl;
      |            ^
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[i] >> B[i] ;
  }
   vector<int> C(N) ;
  vector <int> D(N) ;
    for ( int i=0 ; i<M ; i++){
    cin >> C[i] >> D[i] ;
  }
  vector<int> p(N) ;
  vector<int> md(N,2000000000) ;
  
    for ( int i=0 ; i<N ; i++){
    for ( int j=0 ; j<M ; j++){
   if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
     p(i)=j ;
     md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
   }
    }  
  }
 cout << p(i) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |        ~~^~~
a.cc:22:19: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                  ~^~~
a.cc:22:24: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                       ~^~~
a.cc:22:34: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                                 ~^~~
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                                      ~^~~
a.cc:23:7: error: no match for call to '(std::vector<int>) (int&)'
   23 |      p(i)=j ;
      |      ~^~~
a.cc:24:8: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |      ~~^~~
a.cc:24:17: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                ~^~~
a.cc:24:22: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                     ~^~~
a.cc:24:32: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                               ~^~~
a.cc:24:37: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                                    ~^~~
a.cc:28:12: error: 'i' was not declared in this scope
   28 |  cout << p(i) << endl;
      |            ^
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[i] >> B[i] ;
  }
   vector<int> C(N) ;
  vector <int> D(N) ;
    for ( int i=0 ; i<M ; i++){
    cin >> C[i] >> D[i] ;
  }
  vector<int> p(N) ;
  vector<int> md(N,2000000000) ;
  
    for ( int i=0 ; i<N ; i++){
    for ( int j=0 ; j<M ; j++){
   if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
     p(i)=j ;
     md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
   }
    }  
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |        ~~^~~
a.cc:22:19: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                  ~^~~
a.cc:22:24: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                       ~^~~
a.cc:22:34: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                                 ~^~~
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |    if (md(i)>abs(C(j)-A(i))+abs(D(j)-B(i))){
      |                                      ~^~~
a.cc:23:7: error: no match for call to '(std::vector<int>) (int&)'
   23 |      p(i)=j ;
      |      ~^~~
a.cc:24:8: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |      ~~^~~
a.cc:24:17: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                ~^~~
a.cc:24:22: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                     ~^~~
a.cc:24:32: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                               ~^~~
a.cc:24:37: error: no match for call to '(std::vector<int>) (int&)'
   24 |      md(i)=abs(C(j)-A(i))+abs(D(j)-B(i)  ;
      |                                    ~^~~
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
  int a[n][2], c[m][2];
  int i, j;
  for(i=0; i<n; i++){
    cin >> a[i][0] >> a[i][1];
  }
  for(i=0; i<m; i++){
    cin >> c[i][0] >> c[i][1];
  }
  
  int dist[n][m];
  int minDistIndex[n];
  for(i=0; i<n; i++){
    for(j=0; j<m; j++){
      dist[i][j] = abs(a[i][0]-c[j][0]) + abs(a[i][1]-c[j][1])
    }
  }
  
  for(i=0; i<n; i++){
    int minDist = INT_MAX;
    for(j=0; j<m; j++){
      if(minDist > dist[i][j]){
        minDist = dist[i][j];
        minDistIndex[i] = j;
      } 
      cout << minDistIndex[i]+1 << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:20:63: error: expected ';' before '}' token
   20 |       dist[i][j] = abs(a[i][0]-c[j][0]) + abs(a[i][1]-c[j][1])
      |                                                               ^
      |                                                               ;
   21 |     }
      |     ~                                                          
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:24:21: note: to match this '{'
   24 |   for(i=0; i<n; i++){
      |                     ^
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <math.h>
#include <algorithm>
using namespace std;

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

  for (int i=0; i<n; i++) {
    long long min_dist = LONG_LONG_MAX;
    int ans;
    for (int j=0; j<m; j++) {
      long long dist = abs(a[i]-c[j]) + abs(b[i]-d[j]);
      if (dist < min_dist) {
        min_dist = dist;
        ans = j+1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: 'LONG_LONG_MAX' was not declared in this scope
   24 |     long long min_dist = LONG_LONG_MAX;
      |                          ^~~~~~~~~~~~~
Language: C++

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

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

  for (int i=0; i<n; i++) {
    long long min_dist = LONG_LONG_MAX;
    int ans;
    for (int j=0; j<m; j++) {
      long long dist = abs(a[i]-c[j]) + abs(b[i]-d[j]);
      if (dist < min_dist) {
        min_dist = dist;
        ans = j+1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: 'LONG_LONG_MAX' was not declared in this scope
   23 |     long long min_dist = LONG_LONG_MAX;
      |                          ^~~~~~~~~~~~~
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<pair<int,int>> a(n);
  vector<pair<int,int>> b(m);
  for ( int i=0; i<n; i++ ) cin >> a[i].first >> a[i].second;
  for ( int i=0; i<m; i++ ) cin >> b[i].first >> b[i].second;
  for ( int i=0; i<n; i++ ) {
    int ans=0,mi=1e9;
    for ( int j=0; j<m; j++ ) {
      int x=abs(a[i].first-b[i].first)+abs(a[i].second-b[i].second);
      if ( mi>x ) {
        mi=x;
        ans=j;
      }
      cout << j+1 << '\n';
  }
  return 0;
}

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

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
    ll n,m;
    cin >> n>>m;
    vector<pair<ll,ll>> student(n);
    vector<pair<ll,ll>> check(m);
    rep(i,0,n){
        cin >> student[i].first;
        cin >> student[i].second;
    }
    rep(i,0,m){
        cin>>check[i].first;
        cin>>check[i].second;
    }
    vector<int> ans(n);
    rep(i,0,n){
        int k = 1000;
        rep(j,0,m){
            ll now = abs(student[i].first-check[j].first)+abs(student[i].second-check[j].second);
            if(now<k){
                k = min(now,k);
                ans[i]=j;
                
            }
        }
    }
    rep(i,0,n){
        cout<<ans[i]+1<<endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:24: error: no matching function for call to 'min(ll&, int&)'
   28 |                 k = min(now,k);
      |                     ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:28:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   28 |                 k = min(now,k);
      |                     ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:28:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                 k = min(now,k);
      |                     ~~~^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <deque>
#include <queue>//for queue and priority_queue
#include <fstream>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <set>
#include <map>
#include <list>
#define endl "\n"
typedef long long ll;
using namespace std;
void Lancer() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
bool isPrime(ll n){
	if (n == 2 || n == 3 || n == 5)
		return true;
	else if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n == 1)
		return false;
	else {
		for (int i = 5; i <= sqrt(n); i += 2){
			if (n%i == 0)
				return false;
		}
		return true;
	}
}

int stud[57][2], pnt[57][2],frq[57];
int main(){
	Lancer();
	ll n, m, res = LLONG_MAX, dis,indx=0;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> stud[i][0] >> stud[i][1];
	for (int i = 0; i < m; i++)
		cin >> pnt[i][0] >> pnt[i][1];

	for (int i = 0; i < n; i++){
		res = LLONG_MAX;
		for (int j = 0; j < m; j++){
			if (!frq[j]){
				dis = abs(stud[i][0] - pnt[j][0]) + abs(stud[i][1] - pnt[j][1]);
				if (dis < res){
					indx = j + 1;
					res = dis;
				}
			}
		}
		frq[indx - 1] = 1;
		cout << indx << endl;
	}
	//cout << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:24: error: 'LLONG_MAX' was not declared in this scope
   35 |         ll n, m, res = LLONG_MAX, dis,indx=0;
      |                        ^~~~~~~~~
a.cc:14:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include <list>
  +++ |+#include <climits>
   14 | #define endl "\n"
a.cc:46:33: error: 'dis' was not declared in this scope; did you mean 'div'?
   46 |                                 dis = abs(stud[i][0] - pnt[j][0]) + abs(stud[i][1] - pnt[j][1]);
      |                                 ^~~
      |                                 div
a.cc:48:41: error: 'indx' was not declared in this scope
   48 |                                         indx = j + 1;
      |                                         ^~~~
a.cc:53:21: error: 'indx' was not declared in this scope
   53 |                 frq[indx - 1] = 1;
      |                     ^~~~
Language: C++

#inlude<bits/stdc++.h>
using namespace std;
int dis(int a, int b) {
  return max(a - b, b - a);
}
int main () {
  int N, M;
  cin >> N >> M;
  int sx[100];
  int sy[100];
  int cx[100];
  int cy[100];
  for (int i = 0; i < N; i ++) cin >> sx[i] >> sy[i];
  for (int i = 0; i < M; i ++) cin >> cx[i] >> cy[i];
  for (int i = 0; i < N; i ++) {
    int ans = 0;
    int mdi = 1e9 + 5;
    for (int j = M - 1; j >= 0; j --) {
      if (mdi >= (dis(sx[i], cx[j]) + dis(sy[i], cy[j]))) {
        ans = j + 1;
        mdi = dis(sx[i], cx[j]) + dis(sy[i], cy[j]);
      }
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int dis(int, int)':
a.cc:4:10: error: 'max' was not declared in this scope
    4 |   return max(a - b, b - a);
      |          ^~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   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 | #inlude<bits/stdc++.h>
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout << ans << endl;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:20: error: 'endl' was not declared in this scope
   24 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlude<bits/stdc++.h>
Language: C

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,m,gakusei[51][3],point[51][3],s,t=200000001,num,i,j;

	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++)
		for(j=0;j<2;j++)
			scanf("%d",&gakusei[i][j]);
	for(i=0;i<m;i++)
		for(j=0;j<2;j++)
			scanf("%d",&point[i][j]);

	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			s=abs(gakusei[i][0]-point[j][0])+abs(gakusei[i][1]-point[j][1]);
			if(t>s){
				t=s;
				num=j;
			}
		}
		printf("%d\n",u+1);
		t=200000001;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:31: error: 'u' undeclared (first use in this function)
   23 |                 printf("%d\n",u+1);
      |                               ^
main.c:23:31: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,m,gakusei[51][3],point[51][3],s,t=200000001,num,i,j;

	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++)
		for(j=0;j<2;j++)
			scanf("%d",&gakusei[i][j]);
	for(i=0;i<m;i++)
		for(j=0;j<2;j++)
			scanf("%d",&point[i][j]);

	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			s=abs(gakusei[i][0]-point[j][0])+abs(gakusei[i][1]-point[j][1]);
			if(t>s){
				t=s;
				u=j;
			}
		}
		printf("%d\n",u+1);
		t=200000001;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:33: error: 'u' undeclared (first use in this function)
   20 |                                 u=j;
      |                                 ^
main.c:20:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

using namespace std;

typedef long long ll ;
typedef double db;
typedef vector<ll> vi;
typedef pair<int,int> pii;
typedef vector< pair<int,int> > vii;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define mp			make_pair
#define fi			 first
#define se			 second
#define for0(i,n)        for(ll i=0;i<n;i++)
#define for1(i,n)        for(ll i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)    cout<<"Case "<<z<<": "<<x<<"\n"
int main()
{
	ll n,m;
	cin>>n>>m;
	vi a(n),b(n),c(n),d(n);
	for0(i,n)cin>>a[i]>>b[i];
	for0(i,m)cin>>c[i]>>d[i]; 
	
	for0(i,n){
		ll x,pos,mn =INT_MAX;
		for0(j,m){
			x = abs(a[i]-c[j]) + abs(b[i]-d[j]);
			if(x<mn){
				mn = x;
				pos=j;
				}
			}
		cout<<pos+1<<nw;
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:30: error: 'INT_MAX' was not declared in this scope
   48 |                 ll x,pos,mn =INT_MAX;
      |                              ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <iomanip>
  +++ |+#include <climits>
   15 |
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(n);
  vector<int>d(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 mn=100000000;
    int cou=0;
    for(int j=0;j<m;j++){
      if(mn>abs(a[i]-c[j])+abs(b[i]-d[j])){
        mn=abs(a[i]-c[j])+abs(b[i]-d[j]);
        cou=j;
    }
    cout<<cou<<endl;
  }
}
  
      


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

import java.util.*;

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


Compiler output:
Main.java:9: error: cannot find symbol
    long min=Infinity;
             ^
  symbol:   variable Infinity
  location: class Main
1 error
Language: Java

import java.util.*;

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


Compiler output:
Main.java:9: error: integer number too large
    long min=10000000000;
             ^
1 error
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n , m;
    cin >> n >> m;
    ll a[n][n] , b[m][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++ ) {
        ll x = abs( a[i][0] - b[0][0] ) + abs( a[i][1] - b[0][1] ) , y = 1;
        for (int j = 0 ; j < m - 1 ; j++ ) {
            if ( x > abs( a[i][0] - b[j + 1][0] ) + abs( a[i][1] - b[j + 1][1] ) ) {
                y = j + 2;
                x = abs( a[i][0] - b[j + 1][0] ) + abs( a[i][1] - b[j + 1][1] );
            }
        }
        cout << y << endl;
    }

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

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

int absolute_value(int n){
  if(n >= 0) return n;
  if(n < 0) return -n;
}

int main(){
  int N,M;
  cin >> N >> M;
  vector<vector<int>> student(N, vector<int>(2));
  vector<vector<int>> check_point(N, vector<int>(2));
  rep(i, N){
    cin >> student[i][0] >> student[i][1];
  }
  rep(i, M){
    cin >> check_point[i][0] >>check_point[i][1];
  }
  
  rep(i, N){    
    int min_d = 0;
    int P;
    rep(j, M){     
      int d;
      d = absolute_value(student[i][0]-check_point[j][0]) + absolute_value(student[i][1]-check_point[j][1]);
      if(d < min_d){
        min_d = d;
        P = i+1
      }
    }
    cout << P << endl;
  }
}
      
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: expected ';' before '}' token
   30 |         P = i+1
      |                ^
      |                ;
   31 |       }
      |       ~         
a.cc: In function 'int absolute_value(int)':
a.cc:8:1: warning: control reaches end of non-void function [-Wreturn-type]
    8 | }
      | ^