Language: C++


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;

#define endl '\n'
ll n;
vector < pair <ll,ll> > vec;


int main()
{
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin>>n;

    for(ll i=0;i<n;i++){
        ll a,b;
        cin>>a>>b;
        vec.push_back({a,b});
    }
    vector < pair <ll,ll> > veco;
    map < pair <ll,ll> , ll> mp;
    for(ll i=0;i<n;i++){
        for(ll j=i+1;j<n;j++){

            mp[{vec[i].first-vec[j].first,vec[i].second-vec[j].second}]++;
            mp[{-vec[i].first+vec[j].first,-vec[i].second+vec[j].second}]++;
        }
    }
    ll co = INT_MAX;
    for(auto it=mp.begin();it!=mp.end();it++)
    {

        ll p = (it->first).first;
        ll q = (it->first).second;


        ll com = 0;
        map < pair <ll,ll> ,ll > mp;
        for(ll i=0;i<n;i++){
            for(ll j=i+1;j<n;j++){

                if(((vec[i].first - vec[j].first) == p ) and ((vec[i].second - vec[j].second) == q))
                {
                    mp[vec[i]]++;
                    mp[vec[j]]++;

                    if(mp[vec[i]]==1){

                    if(mp[vec[j]]==1){
                        com++;
                    }
                    }

                }
                else{
                   if(((vec[i].first - vec[j].first) == -p ) and ((vec[i].second - vec[j].second) == -q))
                    {
                        mp[vec[i]]++;
                        mp[vec[j]]++;

                    if(mp[vec[i]]==1){
                        if(mp[vec[j]]==1){
                            com++;
                        }

                        }
                    }
                }

            }
        }

        co = min(co,n-mp.size()+(com));



    }
    cout<<co<<endl;









}


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