Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
//V,Pは大文字i,l,bは小文字
using ll = long long;
using Vi = vector<int>;
using VVi = vector<Vi>;
using Vl = vector<ll>;
using VVl = vector<Vl>;
using Vb = vector<bool>;
using VVb = vector<Vb>;
using P = pair<int,int>;
using Pll = pair<ll, ll>;
const ll mod = 1000000007;
const ll inf = 1000000000000;//10の12乗

int main() {
  int n,m;
  cin >> n >> m;
  ll mi=-1,mx=n;
  rep(i,n){
    int x,y;
    cin >> x >> y;
    chmax(mi,x);chmin(mx,y);
  }
  cout << mx-mi+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: no matching function for call to 'max(ll&, int&)'
    8 | #define chmax(x,y) x=max(x,y)
      |                      ~~~^~~~~
a.cc:34:5: note: in expansion of macro 'chmax'
   34 |     chmax(mi,x);chmin(mx,y);
      |     ^~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:8:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    8 | #define chmax(x,y) x=max(x,y)
      |                      ~~~^~~~~
a.cc:34:5: note: in expansion of macro 'chmax'
   34 |     chmax(mi,x);chmin(mx,y);
      |     ^~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:8:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    8 | #define chmax(x,y) x=max(x,y)
      |                      ~~~^~~~~
a.cc:34:5: note: in expansion of macro 'chmax'
   34 |     chmax(mi,x);chmin(mx,y);
      |     ^~~~~
a.cc:9:25: error: no matching function for call to 'min(ll&, int&)'
    9 | #define chmin(x,y) x=min(x,y)
      |                      ~~~^~~~~
a.cc:34:17: note: in expansion of macro 'chmin'
   34 |     chmax(mi,x);chmin(mx,y);
      |                 ^~~~~
/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:9:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 | #define chmin(x,y) x=min(x,y)
      |                      ~~~^~~~~
a.cc:34:17: note: in expansion of macro 'chmin'
   34 |     chmax(mi,x);chmin(mx,y);
      |                 ^~~~~
/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
/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:9:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 | #define chmin(x,y) x=min(x,y)
      |                      ~~~^~~~~
a.cc:34:17: note: in expansion of macro 'chmin'
   34 |     chmax(mi,x);chmin(mx,y);
      |                 ^~~~~