Language: C++

#include<bits/stdc++.h>

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

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>>;

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:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:19:12: error: 'P' was not declared in this scope
   19 |     vector<P> student(N);
      |            ^
a.cc:19:13: error: template argument 1 is invalid
   19 |     vector<P> student(N);
      |             ^
a.cc:19:13: error: template argument 2 is invalid
a.cc:20:13: error: template argument 2 is invalid
   20 |     vector<P> check(M);
      |             ^
a.cc:21:28: error: invalid types 'int[int]' for array subscript
   21 |     rep(i,N) cin >> student[i].first >> student[i].second;
      |                            ^
a.cc:21:48: error: invalid types 'int[int]' for array subscript
   21 |     rep(i,N) cin >> student[i].first >> student[i].second;
      |                                                ^
a.cc:22:26: error: invalid types 'int[int]' for array subscript
   22 |     rep(i,M) cin >> check[i].first >> check[i].second;
      |                          ^
a.cc:22:44: error: invalid types 'int[int]' for array subscript
   22 |     rep(i,M) cin >> check[i].first >> check[i].second;
      |                                            ^
a.cc:24:30: error: invalid types 'int[int]' for array subscript
   24 |         int min = abs(student[0].first-check[0].first)+abs(student[0].second-check[0].first);
      |                              ^
a.cc:24:45: error: invalid types 'int[int]' for array subscript
   24 |         int min = abs(student[0].first-check[0].first)+abs(student[0].second-check[0].first);
      |                                             ^
a.cc:24:67: error: invalid types 'int[int]' for array subscript
   24 |         int min = abs(student[0].first-check[0].first)+abs(student[0].second-check[0].first);
      |                                                                   ^
a.cc:24:83: error: invalid types 'int[int]' for array subscript
   24 |         int min = abs(student[0].first-check[0].first)+abs(student[0].second-check[0].first);
      |                                                                                   ^
a.cc:26:33: error: invalid types 'int[int]' for array subscript
   26 |             if(min > abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first)){
      |                                 ^
a.cc:26:48: error: invalid types 'int[int]' for array subscript
   26 |             if(min > abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first)){
      |                                                ^
a.cc:26:70: error: invalid types 'int[int]' for array subscript
   26 |             if(min > abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first)){
      |                                                                      ^
a.cc:26:86: error: invalid types 'int[int]' for array subscript
   26 |             if(min > abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first)){
      |                                                                                      ^
a.cc:27:34: error: invalid types 'int[int]' for array subscript
   27 |                 min = abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first);
      |                                  ^
a.cc:27:49: error: invalid types 'int[int]' for array subscript
   27 |                 min = abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first);
      |                                                 ^
a.cc:27:71: error: invalid types 'int[int]' for array subscript
   27 |                 min = abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first);
      |                                                                       ^
a.cc:27:87: error: invalid types 'int[int]' for array subscript
   27 |                 min = abs(student[i].first-check[i].first)+abs(student[i].second-check[i].first);
      |                                                                                       ^