Language: C++

#include<bits/stdc++.h>
#define ffr(i,a,b) for(i=a;i<b;i++)
#define ffrr(i,a,b) for(i=a;i<=b;i++)
#define ll long long int
#define pf printf
#define mm(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define pii pair<ll,ll>
#define mp(a,b) make_pair(a,b)
#define mmxx 1e18

using namespace std;

int main()
{
    ll n, r, c, x, y, ilim, jlim, i, j;

    while(cin >> r >> c >> n)
    {
        map<pii,ll>mapp;
        mapp.clear();
        int mn[200005], lim[200005];
        ffrr(i,1,r)
        {
            mn[i]=c+1;
            lim[i]=1;
        }
        ffr(i,0,n)
        {
            cin >> x >> y;
            if(x<y) continue;
            mapp[mp(x,y)]=1;
            mn[x]=min(mn[x],y);
        }
        jlim=1;
        ilim=r+1;
        //cout << mapp[mp(3,2)] << endl;

        ffrr(i,2,r)
        {
            //cout << i << " i jlim " << jlim << endl;
            if(mapp.find(mp(i,jlim))!=mapp.end())
            {
                ilim=i;
                break;
            }
            if(mapp.find(mp(i,jlim+1))==mapp.end())
            {
                jlim++;
            }

            lim[i]=jlim;
        }

        ffrr(i,1,r) cout << mn[i] << " "; cout << "mn\n";
        ffrr(i,1,r) cout << lim[i] << " "; cout << "lim\n";
        cout << ilim << endl;

        ffr(i,1,ilim)
        {
            if(mn[i]==c+1) continue;
            if(mn[i]<lim[i])
            {
                //ans found
                break;
            }
        }
        cout << i-1 << endl;

    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:22: error: no matching function for call to 'min(int&, long long int&)'
   33 |             mn[x]=min(mn[x],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: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:33:22: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   33 |             mn[x]=min(mn[x],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
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:33:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   33 |             mn[x]=min(mn[x],y);
      |                   ~~~^~~~~~~~~