Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

signed main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  vector<ll> x(n), y(n);
  for(int i=0;i<n;++i) {
    cin >> x[i] >> y[i];
  }

  if(n == 1) {
    cout << 1 << endl;
    return 0;
  }

  vector<pair<ll, ll>> p;
  for(int i=0;i<n;++i) {
    for(int j=i+1;j<n;++j) {
      ll tmpx = x[i] - x[j], tmpy = y[i] - y[j];
      if(tmpx > 0) {
        p.push_back(make_pair(tmpx, tmpy));
      } else {
        p.push_back(make_pair(-tmpx, -tmpy));
      }
    }
  }

  ll mi = INF;
  ll sz = p.size();


  for(int i=0;i<sz;++i) {
    map<pair<ll, ll>, bool> mp;
    for(int j=0;j<n;++j) {
      if(p[i].first != 0) {
        ll div = x[j] / p[i].first;
        ll mod = x[j] % p[i].first;
        mp[make_pair(mod, y[j] - div * p[i].second)] = true;
      } else {
        mp[make_pair(x[j], y[j] % p[i].second)] = true;
      }
    }
    mi = min(mi, (int)(mp.size()));
  }
  cout << mi << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: no matching function for call to 'min(ll&, int)'
   63 |     mi = min(mi, (int)(mp.size()));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~
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:63:13: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   63 |     mi = min(mi, (int)(mp.size()));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~
/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:63:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   63 |     mi = min(mi, (int)(mp.size()));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~