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

#include <iostream>
using namespace std;
int main() {
  int i;
  char s[10];
  while(cin>>i,i){
    sprintf(s,"%o",i);
    for(i=0;s[i]!='\0';i++){
      if(s[i]>='4')s[i]++;
      if(s[i]>='6')s[i]++;
}
    printf("%s\n",ans);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     printf("%s\n",ans);
      |                   ^~~
      |                   abs
Language: C++

#include <iostream>
using namespace std;


long long int d8(long long int c, int n, int d)
{
	int r2 = n % 8;
	if (r2 > 4) r2++;
	if (r2 > 3) r2++;
	c += r2 * pow(10,d - 1);
	if (n / 8 > 0)
		c = d8(c, n / 8, d + 1);
	
	return c;
}

int main()
{
	int n;
	while (cin >> n && n != 0)
	{
		cout << d8(0, n, 1) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'long long int d8(long long int, int, int)':
a.cc:10:19: error: 'pow' was not declared in this scope
   10 |         c += r2 * pow(10,d - 1);
      |                   ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef __int64 ll;
//typedef long long ll;
ll n;

int main(){
	while(cin>>n){
		if(!n)return 0;
		ll m=n,d=1,p;
		while(m>7){m/=8;d++;}
		for(int i=d-1;i>=0;i--){
			p=(n/(int)(pow(8,i)+0.1))%8;
			if(p<4)cout<<p;
			else if(p<5)cout<<p+1;
			else cout<<p+2;
		}
		cout<<endl;
	}
}

Compiler output:
a.cc:16:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc:18:1: error: 'll' does not name a type
   18 | ll n;
      | ^~
a.cc: In function 'int main()':
a.cc:21:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |         while(cin>>n){
      |                    ^
      |                    yn
a.cc:23:17: error: 'll' was not declared in this scope
   23 |                 ll m=n,d=1,p;
      |                 ^~
a.cc:24:23: error: 'm' was not declared in this scope; did you mean 'tm'?
   24 |                 while(m>7){m/=8;d++;}
      |                       ^
      |                       tm
a.cc:24:33: error: 'd' was not declared in this scope
   24 |                 while(m>7){m/=8;d++;}
      |                                 ^
a.cc:25:27: error: 'd' was not declared in this scope
   25 |                 for(int i=d-1;i>=0;i--){
      |                           ^
a.cc:26:25: error: 'p' was not declared in this scope
   26 |                         p=(n/(int)(pow(8,i)+0.1))%8;
      |                         ^
Language: C++

#inmport<cstdio>
s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inmport; did you mean #import?
    1 | #inmport<cstdio>
      |  ^~~~~~~
      |  import
a.cc:2:1: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      | ^
a.cc: In function 'int s(int)':
a.cc:2:24: error: 'printf' was not declared in this scope
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inmport<cstdio>
a.cc:2:65: warning: no return statement in function returning non-void [-Wreturn-type]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                 ^
a.cc: At global scope:
a.cc:2:66: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                  ^~~~
a.cc: In function 'int main()':
a.cc:2:83: error: 'scanf' was not declared in this scope
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                                   ^~~~~
a.cc:2:100: error: 'puts' was not declared in this scope
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                                                    ^~~~
Language: C++

#import<cstdio>
s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc:2:1: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      | ^
a.cc: In function 'int s(int)':
a.cc:2:65: warning: no return statement in function returning non-void [-Wreturn-type]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                 ^
a.cc: At global scope:
a.cc:2:66: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                  ^~~~
Language: C++

#inmport<cstdio>
void s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inmport; did you mean #import?
    1 | #inmport<cstdio>
      |  ^~~~~~~
      |  import
a.cc: In function 'void s(int)':
a.cc:2:29: error: 'printf' was not declared in this scope
    2 | void s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inmport<cstdio>
a.cc: At global scope:
a.cc:2:71: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | void s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                       ^~~~
a.cc: In function 'int main()':
a.cc:2:88: error: 'scanf' was not declared in this scope
    2 | void s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                                        ^~~~~
a.cc:2:105: error: 'puts' was not declared in this scope
    2 | void s(int n){if(n>7)s(n/8);printf("%d",n%8<4?n%8:n%8<6?n%8+1:n%8+2);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                                                         ^~~~
Language: C++

#import<cstdio>
t[]={0,1,2,3,5,7,8,9};
void s(int n){if(n>7)s(n/8);printf("%d",t[n%8]);}
main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc:2:1: error: 't' does not name a type
    2 | t[]={0,1,2,3,5,7,8,9};
      | ^
a.cc: In function 'void s(int)':
a.cc:3:41: error: 't' was not declared in this scope
    3 | void s(int n){if(n>7)s(n/8);printf("%d",t[n%8]);}
      |                                         ^
a.cc: At global scope:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      | ^~~~
Language: C++

#import<cstdio>
int t[]={,1,2,3,5,7,8,9,};void s(int n){if(n>7)s(n/8);printf("%d",t[n%8]);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<cstdio>
      |  ^~~~~~
a.cc:2:10: error: expected primary-expression before ',' token
    2 | int t[]={,1,2,3,5,7,8,9,};void s(int n){if(n>7)s(n/8);printf("%d",t[n%8]);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |          ^
a.cc:2:76: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int t[]={,1,2,3,5,7,8,9,};void s(int n){if(n>7)s(n/8);printf("%d",t[n%8]);}main(){for(int a;scanf("%d",&a),a;puts(""))s(a);}
      |                                                                            ^~~~
Language: C++

#include<iostream>

int n;
int pw[10] = {1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};

void solve(){
	__int64 ans = 0;
	int tmp = n;
	for(int i=0; i<10; i++){
		int temp = tmp%8;
		if(temp==4)
			temp++;
		else if(temp > 4)
			temp+=2;
		ans += temp*pw[i];
		tmp = tmp/8;
		if(tmp == 0)
			break;
	}
	std::cout << ans << std::endl;
}

int main(){
	while(true){
		std::cin >> n;
		if(!n)
			return 0;
		solve();
	}
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:7:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    7 |         __int64 ans = 0;
      |         ^~~~~~~
      |         __int64_t
a.cc:15:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                 ans += temp*pw[i];
      |                 ^~~
      |                 abs
a.cc:20:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         std::cout << ans << std::endl;
      |                      ^~~
      |                      abs
Language: C++

#include<iostream>
#include<sstream>
#include<algorithm>

using namespace std;

const string s = "01235789"

int main(){
  int n;
  while(cin >> n, n){
    stringstream ss;
    while(n){
      ss << s[n % 8];
      n /= 8;
    }
    string ans = ss.str();
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc:9:1: error: expected ',' or ';' before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {

	long long int n, r;
	string s="";
	char x[sizeof(int)];

	while(cin >> n) {
		if(!n)
			break;
		r=0;
		
		for(int i=0; i<n; i++) {
			while(1) {
				r++;
				sprintf(x, "%d", r);
				if(!(strchr(x, '4')!=NULL)&&!(strchr(x, '6')!=NULL))
					break;
			}
		}
		cout << x << endl;
	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: 'strchr' was not declared in this scope
   21 |                                 if(!(strchr(x, '4')!=NULL)&&!(strchr(x, '6')!=NULL))
      |                                      ^~~~~~
a.cc:2:1: note: 'strchr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double eps = 1e-8;

int main(){
	const char oct[] = {'0','1','2','3','5','7','8','9'};
	ll n;
	while(~scanf("%lld",&n)){
		if(n==0) break;
		char buf[11];
		sprintf(buf,"%llo",n);

		for(int i=10;i>=0;i--){
			if(buf[i]-'0' < 0 || buf[i]-'0' >= 8) continue;
			buf[i] = oct[buf[i]-'0'];
		}
		printf("%s",buf)
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:33: error: expected ';' before '}' token
   37 |                 printf("%s",buf)
      |                                 ^
      |                                 ;
   38 |         }
      |         ~
Language: C++

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

string toOct(long long  d)
{
	char c[30];
	string s = "";
	
	sprintf_s(c, "%o", d);
	s += c;

	return s;
}


string solve(long long  n)
{
	char c[30];
	string s;

	s = toOct(n);

	for( int i = 0; i < (int)s.length(); i++)
	{
		if( s[i] >= '4' )
			s[i] += '1' - '0';

		if( s[i] >= '6' )
			s[i] += '1' - '0';
	}

	return s;
}


int main()
{
	long long n;

	while( cin >> n, n)
	{
		cout << solve(n) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::string toOct(long long int)':
a.cc:12:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   12 |         sprintf_s(c, "%o", d);
      |         ^~~~~~~~~
      |         sprintf
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

string toOct(long long  d)
{
	char c[30];
	string s = "";
	
	sprintf_s(c, "%o", d);
	s += c;

	return s;
}


string solve(long long  n)
{
	char c[30];
	string s;

	s = toOct(n);

	for( int i = 0; i < (int)s.length(); i++)
	{
		if( s[i] >= '4' )
			s[i] += '1' - '0';

		if( s[i] >= '6' )
			s[i] += '1' - '0';
	}

	return s;
}


int main()
{
	long long n;

	while( cin >> n, n)
	{
		cout << solve(n) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::string toOct(long long int)':
a.cc:13:9: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   13 |         sprintf_s(c, "%o", d);
      |         ^~~~~~~~~
      |         sprintf
Language: C++

#include <iostream>
using namespace std;
int  main(){char s[]={'0','1','2','3','5','7','8','9'};int n;for(;cin>>n,n;cout<<a<<endl)for(string a="";n>0;n/=8)a=s[n%8]+a;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:82: error: 'a' was not declared in this scope
    3 | int  main(){char s[]={'0','1','2','3','5','7','8','9'};int n;for(;cin>>n,n;cout<<a<<endl)for(string a="";n>0;n/=8)a=s[n%8]+a;}
      |                                                                                  ^
Language: C++

#include<iostream>
using namespace std;

 const int table[] = { 1,2,3,4,5,6,7,8,9 };
 void surgeon(int x)
 {
  if(x>=8)
  {
  surgeon(n/8);
  }
 return(table[n%8]);
 }
 int main()
 {
 int n;
 while(cin>>n, n>0)
 {
  surgeon(n);
  cout<<endl;
  }
 return 0;
}

Compiler output:
a.cc: In function 'void surgeon(int)':
a.cc:9:11: error: 'n' was not declared in this scope
    9 |   surgeon(n/8);
      |           ^
a.cc:11:15: error: 'n' was not declared in this scope
   11 |  return(table[n%8]);
      |               ^
Language: C++

#include<iostream>
using namespace std;

 const int table[] = { 1,2,3,4,5,6,7,8,9 };
 void surgeon(int x)
 {
  if(x>=8)
  {
  surgeon(x/8);
  }
 return(table[x%8]);
 }
 int main()
 {
 int x;
 while(cin>>x, x>0)
 {
  surgeon(n);
  cout<<endl;
  }
 return 0;
}

Compiler output:
a.cc: In function 'void surgeon(int)':
a.cc:11:18: error: return-statement with a value, in function returning 'void' [-fpermissive]
   11 |  return(table[x%8]);
      |        ~~~~~~~~~~^~
a.cc: In function 'int main()':
a.cc:18:11: error: 'n' was not declared in this scope
   18 |   surgeon(n);
      |           ^
Language: C++

#include<iostream>
using namespace std;

 const int table[] = { 1,2,3,4,5,6,7,8,9 };
 void surgeon(int x)
 {
  if(x>=8)
  {
  surgeon(x/8);
  }
 return(table[x%8]);
 }
 int main()
 {
 int x;
 while(cin>>x, x>0)
 {
  surgeon(x);
  cout<<endl;
  }
 return 0;
}

Compiler output:
a.cc: In function 'void surgeon(int)':
a.cc:11:18: error: return-statement with a value, in function returning 'void' [-fpermissive]
   11 |  return(table[x%8]);
      |        ~~~~~~~~~~^~
Language: C++

#include<iostream>
int main(){
	while(1){
		int a;
		std::cin>>a;
		double int b=1;
		if(a==0)break;
		for(int i=0;i<a;i++){
			b++;
			int n=10;
			for(int j=0;j<10;j++){
				while(a%n==4||a%6==&||a/n==4||a/n==6){
					b++;
				}
			}
		}
		std::cout<<b<<std::endl;
	}
			
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: two or more data types in declaration of 'b'
    6 |                 double int b=1;
      |                 ^~~~~~
a.cc:9:25: error: 'b' was not declared in this scope
    9 |                         b++;
      |                         ^
a.cc:12:53: error: expected primary-expression before '||' token
   12 |                                 while(a%n==4||a%6==&||a/n==4||a/n==6){
      |                                                     ^~
a.cc:17:28: error: 'b' was not declared in this scope
   17 |                 std::cout<<b<<std::endl;
      |                            ^
Language: Java

import java.util.*;

class Main {
	static int[][] map;
	static int[][] cx;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		while (true) {
			int n = stdIn.nextInt();
			int m = stdIn.nextInt();
			if (n == 0 && m == 0){
				break;
			}	
			map = new int[n][n];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					map[i][j] = stdIn.nextInt();
				}
			}
			cx = new int[m][m];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < m; j++) {
					cx[i][j] = stdIn.nextInt();
				}
			}
			int GX = 999999;
			int GY = 999999;
			for (int i = 0; i < 5; i++) {
				if (check()) {
					GX = Math.min(GX, x);
					GY = Math.min(GY, y);
					
				}
				rotate(cx);
			}
			if(x == -1 && y == -1) {
				System.out.println("NA");
			}
			else {
				System.out.println(GX+1 + " " + GY+1);
			}
			}
			
		}
		
		
	}
	static void rotate(int[][] a) {
		int[][] newMap = new int[a.length][a.length];
		for(int i = 0; i < a.length; i++) {
			for(int j = 0; j < a.length; j++) {
				newMap[a.length - j - 1][i] = a[i][j];
			}
		}
		cx = newMap;
	}
	static int x;
	static int y;
	static boolean check() {
		x = -1;
		y = -1;
		for(int i = 0; i < map.length; i++) {
			for(int j = 0; j < map.length; j++) {
				boolean check = true;
				int lasty = -1;
				int lastx = -1;
				OUT:for(int k = 0; k < cx.length; k++) {
					for(int l = 0; l < cx.length; l++) {
						if(cx[k][l] == -1) continue;
						if(lasty == -1 && lastx == -1) {
							lasty = k;
							lastx = l;
						}
						if(i+k >= map.length || j + l >= map.length) {
							check = false;
							break OUT;
						}
						if(map[i+k][j+l] != cx[k][l]) {
							check = false;
							break OUT;
						}
					}
				}
				if(check) {
					y = i + lasty;
					x = j + lastx;
					return true;
				}
			}
		}
		return false;
	}
}

Compiler output:
Main.java:48: error: unnamed classes are a preview feature and are disabled by default.
	static void rotate(int[][] a) {
	       ^
  (use --enable-preview to enable unnamed classes)
Main.java:93: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.Scanner;

public class A0209 {
	static int n, m;
	static int win[][], pic[][];

	public static boolean search(int x, int y) {
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < m; j++) {
				if (pic[i][j] != -1 && win[y + i][x + j] != pic[i][j]) {
					return false;
				}
			}
		}
		return true;
	}

	public static int[][] turn() {
		int a[][] = new int[m][m];

		for (int i = 0; i < m; i++) {
			for (int j = 0; j < m; j++) {
				a[m - j - 1][i] = pic[i][j];
			}
		}

		return a;
	}

	public static void ans(int x, int y) {
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < m; j++) {
				if (pic[i][j] != -1) {
					System.out.println((x + j) + " " + (y + i));
					return ;
				}
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		L: while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if ((n | m) == 0) {
				break;
			}
			win = new int[n][n];
			pic = new int[m][m];

			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					win[i][j] = sc.nextInt();
				}
			}
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < m; j++) {
					pic[i][j] = sc.nextInt();
				}
			}

			for (int q = 0; q < 4; q++) {
				for (int i = 0; i < n - m ; i++) {
					for (int j = 0; j < n - m; j++) {
						if (search(j, i)) {
							ans(j + 1, i + 1);
							continue L;
						}
					}
				}
				pic = turn();
			}
			System.out.println("NA");
		}
	}
}

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

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

int n,m,pic[101][101],ed[51][51];
int edb[101][101];
int site;
int num,flag = 0;
int ans,count;

void deb() {

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++)
      cout <<pic[i][j] << " ";
    cout << endl;
  }
  
  
  cout << "-------------------"<<endl;
  for(int i=0;i<m;i++) {
    for(int j=0;j<m;j++) {
      printf("%2d ",ed[i][j]);
    }
    cout << endl;
  }
  cout << "---------------"<<endl;
}


void input() {
     
   for(int i=0;i<n;i++) {
    for(int j=0;j<n;j++) {
      cin >> pic[i][j];
    }
  }

    
  for(int i=0;i<m;i++) {
    for(int j=0; j<m;j++) {
      cin >> ed[i][j];
    }
  }

}


void rot() {
  //  cout << "start rot();" << endl;
  int rotf = 0;
  int rotk;
  for(int i=0;i<m;i++){
    rotk = 0;
    for(int j=m-1;j>=0;j--) {
      edb[i][rotk] = ed[j][i];
      rotk++;
    }
  }

  
  for(int i=0;i<m;i++)
    for(int j=0;j<m;j++) {
      ed[i][j] = edb[i][j];
      if(ed[i][j] != -1 && rotf == 0) {
	site = i*m+j;
	num = ed[i][j];
	rotf = 1;
      }
    }

  //  cout << "num = "<<num<<endl;
}

void check(int h,int w) {
  int chfla;
  count = 0;
  chfla = 0;
  for(int i=0;i<m;i++) {
    for(int j=0;j<m;j++) {
      
      //printf("ed[%d][%d](%d) == pic[%d][%d](%d)\n",i,j,ed[i][j],h+i-site/m,w+j-site%m,pic[h+i-site/m][w+j-site%m]);
      if(ed[i][j] == -1)count++;
      else if(ed[i][j] == pic[h+i-site/m][w+j-site%m]) count++;
      else {
	chfla = 1;
	break;
      }
    }
    if(chfla == 1) break;
  }

  ans = (h)*m+(w);
  //  cout << "count = "<<count<<endl;
}

void search() {
  int sefla = 0;
  //cout << num << endl;
  for(int i=0;i<n;i++) {
    for(int j=0; j<n;j++) {
      //  printf("pic[%d][%d](%d) == %d\n",i,j,pic[i][j],num);
      if(pic[i][j] == num) {
	//	printf("pic[%d][%d](%d) => check(%d,%d);\n--------------\n",i,j,pic[i][j] ,i,j);
	check(i,j);
	if(count == m*m) {
	  sefla = 1;
	  break;
	}
      }
    }
    if(sefla == 1) break;
  }
}

  


int main() {
  
  while(1) {
    
    
    cin >> n >> m;
    if(n==0 && m== 0) break;
    //    cout << "start input();" <<endl;
    input();
	
    //    deb();
    int maf = 0;
    for(int i=0;i<m;i++) {
      for(int j=0;j<m;j++) {
	//	printf("ed[%d][%d] = %d\n",i,j,ed[i][j]);
	if(ed[i][j] != -1) {
	  site = i*m + j;
	  num = ed[i][j];
	  maf = 1;
	  break;
	}
      }
      if(maf == 1) break;
    }
    //    cout << "num = "<<num<<endl;
    search();
	
    for(int i=0;i<3;i++) {
      if(count != m*m){
	//	cout << "start rot();"<<endl;
	rot();
	//	deb();    
	//	cout << "srart search();"<<endl;
	search();
      } else break;
    }
	
    if(count == m*m) cout << ans%m+1 << " " << ans/m+1<< endl;
    else cout << "NA" << endl;
	
  }
  
  return 0;
  
}


}

Compiler output:
a.cc:166:1: error: expected declaration before '}' token
  166 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

void f(int set[][51],int m)
{
	int ans[100][100]={};

	for(int i=0;i<m;i++)
	{
		for(int j=0;j<m;j++)
		{
			ans[j][(m-1)-i]=set[i][j];
		}
	}
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<m;j++)
		{
			set[i][j]=ans[i][j];
		}
	}
}

int main()
{
	int n,m;

	while(cin >> n >> m && n)
	{
		int flag=0;
		int setcount=0;
		int count=0;
 		int data[1001][1001]={};
 		int set[501][501]={};
 		int i,j,k,l;

 		for(i=0;i<n;i++)
	 		for(j=0;j<n;j++)
	 			cin >> data[i][j];

 		for(i=0;i<m;i++)
 		{
 			for(j=0;j<m;j++)
 			{
 				cin >> set[i][j];
 				if(set[i][j]>=0)setcount++;
 			}
 		}

 		for(int z=0;z<4;z++)
 		{
	 		for(int l=0;l<n;l++)
	 		{
	 			for(int k=0;k<n;k++)
	 			{
	 				count=0;
	 				for(i=0;i<m;i++)
		 			{
			 			for(j=0;j<m;j++)
			 			{
			 				if(set[i][j]==data[i+k][j+l])count++;
			 				if(count==setcount)
			 				{
			 					cout << l+i <<" "<< k+j << endl;
			 					flag=1;
			 					break;
			 				}
			 			}
			 			if(flag)break;
		 			}
		 			if(flag)break;
	 			}
	 			if(flag)break;
		 	}
		 	if(flag)break;
	 		else f(set,m);
 		}
 		if(!flag)cout << "NA" << endl;
	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:32: error: cannot convert 'int (*)[501]' to 'int (*)[51]'
   77 |                         else f(set,m);
      |                                ^~~
      |                                |
      |                                int (*)[501]
a.cc:5:12: note:   initializing argument 1 of 'void f(int (*)[51], int)'
    5 | void f(int set[][51],int m)
      |        ~~~~^~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e9;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
int main(){
	int n,m;
	while(scanf("%d %d",&n,&m),n){
		vvi in(n,vi(n));
		vvi pic(m,vi(m));
		rep(i,n)rep(j,n)scanf("%d",&in[i][j]);
		rep(i,m)rep(j,m)scanf("%d",&pic[i][j]);
		pii out(inf,inf);
		int N=n-m+1,M=n-m+1;
		rep(e,4){
			rep(i,n-m+1)rep(j,n-m+1){
				pii t(inf,inf);
				rep(k,m)rep(l,m)
					if(pic[k][l]!=-1){
						if(in[i+k][j+l]!=pic[k][l])goto en;
						t=min(t,pii(i+k,j+l));
					}
				out=min(out,t);
				N=out.first;
				M=out.second;
				goto end;
				en:;
				if(i==N&&j==M)goto end;
			}
			end:;
			if(i==3)break;
			vvi tmp=pic;
			rep(i,m)rep(j,m)pic[i][j]=tmp[j][m-i-1];
		}
		if(out.first==inf)cout<<"NA"<<endl;
		else cout<<out.second+1<<" "<<out.first+1<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:28: error: 'i' was not declared in this scope
   50 |                         if(i==3)break;
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for ( int i = 0; i < (int)n; i++ )
#define NMAX 200
#define MMAX 100
#define INFTY (1<<21)
int n, m, T[NMAX][NMAX], P[MMAX][MMAX];
void valid(int sx, int sy, int &lx, int &ly) {
	int ax = -1, ay;
	rep(y, m)
		rep(x, m)
		{
			if (P[x][y] == -1)
				continue;
			if (P[x][y] != T[sx + x][sy + y])
				return;
			if (ax == -1) {
				ay = y;
				ax = x;
			}
		}
	if (ay < ly || (ay == ly && ax < lx)) {
		ly = sy + ay;
		lx = sx + ax;
	}
}
bool rotate(int sx, int sy) {
	int tmp[MMAX][MMAX];
	int ly = INFTY, lx;
	rep(r, 4)
	{
		valid(sx, sy, lx, ly);
		rep(y, m)
			rep(x, m)
				tmp[x][y] = P[x][y];
		rep(y, m)
			rep(x, m)
				P[y][m - x - 1] = tmp[x][y];
	}
	if (ly == INFTY)
		return false;
	cout << lx + 1 << " " << ly + 1 << endl;
	return true;
}
void compute() {
	rep(y, n-m+1)
		rep(x, n-m+1)
			if (rotate(x, y))
				return;
	cout << "NA" << endl;
}
void main() {
	while (cin >> n >> m && n) {
		rep(y, n)
			rep(x, n)
				cin >> T[x][y];
		rep(y, m)
			rep(x, m)
				cin >> P[x][y];
		compute();
	}
}

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


#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int n, m;
int field[110][110];
vector<vector<int> > p;

vector<vector<int> > rotate90() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-j-1][i];
	return temp;
}


vector<vector<int> > l_rotate90() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[j][m-i-1];
	return temp;
}

vector<vector<int> > rotate180() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-i-1][m-j-1];
	return temp;
}

vector<vector<int> > l_rotate180() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m - i - 1][m - j - 1];
	return temp;
}


vector<vector<int> > rotate270() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[j][m-i-1];
	return temp;
}

vector<vector<int> > l_rotate270() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-j-1][i];
	return temp;
}

bool check(vector<vector<int> > p_temp) {
	int x = 0, y = 0;
	bool flag = false,res = false;
	for (int i = 0; i < n - m; i++) {
		for (int j = 0; j < n - m; j++) {
			flag = false;
			for (int k = 0; k < m; k++) {
				for (int l = 0; l < m; l++) {
					if (p_temp[k][l] == -1)continue;
					if (field[i + k][j + l] == p_temp[k][l]) {
						flag = true;
					}
					else {
						if (flag) {
							flag = false;
							break;
						}
					}				
				}
				if (!flag)break;
			}
			if (flag) {
				bool f = false;
				int add_x = 0,add_y = 0;
				for (int k = 0; k < m; k++) {
					for (int l = 0; l < m; l++) {
						if (p_temp[k][l] != -1) {
							add_x = l, add_y = k;
							f = true;
							break;
						}
					}
					if (f)break;
				}
				cout << i + 1+add_x << " " << j + 1 + add_y << endl;
				return 1;
			}
		}
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int n, m;
int field[110][110];
vector<vector<int> > p;

vector<vector<int> > rotate90() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-j-1][i];
	return temp;
}


vector<vector<int> > l_rotate90() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[j][m-i-1];
	return temp;
}

vector<vector<int> > rotate180() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-i-1][m-j-1];
	return temp;
}

vector<vector<int> > l_rotate180() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m - i - 1][m - j - 1];
	return temp;
}


vector<vector<int> > rotate270() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[j][m-i-1];
	return temp;
}

vector<vector<int> > l_rotate270() {
	vector<vector<int> > temp;
	temp = p;
	for (int i = 0; i < m; i++) 
		for (int j = 0; j < m; j++) 
			temp[i][j] = p[m-j-1][i];
	return temp;
}

bool check(vector<vector<int> > p_temp) {
	int x = 0, y = 0;
	bool flag = false,res = false;
	for (int i = 0; i < n - m; i++) {
		for (int j = 0; j < n - m; j++) {
			flag = false;
			for (int k = 0; k < m; k++) {
				for (int l = 0; l < m; l++) {
					if (p_temp[k][l] == -1)continue;
					if (field[i + k][j + l] == p_temp[k][l]) {
						flag = true;
					}
					else {
						if (flag) {
							flag = false;
							break;
						}
					}				
				}
				if (!flag)break;
			}
			if (flag) {
				bool f = false;
				int add_x = 0,add_y = 0;
				for (int k = 0; k < m; k++) {
					for (int l = 0; l < m; l++) {
						if (p_temp[k][l] != -1) {
							add_x = l, add_y = k;
							f = true;
							break;
						}
					}
					if (f)break;
				}
				cout << j + 1 + add_x<<" "<< i + 1 + add_y << endl;
				return 1;
			}
		}
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <cstring>
#include <numeric>
#include <pmmintrin.h>

#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
typedef long long llong;

char A[101][128], B[101][128];
__m128i mado[101][16], pic[101][16];
int a[4];
int n, m;
int main()
{
	while (scanf("%d%d", &m, &n), (n|m)) {
		memset(A, 0, sizeof(A));
		memset(B, 0, sizeof(B));
		int t;
		rep(i, n) rep(j, n) { scanf("%d", &t); A[i][j] = (t+1) - '0'; }
		rep(i, m) rep(j, m) { scanf("%d", &t); B[i][j] = (t+1) - '0'; }
		memcpy(mado, A, sizeof(A));
		memcpy(pic, B, sizeof(B));

		rep(i, n) {
			rep(j, n-m+1) {
				rep(k, m) rep(l, m>>4) {
					__m128i t = _mm_or_si128(mado[k][l], pic[i+k][l]);
					t = _mm_xor_si128(t, pic[k][l]);
					_mm_store_si128((__m128i*)a, t);
					if (std::accumulate(a, a+4, 0) != 0) goto BREAK;
				}
BREAK:
				rep(k, m) REP(l, 1, m>>4)
					mado[i+k][l] = _mm_alignr_epi8(mado[i+k][l], mado[i+k][l-1], 1);
			}
			memcpy(mado, A, sizeof(A));
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:56: error: '_mm_alignr_epi8' was not declared in this scope; did you mean '_mm_setr_epi8'?
   35 |                                         mado[i+k][l] = _mm_alignr_epi8(mado[i+k][l], mado[i+k][l-1], 1);
      |                                                        ^~~~~~~~~~~~~~~
      |                                                        _mm_setr_epi8
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

int n,m;
int rx,ry;
int px,py;
int pic[101][101];
int pic2[101][101];
int p[101][101];

bool check(int x,int y){
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++){
			if(p[j][i]!=-1 && p[j][i]!=pic[x+j][y+i])return false;
		}
	}
	return true;
}

void pc(){
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++){
			if(p[j][i]!=-1){
				px=j;
				py=i;
				return;
			};
		}
	}
}

void dfs(){
	for(int i=0;i<n-m;i++){
		for(int j=0;j<n-m;j++){
			if(check(j,i) && (i+py<ry || i+py==ry && j+px<rx)){
				rx=j+px;
				ry=i+py;
				break;
			}
		}
	}
}

void turn(){
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++)pic2[m-1-i][j]=p[j][i];
	}
	for(int i=0;i<m;i++){
		for(int j=0;j<m;j++){
			p[j][i]=pic2[j][i];
			//printf("%d ",pic[j][i]);
		}
		//printf("\n");
	}
}

int main(void){
	while(1){
		scanf("%d%d",&n,&m);
		memset(pic,0,sizeof(pic));
		memset(pic2,0,sizeof(pic2));
		memset(p,0,sizeof(p));
		if(n==0 && m==0)break;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++)scanf("%d",&pic[j][i]);
		}
		for(int i=0;i<m;i++){
			for(int j=0;j<m;j++)scanf("%d",&p[j][i]);
		}
		rx=n,ry=n;
		for(int i=0;i<=4;i++){
			pc();
			dfs();
			turn();
		}
		if(rx==n && ry==n)printf("NA\n");
		else printf("%d %d\n",rx+1,ry+1);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:17: error: 'memset' was not declared in this scope
   63 |                 memset(pic,0,sizeof(pic));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <iostream>

using namespace std;

const int max_matrix_size = 100;

void p(int a[max_matrix_size][max_matrix_size], int size, int offseti = 0, int offsetj = 0){
	for(int i = 0; i < size; i++){
		for(int j = 0; j < size; j++){
			cout << a[offseti+i][offsetj+j] << ' ';
		}
		cout << endl;
	}
}

// aの[starti][startj]からsize分の正方行列を比較
bool compareMatrix(int a[max_matrix_size][max_matrix_size], int b[max_matrix_size][max_matrix_size], int starti, int startj, int size){
	for(int i = 0; i < size; i++){
		for(int j = 0; j < size; j++){
			if( b[i][j] == -1) continue;
			if(a[starti+i][startj+j] != b[i][j]) return false;
		}
	}
	p(a, size, starti, startj);
	p(b, size);

	return true;
}

// 2次元配列を90度回転
void rotateMatrix(int (*a)[max_matrix_size], int size){
	int tmp[max_matrix_size][max_matrix_size];
	for(int i = 0; i < size; i++){
		for(int j = 0; j < size; j++){
			tmp[i][j] = a[j][(size-1)-i];
		}
	}
	memcpy(a, tmp, sizeof(int)*max_matrix_size*max_matrix_size);
}

void printnonnegative(int piece[max_matrix_size][max_matrix_size], int size, int offseti, int offsetj){
	for(int i = 0; i < size; i++){
		for(int j = 0; j < size; j++){
			if(piece[i][j] != -1){
				cout << offsetj+j+1 << ' ' << offseti+i+1 << endl;
				return;
			}
		}
	}
}


void search(int pict[max_matrix_size][max_matrix_size], int pictsize, int piece[max_matrix_size][max_matrix_size], int piecesize ){
	for(int i = 0; i < pictsize - piecesize + 1; i++){
		for(int j = 0; j < pictsize - piecesize + 1; j++){
			//cout << "i = " << i << ", j = " << j << endl;
			for(int k = 0; k < 4; k++){
				//cout << "rotate:" << k*90 << endl;
				if(compareMatrix(pict, piece, i, j, piecesize) == true){
					printnonnegative(piece, piecesize, i, j);
					return;
				}
				rotateMatrix(piece, piecesize);
			}
		}
	}
	cout << "NA" << endl;
}

int main(){
	int picture[max_matrix_size][max_matrix_size];
	int piece[max_matrix_size][max_matrix_size];

	int n, m;
	while(cin >> n >> m){
		if(!n && !m) break;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				cin >> picture[i][j];
			}
		}
		for(int i = 0; i < m; i++){
			for(int j = 0; j < m; j++){
				cin >> piece[i][j];
			}
		}

		search(picture, n, piece, m);
	}

	return 0;
}

Compiler output:
a.cc: In function 'void rotateMatrix(int (*)[100], int)':
a.cc:38:9: error: 'memcpy' was not declared in this scope
   38 |         memcpy(a, tmp, sizeof(int)*max_matrix_size*max_matrix_size);
      |         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
struct State{char x[35][35];};
int H,W,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};State S;char f[5]="NESW";
int solve(State V,int depth){
	if(depth==31)return 99999999;
	bool OK=true;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(V.x[i][j]>='A' && V.x[i][j]<='W')OK=false;
		}
	}
	if(OK==true)return depth;
	vector<int>G[30][30];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(V.x[i][j]<'A' || V.x[i][j]>'W')continue;
			
			int dr=0;for(int k=0;k<4;k++){if(V.x[i][j]==f[k])dr=k;}
			for(int k=dr+5;k>=dr-2;k--){
				int ex=i+dx[k%4],ey=j+dy[k%4];
				if(V.x[ex][ey]=='X' || V.x[ex][ey]=='.'){
					V.x[i][j]=f[k%4];
					G[ex][ey].push_back((11-k)%4);break;
				}
			}
		}
	}
	State I=V;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(G[i][j].size()>=1){
				sort(G[i][j].begin(),G[i][j].end());
				int J=(11-G[i][j][0])%4;
				int fx=i-dx[J],fy=j-dy[J];
				if(I.x[i][j]!='X'){I.x[i][j]=I.x[fx][fy];}
				I.x[fx][fy]='.';
			}
		}
	}
	return solve(I,depth+1);
}
int main(){
	while(true){
		cin>>W>>H;if(W==0 && H==0)break;
		for(int i=0;i<H;i++){for(int j=0;j<W;j++)cin>>S.x[i][j];}
		int ans=solve(S,0);
		if(ans>180)cout<<"NA"<<endl;else cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int solve(State, int)':
a.cc:15:9: error: 'vector' was not declared in this scope
   15 |         vector<int>G[30][30];
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:15:16: error: expected primary-expression before 'int'
   15 |         vector<int>G[30][30];
      |                ^~~
a.cc:25:41: error: 'G' was not declared in this scope
   25 |                                         G[ex][ey].push_back((11-k)%4);break;
      |                                         ^
a.cc:33:28: error: 'G' was not declared in this scope
   33 |                         if(G[i][j].size()>=1){
      |                            ^
Language: C++

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

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

int main()
{
	int W,H;
	while(cin >> W >> H, (W||H))
	{
		int cnt=0, p[35][35],tp[35][35];
		char f[35][35];
		cin.ignore();
		for(int i=0; i<H; i++)
		{
			string t;
			getline(cin, t);
			for(int j=0; j<W; j++)
			{
				f[j][i]=t[j];
				p[j][i]=-1;
				if(f[j][i]=='E') p[j][i]=0;
				if(f[j][i]=='S') p[j][i]=3;
				if(f[j][i]=='W') p[j][i]=2;
				if(f[j][i]=='N') p[j][i]=1;
				
				if(p[j][i]!=-1) cnt++;
			}
		}
		
		int ret=0;
		for(; ret<=180; ret++)
		{
			if(cnt==0) break;
			
			for(int i=0; i<H; i++)
			for(int j=0; j<W; j++)
			{
				tp[j][i]=-1;
				
				if(p[j][i]!=-1)
				{
					int next=p[j][i];
					for(int k=0; k<4; k++)
					{
						int d=(p[j][i]+k+3)%4;
						int tx=j+dx[d], ty=i+dy[d];
						if(tx<0||ty<0||tx>=W||ty>=H) continue;
						if(f[tx][ty]=='#'||p[tx][ty]!=-1) continue;
						
						next=d;
						break;
					}
					
					p[j][i]=next;
				}
			}
			
			for(int i=0; i<H; i++)
			for(int j=W-1; j>=0; j--)
			{
				if(p[j][i]!=-1)
				{
					int tx=j+dx[p[j][i]], ty=i+dy[p[j][i]];
					if(tp[tx][ty]==-1&&p[tx][ty]==-1) tp[tx][ty]=p[j][i];
					else tp[j][i]=p[j][i];
				}
			}
			
			memcpy(p, tp, sizeof(p));
			
			for(int i=0; i<H; i++)
			for(int j=0; j<W; j++)
			{
				if(f[j][i]=='X'&&p[j][i]!=-1)
				{
					cnt--;
					p[j][i]=-1;
				}
			}
		}
		
		if(ret>180) cout <<"NA"<< endl;
		else cout << ret << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:25: error: 'memcpy' was not declared in this scope
   72 |                         memcpy(p, tp, sizeof(p));
      |                         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: Java

import java.math.*;
import java.util.*;
public class a0211{
	public static void main(String[] args){
		int i;
		Scanner sc=new Scanner(System.in);
		int n;
		while(true){
			n=sc.nextInt();
			if(n==0)
				break;
			int[] a=new int[n];
			int[] b=new int[n];
			for(i=0;i<n;++i){
				a[i]=sc.nextInt();
				b[i]=sc.nextInt();
			}
			BigInteger c=new BigInteger(Integer.toString(b[0]));
			for(i=1;i<n;++i)
				c=c.divide(c.gcd(new BigInteger(Integer.toString(b[i])))).multiply(new BigInteger(Integer.toString(b[i])));
			BigInteger[] d=new BigInteger[n];
			for(i=0;i<n;++i)
				d[i]=c.divide(new BigInteger(Integer.toString(b[i]))).multiply(new BigInteger(Integer.toString(a[i])));
			BigInteger e=new BigInteger("1");
			for(i=0;i<n;++i)
				e=e.divide(e.gcd(d[i])).multiply(d[i]);
			for(i=0;i<n;++i){
				System.out.println(new BigInteger(Integer.toString(b[i])).multiply(e).divide(new BigInteger(Integer.toString(a[i]))).divide(c));
			}
		}
	}


}

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

#include<iostream>
using namespace std;
int gcd(int a,int b){ return a%b==0 ? b : gcd(b,a%b);}
int main(){
    while(true){

    long long int p = 1;
    int d[11];
    int v[11];
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> d[i] >> v[i];
        p *= d[i] / gcd(d[i],v[i]);

    }

    for(int i=0;i<n;i++){
        cout << v[i]*p/d[i]<<endl; 
    }
    return 0;
}

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

#include<iostream>
#include<algorithm>
#include<vector>
#define PB push_back
using namespace std;

int gcd(int a,int b){ return a%b==0 ? b : gcd(b,a%b);}

vector<long long int> lcm(vector<long long int> v){
    vector<long long int> ret;
    for(int i=0;i<v.size()-1;i++){
	ret.PB(v[i]*v[i+1]/gcd(v[i],v[i+1]));
    }
    return ret;
}
int main(){
    while(true){
        long long int p = 1;
        long long  int d[11];
        long long int v[11];
	vector<long long int> lc;
        int n;
        cin >> n;
        if(!n) break;
        for(int i=0;i<n;i++){
            cin >> d[i] >> v[i];
	    lc.PB(d[i]/gcd(d[i],v[i]));
        }
	while(lc.size()>1){
	    lc = lcm(lc);
	}
	p = lc[0];
	bool flg = true;
	for(int i=0;i<n;i++){
	    if(p % d[i] == 0){
		flg = false;
		break;
	    }
	}
	
	vector<long long int> ans;
	bool flg = true;
	for(int i=0;i<n;i++){
	    ans.PB(v[i]*p/d[i]);
	}
	for(int i=0;i<n;i++){
	    for(int j=i+1;j<n;j++){
		if(ans[i]!=ans[j]) flg = false;
	    }
	}
	if(flg){
	    for(int i=0;i<n;i++){
		cout << ans[i] << endl;
	    }
	}else{
	    for(int i=0;i<n;i++){
		cout << 1 << endl;
	    }
	}
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: redeclaration of 'bool flg'
   42 |         bool flg = true;
      |              ^~~
a.cc:33:14: note: 'bool flg' previously declared here
   33 |         bool flg = true;
      |              ^~~
Language: C++

#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
ll lcm(ll a,ll b){return a/__gcd(a,b)*b;}
int main(){
	int n,d[10],v[10],t;
	while(cin>>n,n){
		rep(i,n)cin>>d[i]>>v[i],t=__gcd(d[i],v[i]),d[i]/=t,v[i]/=t;
		ll a=d[0],b=v[0];
		rep(i,n)a=lcm(a,d[i]),b=__gcd(b,(ll)v[i]);
		rep(i,n)cout<<a/b*v[i]/d[i]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'll lcm(ll, ll)':
a.cc:5:28: error: '__gcd' was not declared in this scope
    5 | ll lcm(ll a,ll b){return a/__gcd(a,b)*b;}
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:9:43: error: '__gcd' was not declared in this scope
    9 |                 rep(i,n)cin>>d[i]>>v[i],t=__gcd(d[i],v[i]),d[i]/=t,v[i]/=t;
      |                                           ^~~~~
a.cc:11:41: error: '__gcd' was not declared in this scope
   11 |                 rep(i,n)a=lcm(a,d[i]),b=__gcd(b,(ll)v[i]);
      |                                         ^~~~~