Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

ll N;
vector<pair<ll,ll> > xy;
vector<pair<ll,ll> > incline;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

   
    cin >> N ;
    rep(i, N){
        ll x, y ;
        cin >> x >> y ;
        xy.pb(mp(x,y));
    }
    
    
    rep(i, N)rep(j, N){
        if(xy[i].first == xy[j].first) continue;
        //incline.pb((xy[i].second - xy[j].second)/(xy[i].first - xy[j].first));
        ll a = xy[i].first - xy[j].first;
        ll b = xy[i].second - xy[j].second;
        ll c = gcd(abs(a),abs(b));
        
        // minus to a
        if(a * b == 0) continue;
        else if(a * b < 0){a = abs(a)*(-1L), b = abs(b);}
        else {a = abs(a), b = abs(b); }
        incline.pb(mp(a/c, b/c));
    }
    
    rmsame(incline);
    
    ll ans = N ;
    
    rep(i, incline.size() + 2){
        //incline = ∞の場合
        if(i == incline.size()){
            vector<ll> x;
            rep(j, xy.size()){
                x.pb(xy[j].first);
            }
            rmsame(x);
            ans = min(ans, (ll)x.size());
        }else if(i == incline.size() + 1){
            vector<ll> y ;
            rep(j, xy.size()){
                y.pb(xy[j].second);
            }
            rmsame(y);
            ans = min(ans, (ll).y.size());
        }else{
//            ld a = incline[i];
            ll diffx = incline[i].first;
            ll diffy = incline[i].second;
            
            vector<pair<ll,ll> > b;
            rep(j, xy.size()){
                //ld inc = xy[j].second - a * xy[j].first;
                ll up = xy[j].second * diffx - diffy * xy[j].first;
                ll down = diffx;
                ll c = gcd(abs(up), abs(down));
                
                if(up * down == 0){b.pb(0LL,0LL); continue; }
                else if(up * down < 0){up = abs(up) * (-1L), down = abs(down); }
                else {up = abs(up), down = abs(down); }
                
                b.pb(mp(up/c, down/c));
            }

            rmsame(b);
            ans = min(ans, (ll)b.size());
        }
    }

    
    cout << ans << endl;

    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected primary-expression before 'long'
   13 | #define ll long long
      |            ^~~~
a.cc:82:29: note: in expansion of macro 'll'
   82 |             ans = min(ans, (ll).y.size());
      |                             ^~
a.cc:82:29: error: expected ')' before 'long'
   82 |             ans = min(ans, (ll).y.size());
      |                            ~^
      |                             )
a.cc:95:40: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int, long long int)'
   95 |                 if(up * down == 0){b.pb(0LL,0LL); continue; }
      |                                    ~~~~^~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided