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

#define for(int i=0;i<n;i++){ a;a[200],b[200],c[1000],d[1000],n,m,i,j,k,t,w,q;main(){for(;;){scanf("%d",&n);if(!n)break;for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);scanf("%d",&m);for(i=0;i<m;i++)scanf("%d%d",&c[i],&d[i]);for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=0;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;} 

Compiler output:
main.c:1:17: error: expected ',' or ')', found "i"
    1 | #define for(int i=0;i<n;i++){ a;a[200],b[200],c[1000],d[1000],n,m,i,j,k,t,w,q;main(){for(;;){scanf("%d",&n);if(!n)break;for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);scanf("%d",&m);for(i=0;i<m;i++)scanf("%d%d",&c[i],&d[i]);for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=0;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |                 ^
Language: C

#define for(int i=0;i<n;i++) a;a[200],b[200],c[1000],d[1000],n,m,i,j,k,t,w,q;main(){for(;;){scanf("%d",&n);if(!n)break;for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);scanf("%d",&m);for(i=0;i<m;i++)scanf("%d%d",&c[i],&d[i]);for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=0;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;} 

Compiler output:
main.c:1:17: error: expected ',' or ')', found "i"
    1 | #define for(int i=0;i<n;i++) a;a[200],b[200],c[1000],d[1000],n,m,i,j,k,t,w,q;main(){for(;;){scanf("%d",&n);if(!n)break;for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);scanf("%d",&m);for(i=0;i<m;i++)scanf("%d%d",&c[i],&d[i]);for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=0;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |                 ^
Language: C++

#include <iostream>
using namespace std;
int n,m,seiz[220][2],data[1100][2],x,y,cnt,k;
int main(){
	while(;;){
	cin>>m;
	if(m==0){
		break;
	}
	for(int i=0;i<m;i++){
		cin>>seiz[i][0]>>seiz[i][1];
	}
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>data[i][0]>>data[i][1];
	}
	for(int i=0;i<n;i++){
		cnt=1;
		x=data[i][0]-seiz[0][0];
		y=data[i][1]-seiz[0][1];
		for(int j=1;j<m;j++){
			for(k=0;k<n;k++){
				if(k!=i && seiz[j][0]==(data[k][0]-x)){
					if(seiz[j][1]==(data[k][1]-y)){
						cnt++;
						break;
					}
				}
			}
					
		}
		if(cnt==m){
			break;
		}
	}
	cout<<x<<" "<<y<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: expected primary-expression before ';' token
    5 |         while(;;){
      |               ^
a.cc:5:15: error: expected ')' before ';' token
    5 |         while(;;){
      |              ~^
      |               )
a.cc:5:17: error: expected primary-expression before ')' token
    5 |         while(;;){
      |                 ^
Language: C++

#include<iostream>
#include<map>
#include<algorithm>
#include<mpi.h>

using namespace std;

typedef pair<int, int> P;

#define F first
#define S second

int main(int argc, char *argv[])
{
  int size, tag = 0;
  int m, n, x, y;
  int ans_x, ans_y;
  int rank, numprocs;
  P target[256], star[1024];
  P shift[1024];
  
  MPI_Request req;
  MPI_Status stat;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  while(1){
    if(rank == 0){
      cin >> m;
      if(m != 0){
	for(int i = 0;i < m; i++)
	  cin >> target[i].F >> target[i].S;
	cin >> n;
	for(int i = 0;i < n; i++)
	  cin >> star[i].F >> star[i].S;
      
	sort(target, target + m);
	sort(star, star + n);
      }
    }

    size = n / numprocs;
    if(rank == numprocs - 1)
      size = n / numprocs + n % numprocs;
    
    MPI_Bcast(&m, 1, MPI_INT, 0, MPI_COMM_WORLD);
    if(!m) break;
    MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);
    MPI_Bcast(target, m, MPI::TWOINT, 0, MPI_COMM_WORLD);
    /*
    if(rank == 0){
      for(int i = 1;i < numprocs; i++)
	MPI_Isend(&star[i * size], i == numprocs - 1 ? size : size + n % numprocs, MPI::TWOINT, i, tag, MPI_COMM_WORLD, &req);
    } else {
      MPI_Irecv(&star[rank * size], size, MPI::TWOINT, 0, tag, MPI_COMM_WORLD, &req);
      MPI_Wait(&req, &stat);
    }
    */
    MPI_Bcast( star, n, MPI::TWOINT, 0, MPI_COMM_WORLD);
	
    bool flag;
    int start = rank * (n / numprocs);
    int end = (rank + 1) * (n / numprocs);
    if(rank == numprocs - 1)
      end = n;

    for(int i = start;i < end; i++){
      flag = true;
      x = star[i].F - target[0].F;
      y = star[i].S - target[0].S;

      for(int j = 0;j < m; j++){
	if(!binary_search(star, star + n, P(target[j].F + x, target[j].S + y))){
	  flag = false;
	  break;
	}	
      }
      if(flag) break;
    }
    
    if(!flag) x = y = 0;
    MPI_Reduce(&x, &ans_x, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    MPI_Reduce(&y, &ans_y, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    
    if(rank == 0)
      cout << ans_x << " " << ans_y << endl;
  }

  MPI_Finalize();

}

Compiler output:
a.cc:4:9: fatal error: mpi.h: No such file or directory
    4 | #include<mpi.h>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<map>
#include<algorithm>
#include"mpi.h"

using namespace std;

typedef pair<int, int> P;

#define F first
#define S second

int main(int argc, char *argv[])
{
  int size, tag = 0;
  int m, n, x, y;
  int ans_x, ans_y;
  int rank, numprocs;
  P target[256], star[1024];
  P shift[1024];
  
  MPI_Request req;
  MPI_Status stat;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  while(1){
    if(rank == 0){
      cin >> m;
      if(m != 0){
	for(int i = 0;i < m; i++)
	  cin >> target[i].F >> target[i].S;
	cin >> n;
	for(int i = 0;i < n; i++)
	  cin >> star[i].F >> star[i].S;
      
	sort(target, target + m);
	sort(star, star + n);
      }
    }

    size = n / numprocs;
    if(rank == numprocs - 1)
      size = n / numprocs + n % numprocs;
    
    MPI_Bcast(&m, 1, MPI_INT, 0, MPI_COMM_WORLD);
    if(!m) break;
    MPI_Bcast(&n, 1, MPI_INT, 0, MPI_COMM_WORLD);
    MPI_Bcast(target, m, MPI::TWOINT, 0, MPI_COMM_WORLD);
    /*
    if(rank == 0){
      for(int i = 1;i < numprocs; i++)
	MPI_Isend(&star[i * size], i == numprocs - 1 ? size : size + n % numprocs, MPI::TWOINT, i, tag, MPI_COMM_WORLD, &req);
    } else {
      MPI_Irecv(&star[rank * size], size, MPI::TWOINT, 0, tag, MPI_COMM_WORLD, &req);
      MPI_Wait(&req, &stat);
    }
    */
    MPI_Bcast( star, n, MPI::TWOINT, 0, MPI_COMM_WORLD);
	
    bool flag;
    int start = rank * (n / numprocs);
    int end = (rank + 1) * (n / numprocs);
    if(rank == numprocs - 1)
      end = n;

    for(int i = start;i < end; i++){
      flag = true;
      x = star[i].F - target[0].F;
      y = star[i].S - target[0].S;

      for(int j = 0;j < m; j++){
	if(!binary_search(star, star + n, P(target[j].F + x, target[j].S + y))){
	  flag = false;
	  break;
	}	
      }
      if(flag) break;
    }
    
    if(!flag) x = y = 0;
    MPI_Reduce(&x, &ans_x, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    MPI_Reduce(&y, &ans_y, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
    
    if(rank == 0)
      cout << ans_x << " " << ans_y << endl;
  }

  MPI_Finalize();

}

Compiler output:
a.cc:4:9: fatal error: mpi.h: No such file or directory
    4 | #include"mpi.h"
      |         ^~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; ++i)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define PB push_back
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> Point;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cerr << #x << " = " << (x) << "\n"
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

int m, n;
vector<PII> vp, vp2;

void input() {
  cin >> m;
  if ( !m ) {
    return;
  }
  vp.resize( m );
  for ( int i = 0; i < m; i++ ) {
    cin >> vp[ i ].first >> vp[ i ].second;
  }
  cin >> n;
  vp2.resize( n );
  for ( int i = 0; i < n; i++ ) {
    cin >> vp2[ i ].first >> vp2[ i ].second;
  }
}


void solve() {
  set<PII> s( vp2.begin(), vp2.end() );
  for ( int i = 0; i < n; i++ ) {
    bool isans = true;
    for ( int j = 0; j < m; j++ ) {
      if ( !s.count( MP( vp[ j ].first + vp2[ i ].first - vp[ 0 ].first, vp[ j ].second + vp2[ i ].second - vp[ 0 ].second ) ) ) {
        isans = false;
        break;
      }
    }
    if ( isans ) {
      cout << vp2[ i ].first - vp[ 0 ].first << " " << vp2[ i ].second - vp[ 0 ].second << "\n";
      break;
    }
  }
}

int main() {
  ios::sync_with_stdio( false );
  cin.tie( 0 );
  while ( true ) {
    input();
    if ( m == 0 ) {
      break;
    }
#ifdef WIN32
    clock_t stime = clock();
#endif
    solve();
#ifdef WIN32
    clock_t etime = clock();
    cerr << "TIME : " << ( double ) ( etime - stime ) / CLOCKS_PER_SEC << "\n";
  }
#endif
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; ++i)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define PB push_back
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> Point;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cerr << #x << " = " << (x) << "\n"
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

int m, n;
vector<PII> vp, vp2;

void input() {
  cin >> m;
  if ( !m ) {
    return;
  }
  vp.resize( m );
  for ( int i = 0; i < m; i++ ) {
    cin >> vp[ i ].first >> vp[ i ].second;
  }
  cin >> n;
  vp2.resize( n );
  for ( int i = 0; i < n; i++ ) {
    cin >> vp2[ i ].first >> vp2[ i ].second;
  }
}


void solve() {
  set<PII> s( vp2.begin(), vp2.end() );
  for ( int i = 0; i < n; i++ ) {
    bool isans = true;
    for ( int j = 0; j < m; j++ ) {
      if ( !s.count( MP( vp[ j ].first + vp2[ i ].first - vp[ 0 ].first, vp[ j ].second + vp2[ i ].second - vp[ 0 ].second ) ) ) {
        isans = false;
        break;
      }
    }
    if ( isans ) {
      cout << vp2[ i ].first - vp[ 0 ].first << " " << vp2[ i ].second - vp[ 0 ].second << "\n";
      break;
    }
  }
}

int main() {
  ios::sync_with_stdio( false );
  cin.tie( 0 );
  while ( true ) {
    input();
    if ( !m ) {
      break;
    }
#ifdef WIN32
    clock_t stime = clock();
#endif
    solve();
#ifdef WIN32
    clock_t etime = clock();
    cerr << "TIME : " << ( double ) ( etime - stime ) / CLOCKS_PER_SEC << "\n";
  }
#endif
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; ++i)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define PB push_back
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> Point;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cerr << #x << " = " << (x) << "\n"
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

int m, n;
vector<PII> vp, vp2;

void input() {
  cin >> m;
  if ( !m ) {
    return;
  }
  vp.resize( m );
  for ( int i = 0; i < m; i++ ) {
    cin >> vp[ i ].first >> vp[ i ].second;
  }
  cin >> n;
  vp2.resize( n );
  for ( int i = 0; i < n; i++ ) {
    cin >> vp2[ i ].first >> vp2[ i ].second;
  }
}


void solve() {
  set<PII> s( vp2.begin(), vp2.end() );
  for ( int i = 0; i < n; i++ ) {
    bool isans = true;
    for ( int j = 0; j < m; j++ ) {
      if ( !s.count( MP( vp[ j ].first + vp2[ i ].first - vp[ 0 ].first, vp[ j ].second + vp2[ i ].second - vp[ 0 ].second ) ) ) {
        isans = false;
        break;
      }
    }
    if ( isans ) {
      cout << vp2[ i ].first - vp[ 0 ].first << " " << vp2[ i ].second - vp[ 0 ].second << "\n";
      break;
    }
  }
}

int main() {
  ios::sync_with_stdio( false );
  cin.tie( 0 );
  while ( true ) {
    input();
    if ( !m ) 
      break;
#ifdef WIN32
    clock_t stime = clock();
#endif
    solve();
#ifdef WIN32
    clock_t etime = clock();
    cerr << "TIME : " << ( double ) ( etime - stime ) / CLOCKS_PER_SEC << "\n";
  }
#endif
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; ++i)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define PB push_back
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> Point;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1ll << 60;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };

#ifdef WIN32
#define dump(x) cerr << #x << " = " << (x) << "\n"
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n"
#else
#define dump(x)
#define debug(x)
#endif

int m = 1, n;
vector<PII> vp, vp2;

void input() {
  cin >> m;
  if ( !m ) {
    return;
  }
  vp.resize( m );
  for ( int i = 0; i < m; i++ ) {
    cin >> vp[ i ].first >> vp[ i ].second;
  }
  cin >> n;
  vp2.resize( n );
  for ( int i = 0; i < n; i++ ) {
    cin >> vp2[ i ].first >> vp2[ i ].second;
  }
}


void solve() {
  set<PII> s( vp2.begin(), vp2.end() );
  for ( int i = 0; i < n; i++ ) {
    bool isans = true;
    for ( int j = 0; j < m; j++ ) {
      if ( !s.count( MP( vp[ j ].first + vp2[ i ].first - vp[ 0 ].first, vp[ j ].second + vp2[ i ].second - vp[ 0 ].second ) ) ) {
        isans = false;
        break;
      }
    }
    if ( isans ) {
      cout << vp2[ i ].first - vp[ 0 ].first << " " << vp2[ i ].second - vp[ 0 ].second << "\n";
      break;
    }
  }
}

int main() {
  ios::sync_with_stdio( false );
  cin.tie( 0 );
  while ( true ) {
    input();
    if ( !m ) 
      break;
#ifdef WIN32
    clock_t stime = clock();
#endif
    solve();
#ifdef WIN32
    clock_t etime = clock();
    cerr << "TIME : " << ( double ) ( etime - stime ) / CLOCKS_PER_SEC << "\n";
  }
#endif
  return 0;
}

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

#include<iostream>
using namespace std;
 
struct location{
    int x;
    int y;
};
 
bool solve2(int m, int n, location sample[], location star[], int start)
{
    int star_now = start;
    for (int i = 1; i < m - 1; i++){
        location vec_sample;
        vec_sample.x = sample[i + 1].x - sample[i].x;
        vec_sample.y = sample[i + 1].y - sample[i].y;
 
        for (int j = 0; j < n; j++){
            location vec_star;
            vec_star.x = star[j].x - star[star_now].x;
            vec_star.y = star[j].y - star[star_now].y;

            if (vec_sample.x == vec_star.x && vec_sample.y == vec_star.y){
                star_now=j;
                break;
            }
        }
 
        if (j == m){ return false; }
    }
    return true;
}
 
void solve1(int m, int n, location sample[], location star[])
{
    location vec_sample;
    vec_sample.x = sample[1].x - sample[0].x;
    vec_sample.y = sample[1].y - sample[0].y;
 
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            location vec_star;
            vec_star.x = star[j].x - star[i].x;
            vec_star.y = star[j].y - star[i].y;
 
            if (vec_sample.x == vec_star.x && vec_sample.y == vec_star.y){
                bool check = solve2(m, n, sample, star, j);
                if (check){
                    cout << star[i].x - sample[0].x << " " << star[i].y - sample[0].y << endl;
                    return;
                }
            }
        }
    }
}
 
int main()
{
    while (1){
        int m;
        cin >> m;
        if (!m){ break; }
 
        int n;
        location sample[200], star[1000];
        for (int i = 0; i < m; i++){
            cin >> sample[i].x >> sample[i].y;
        }
        cin >> n;
        for (int i = 0; i < n; i++){
            cin >> star[i].x >> star[i].y;
        }
 
        solve1(m, n, sample, star);
 
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool solve2(int, int, location*, location*, int)':
a.cc:28:13: error: 'j' was not declared in this scope
   28 |         if (j == m){ return false; }
      |             ^
Language: C++


//aoj 0524 Searching Constellation

#include<iostream>

using namespace std;

int main(){
	while (1){
		int n, m, x, y, roop = 0, a[200][2]={}, b[1000][2]={}, star[1000000][2]={},starx[1000000] = {}, stary[1000000] = {}, starx2[1000000] = {}, stary2[1000000] = {};;

		cin >> n;
		
		if (n == 0){
			return 0;
		}

		for (int i = 0; i < n; i++){

			cin >> x >> y;

			starx[x] = 1;

			stary[y] = 1;

			a[i][0] = x;

			a[i][1] = y;

		}

		for (int i = 0; i < n - 1; i++){

			star[i][0] = a[i + 1][0] - a[0][0];

			star[i][1] = a[i + 1][1] - a[0][1];

		}

		cin >> m;

		for (int i = 0; i < m; i++){

			cin >> x >> y;

			starx2[x] = 1;

			stary2[y] = 1;

			b[i][0] = x;

			b[i][1] = y;

		}
		for (int i = 0; i < n; i++){

			for (int j = 0; j < n; j++){

				if (starx2[b[i][0] + star[j][0]] == 1 && stary2[b[i][1] + star[j][1]] == 1){

					roop++;

					if (n == roop){

						cout << b[i][0] - a[0][0] << ' ' << b[i][1] - a[0][1] << endl;

					}

				}
				else{

					roop = 0;

				}

			}

		}
	
	}
	return 0;

}


//aoj 0524 Searching Constellation

#include<iostream>

using namespace std;

int starx[1000000] = {}, stary[1000000] = {}, starx2[1000000] = {}, stary2[1000000] = {};

int main(){
	while (1){
		int n, m, x, y, roop = 0, a[20000][2]={}, b[100000][2]={}, star[10000000][2]={};

		cin >> n;
		
		if (n == 0){
			return 0;
		}

		for (int i = 0; i < n; i++){

			cin >> x >> y;

			starx[x] = 1;

			stary[y] = 1;

			a[i][0] = x;

			a[i][1] = y;

		}

		for (int i = 0; i < n - 1; i++){

			star[i][0] = a[i + 1][0] - a[0][0];

			star[i][1] = a[i + 1][1] - a[0][1];

		}

		cin >> m;

		for (int i = 0; i < m; i++){

			cin >> x >> y;

			starx2[x] = 1;

			stary2[y] = 1;

			b[i][0] = x;

			b[i][1] = y;

		}
		for (int i = 0; i < n; i++){

			for (int j = 0; j < n; j++){

				if (starx2[b[i][0] + star[j][0]] == 1 && stary2[b[i][1] + star[j][1]] == 1){

					roop++;

					if (n == roop){

						cout << b[i][0] - a[0][0] << ' ' << b[i][1] - a[0][1] << endl;

					}

				}
				else{

					roop = 0;

				}

			}

		}
	
	}
	return 0;

}

Compiler output:
a.cc:94:5: error: redefinition of 'int main()'
   94 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <set>

using namespace std;

pair<int,int> d[300];
pair<int,int> dd[2000];

int main(){
 int m;
 scnaf("%d".&m);
 for(int i = 0; i < m; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  d[i] = make_pair(a,b);
 }
 int n;
 scanf("%d",&n);
 map<pair<int,int> > mp;
 for(int i = 0; i < n; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  dd[i] = make_pair(a,b);
  mp.insert(make_pair(a,b));
 }
 for(int i = 0; i < n; i++){
  bool ok = true;
  pair<int,int> shift = make_pair(dd[i].first - d[0].first,dd[i].second - d[0].second);
  for(int j = 0; j < m; j++){
   if(mp.end() == mp.find(make_pair(d[j].first + shift.first,d[j].second + shift.second))){
    ok = false;
    break;
   }
  }
  if(ok){
   printf("%d %d\n",shift.first,shift.second);
   break;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected unqualified-id before '&' token
   12 |  scnaf("%d".&m);
      |             ^
a.cc:12:2: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 |  scnaf("%d".&m);
      |  ^~~~~
      |  scanf
a.cc:20:2: error: 'map' was not declared in this scope
   20 |  map<pair<int,int> > mp;
      |  ^~~
a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    3 | #include <set>
  +++ |+#include <map>
    4 | 
a.cc:20:20: error: expected primary-expression before '>' token
   20 |  map<pair<int,int> > mp;
      |                    ^
a.cc:20:22: error: 'mp' was not declared in this scope; did you mean 'm'?
   20 |  map<pair<int,int> > mp;
      |                      ^~
      |                      m
Language: C++

#include <stdio.h>
#include <algorithm>
#include <set>

using namespace std;

pair<int,int> d[300];
pair<int,int> dd[2000];

int main(){
 int m;
 scnaf("%d".&m);
 for(int i = 0; i < m; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  d[i] = make_pair(a,b);
 }
 int n;
 scanf("%d",&n);
 set<pair<int,int> > mp;
 for(int i = 0; i < n; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  dd[i] = make_pair(a,b);
  mp.insert(make_pair(a,b));
 }
 for(int i = 0; i < n; i++){
  bool ok = true;
  pair<int,int> shift = make_pair(dd[i].first - d[0].first,dd[i].second - d[0].second);
  for(int j = 0; j < m; j++){
   if(mp.end() == mp.find(make_pair(d[j].first + shift.first,d[j].second + shift.second))){
    ok = false;
    break;
   }
  }
  if(ok){
   printf("%d %d\n",shift.first,shift.second);
   break;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected unqualified-id before '&' token
   12 |  scnaf("%d".&m);
      |             ^
a.cc:12:2: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 |  scnaf("%d".&m);
      |  ^~~~~
      |  scanf
Language: C++

#include <stdio.h>
#include <algorithm>
#include <set>

using namespace std;

pair<int,int> d[300];
pair<int,int> dd[2000];

int main(){
 int m;
 scnaf("%d",&m);
 for(int i = 0; i < m; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  d[i] = make_pair(a,b);
 }
 int n;
 scanf("%d",&n);
 set<pair<int,int> > mp;
 for(int i = 0; i < n; i++){
  int a,b;
  scanf("%d%d",&a,&b);
  dd[i] = make_pair(a,b);
  mp.insert(make_pair(a,b));
 }
 for(int i = 0; i < n; i++){
  bool ok = true;
  pair<int,int> shift = make_pair(dd[i].first - d[0].first,dd[i].second - d[0].second);
  for(int j = 0; j < m; j++){
   if(mp.end() == mp.find(make_pair(d[j].first + shift.first,d[j].second + shift.second))){
    ok = false;
    break;
   }
  }
  if(ok){
   printf("%d %d\n",shift.first,shift.second);
   break;
  }
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:2: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 |  scnaf("%d",&m);
      |  ^~~~~
      |  scanf
Language: C++

#include<iostream>
using namespace std;
main(){
int n,m,i,j,k,l,x[9999][2],y[9999][2],x2,y2,c,a;
while(true){
cin>>m;
if(m==0){break;}
for(i=0;i<m;i++){cin>>x[i][0]>>y[i][0];}
cin>>n;
for(i=0;i<n;i++){cin>>x[i][1]>>y[i][1];}
for(i=0;i<m;i++){
for(j=0;j<n;j++){
a=0;x2=x[j][1]-x[i][0];y2=y[j][1]-y[i][0];
for(k=0;k<m;k++){c=0;
for(l=0;l<n;l++){
if(x[k][0]+x2==x[l][1] && y[k][0]+y2==y[l][1]){c++;break;}
}
if(c==0){break;}
a++;
if(a==m){goto z;}
}
}
z:;
cout<<x2<<' '<<y2<<endl;
}
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:3:7: note: to match this '{'
    3 | main(){
      |       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;

P f(P a, P b)
{
	return P(b.first - a.first, b.second - a.second);
}

int main()
{
	int m, n;

	while (true) {
		cin >> m;
		if (m == 0) break;

		vector<P> seiza(m);

		for (int i = 0; i < m; ++i) cin >> seiza[i].first >> seiza[i].second;

		cin >> n;

		vector<P> image(n);

		for (int i = 0; i < n; ++i) cin >> image[i].first >> image[i].second;

		P s0 = seiza[0];

		for (int i = 0; i < n; ++i) {
			int cnt = 1;
			bool f = false;

			P amount_of_change = f(s0, image[i]);
			for (int j = 1; j < m; ++j) {
				P sj = seiza[j];
				for (int k = 0; k < n; ++k) {
					if (sj.first + amount_of_change.first == image[k].first && sj.second + amount_of_change.second == image[k].second) {
						cnt++;
					}
				}

				if (cnt == m) {
					printf("%d %d\n", amount_of_change.first, amount_of_change.second);
					goto end;
				}
			}
		}
end:;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:47: error: 'f' cannot be used as a function
   36 |                         P amount_of_change = f(s0, image[i]);
      |                                              ~^~~~~~~~~~~~~~
Language: C++

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

typedef pair <int,int> PII;
typedef vector <PII> VPII;

int main( void )
{
	int m, n;
	while ( cin >> m && m )
	{
		int x, y;

		VPII search( m );
		for ( int i = 0; i < m; i++ )
		{
			cin >> x >> y;
			search[i] = make_pair( x, y );
		}
		cin >> n;
		VPII field( n );
		for ( int i = 0; i < n; i++ )
		{
			cin >> x >> y;
			field[i] = make_pair( x, y );
		}

		VPII d( m );
		for ( int i = 1; i < m; i++ )
		{
			d[i].first = search[i].first - search[0].first;
			d[i].second = search[i].second - search[0].second;
		}

		for ( int i = 0; i < n; i++ )
		{
			bool found = true;
			for ( int j = 1; found && j < m; j++ )
			{
				PII q = field[i];
				q.first += d[j].first;
				q.second += d[j].second;
				if ( find( field.begin(), field.end(), q ) == field.end() ) found = false;
			}
			if ( found )
			{
				cout << field[i].first - search[0].first << " " << field[i].second - search[0].second << endl;
				break;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:42: error: no matching function for call to 'find(std::vector<std::pair<int, int> >::iterator, std::vector<std::pair<int, int> >::iterator, PII&)'
   45 |                                 if ( find( field.begin(), field.end(), q ) == field.end() ) found = false;
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:45:42: note:   '__gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   45 |                                 if ( find( field.begin(), field.end(), q ) == field.end() ) found = false;
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

5
8 5
6 4
4 3
7 10
0 10
10
10 5
2 7
9 7
8 10
10 2
1 2
8 1
6 7
6 0
0 9
5
904207 809784
845370 244806
499091 59863
638406 182509
435076 362268
10
757559 866424
114810 239537
519926 989458
461089 424480
674361 448440
81851 150384
459107 795405
299682 6700
254125 362183
50795 541942
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5
      | ^
Language: C++

int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:1:76: error: 'scanf' was not declared in this scope
    1 | int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |                                                                            ^~~~~
a.cc:1:344: error: 'printf' was not declared in this scope
    1 | int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |                                                                                                                                                                                                                                                                                                                                                        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
Language: C++

#include<stdio.h>int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}

Compiler output:
a.cc:1:22: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |                      ^
a.cc:1:9: fatal error: stdio.h>in: No such file or directory
    1 | #include<stdio.h>int a[200],b[200],c[1000],d[1000],n,m,i,j,k,t=0;int w,q;int main(){for(;;){scanf("%d",&n);if(n==0)break;for(i=0;i<n;i++){scanf("%d %d",&a[i],&b[i]);}scanf("%d",&m);for(i=0;i<m;i++){scanf("%d %d",&c[i],&d[i]);}for(i=0;i<m;i++){w=c[i]-a[0];q=d[i]-b[0];for(j=1;j<n;j++){for(k=0;k<m;k++){if(a[j]+w==c[k]){if(b[j]+q==d[k]){t++;break;}}}}if(t==n-1){printf("%d %d\n",w,q);t=0;break;}t=0;}}return 0;}
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <queue>
using namespace std;
int main(){
int m;
int c;
int f;
int g;
int h;
int i;
int j;
int k;
while(cin >>m){
if(m==0){break;}
int a[m];
int b[m];
c=0;
while(c<m){
cin >>a[c];
cin >>b[c];
c=c+1;}
cin >>n;
int d[n];
int e[n];
c=0;
while(c<n){
cin >>d[c];
cin >>e[c];
c=c+1;}
c=0;
while(c<n){
k=0;
f=d[c]-a[0];
g=e[c]-b[0];
h=1;
while(h<m){
j=0
i=0;
while(i<n){
if(a[h]+f==d[i]&&b[h]+g==e[i]){j=1; break;}
i=i+1;}
if(j==0){k=1; break;}
h=h+1;}
if(k==0){cout <<g<<" "<<h<<endl; break;}
c=c+1;}
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'n' was not declared in this scope
   22 | cin >>n;
      |       ^
a.cc:27:7: error: 'd' was not declared in this scope
   27 | cin >>d[c];
      |       ^
a.cc:28:7: error: 'e' was not declared in this scope
   28 | cin >>e[c];
      |       ^
a.cc:33:3: error: 'd' was not declared in this scope
   33 | f=d[c]-a[0];
      |   ^
a.cc:34:3: error: 'e' was not declared in this scope
   34 | g=e[c]-b[0];
      |   ^
a.cc:37:4: error: expected ';' before 'i'
   37 | j=0
      |    ^
      |    ;
   38 | i=0;
      | ~
Language: C++

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

int main()
{
while(true) {
int m, n;
vector<pair<int, int> > ms, ns;

scanf("%d", &m);
if(m == 0)
break;
ms.resize(m);
for(int i = 0; i < m; ++i)
scanf("%d%d", &ms[i].first, &ms[i].second);
scanf("%d", &n);
ns.resize(n);
for(int i = 0; i < n; ++i)
scanf("%d%d", &ns[i].first, &ns[i].second);
int dx, dy;
for(int i = 0; i < n; ++i) {
dx = ns[i].first - ms[0].first;
dy = ns[i].second - ms[0].second;
bool exist = true;
for(int j = 0; j < m; ++j) {
if(!binary_search(ns.begin(), ns.end(), make_pair(ms[i].first + dx, ms[i].second + dy)))
exist = false;
}
if(exist)
break;
}
printf("%d\n%d\n", dx, dy);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'binary_search' was not declared in this scope
   27 | if(!binary_search(ns.begin(), ns.end(), make_pair(ms[i].first + dx, ms[i].second + dy)))
      |     ^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)


int main(){

	while(true){
		
		int m,n,x,y;
		vector<pair<int,int> >c;
		vector<pair<int,int> >p;
		vector<pair<int,int> >s;
		cin >> m;
		if(m==0) break;
		rep(i,m){
		cin >> x >> y;
		c.push_back(make_pair(x,y));
		}
		cin >> n;
		rep(i,n){
		cin >> x >> y;
		p.push_back(make_pair(x,y));
		}
		sort(c.begin(),c.end());
		sort(p.begin(),p.end());
		int x=0; int y;
        rep(i,n){
		rep(j,m-1){
	    s.push_back(make_pair(p[i].first+c[j+1].first-c[0].first,p[i].second+c[j+1].second-c[0].second));
		REP(k,i+1,n-1){
		if(p[k]==s[j]){ x++; break;}
		}
        }
		s.clear();
		if(x==m-1){ y=i; break;}
	}
		cout << p[y].first-c[0].first << " " << p[y].second-c[0].second << endl;
        c.clear(); p.clear();
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:21: error: redeclaration of 'int x'
   46 |                 int x=0; int y;
      |                     ^
a.cc:29:25: note: 'int x' previously declared here
   29 |                 int m,n,x,y;
      |                         ^
a.cc:46:30: error: redeclaration of 'int y'
   46 |                 int x=0; int y;
      |                              ^
a.cc:29:27: note: 'int y' previously declared here
   29 |                 int m,n,x,y;
      |                           ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define MAX 200

struct Point{
  int x, y;

  bool operator < (const Point p)const{
    if(x != p.x){
      return x < p.x;
    }else{
      return y < p.y;
    }
  }
};

int n, m;
Point star[MAX], pict[MAX*5];

Point search(){
  Point res;
  vector<Point> v;

  for(int i = 0 ; i < m ; i++){
    for(int j = 0 ; j < n ; j++){
      Point P;
      P.x = pict[j].x - star[i].x;
      P.y = pict[j].y - star[i].y;
      v.push_back(P);
    }
  }
  sort(v.begin(),v.end());

  int cnt = 1;
  Point p = v[0];
  for(int i = 1 ; i < (int)v.size() ; i++){
    if(cnt == m){
      res = p;
      break;
    }

    if(p.x != v[i].x || p.y != v[i].y){
      p = v[i];
      cnt = 1;
    }else{
      cnt++;
    }
  }

  return res;
}

int main(){
  while(cin >> m, m){
    for(int i = 0 ; i < m ; i++){
      cin >> star[i].x >> star[i].y;
    }

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

    Point p = search();
    cout << p.x << " " << p.y << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'Point search()':
a.cc:35:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   35 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
Language: Java

import java.util.Scanner;

public class Solve {
	
	private static boolean debug = false;
	
	private static int r;
	private static int c;
	
	private static int[][] senbeis;
	
	private static int URA = 0, OMOTE = 1; 
	
	@SuppressWarnings("unused")
	private static void debug(String format, Object... objects) {
		if (!debug)
			return;
		System.out.format(format, objects);
	}
	
	public static int solve() {
		int ans = 0;
		for (int trial = 0; trial < (2 << 10); trial++) {
			int canSell = 0;
			for (int x = 0; x < c; x++) {
				int ura = 0;
				for (int y = 0; y < r; y++) {
					boolean reverses = ((y >> trial) & 1) == 0;
					int target = reverses ? URA : OMOTE;
					ura += (senbeis[y][x] == target) ? 1 : 0;
				}
				canSell += Math.max(ura, r - ura);
			}
			ans = Math.max(ans, canSell);
		}
		return ans;
	}
	
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		r = scanner.nextInt();
		c = scanner.nextInt();
		senbeis = new int[r][c];
		for (int i = 0; i < r; i++) {
			for (int j = 0; j < c; j++) {
				senbeis[i][j] = scanner.nextInt();
			}
		}
		debug("===\n");
		debug("%d %d\n", r, c);
		for (int i = 0; i < r; i++) {
			for (int j = 0; j < c; j++) {
				debug("%d ", senbeis[i][j]);
			}
			debug("\n");
		}
		debug("===\n");
		System.out.format("%d\n", solve());
		scanner.close();
	}
}

Compiler output:
Main.java:3: error: class Solve is public, should be declared in a file named Solve.java
public class Solve {
       ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
		int row,col;
		int[] cols;
		int cnt_min = 10*10000;
		
		row = scn.nextInt();
		col = scn.nextInt();
		cols = new int[col];
		
		for(int i=0; i<row; i++) for(int j=0; j<col; j++)
			cols[j] = cols[j]<<1+scn.nextInt();
		
		for(int i=0; i<1<<(row-1); i++){
			int cnt=0;
			for(int column : cols){
				int tmp=0;
				column=column^i;
				for(int j=0; j<row; j++){
					if(column&1 == 0)
						tmp++;
					column = column>>1;
				}
				cnt += (tmp<(row-tmp))?tmp:(row-tmp);
			}
			cnt_min = (cnt<cnt_min)?cnt:cnt_min;
		}
		
		System.out.println(cnt_min);
	}
}

Compiler output:
Main.java:23: error: bad operand types for binary operator '&'
					if(column&1 == 0)
					         ^
  first type:  int
  second type: boolean
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
		int row,col;
		int[] cols;
		int cnt_min = 10*10000;

while(true){
		row = scn.nextInt();
		col = scn.nextInt();
if(row==0&&col==0) break;

		cols = new int[col];

		for(int i=0; i<row; i++) for(int j=0; j<col; j++)
			cols[j] = cols[j]<<1+scn.nextInt();

		for(int i=0; i<1<<(row-1); i++){
			int cnt=0;
			for(int column : cols){
				int tmp=0;
				column=column^i;
				for(int j=0; j<row; j++){
					if(column&1 == 0)
						tmp++;
					column = column>>1;
				}
				cnt += (tmp<(row-tmp))?tmp:(row-tmp);
			}
			cnt_min = (cnt<cnt_min)?cnt:cnt_min;
		}

		System.out.println(cnt_min);
}
	}
}

Compiler output:
Main.java:26: error: bad operand types for binary operator '&'
					if(column&1 == 0)
					         ^
  first type:  int
  second type: boolean
1 error
Language: Java

import java.util.*;

public class aoj525{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
		int row,col;
		int[] cols;
		int cnt_min = 10*10000;

		while(true){
			row = scn.nextInt();
			col = scn.nextInt();
			
			if(row==0&&col==0) break;
			
			cols = new int[col];
	
			for(int i=0; i<row; i++) for(int j=0; j<col; j++)
				cols[j] = (cols[j]<<1)+scn.nextInt();
	
			for(int i=0; i<(1<<(row-1)); i++){
				int cnt=0;
				for(int column : cols){
					int tmp=0;
					column=column^i;
					for(int j=0; j<row; j++){
						tmp += column&1;
						column >>= 1;
					}
					cnt += (tmp<(row-tmp))?tmp:(row-tmp);
				}
				cnt_min = (cnt<cnt_min)?cnt:cnt_min;
			}
	
			System.out.println(row*col-cnt_min);
		}
	}
}

Compiler output:
Main.java:3: error: class aoj525 is public, should be declared in a file named aoj525.java
public class aoj525{
       ^
1 error
Language: Java

import java.util.*;

public class aoj525{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
		int row,col;
		int[] cols;
		int cnt_min;

		while(true){
			cnt_min = 10*10000;
			row = scn.nextInt();
			col = scn.nextInt();
			
			if(row==0&&col==0) break;
			
			cols = new int[col];
	
			for(int i=0; i<row; i++) for(int j=0; j<col; j++)
				cols[j] = (cols[j]<<1)+scn.nextInt();
	
			for(int i=0; i<(1<<(row-1)); i++){
				int cnt=0;
				for(int column : cols){
					int tmp=0;
					column=column^i;
					for(int j=0; j<row; j++){
						tmp += column&1;
						column >>= 1;
					}
					cnt += (tmp<(row-tmp))?tmp:(row-tmp);
				}
				cnt_min = (cnt<cnt_min)?cnt:cnt_min;
			}
	
			System.out.println(row*col-cnt_min);
		}
	}
}

Compiler output:
Main.java:3: error: class aoj525 is public, should be declared in a file named aoj525.java
public class aoj525{
       ^
1 error
Language: C

#include <cstdio>
#include <algorithm>
using namespace std;
int r, c, a[15][10005], maxn;
void dfs(int x)
{
    if (x == r + 1)
    {
        int temp = 0;
        for (int j = 1; j <= c; j++)
        {
            int s = 0;
            for (int i = 1; i <= r; i++)
                if (a[i][j] == 1)
                    s++;
            temp += max(s, r - s);
        }
        maxn = max(maxn, temp);
        return ;
    }
    dfs(x + 1);
    for (int i = 1; i <= c; i++)
        a[x][i] = !a[x][i];
    dfs(x + 1);
}
int main()
{
    while (scanf("%d %d", &r, &c) != EOF)
    {
        maxn = 0;
        if (r == 0 && c == 0)
            break;
        for (int i = 1; i <= r; i++)
            for (int j = 1; j <= c; j++)
                scanf("%d", &a[i][j]);
        dfs(1);
        printf("%d\n", maxn);
    }
    return 0;
}


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

#include<stdio.h>


int r,c;
char senbei[10][10000],check[10];
long max;

void search(int i){
	if(i>=r){
		long stock;
		stock=count();
		max=(stock>max)?stock:max;
		return;
	}
	check[i]=1;
	search(i+1);
	check[i]=0;
	search(i+1);
}

long count(){
	int i,j;
	char num;
	long ans=0;
	for(i=0;i<c;i++){
		num=0;
		for(j=0;j<r;j++){
			num+=senbei[j][i]^check[j];
		}
		if((int)num>(r/2)) ans+=(long)num;
		else ans+=(long)(r-(int)num);
	}
	return ans;
}

int main(){
	int i,j;
	while(1){
		scanf("%d %d",&r,&c);
		if(r==0) break;
		for(i=0;i<r;i++){
			for(j=0;j<c;j++){
				scanf("%d",&senbei[i][j]);
			}
		}
		max=0;
		search(0);
		printf("%ld\n",max);
	}
    return 0;
}

Compiler output:
main.c: In function 'search':
main.c:11:23: error: implicit declaration of function 'count' [-Wimplicit-function-declaration]
   11 |                 stock=count();
      |                       ^~~~~
main.c: At top level:
main.c:21:6: error: conflicting types for 'count'; have 'long int()'
   21 | long count(){
      |      ^~~~~
main.c:11:23: note: previous implicit declaration of 'count' with type 'int()'
   11 |                 stock=count();
      |                       ^~~~~