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

#include<iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

bool vector_finder(vector<int> vec, int number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return true;
	}else { // 発見できなかったとき
		return false;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	


	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> x[i - 1] >> y[i - 1];
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				vector<int> f;
				for (int k = 1; k <= N; k++) {

					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == false) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
			}
		}
	}

	cout << Cost << endl;
}







Compiler output:
a.cc: In function 'bool vector_finder(std::vector<int>, int)':
a.cc:14:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  	cin >> n;
  	vector<int> x(n);
  	vector<int> y(n);
  	for(int i=0;i<n;i++){
      cin >> x[i] >> y[i];
    }
  	int p,q;
  	int cost=1;
  	vector<int> c;
  for(int i=0;i<n-1;i++){
    p=x[i+1]-x[i];
    q=y[i+1]-y[i];
    for(int j=0;j<n-1;j++){
      if( p!=(x[j+1]-x[j]) && q!=(y[j+1]-y[j]) ){
        cost++;
      }
    }
    	c.bush_back(cost);
  }
  int m=c[0];
  	for(size_t i=0;i<c.size();i++){
      m=min(m,c[i])
    }
  
  cout << m << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'class std::vector<int>' has no member named 'bush_back'; did you mean 'push_back'?
   23 |         c.bush_back(cost);
      |           ^~~~~~~~~
      |           push_back
a.cc:27:20: error: expected ';' before '}' token
   27 |       m=min(m,c[i])
      |                    ^
      |                    ;
   28 |     }
      |     ~
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

bool vector_finder(vector<int> vec, int number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return true;
	}else { // 発見できなかったとき
		return false;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	


	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> x[i - 1] >> y[i - 1];
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				vector<int> f;
				for (int k = 1; k <= N; k++) {

					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == false) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
			}
		}
	}

	cout << Cost << endl;


Compiler output:
a.cc: In function 'bool vector_finder(std::vector<int>, int)':
a.cc:14:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:64:30: error: expected '}' at end of input
   64 |         cout << Cost << endl;
      |                              ^
a.cc:23:11: note: to match this '{'
   23 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

bool vector_finder(vector<int> vec, int number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return true;
	}else { // 発見できなかったとき
		return false;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	vector<int> f;


	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> x[i - 1] >> y[i - 1];
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				for (int k = 1; k <= N; k++) {
					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == false) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
				f.clear();
			}
		}
	}

	cout << Cost << endl;


Compiler output:
a.cc: In function 'bool vector_finder(std::vector<int>, int)':
a.cc:14:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:63:30: error: expected '}' at end of input
   63 |         cout << Cost << endl;
      |                              ^
a.cc:23:11: note: to match this '{'
   23 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
  if(n==1)cout<<1<<endl;
  else{
    vector<pair<long long ,long long > > d(0),d2(0),xy(n);
    for(int i=0;i<n;i++){
        cin >> xy[i].first>>xy[i].second;
    }
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
          if((xy[i].first-xy[j].first)*(xy[i].second-xy[j].second)>=0)
            d.push_back({abs(xy[i].first-xy[j].first),abs(xy[i].second-xy[j].second)});
          else if((xy[i].first-xy[j].first)*(xy[i].second-xy[j].second)<0){
            if(xy[i].second-xy[j].second<0)
              d2.push_back({xy[i].first-xy[j].first,-xy[i].second+xy[j].second});
            else
              d2.push_back({-xy[i].first+xy[j].first,xy[i].second-xy[j].second});
        }
    }
    long long ma=1,ma2=1;
    if(d.size()>0){
      sort(d.begin(),d.end());
      long long a=d[0].first,b=d[0].second,count=1;
      for(int i=1;i<d.size();i++){
        if(a==d[i].first&&b==d[i].second){
            count++;
        }
        else{
            ma=max(ma,count);
            count=1;
            a=d[i].first,b=d[i].second;
        }
      }
    }
    if(d2.size()>0){
      sort(d2.begin(),d2.end());
      long long a=d2[0].first,b=d2[0].second,count=1;
      for(int i=1;i<d2.size();i++){
        if(a==d2[i].first&&b==d2[i].second){
            count++;
        }
        else{
            ma2=max(ma2,count);
            count=1;
            a=d2[i].first,b=d2[i].second;
        }
      }
    }
}

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

#include<iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

int vector_finder(vector<int> vec, int number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}else { // 発見できなかったとき
		return 0;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	vector<int> f;


	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> x[i - 1] >> y[i - 1];
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				for (int k = 1; k <= N; k++) {
					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == 0) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
				f.clear();
			}
		}
	}

	cout << Cost << endl;
}

Compiler output:
a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:14:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   14 |         auto itr = find(vec.begin(), vec.end(), number);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

int vector_finder(std::vector<int> vec, int number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}else { // 発見できなかったとき
		return 0;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	vector<int> f;


	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> x[i - 1] >> y[i - 1];
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				for (int k = 1; k <= N; k++) {
					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == 0) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
				f.clear();
			}
		}
	}

	cout << Cost << endl;
}

Compiler output:
a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:14:29: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |         auto itr = std::find(vec.begin(), vec.end(), number);
      |                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:29: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   14 |         auto itr = std::find(vec.begin(), vec.end(), number);
      |                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include<vector>
#include<math.h>
#include<string>

typedef long long ll;
typedef unsigned short int unsi;
typedef unsigned int uni;
typedef unsigned long int unli;

using namespace std;

int vector_finder(std::vector<int> vec, int number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}else { // 発見できなかったとき
		return 0;
	}
}

int main(){
	int N;
	int x[50];
	int y[50];
	int Cost = 50;
	int c = 0;

	int dx, dy;
	int t;
	vector<int> f;


	scanf("%d", &N);

	for (int i = 1; i <= N; i++) {
		scanf("%d%d", &x[i-1], &y[i-1]);
	}
	
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			if (j != i) {
				dx = x[i - 1] - x[j - 1];
				dy = y[i - 1] - y[j - 1];
				for (int k = 1; k <= N; k++) {
					t = dx * y[k - 1] - dy * x[k - 1];
					if (vector_finder(f, t) == 0) {
						c++;
						f.push_back(t);
					}
				}

				if (Cost > c) {
					Cost = c;
				}
				c = 0;
				f.clear();
			}
		}
	}

	printf("%d", Cost);
}

Compiler output:
a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:14:25: error: 'find' is not a member of 'std'
   14 |         auto itr = std::find(vec.begin(), vec.end(), number);
      |                         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <utility>
#include <cstdio>
#include <cstring>
#define int long long
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)



void main(){
	int n, count=0, sub_max=0, max=0;
	vector<pair<int, int>> pairs(50);
	vector<pair<int, int>> vec(2500);
	pair<int, int> maxv;
	cin >> n;
	rep(i, n) cin >> pairs[i].first >> pairs[i].second;

	pairs.resize(n);
	vec.resize(n * n);

	rep(i, n){
		rep(k, n){
			vec[count] = make_pair(pairs[i].first - pairs[k].first, pairs[i].second - pairs[k].second);
			count++;
		}
	}

	rep(i, n * n){
		if(vec[i].first < 0){
			vec[i].first = -vec[i].first;
			vec[i].second = -vec[i].second;
		}
	}

	sort(vec.begin(), vec.end());

	rep(i, n * n){
		// cout << "debug i:" << i <<" " << vec[i].first << " " << vec[i].second << endl;
		if (vec[i].first == vec[i + 1].first && vec[i].second == vec[i + 1].second)
		{
			if (!(vec[i].first == 0 && vec[i].second == 0)){
				sub_max++;
			}
		}else{
			sub_max =1;
		}
		if(sub_max > max){
			max = sub_max;
			maxv = make_pair(vec[i].first, vec[i].second);
		}
	}

	// cout << "debug " <<maxv.first << " "<<maxv.second << endl;
	cout << n - max/2;

	return 0;
}

Compiler output:
a.cc:19:1: error: '::main' must return 'int'
   19 | void main(){
      | ^~~~
Language: C++

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

int main()
{
    int N;
    cin >> N;
    int a[N][2];
    for (int i = 0; i < N; i++)
    {
        cin >> a[i][0] >> a[i][1];
    }
    int ans[N][N];
    for (int i = 0; i < N - 1; i++)
    {
        ans[i][0] = a[i + 1][0] - a[i][0];
        ans[i][1] = a[i + 1][1] - a[i][1];
    }
    int sum[N];
    for (int i = 0; i < N; i++)
    {
        sum[i] = 0;
        int check[2];
        check[0] = ans[i][0];
        check[1] = ans[i][1];
        for (int j = 0; j < N; j++)
        {
            if (ans[j][0] == check[0] && ans[j][1] == check[1])
            {
                sum[i]++;
            }
        }
    }

    int maxv = INT_MIN;
    int minv = INT_MAX;
    for (int i = 0; i < N; ++i)
    {
        if (sum[i] > maxv)
            maxv = sum[i];
        if (sum[i] < minv)
            minv = sum[i];
    }
    cout << N - maxv << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: 'INT_MIN' was not declared in this scope
   36 |     int maxv = INT_MIN;
      |                ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc:37:16: error: 'INT_MAX' was not declared in this scope
   37 |     int minv = INT_MAX;
      |                ^~~~~~~
a.cc:37:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <utility>
#include <cstdio>
#include <cstring>
#define int long long
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)



void main(){
	int n, count=0, sub_max=0, max=0;
	vector<pair<int, int>> pairs(50);
	vector<pair<int, int>> vec(2500);
	pair<int, int> maxv;
	cin >> n;
	rep(i, n) cin >> pairs[i].first >> pairs[i].second;

	pairs.resize(n);
	vec.resize(n * n);

	rep(i, n){
		rep(k, n){
			vec[count] = make_pair(pairs[i].first - pairs[k].first, pairs[i].second - pairs[k].second);
			count++;
		}
	}

	rep(i, n * n){
		if(vec[i].first < 0){
			vec[i].first = -vec[i].first;
			vec[i].second = -vec[i].second;
		}
	}

	sort(vec.begin(), vec.end());

	rep(i, n * n){
		// cout << "debug i:" << i <<" " << vec[i].first << " " << vec[i].second << endl;
		if (vec[i].first == vec[i + 1].first && vec[i].second == vec[i + 1].second)
		{
			if (!(vec[i].first == 0 && vec[i].second == 0)){
				sub_max++;
			}
		}else{
			sub_max =1;
		}
		if(sub_max > max){
			max = sub_max;
			maxv = make_pair(vec[i].first, vec[i].second);
		}
	}

	// cout << "debug " <<maxv.first << " "<<maxv.second << endl;
	cout << n - max/2;

	return 0
}

Compiler output:
a.cc:19:1: error: '::main' must return 'int'
   19 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:65:17: error: expected ';' before '}' token
   65 |         return 0
      |                 ^
      |                 ;
   66 | }
      | ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <utility>
#include <cstdio>
#include <cstring>
#define int long long
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)



void main(){
	int n, count=0, sub_max=0, max=0;
	vector<pair<int, int>> pairs(50);
	vector<pair<int, int>> vec(2500);
	pair<int, int> maxv;
	cin >> n;
	rep(i, n) cin >> pairs[i].first >> pairs[i].second;

	pairs.resize(n);
	vec.resize(n * n);

	rep(i, n){
		rep(k, n){
			vec[count] = make_pair(pairs[i].first - pairs[k].first, pairs[i].second - pairs[k].second);
			count++;
		}
	}

	rep(i, n * n){
		if(vec[i].first < 0){
			vec[i].first = -vec[i].first;
			vec[i].second = -vec[i].second;
		}
	}

	sort(vec.begin(), vec.end());

	rep(i, n * n){
		// cout << "debug i:" << i <<" " << vec[i].first << " " << vec[i].second << endl;
		if (vec[i].first == vec[i + 1].first && vec[i].second == vec[i + 1].second)
		{
			if (!(vec[i].first == 0 && vec[i].second == 0)){
				sub_max++;
			}
		}else{
			sub_max =1;
		}
		if(sub_max > max){
			max = sub_max;
			maxv = make_pair(vec[i].first, vec[i].second);
		}
	}

	// cout << "debug " <<maxv.first << " "<<maxv.second << endl;
	cout << n - max/2;
}

Compiler output:
a.cc:19:1: error: '::main' must return 'int'
   19 | void main(){
      | ^~~~
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, sum, minsum = 100;
  for (int i = 1; i < N; i++) {
    for (int ie = 1; ie <= i; ie++) {
      p =P.at(i).x - P.at(i-ie).x;
      for (int k = 1; k < N;k++) {
        for (int ke = 1; ke <= k;ke++) {
        q = P.at(k).y - P.at(k-ke).y;
        if (p==0 && q==0) continue;
        sum = 1;
        for (int j=1; j<N; j++) {
          if ((P.at(j).x - P.at(j-1).x) != p || (P.at(j).y - P.at(j-1).y) != q) {
            sum++;
          }
        }
        minsum = min(sum, minsum);
      }
    }
  }
  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:31:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   31 | int main() {
      |         ^~
a.cc:31:9: note: remove parentheses to default-initialize a variable
   31 | int main() {
      |         ^~
      |         --
a.cc:31:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:31:12: error: a function-definition is not allowed here before '{' token
   31 | int main() {
      |            ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:9:33: note: to match this '{'
    9 | int getpq(int N, vector<pos> P) {
      |                                 ^
a.cc:47:2: warning: control reaches end of non-void function [-Wreturn-type]
   47 | }
      |  ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <utility>
#include <cstdio>
#include <cstring>
#define int long long
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)



int main(){
	int n, count=0, sub_max=0, max=0;
	vector<pair<int, int>> pairs(50);
	vector<pair<int, int>> vec(2500);
	pair<int, int> maxv;
	cin >> n;
	rep(i, n) cin >> pairs[i].first >> pairs[i].second;

	pairs.resize(n);
	vec.resize(n * n);

	rep(i, n){
		rep(k, n){
			vec[count] = make_pair(pairs[i].first - pairs[k].first, pairs[i].second - pairs[k].second);
			count++;
		}
	}

	rep(i, n * n){
		if(vec[i].first < 0){
			vec[i].first = -vec[i].first;
			vec[i].second = -vec[i].second;
		}
	}

	sort(vec.begin(), vec.end());

	rep(i, n * n){
		// cout << "debug i:" << i <<" " << vec[i].first << " " << vec[i].second << endl;
		if (vec[i].first == vec[i + 1].first && vec[i].second == vec[i + 1].second)
		{
			if (!(vec[i].first == 0 && vec[i].second == 0)){
				sub_max++;
			}
		}else{
			sub_max =1;
		}
		if(sub_max > max){
			max = sub_max;
			maxv = make_pair(vec[i].first, vec[i].second);
		}
	}

	// cout << "debug " <<maxv.first << " "<<maxv.second << endl;
	cout << n - max/2;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int INF=1e9+5;
bool vis[INF][INF];
int x[55];
int y[55];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++)cin>>x[i]>>y[i];
	map<int,int> mp;
	map<int,int> inv;
	for(int i=0;i<n;i++){
		mp[x[i]]=y[i];
		inv[y[i]]=x[i];
	}
	int ans=0;
	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			memset(vis,false,sizeof(vis));
			for(int k=0;k<n;k++){
				vis[x[k]-1][y[k]-1]=true;
			}
			int di=x[i]-x[j];
			int dj=y[i]-y[j];
			int cnt=0;
			for(int k=0;k<n;k++){
				for(int l=0;l<n;l++){
					if(k!=l&&mp[x[k]-di]==y[l]&&inv[y[k]-dj]==x[l]&&vis[x[k]-di][y[k]-dj]){
						cnt++;
						vis[x[k]-di][y[k]-dj]=false;
						break;
					}
				}
			}
			ans=max(ans,cnt);
		}
	}
	cout<<n-ans<<endl;
	return 0;
}

Compiler output:
/tmp/ccTnyBsX.o: in function `main':
a.cc:(.text+0x3b): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x67): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0xfb): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x112): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x19b): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x1b5): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x1f7): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x20e): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccTnyBsX.o
a.cc:(.text+0x22a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>

int n,x[50],y[50],p,q,fir[50],res,ans=0x7fffffff;

in main(){
  scanf("%d",&n);
  for(int i=0;i<n;i++)scanf("%d%d",&x[i],&y[i]);
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i!=j){
        p=x[i]-x[j],q=y[i]-y[j],res=n;
        for(int k=0;k<n;k++){
          for(int l=0;l<n;l++){
            if(x[k]-p==x[l]&&y[k]-q==y[l]){
              res--;
              break;
            }
          }
        if(res<ans)ans=res;
        }
      }
    }
  }
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc:5:1: error: 'in' does not name a type; did you mean 'int'?
    5 | in main(){
      | ^~
      | int
Language: C

//
// Created by yuu on 2019-06-09.
//

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <math.h>
#include <stack>
#include <queue>

using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}

int main(void){
    int N;
    cin>>N;

    pair<int, int > xy;
    vector<pair <int, int >> pairs;

    vector<pair<int, int>> kousa;


    for (int i = 0; i < N; ++i) {
        int x, y;
        cin>>x>>y;
        pairs.push_back(make_pair(x, y));
    }

    sort(pairs.begin(), pairs.end(), compare_by_a);

    for (int i = N-1; i > 0; i--) {
        int first = pairs[i].first - pairs[i-1].first;
        int second= pairs[i].second - pairs[i-1].second;

        kousa.push_back(make_pair(first,second));
    }

    map<pair<int, int>, int> freq_kousa;

    for (int i = 0; i < kousa.size(); ++i) {
        freq_kousa[kousa[i]] = 0;
    }

    for (int i = 0; i < kousa.size(); ++i) {
        freq_kousa[kousa[i]] = freq_kousa[kousa[i]] + 1;
    }
    int max_freq = freq_kousa[kousa[0]];
    xy = kousa[0];


    for (int i = 0; i < kousa.size(); ++i) {
        if(max_freq < freq_kousa[kousa[i]]) {
            max_freq = freq_kousa[kousa[i]];
            xy = kousa[i];
        }
    }
//    sort(kousa.begin(), kousa.end(), compare_by_a);

    int p = xy.first;
    int q = xy.second;

    int cost = 0;
    for (int i = N-1; i >= 0; i--) {
        if(i == N-1){
            cost ++;
        }else{
            if(pairs[i].first + p == pairs[i+1].first && pairs[i].second + q == pairs[i+1].second){
                continue;
            }else{
                cost++;
            }
        }
    }

    cout<<cost<<endl;
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
struct each{
    int x,y;
}a[90];
map<P,int>ma;
bool com(each x,each y){
    if(x.x==y.x)    return x.y<y.y;
    return x.x<y.x;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&a[i].x,&a[i].y);
        ma[P(a[i].x,a[i].y)]=i;
    }
    sort(a+1,a+n+1,com);
    int ans=2147483647;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)
            if(i!=j) {
            long long p=a[i].x-a[j].x,q=a[i].y-a[j].y,cost=0;
            for(int k=1;k<=n;k++)
                if(ma.count(P(a[k].x+p,a[k].y+q)))
                    ++cost;
            ans=min(ans,n-cost);
        }
    }
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: no matching function for call to 'min(int&, long long int)'
   28 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
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:28:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   28 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
/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:28:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   28 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<bitset>
#include<utility>
#include<sstream>
#include<iomanip>
using namespace std;

#define ll long long
#define MP make_pair

ll n,x[50],y[50],c=1,maxnx=0,maxny=0,sx[1000000000]={},sy[1000000000]={};
ll tx[1000000000]={},ty[1000000000]={};

int main(void) {
	int  ans;

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

	sort(p.begin(),p.begin()+n);

	//cout<<"\n";
	/*for (int i = 0; i < n; i++) {
		printf("%lld %lld\n",p[i].first,p[i].second);
	}*/
	//cout<<"\n";

	for (int i = 0; i < n; i++) {
		if(i>0){
			sx[p[i].first-p[i-1].first]++;
			sy[p[i].second-p[i-1].second]++;
			maxnx=max(maxnx,sx[p[i].first-p[i-1].first]);
			maxny=max(maxny,sy[p[i].second-p[i-1].second]);
		}

	}
	int num=max(n-maxnx,n-maxny);
	ans=num;
	//cout<<ans<<"\n\n";

	for (int i = 0; i < n; i++) {
		p[i]=MP(y[i],x[i]);

	}

	sort(p.begin(),p.begin()+n);
	/*for (int i = 0; i < n; i++) {
		printf("%lld %lld\n",p[i].first,p[i].second);
	}*/
	//cout<<"\n";
	maxnx=0;
	maxny=0;

	for (int i = 0; i < n; i++) {
		if(i>0){
			tx[p[i].first-p[i-1].first]++;
			ty[p[i].second-p[i-1].second]++;
			maxnx=max(maxnx,tx[p[i].first-p[i-1].first]);
			maxny=max(maxny,ty[p[i].second-p[i-1].second]);
		}

	}
	num=max(n-maxnx,n-maxny);
	ans=min(ans,num);
	cout<<ans<<"\n";


	return 0;
}


Compiler output:
/tmp/cciyRhdY.o: in function `main':
a.cc:(.text+0x24d): relocation truncated to fit: R_X86_64_PC32 against symbol `sy' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x264): relocation truncated to fit: R_X86_64_PC32 against symbol `sy' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x31d): relocation truncated to fit: R_X86_64_PC32 against symbol `sy' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x4f6): relocation truncated to fit: R_X86_64_PC32 against symbol `tx' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x50d): relocation truncated to fit: R_X86_64_PC32 against symbol `tx' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x561): relocation truncated to fit: R_X86_64_PC32 against symbol `ty' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x578): relocation truncated to fit: R_X86_64_PC32 against symbol `ty' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x5c6): relocation truncated to fit: R_X86_64_PC32 against symbol `tx' defined in .bss section in /tmp/cciyRhdY.o
a.cc:(.text+0x631): relocation truncated to fit: R_X86_64_PC32 against symbol `ty' defined in .bss section in /tmp/cciyRhdY.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<long long,long long>P;
struct each{
    long long x,y;
}a[90];
map<P,int>ma;
bool com(each x,each y){
    if(x.x==y.x)    return x.y<y.y;
    return x.x<y.x;
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&a[i].x,&a[i].y);
        ma[P(a[i].x,a[i].y)]=i;
    }
    int ans=2147483647;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)
            if(i!=j) {
            long long p=a[i].x-a[j].x,q=a[i].y-a[j].y,cost=0;
            for(int k=1;k<=n;k++)
                if(ma.count(P(a[k].x+p,a[k].y+q)))
                    ++cost;
            ans=min(ans,n-cost);
        }
    }
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:20: error: no matching function for call to 'min(int&, long long int)'
   27 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
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:27:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   27 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
/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:27:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   27 |             ans=min(ans,n-cost);
      |                 ~~~^~~~~~~~~~~~
Language: C++

#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(a,b) memset(a,b,sizeof(a))
#define msn(a,n,b) for(int i=0;i<=n;i++)a[i]=b
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define fi first
#define se second
using namespace std;
mt19937 rng_32(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const int mod=1e9+7;
const int seed=233;
const double PI=acos(-1.0);
const double eps=1e-7;
const int inf=0x3f3f3f3f;
const int max_n=100005;
namespace {
    inline int Add(int x,int y){return (x+=y)>=mod?x-mod:x;}
    inline int Sub(int x,int y){return (x-=y)<0?x+mod:x;}
    inline int Mul(int x,int y) {return 1ll*x*y%mod;}
    inline int Pow(int x,int y=mod-2){int res=1;while(y){if(y&1)res=1ll*res*x%mod;x=1ll*x*x%mod;y>>=1;}return res;}
}
/**********************head************************/
P p[55];
int n;
int cal(ll dx,ll dy)
{
    set<P> s;
    for(int i=1;i<=n;i++)s.insert(p[i]);
    int res=0;
    while(!s.empty())
    {
        P tp=*s.begin();
        ll x=tp.fi,y=tp.se;
        while(s.find(P(x,y))!=s.end())
        {
            s.erase(P(x,y));
            x+=dx,y+=dy;
        }
        res++;
    }
    return res;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%lld%lld",&p[i].fi,&p[i].se);
    map<P,int> mp;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            if(j==i)continue;
            int dx=p[i].fi-p[j].fi,dy=p[i].se-p[j].se;
            mp[P(x,y)]++;
        }
    }
    int ans=0;
    for(auto x:mp)ans=max(ans,x.second);
    printf("%d\n",n-ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:18: error: 'x' was not declared in this scope; did you mean 'dx'?
   59 |             mp[P(x,y)]++;
      |                  ^
      |                  dx
a.cc:59:20: error: 'y' was not declared in this scope; did you mean 'dy'?
   59 |             mp[P(x,y)]++;
      |                    ^
      |                    dy
Language: C++

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

#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long
a.
int main(){
    int n, k;
    cin>>n>>k;
    if(k==1){
        cout<<"0"<<endl;
    }
    else{
        cout<<(1+n-k)-1;
    }
    return 0;
}

Compiler output:
a.cc:10:1: error: 'a' does not name a type
   10 | a.
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define MMOD(i) ((i%MOD)+MOD)%MOD;
#define all(v) v.begin() , v.end()
#define vec(i,j) vector<vector<ll>>(i,vector<ll>(j,0))
const ll INF=99999999999999;
const ll MOD=1000000007;
const ll MAX_N=100010;
ll a,b,c,d,e,f,x,y,z,k,m,n,l,q,h,w,t,ans=0;
vl v,v1,v2;
vp p;
string s;
ll solve(){
   rep(i,n){
       rep(j,i){
           x=p[i].first-p[j].first;
           y=p[i].second-p[j].second;
           a=0;
           rep(k,n){
               rep(l,k){
                   if(p[k].first-p[l].first==x&&p[k].second-p[l].second==y){
                       a++;
                   }
               }
           }
           ans=fminl(n*(n-1)/2-a,ans);
       }
   }

Compiler output:
a.cc: In function 'll solve()':
a.cc:32:5: error: expected '}' at end of input
   32 |    }
      |     ^
a.cc:17:11: note: to match this '{'
   17 | ll solve(){
      |           ^
a.cc:32:5: warning: no return statement in function returning non-void [-Wreturn-type]
   32 |    }
      |     ^
Language: C++

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

int main(){
  int n;
	int x,y;
  	cin >> n;
  	vector<int> x(n);
  	vector<int> y(n);
  	for(int i=0;i<n;i++){
      cin >> x[i] >> y[i];
    }
  	int p,q;
  	int cost=1;
  	p=x[1]-x[0];
  	q=y[1]-y[0];
  	for(int i=0;i<n-1;i++){
      if( p!=(x[i+1]-x[i]) && q!=(y[i+1]-y[i]) ){
        cost++;
      }
    }
  	cout << cost <<endl;
  return 0;
}
         
     

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: conflicting declaration 'std::vector<int> x'
    8 |         vector<int> x(n);
      |                     ^
a.cc:6:13: note: previous declaration as 'int x'
    6 |         int x,y;
      |             ^
a.cc:9:21: error: conflicting declaration 'std::vector<int> y'
    9 |         vector<int> y(n);
      |                     ^
a.cc:6:15: note: previous declaration as 'int y'
    6 |         int x,y;
      |               ^
a.cc:11:15: error: invalid types 'int[int]' for array subscript
   11 |       cin >> x[i] >> y[i];
      |               ^
a.cc:11:23: error: invalid types 'int[int]' for array subscript
   11 |       cin >> x[i] >> y[i];
      |                       ^
a.cc:15:12: error: invalid types 'int[int]' for array subscript
   15 |         p=x[1]-x[0];
      |            ^
a.cc:15:17: error: invalid types 'int[int]' for array subscript
   15 |         p=x[1]-x[0];
      |                 ^
a.cc:16:12: error: invalid types 'int[int]' for array subscript
   16 |         q=y[1]-y[0];
      |            ^
a.cc:16:17: error: invalid types 'int[int]' for array subscript
   16 |         q=y[1]-y[0];
      |                 ^
a.cc:18:16: error: invalid types 'int[int]' for array subscript
   18 |       if( p!=(x[i+1]-x[i]) && q!=(y[i+1]-y[i]) ){
      |                ^
a.cc:18:23: error: invalid types 'int[int]' for array subscript
   18 |       if( p!=(x[i+1]-x[i]) && q!=(y[i+1]-y[i]) ){
      |                       ^
a.cc:18:36: error: invalid types 'int[int]' for array subscript
   18 |       if( p!=(x[i+1]-x[i]) && q!=(y[i+1]-y[i]) ){
      |                                    ^
a.cc:18:43: error: invalid types 'int[int]' for array subscript
   18 |       if( p!=(x[i+1]-x[i]) && q!=(y[i+1]-y[i]) ){
      |                                           ^
Language: C++

int N;
ll X[50], Y[50];
{
  int i, j, k, a, b;
  int res, tmp;
  ll p, q;

  rd(N,(X,Y)(N));
  res = N;

  rep(a,N) rep(b,a+1,N){
    p = X[b] - X[a];
    q = Y[b] - Y[a];

    tmp = N;
    rep(i,N) rep(j,N) if(X[j]-X[i]==p && Y[j]-Y[i]==q) tmp--;
    res <?= tmp;
  }

  wt(res);
}


Compiler output:
a.cc:2:1: error: 'll' does not name a type
    2 | ll X[50], Y[50];
      | ^~
a.cc:3:1: error: expected unqualified-id before '{' token
    3 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
struct each{
    int x,y;
}a[90];
map<P,int>ma;
int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&a[i].x,&a[i].y);
        ma[P(a[i].x,a[i].y)]=i;
    }
    int ans=2147483647;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)
            if(i!=j) {
            int p=a[i].x-a[j].x,q=a[i].y-a[j].y,cost=0;
            for(int k=1;k<=n;k++)
                if(ma.count(P(a[k].x+p,a[k].y+q)))
                    ++cost;
            if(!k)  ans=min(ans,n-cost);
        }
    }
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'k' was not declared in this scope
   23 |             if(!k)  ans=min(ans,n-cost);
      |                 ^
Language: C++

#include <iostream>

using namespace std;

int main() {
    int N;
    cin >> N;

    pair<int, int> P[N];
    int x, y;
    for(int i = 0; i < N; i++) {
        cin >> x >> y;
        P[i] = make_pair(x, y);
    }

    sort(P, P + N);

    int p, q, max_cnt = 0;
    for(int i = 0; i < N - 1; i++) {
        int cnt = 1;
        p = P[i + 1].first - P[i].first;
        q = P[i + 1].second - P[i].second;
        for(int j = i + 1; j < N - 1; j++) {
            if(P[j + 1].first - P[j].first == p && P[j + 1].second - P[j].second == q) cnt++;
        }
        max_cnt = max(max_cnt, cnt);
    }

    cout << N - max_cnt << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort(P, P + N);
      |     ^~~~
      |     short