Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long L, R; cin >> L >> R;
    long long MOD = 2019;
    long long seg_cnt = 0;
    vector<long long> mod_cnt(2019);
    for (long long l = 0; l <= R; l += 2019) {
        long long r = l + 2018;
        if (L <= l && r <= R) {
            seg_cnt++;
        } else if (min(R, r) - max(L, l) >= 0) {
            for (long long j = l; j <= r; j++) {
                if (L <= j && j <= R) {
                    mod_cnt[j % MOD]++;
                }
            }
        }
    }
    for (int i = 0; i < 2019; i++) {
        mod_cnt[i] += seg_cnt;
    }
    long long ans = 2020;
    for (int i = 0; i < 2019; i++) {
        for (int j = i+1; j < 2019; j++) {
            if (mod_cnt[i] > 1) ans = min(i*i%MOD);
            ans = min(i*j%MOD);
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:42: error: no matching function for call to 'min(long long int)'
   26 |             if (mod_cnt[i] > 1) ans = min(i*i%MOD);
      |                                       ~~~^~~~~~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:26:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |             if (mod_cnt[i] > 1) ans = min(i*i%MOD);
      |                                       ~~~^~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
a.cc:27:22: error: no matching function for call to 'min(long long int)'
   27 |             ans = min(i*j%MOD);
      |                   ~~~^~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:27:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   27 |             ans = min(i*j%MOD);
      |                   ~~~^~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided