criyle/codenet-compile-errors huggingface dataset:
Language: C++

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

int main() {
  int N;
  cin >> N;
  map<pair<int,int>> mp;
  vector<pair<int,int>> pe(N);
  for(int i=0;i<N;i++){
    int x,y;
    cin >> x >> y;
    pe[i]=make_pair(x,y);
  }
  sort(pe.begin(),pe.end());
  for(int i=0;i<N;i++){
    for(int j=0;j<i;j++){
      pair<int,int> p=make_pair(pe[i].first-pe[j].first,pe[i].second-pe[j].second);
      mp[p]++;
    }
  }
  int mc=0;
  for(auto p:mp){
    if(p.second>mc)mc=p.second;
  }
  cout << N-mc;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: wrong number of template arguments (1, should be at least 2)
    7 |   map<pair<int,int>> mp;
      |                   ^~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:18:9: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>')
   18 |       mp[p]++;
      |         ^
a.cc:22:14: error: 'begin' was not declared in this scope
   22 |   for(auto p:mp){
      |              ^~
a.cc:22:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:22:14: error: 'end' was not declared in this scope
   22 |   for(auto p:mp){
      |              ^~
a.cc:22:14: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

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

#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;

int main() {
    lli n;
    cin >> n;
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    lli x[n];
    lli y[n];
    REP(i, 0, n) {
        lli xi, yi;
        cin >> xi >> yi;
        x[i] = xi;
        y[i] = yi;
    }
    map<P, lli> m;
    REP(i, 0, n) {
        REP(j, i+1, n) {
            // この(p, q)の組み合わせでのコストを出す。
            lli p = x[j] - x[i];
            lli q = y[j] - y[i];

            m[P(p, q)]++;
        }
    }
    lli ans = 0;
    for(auto it = container.begin(); it != container.end(); it++) {
        ans = max(ans, it->second);
    }
    cout << n - ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:19: error: 'container' was not declared in this scope
   40 |     for(auto it = container.begin(); it != container.end(); it++) {
      |                   ^~~~~~~~~
Language: C++

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

#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;

int main() {
    lli n;
    cin >> n;
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    lli x[n];
    lli y[n];
    REP(i, 0, n) {
        lli xi, yi;
        cin >> xi >> yi;
        x[i] = xi;
        y[i] = yi;
    }
    map<P, lli> m;
    REP(i, 0, n) {
        REP(j, i+1, n) {
            // この(p, q)の組み合わせでのコストを出す。
            lli p = x[j] - x[i];
            lli q = y[j] - y[i];

            m[P(p, q)]++;
        }
    }
    lli ans = 0;
    for(auto it = container.begin(); it != container.end(); it++)
        ans = max(ans, it->second);
    }
    cout << n - ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:19: error: 'container' was not declared in this scope
   40 |     for(auto it = container.begin(); it != container.end(); it++)
      |                   ^~~~~~~~~
a.cc: At global scope:
a.cc:43:5: error: 'cout' does not name a type
   43 |     cout << n - ans << endl;
      |     ^~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

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

// Shortcut

#pragma optimize ("O3")
#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << ' ';
#define PrintVl(a) for (int iiii = 0; iiii < a.size(); iiii++) cout << a[iiii] << endl;
#define PrintA(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << ' ';
#define PrintAl(a, n) for (int iiii = 0; iiii < n; iiii++) cout << a[iiii] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

//#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define bend(a) a.begin(), a.end()
#define rbend(a) a.rbegin(), a.rend()
#define mset(a) memset(a, 0, sizeof(a));
#define mmset(a) memset(a, 0x3f, sizeof(a));
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 1e5 + 5, mod = 1e9 + 7, inf = 1e9 + 7;

int n, ans = 0;
pii a[N];

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n;
    ForE(i, 1, n){
        cin >> a[i].fi >> a[i].se;
    }
    sort(a + 1, a + 1 + n);
    map <pii, int> mpp;
    ForE(i, 1, n){
        ForE(j, i + 1, n){
            int x = a[j].fi - a[i].fi, y = b[j].se - b[i].se;
            mpp[{x, y}]++;
            ans = max(ans, mpp[{x, y}]);
        }
    }
    cout << n - ans;
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:84:44: error: 'b' was not declared in this scope
   84 |             int x = a[j].fi - a[i].fi, y = b[j].se - b[i].se;
      |                                            ^
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;


int n;
int x[50], y[50], _x[50], _y[50];

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

	for (int i = 1; i < n; i++){
	_x[i] = x[i] - x[i - 1];

	_y[i] = y[i] - y[i - 1];
	}
	for (int i = 0; i < 50; i++){
		if ()
	}

	




	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected primary-expression before ')' token
   23 |                 if ()
      |                     ^
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
int main()
{
  int n;
  cin >> n;
  vector<pair<ll, ll>> xy(n);
  for(int i=0;i<n;i++){
    ll x,y;
    cin >> x >> y;
    xy[i]=make_pair(x,y);
  }
  //cout << "a" <<endl;
  vector<vector<ll>> pq(n,vector<ll> (n,0));
  
  vector<ll> p(n,0);
  vector<ll> q(n,0);

  for(int i=n-1;i>0;i--){
    p.at(i)=xy[i].first-xy[i-1].first;
    q.at(i)=xy[i].second-xy[i-1].second;
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i==j){
        break;
      }
      if((p.at(i)==p.at(j))&&(q.at(i)==q.at(j))){
        pq.at(i).at(j)-=1;
      }
    }
  }
  sort(pq.begin(),pq.end());
  sort(pq.at(0).begin(),pq.at(0).end());
  
  

  int cost=n-1;
  cost=cost+pq.at(0).at(0);
  //cout << pq.at(0).at(0);
  if(n==2){
    cost=1;
  }
  else(n==1){
    cost=1;
  }
  cout << cost << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: expected ';' before '{' token
   47 |   else(n==1){
      |             ^
      |             ;
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repR(i, n) for(ll i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(ll i = n; i >= 0; ++i)
#define FOR(i, m, n) for(ll i = m; i < n; ++i)
#define FORR(i, m, n) for(ll i = m;i >= n;--i)
#define VSORT(v) sort(v.begin(), v.end());
#define VREV(v) reverse(v.begin(), v.end());
#define INF 999999999
#define itn ll
#define ednl endl
using namespace std;
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vector<ll> A(N);
	vector<ll> B(N);
	
	FDS(i,N){
		cin>>A[i]>>B[i];
	}
	
	vector<pair<ll,ll>> sa;
	FDS(i,N)FDS(j,N){
		if(i==j)continue;
		sa.push_back(makepair(A[j]-A[i],B[j]-B[i]));
	}
	int ans=N;
	FDS(i,sa.size()){
		ll x=sa[i].first,y=sa[j].second;
		int c=0;
		FDS(k,sa.size()){
			if(sa[k].first==x&&sa[k].second==y){
				c++;
			}
		}
		ans=min(ans,N-c);
		
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:30: error: 'makepair' was not declared in this scope
   32 |                 sa.push_back(makepair(A[j]-A[i],B[j]-B[i]));
      |                              ^~~~~~~~
a.cc:36:39: error: 'j' was not declared in this scope
   36 |                 ll x=sa[i].first,y=sa[j].second;
      |                                       ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <tuple>
#define ed "\n"
using namespace std;
struct P
{
    int x;
    int y;
};
int main()
{
    int n;
    cin >> n;
    vector<P> m(n);
    if (n == 1)
    {
        cout << "1" << ed;
        return 0;
    }
    //入力
    for (int i = 0; i < n; i++)
    {
        cin >> m[i].x >> m[i].y;
    }
    sort(m.begin(), m.end(), [](const P &a, const P &b) { return a.x < b.x; });
    map<tuple<int, int>, int> memo;
    int max = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            P t;
            if (m[i].x - m[j].x >= 0)
                t = {m[i].x - m[j].x, m[i].y - m[j].y};
            else
                t = {-(m[i].x - m[j].x), -(m[i].y - m[j].y)};
            cerr << m[i].x << "-" << m[j].x << " " << i << " " << j << "\n";
            memo[make_tuple(t.x, t.y)]++;
            if (max < memo[make_tuple(t.x, t.y)])
                max = memo[make_tuple(t.x, t.y)];
        }
    }
    cout << n - max << ed;
    
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |     sort(m.begin(), m.end(), [](const P &a, const P &b) { return a.x < b.x; });
      |     ^~~~
      |     short
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <tuple>
#define ed "\n"
using namespace std;
struct P
{
    int x;
    int y;
};
int main()
{
    int n;
    cin >> n;
    vector<P> m(n);
    if (n == 1)
    {
        cout << "1" << ed;
        return 0;
    }
    //入力
    for (int i = 0; i < n; i++)
    {
        cin >> m[i].x >> m[i].y;
    }
    sort(m.begin(), m.end(), [](const P &a, const P &b) { return a.x < b.x; });
    map<tuple<int, int>, int> memo;
    int max = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            P t;
            if (m[i].x - m[j].x >= 0)
                t = {m[i].x - m[j].x, m[i].y - m[j].y};
            else
                t = {-(m[i].x - m[j].x), -(m[i].y - m[j].y)};
            cerr << m[i].x << "-" << m[j].x << " " << i << " " << j << "\n";
            memo[make_tuple(t.x, t.y)]++;
            if (max < memo[make_tuple(t.x, t.y)])
                max = memo[make_tuple(t.x, t.y)];
        }
    }
    cout << n - max << ed;
    
    return 0;

}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
using namespace std;

#define int long long

signed main(){

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

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

    int ans = n;
    for(int i = 0; i < n; ++i){
        for (int j = 0; j < n; ++j)
        {
            if(i == j) continue;
            int dx = x[j] - x[i], dy = y[j] - y[i];

            int cnt = 0;
            for (int m = 0; m < n; ++m)
            {
                for (int k = 0; k < n; ++k)
                {
                    if(m == k) continue;
                    if(dx == x[k] - x[m] && dy == y[k] - y[m]) ++cnt;
                }
                
            }
            ans = min(ans, n-cnt);
        }
        
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected primary-expression before 'long'
    5 | #define int long long
      |             ^~~~
a.cc:12:29: note: in expansion of macro 'int'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                             ^~~
a.cc:12:29: error: expected ')' before 'long'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                            ~^
      |                             )
Language: C++

#include<iostream>
#include<vector>
using namespace std;

#define int long long

signed main(){

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

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

    int ans = n;
    for(int i = 0, i_len = n; i < i_len; ++i){
        for (int j = 0; j < n; ++j)
        {
            if(i == j) continue;
            int dx = x[j] - x[i], dy = y[j] - y[i];

            int cnt = 0;
            for (int m = 0; m < n; ++m)
            {
                for (int k = 0; k < n; ++k)
                {
                    if(m == k) continue;
                    if(dx == x[k] - x[m] && dy == y[k] - y[m]) ++cnt;
                }
                
            }
            ans = min(ans, n-cnt);
        }
        
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected primary-expression before 'long'
    5 | #define int long long
      |             ^~~~
a.cc:12:29: note: in expansion of macro 'int'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                             ^~~
a.cc:12:29: error: expected ')' before 'long'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                            ~^
      |                             )
Language: C++

#include<iostream>
#include<vector>
using namespace std;

#define int long long

signed main(){

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

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

    int ans = n;
    for(int i = 0, i_len = (int)n; i < i_len; ++i){
        for (int j = 0; j < n; ++j)
        {
            if(i == j) continue;
            int dx = x[j] - x[i], dy = y[j] - y[i];

            int cnt = 0;
            for (int m = 0; m < n; ++m)
            {
                for (int k = 0; k < n; ++k)
                {
                    if(m == k) continue;
                    if(dx == x[k] - x[m] && dy == y[k] - y[m]) ++cnt;
                }
                
            }
            ans = min(ans, n-cnt);
        }
        
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected primary-expression before 'long'
    5 | #define int long long
      |             ^~~~
a.cc:12:29: note: in expansion of macro 'int'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                             ^~~
a.cc:12:29: error: expected ')' before 'long'
   12 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                            ~^
      |                             )
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){

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

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

    int ans = n;
    for(int i = 0, i_len = (int)n; i < i_len; ++i){
        for (int j = 0; j < n; ++j)
        {
            if(i == j) continue;
            int dx = x[j] - x[i], dy = y[j] - y[i];

            int cnt = 0;
            for (int m = 0; m < n; ++m)
            {
                for (int k = 0; k < n; ++k)
                {
                    if(m == k) continue;
                    if(dx == x[m] - x[k] && dy == y[m] - y[k]) ++cnt;
                }
                
            }
            ans = min(ans, n-cnt);
        }
        
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: expected primary-expression before 'int'
   10 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                             ^~~
a.cc:10:29: error: expected ')' before 'int'
   10 |     for(int i = 0, i_len = (int); i < i_len; ++i){
      |                            ~^~~
      |                             )
Language: C

#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#define ed "\n"
using namespace std;
struct P{ int x; int y; }; 
int main(){
    int n;
    vector<P> m(n);
    cin >> n;
    if(n==1) { cout << "1" << ed; return 0; }
    //入力
    for(int i=0; i<n; i++){
        cin >> m[i].x >> m[i].y;
    }

    map<tuple<int,int>, int> memo;
    int max= 0;
    for(int i=0; i<n-1; i++){
        for(int j=i+1; j<n; j++){
            P t;
            if(m[i].x-m[j].x>=0) t= {m[i].x-m[j].x, m[i].y-m[j].y};
            else t= {-(m[i].x-m[j].x), -(m[i].y-m[j].y)};
            // cout << t.x << " " << t.y << ed;
            memo[make_tuple(t.x,t.y)]++;
            if(max<memo[make_tuple(t.x,t.y)]) max= memo[make_tuple(t.x,t.y)];
        }
    }
    cout << n-max << ed;
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

N = int(input())
balls = [
    [int(s) for s in input().split(' ')]
    for i in range(N)
]
balls.sort(key=lambda p: p[1])
balls.sort(key=lambda p: p[0])
d = {}
d_max = 0
for i in range(N):
    for j in range(i + 1, N):
        p = balls[j][0] - balls[i][0]
        q = balls[j][1] - balls[i][1]
        if not p in d:
            d[p] = {}
        d[p][q] = (d[p][q] if q in d[p] else 0) + 1
        d_max = max([d_max, d[p][q]])
print(N - d_max)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
a.cc:9:1: error: 'd_max' does not name a type
    9 | d_max = 0
      | ^~~~~
a.cc:16:9: error: 'd' does not name a type
   16 |         d[p][q] = (d[p][q] if q in d[p] else 0) + 1
      |         ^
Language: C++

N = int(input())
b = [
    [int(s) for s in input().split(' ')] for i in range(N)]
b.sort(key=lambda p: p[1])
b.sort(key=lambda p: p[0])
d = {}
d_max = 0
for i in range(N):
    for j in range(i + 1, N):
        p = b[j][0] - b[i][0]
        q = b[j][1] - b[i][1]
        if not p in d:
            d[p] = {}
        d[p][q] = (d[p][q] if q in d[p] else 0) + 1
        d_max = max([d_max, d[p][q]])
print(N - d_max)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
a.cc:7:1: error: 'd_max' does not name a type
    7 | d_max = 0
      | ^~~~~
a.cc:14:9: error: 'd' does not name a type
   14 |         d[p][q] = (d[p][q] if q in d[p] else 0) + 1
      |         ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    if(n==1){
        cout<<1<<endl;
        return 0;
    }
    vector<ll> x(n),y(n);
    ll p,q;
    REP(i,n){
        cin>>x[i]>>y[i];
    }
    map<LP,ll> mp;
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n;j++){
            if(i==j)continue;
            p=x[j]-x[i],q=y[j]-y[i];
            mp[{p,q}]++;
        }
    }
    int ma = 0;
    for(auto x:mp){
        //cout<<x.first.first<<":"<<x.first.second<<":"<<x.second<<endl;
        chmax(ma,x.second);
    }
    cout<<n-ma<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: no matching function for call to 'chmax(int&, long long int&)'
   51 |         chmax(ma,x.second);
      |         ~~~~~^~~~~~~~~~~~~
a.cc:19:31: note: candidate: 'template<class T> bool chmax(T&, T)'
   19 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:19:31: note:   template argument deduction/substitution failed:
a.cc:51:14: note:   deduced conflicting types for parameter 'T' ('int' and 'long long int')
   51 |         chmax(ma,x.second);
      |         ~~~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)

typedef pair<int, int> P;

int main(void){
    int N; cin >> N;
    int x[N], y[N]; rep(i, N) cin >> x[i] >> y[i];

    map<P, int> m;
    int a = 0;

    rep(i, N){
      rep(j, N){
        if(i == j) continue;
        int p = x[i] - x[j], q = y[i] - y[j];
        a = max(a, ++m[P(p, q)]);
      }
    }

    cout << n - a << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'n' was not declared in this scope
   22 |     cout << n - a << endl;
      |             ^
Language: C++

#include<iostream>
int main(){
    size_t N;
    std::cin >> N;
    assert(N != 1);
    std::cout << N << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'assert' was not declared in this scope
    5 |     assert(N != 1);
      |     ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<iostream>
  +++ |+#include <cassert>
    2 | int main(){
Language: C++

#include<iostream>
int main(){
    size_t N;
    std::cin >> N;
    assert(N != 1);
    std::cout << N << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'assert' was not declared in this scope
    5 |     assert(N != 1);
      |     ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<iostream>
  +++ |+#include <cassert>
    2 | int main(){
a.cc:6:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |     std::cout << N << endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  long N;
  cin >> N;
  vector<pair<long, long>> data(N);
  for(int i = 0; i < N; i++){
    cin >> data.at(i).first >> data.at(i).second;
  }
  sort(data.begin(), data.end());
  long count = 0, sub, a, b;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(i == j)continue;
      sub = 1;
      a = data.at(j).first - data.at(i).first;
      b = data.at(j).second - data.at(i).second;
      for(int k = 0; k < N; k++){
        if(k == i)continue;
        for(int l = 0; l < N; l++){
          if(l == j || k == l)continue;
         if(data.at(l).first - data.at(k).first == a && data.at(l).second - data.at(k).second == b){
           sub++;
        } 
      }
      count = max(count, sub);
    }
  }
  if(N == 1)cout << 1 << endl;
  else cout << N - count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:3:13: note: to match this '{'
    3 | int main () {
      |             ^
Language: C++

// Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
signed main() {
  int N;
  cin >> N;

  vector<pair<int,int>> ball(N);
  for (int i = 0; i < N; i++) {
    int x,y; cin >> x >> y;
    ball[i] = make_pair(x,y);
  }
  sort(ball.begin(), ball.end());

  map<pair<int,int>,int> cnt;
  for (int i = 0; i < N-1; i++) {
    for (int j = i+1; j < N; j++) {
      int x = ball[j].first - ball[i].first;
      int y = ball[j].second - ball[i].second;
      pq.push_back(make_pair(x,y));
      cnt[make_pair(x,y)]++;
    }
  }

  int ans = 0;
  for(auto it = cnt.begin(); it != cnt.end(); it++) {
    ans = max(ans, it->second);
  }
  ans = N-ans;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'pq' was not declared in this scope
   23 |       pq.push_back(make_pair(x,y));
      |       ^~
Language: C++

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

struct pos {
  int x;
  int y;
};

int getpq(int N, vector<pos> P) {
  int p, q;
  int sum, minsum = 100, cnt;
  for (int i = 0; i < N; i++) {
    for (int j = i+1; i < N; i++) {
      p =P.at(i).x - P.at(j).x;
      q =P.at(i).y - P.at(j).y;
      if (p==0 && q==0) continue;
      sum = N;
      for (int i = 0; i < N; i++) {
        for (int j = i+1; i < N; i++) {
          if ((P.at(j).x - P.at(j-ie).x) == p && (P.at(j).y - P.at(j-ie).y) == q) {
            sum--;
          }
        }
      }
      minsum = min(minsum, sum);
    }
  }
  return minsum;
}
 
int main() {
  int N;
  cin >> N;
  vector<pos> p(N);
  for (int i = 0; i < N; i++) {
    cin >> p.at(i).x >> p.at(i).y;
  }

  int ans;
  sort(p.begin(), p.end(), [](const pos& i, const pos& j) { return i.x < j.x;});
  ans = getpq(N,p);
  sort(p.begin(), p.end(), [](const pos& i, const pos& j) { return i.y < j.y;});
  ans = min(ans,getpq(N,p));
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int getpq(int, std::vector<pos>)':
a.cc:20:35: error: 'ie' was not declared in this scope; did you mean 'i'?
   20 |           if ((P.at(j).x - P.at(j-ie).x) == p && (P.at(j).y - P.at(j-ie).y) == q) {
      |                                   ^~
      |                                   i
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
 
 
 
int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
 
    int n;
    cin>>n;
    ll x[n],y[n];
    ll ans = n;
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    map<pair<ll,ll>,ll> mp;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(x!=j && x[i]!=x[j] && y[i]!=y[j]){
                mp[make_pair(x[i]-y[j],y[i]-y[j])]++;
                mp[make_pair(x[j]-x[i],y[j]-y[i])]++;
            }
        }
    }
    ll ret = 0;
    for(auto i:mp){
        ll cnt = 0;
        for(int k=0;k<n;k++){
            for(int j=0;j<n;j++){
                if(k!=j){
                    if(x[k]-x[j]==i.first.first && y[k]-y[j]==i.first.second) cnt++;
                }
            }
            ret = max(ret,cnt);
        }
    }
    ans -= ret;
    cout<<ans<<endl;

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |             if(x!=j && x[i]!=x[j] && y[i]!=y[j]){
      |                ~^~~
Language: C++

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

int main(){
 int N;
 cin >> N;
 std::vector<pair<int,int>> pairs(N);
 for(int i = 0 ; i < N;i++){
   cin >> pairs.at(i).first >> pairs.at(i).second;
 }
 sort(pairs.begin(), pairs.end());
 std::vector<pair<int,float>> scores;
  
 for(int i = 1; i < N;i ++){
   int dx = pairs.at(i).first -pairs.at(i -1).first;
   int dy = pairs.at(i).second -pairs.at(i -1).second;
   if(dy != 0){
   bool ret = false;]
   for(auto itr = scores.begin(); itr < scores.end();itr++){
		if((*itr).second == dx/ dy){
          (*itr).first++;
			ret = true;
        }
   }
   if(!ret){
     pair<int, float>score;
     score.second = dx / dy;
     score.first =1;
     scores.push_back(score);
   } 
   }
  
 }
 sort(scores.begin(),scores.end());
  
 cout << N- (scores.at(scores.size() - 1).first) <<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected primary-expression before ']' token
   20 |    bool ret = false;]
      |                     ^
a.cc:21:35: error: 'itr' was not declared in this scope
   21 |    for(auto itr = scores.begin(); itr < scores.end();itr++){
      |                                   ^~~
Language: C++

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

int main(){
 int N;
 cin >> N;
 std::vector<pair<int,int>> pairs(N);
 for(int i = 0 ; i < N;i++){
   cin >> pairs.at(i).first >> pairs.at(i).second;
 }
 sort(pairs.begin(), pairs.end());
 std::vector<pair<int,float>> scores;
  
 for(int i = 1; i < N;i ++){
   int dx = pairs.at(i).first -pairs.at(i -1).first;
   int dy = pairs.at(i).second -pairs.at(i -1).second;
   id(dy != 0){
   bool ret = false;]
   for(auto itr = scores.begin(); itr < scores.end();itr++){
		if((*itr).second == dx/ dy){
          (*itr).first++;
			ret = true;
        }
   }
   if(!ret){
     pair<int, float>score;
     score.second = dx / dy;
     score.first =1;
     scores.push_back(score);
   } 
   }
  
 }
 sort(scores.begin(),scores.end());
  
 cout << N- (scores.at(scores.size() - 1).first) <<endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'id' was not declared in this scope; did you mean 'i'?
   19 |    id(dy != 0){
      |    ^~
      |    i
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

long long n, cnt = 0;
vector<pair<long long, long long>> v;
map<pair<long long, long long>, long long> mp;

int main() {
  cin >> n;
  v.resize(n);
  for(int i = 0; i < n; ++i) cin >> v[i].fi >> v[i].se;
  for(int i = 0; i < n; ++i)
    for(int j = i + 1; j < n; ++j) {
      int x = v[i].fi - v[j].fi, y = v[i].se - v[j].se;
      if(x < 0) {
        x *= -1;
        y *= -1;
      }
      cnt = max(cnt, ++mp[make_pair({x, y})]);
    }

  cout << n - cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:36: error: no matching function for call to 'make_pair(<brace-enclosed initializer list>)'
   21 |       cnt = max(cnt, ++mp[make_pair({x, y})]);
      |                           ~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h:1132:5: note: candidate: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#define _CRT_SECURE_NO_WARNINGS

/* include ***********************/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

/* define *************************/
//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
#define FOR(i,s,n) for(int i=(int)(s),i##_len=(int)(n);i<i##_len;i++)
#define RFOR(i,s,n) for(int i=(int)(n)-1,i##_len=(int)(s);i>=i##_len;i--)

//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTL(d) printf("%lld\n",(d))

//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))

#define INF 1e9
#define MOD 1000000007

typedef long long ll;
typedef unsigned long long ull;

int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};
//今回の変数

int Min(int a, int b) {
	return (a)<(b) ? (a) : (b);
}
int Max(int  a, int  b) {
	return (a) > (b) ? (a) : (b);
}
ll Minl(ll a, ll b) {
	return (a)<(b) ? (a) : (b);
}
ll Maxl(ll a, ll b) {
	return (a)>(b) ? (a) : (b);
}
void hSwap(ll x[], int i, int j)
{
	ll temp;

	temp = x[i];
	x[i] = x[j];
	x[j] = temp;
}
void ShowData(ll x[], int left, int right)
{
	int i;
	for (i = left; i <= right; i++)printf("%lld  ", x[i]);
	printf("\n");
}
void QSort2(ll x[], ll y[], int left, int right, int n) {
	int i, j;	//左端,右端
	ll pivot;	//軸

	i = left;
	j = right;
	pivot = x[(left + right) / 2];

	while (1) {
		if (n > 0) {				//n>0なら昇順、n<=0なら降順
			while ((x[i] < pivot) && (i <= right))i++;	//軸値より大きい要素
			while ((pivot < x[j]) && (i <= right))j--;	//軸値より小さい要素
		}
		else {
			while ((x[i] > pivot) && (i <= right))i++;	//軸値より小さい要素
			while ((pivot > x[j]) && (i <= right))j--;	//軸値より大きい要素
		}
		if (i >= j)	break;
		hSwap(x, i, j);
		hSwap(y, i, j);
		i++; j--;
	}
	//ShowData(x, left, right);

	if (left < i - 1)QSort2(x, y, left, i - 1, n);
	if (j + 1 <  right)QSort2(x, y, j + 1, right, n);
}

int main() {
	int n;
	scanf("%d", &n);

	ll x[50], y[50];
	REP(i, n) {
		scanf("%lld%lld", &x[i], &y[i]);
	}
	QSort2(x, y, 0, n - 1, 1);
	//ShowData(x, 0, n - 1);
	//ShowData(y, 0, n - 1);

	ll min = 1e9;

	REP(i, n - 1) {
		FOR(j, i + 1, n) {
			ll dx = x[j] - x[i];
			ll dy = y[j] - y[i];
			int score = n;
			REP(k, n - 1) {
				FOR(l, k + 1, n) {
					ll ndx = x[l] - x[k];
					ll ndy = y[l] - y[k];
					//printf("k:%d l:%d %lld:%lld %lld:%lld\n", k, l, ndx,dx, ndy,dy);
					int flagx=0, flagy=0;
					if(ndx == dx){
						flagx = 1;
					}
					if (ndy == dy){
						flagy = 1;
					}
					if (flagx&&flagy) {
						score--;
					}
				}
			}
			min = MinL(min, score);
			//PRINTD(min);
		}
	}

	PRINTD(min);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:131:31: error: 'MinL' was not declared in this scope; did you mean 'Minl'?
  131 |                         min = MinL(min, score);
      |                               ^~~~
      |                               Minl
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long int;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

typedef pair<int, int> P;

bool pairCompare1(const P& firstElof, const P& secondElof)
{
    return firstElof.first > secondElof.first;
}
bool pairCompare2(const P& firstElof, const P& secondElof)
{
    return firstElof.first < secondElof.first;
}
bool pairCompare3(const P& firstElof, const P& secondElof)
{
    return firstElof.second > secondElof.second;
}
bool pairCompare4(const P& firstElof, const P& secondElof)
{
    return firstElof.second < secondElof.second;
}

int main() {
    int n; cin >> n;
    vector<P> p;
    int tx,ty;
    rep(i, n) {
        cin >> tx >> ty;
        p.push_back(make_pair(tx, ty));
    }

    vector<P> p1;
    sort(p.begin(),p.end(),pairCompare1);
    for(int i=1; i < n; i++) {
        p1.push_back(make_pair(p[i].first-p[i-1].first, p[i].second-p[i-1].second));
    }
    sort(p1.begin(), p1.end());
    p1.erase(unique(p1.begin(), p1.end()), p1.end());
    int ans = p1.size();



    vector<P> p2;
    sort(p.begin(),p.end(),pairCompare2);
    for(int i=1; i < n; i++) {
        p2.push_back(make_pair(p[i].first-p[i-1].first, p[i].second-p[i-1].second));
    }
    sort(p2.begin(), p2.end());
    p2.erase(unique(p2.begin(), p2.end()), p2.end());
    ans = min(ans, (int)p2.size());

    vector<P> p3;
    sort(p.begin(),p.end(),pairCompare3);
    for(int i=1; i < n; i++) {
        p3.push_back(make_pair(p[i].first-p[i-1].first, p[i].second-p[i-1].second));
    }
    sort(p3.begin(), p3.end());
    p3.erase(unique(p3.begin(), p3.end()), p3.end());
    ans = min(ans, (int)p3.size());

    vector<P> p4;
    sort(p.begin(),p.end(),pairCompare4);
    for(int i=1; i < n; i++) {
        p4.push_back(make_pair(p[i].first-p[i-1].first, p[i].second-p[i-1].second));
    }
    sort(p4.begin(), p4.end());
    p4.erase(unique(p4.begin(), p4.end()), p4.end());
    ans = min(ans, (int)p4.size());

    cout << ans << endl;

}

/**
4
1 1
3 7
3 3
5 9
 **/

Compiler output:
a.cc:7:19: error: declaration does not declare anything [-fpermissive]
    7 | typedef long long int;
      |                   ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define N 60

int n,ans,a[N],b[N];
map<int,int> mp;

int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;++i) scanf("%d%d",a+i,b+i);
	for (int i=1;i<=n;++i)
		for (int j=1;j<=n;++j) if (i!=j) ans=max(ans,++mp[a[i]-a[j]][b[i]-b[j]]);
	printf("%d\n",n-ans);
	
	return 0;
}
			


Compiler output:
a.cc: In function 'int main()':
a.cc:14:77: error: invalid types 'std::map<int, int>::mapped_type {aka int}[int]' for array subscript
   14 |                 for (int j=1;j<=n;++j) if (i!=j) ans=max(ans,++mp[a[i]-a[j]][b[i]-b[j]]);
      |                                                                             ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;
  if (N==1){
    cout << 1 << endl;
    return;
  }
  int x[N], y[N], sc=N-1, scb=N-1, p=0, q=0, wh=0;
  for(int i=0; i<N; i++) cin >> x[i] >> y[i];
  for(int i=0; i<N-1; i++){
    for(int j=i+1; j<N; j++){
      p=x[j]-x[i], q=y[j]-y[i], sc=N;
      for(int k=0; k<N-1; k++){
        for(int l=0; l<N; l++){
          if (k==l) continue;
          if (x[k]+p == x[l] && y[k]+q == y[l]) sc--;
        }
      }
      scb = min(sc, scb);
    }
  }
  cout << scb << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |     return;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;

using pll = pair<long long, long long>;

int main() {
    long long N;
	map<long long, long long> count;
	map<long long, long long> count1;
	map<long long, long long> count2;
    cin >> N;
    vector<pll> v(N);
    vector<pll> ans2(N);
    for (int i = 0; i < N; ++i) cin >> v[i].first >> v[i].second;
    sort(v.begin(), v.end());
	long long max1,max2,max3;
	max1=0;
	max2=0;
	max3=0;
	long long aaa;
	long long bbb;
	long long ans;
	ans=0;
	
    long long res = 0;
    for (int j = 1; j < N; ++j) {
   	 aaa=v[i].first - v[i-1].first;
   	 bbb=v[i].second - v[i-1].second;
   	 	for (int i = 1; i < N; ++i) {
        	if(v[i].first - v[i-1].first==aaa && v[i].second - v[i-1].second==bbb){
				ans++;
			}
		}
		if(max1<ans){
			max1=ans;
		}
		ans=0;
	}
	printf("%lld",N-max1);
	
    //std::vector<int>::iterator iter = std::max_element(v.first.begin(), v.second.end());
    //size_t index = std::distance(v.first.begin(), iter);
    
    //printf("%lld",);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: 'i' was not declared in this scope
   30 |          aaa=v[i].first - v[i-1].first;
      |                ^
Language: C++

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

bool f(vector<bool> &used) {
    for (auto &b: used) if (!b) return true;
    return false;
}

int gcd(int n, int m) {
    if (n < m) swap(n,m);
    while (m) {
        n %= m;
        swap(n,m);
    }
    return n;
}

void solve() {
    int n;
    cin >> n;
    VLL x(n), y(n);
    REP(i,0,n) cin >> x[i] >> y[i];
    vector<bool> used(n);
    int cnt = 0;

    map<pair<PII,int>, int> m;
    while (f(used)) {
        ++cnt;
        REP(i,0,n) REP(j,i+1,n) {
            int dx = x[j] - x[i], dy = y[j] - y[i];
            int g = gcd(dx, dy);
            dx /= g;
            dy /= g;
            int b = y[i] - dy / dx * x[i];
            m[MP(MP(dy,dx),b)]++;
        }
        auto it = max_element(all(m));
        int ddx = it->first.first.first, ddy = it->first.first.second, db = it->first.second;
        REP(i,0,n) {
            if (LL(y[i] - db) * ddx == LL(ddx) * x[i]) {
                used[i] = true;
            }
        }
    }
    cout << cnt << endl;
}

int main() {
    solve();
    
    return 0;
}

Compiler output:
a.cc: In function 'bool f(std::vector<bool>&)':
a.cc:61:19: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference'
   61 |     for (auto &b: used) if (!b) return true;
      |                   ^~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<cstdlib>
#include<map>
#include<algorithm>
#include<vector>
using namespace std;

vector<long long int> vx,vy;
long long int x[55],y[55];
map<long long int,long long int> mpx,mpy;
int N;
int main (){
    cin >> N;
    for(int i=0; i<N; i++) {
        cin >> x[i] >> y[i];
        mpx[abs(x[i])]++;
        mpy[abs(y[i])]++;
    }
    sort(x,x+N);
    sort(y,y+N);
    for(int i=0; i<N; i++) {
        for(int j=i+1; j<N; j++) {
            if(x[i]-x[j]!=0)vx.push_back(abs(x[i]-x[j]));
            if(y[i]-y[j]!=0)vy.push_back(abs(y[i]-y[j]));
        }
    }
    long long int ansy = 99999999999;
    long long int ansx = 99999999999;
        for(int i=0; i<vx.size(); i++) {
        long long int cntx = 1;
        long long int cnty = 1;
        for(int j=0; j<N-1; j++) {
             if( mpx[x[j]+vx[i]] == 0) cntx++;
             if( mpy[y[j]+vy[i]] == 0 ) cnty++;
        }
        ansy = min(ansy,cnty);
        ansx = min(ansx,cntx);
        }
    }
    cout << max(ansy,ansx) << endl;
    return 0;
}


Compiler output:
a.cc:41:5: error: 'cout' does not name a type
   41 |     cout << max(ansy,ansx) << endl;
      |     ^~~~
a.cc:42:5: error: expected unqualified-id before 'return'
   42 |     return 0;
      |     ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
  int N;// neg; 負のAiの個数
  cin >> N;
  vector<int> x(N), y(N);
  priority_queue<pair<int, int>> vec;
  vector<vector<vector<int>>> vec(N, vector<vector<int>>(N, vector<int>(2,0)));// N x N x 2

  rep(i, N) {
    cin >> x[i] >> y[i];
    //cout << x[i] << y[i];
  }
  int tmp = 0;
  for(int i=0; i<N; i++) {
    for(int j=i+1; i<N; j++) {
      tmp = x[i] - x[j];
      if(tmp>0) {
        vec.push(make_pair(tmp, y[i]-y[j]));
      } else {
        vec.push(make_pair(-tmp, -y[i]+y[j]));
      }
      // cout << tmp << endl;
    }
  }
  
  int cnt = 0;
  int maxcnt = 0;
  pair<int, int> tmp_p = make_pair(0, 0);
  rep(i, N*(N-1)/2) {
    auto p = vec.top();
    vec.pop();
    if(tmp_p == p) cnt++; 
    else {
        if(cnt>maxcnt) maxcnt = cnt;
        tmp_p = p;
        cnt = 0;
    }
  }
  
  cout << N-maxcnt+1 << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: conflicting declaration 'std::vector<std::vector<std::vector<int> > > vec'
   20 |   vector<vector<vector<int>>> vec(N, vector<vector<int>>(N, vector<int>(2,0)));// N x N x 2
      |                               ^~~
a.cc:19:34: note: previous declaration as 'std::priority_queue<std::pair<int, int> > vec'
   19 |   priority_queue<pair<int, int>> vec;
      |                                  ^~~