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

d = gets.to_i
d.times do |i|
    n = gets.to_i
    a = Array.new(n).map { Array.new(n, 0) }
    a.map! {|r| [9] + r + [9]}
    a.unshift [9] * (n + 2)
    a<< [9] * (n + 2)
    y = n
    x = 1
    dy = -1
    dx = 0
    loop do
        a[y][x] = 1
        if a[y + dy][x + dx] == 0
            a[y + dx][x - dy] = 9
            y += dy
            x += dx
        else
            dy, dx = dx, -dy
            if a[y + dy][x + dx] == 0
                a[y - dx][x + dy] = 9
                y += dy
                x += dx
            else
                break
            end
        end
    end
    a[1..-2].each do |r|
        puts r.map {|x| x == 1 ? '#' : ' '} * ''
    end
    puts if i < d - 1
end



Compiler output:
a.cc:29:7: error: too many decimal points in number
   29 |     a[1..-2].each do |r|
      |       ^~~
a.cc:30:47: error: empty character constant
   30 |         puts r.map {|x| x == 1 ? '#' : ' '} * ''
      |                                               ^~
a.cc:1:1: error: 'd' does not name a type
    1 | d = gets.to_i
      | ^
a.cc:5:5: error: 'a' does not name a type
    5 |     a.map! {|r| [9] + r + [9]}
      |     ^
a.cc:6:5: error: 'a' does not name a type
    6 |     a.unshift [9] * (n + 2)
      |     ^
a.cc:30:47: error: expected unqualified-id before '\x0'
   30 |         puts r.map {|x| x == 1 ? '#' : ' '} * ''
      |                                               ^~
Language: C++

d = gets.to_i
d.times do |i|
    n = gets.to_i
    a = Array.new(n).map { Array.new(n, 0) }
    a.map! {|r| [9] + r + [9]}
    a.unshift [9] * (n + 2)
    a<< [9] * (n + 2)
    y = n
    x = 1
    dy = -1
    dx = 0
    loop do
        a[y][x] = 1
        if a[y + dy][x + dx] == 0
            a[y + dx][x - dy] = 9
            y += dy
            x += dx
        else
            dy, dx = dx, -dy
            if a[y + dy][x + dx] == 0
                a[y - dx][x + dy] = 9
                y += dy
                x += dx
            else
                break
            end
        end
    end
    a[1..-2].each do |r|
        puts r[1..-2].map {|x| x == 1 ? '#' : ' '} * ''
    end
    puts if i < d - 1
end



Compiler output:
a.cc:29:7: error: too many decimal points in number
   29 |     a[1..-2].each do |r|
      |       ^~~
a.cc:30:16: error: too many decimal points in number
   30 |         puts r[1..-2].map {|x| x == 1 ? '#' : ' '} * ''
      |                ^~~
a.cc:30:54: error: empty character constant
   30 |         puts r[1..-2].map {|x| x == 1 ? '#' : ' '} * ''
      |                                                      ^~
a.cc:1:1: error: 'd' does not name a type
    1 | d = gets.to_i
      | ^
a.cc:5:5: error: 'a' does not name a type
    5 |     a.map! {|r| [9] + r + [9]}
      |     ^
a.cc:6:5: error: 'a' does not name a type
    6 |     a.unshift [9] * (n + 2)
      |     ^
a.cc:30:54: error: expected unqualified-id before '\x0'
   30 |         puts r[1..-2].map {|x| x == 1 ? '#' : ' '} * ''
      |                                                      ^~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
int main(){
	int n;
	cin>>n;
	rep(l,n){
		if(i) cout<<endl;
		int m;
		cin>>m;
		// cout<<m<<endl;
		if(m==1){
			cout<<"#\n";
			continue;
		}
		if(m==2){
			cout<<"##\n";
			cout<<"# \n";
			continue;
		}
		if(m==3){
			/*
			###
			# #
			# #
			*/
			cout<<"###\n";
			cout<<"# #\n";
			cout<<"# #\n";
			// cout<<"\n";
			continue;
		}
		if(m==4){
			cout<<"####\n";
			cout<<"#  #\n";
			cout<<"#  #\n";
			cout<<"# ##\n";
			// cout<<endl;
			continue;
		}
		vector<vector<char> > vv;
		initvv(vv,m,m);
		rep(i,m){
			rep(j,m) vv[i][j]=' ';
		}
		rep(i,m){
			vv[0][i]='#';
			vv[m-1][i]='#';
			vv[i][m-1]='#';
			vv[i][0]='#';
		}
		vv[m-1][1]=' ';
		int x=m-1,y=2;
		int c=0;
		while(1){
			// cout<<x<<" "<<y<<endl;
			if(vv[x+dx[c]*2][y+dy[c]*2]==' '){
				x+=dx[c];
				y+=dy[c];
				vv[x][y]='#';
			}
			else if(vv[x+2*dx[(c+1)%4]][y+2*dy[(c+1)%4]]==' '&&vv[x+dx[(c+1)%4+dx[(c+2)%4]]][y+dy[(c+1)%4]+dy[(c+2)%4]]==' '){
				c++;
				c%=4;
				x+=dx[c];
				y+=dy[c];
				vv[x][y]='#';
			}
			else{
				break;
			}
		}
		/*
		######
		#    #
		# ## #
		# #  #
		# #  #
		# ####
		*/
		rep(i,m){
			rep(j,m){
				cout<<vv[i][j];
			}
			cout<<endl;
		}
		cout<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:20: error: 'i' was not declared in this scope
   47 |                 if(i) cout<<endl;
      |                    ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int d;
string map[105];
int n;
 
void visit() {
  int dx[4] = {0,1,0,-1};
  int dy[4] = {-1,0,1,0};
  int sum,  flg = 0;
  int x = 2,y = n;
  map[y][x] = ' ';
  int ab[4] = {2,2,2,2};
 
  while(1) {
    sum = 0;
    while(1) {
      if(map[y+dy[flg]*2][x+dx[flg]*2] != '#' && map[y+dy[flg]][x+dx[flg]] != ' ' ) {
    flg++;
    //  cout << sum << endl;
 
    break;
      }
       
      map[y+dy[flg]][x+dx[flg]] = ' ';
      y = y + dy[flg];
      x = x + dx[flg];
      sum++;
    }
    if(flg == 4) flg = 0;
    if(sum == 0) break;
    ab[0] = ab[1];
    ab[1] = ab[2];
    ab[2]  = sum;
    if(ab[0] == 1 && ab[2] == 1 && ab[1] == 1) break;
 
  }
}
 
 
int main() {
   
  cin >> d;
   
  for(int l=0;l<d;l++) {
     
    cin >> n;
 
    if(n == 1) {
      cout << "#" <<endl  ;
    if(l != d-1) cout << endl;
    continue;
    }   
 
    for(int i=0;i<=n+1;i++){
      map[i].resize(n+2);
      for(int j=0;j<=n+1;j++){
    map[i][j] = '#';
    if(i == 0 || j == 0 || i == n+1 || j == n+1) map[i][j] = '.';
      }
    }
     
     
    visit();
     
    for(int i=1;i<=n;i++){
      for(int j=1;j<map[i].size()-1;j++) {
    cout << map[i][j];
      }
      cout << endl;
    }
    if(l != d-1) 
      cout << endl;
     
  }
return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:9: error: expected ';' before '}' token
   77 | return 0
      |         ^
      |         ;
   78 | }
      | ~
Language: C++

#include <iostream>

#include <string>

using namespace std;

??

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

??

int main(){

	int d;

	cin >> d;

	for(int t = 0;t < d;t++){

		if(t) cout << endl;

		char s[100][100];

		int n;

		cin >> n;

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

			for(int j = 0;j < n;j++) s[i][j] = ' ';

		}

		int x = n - 1,y = 0,dir = 0;

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

			bool flag = false;

			while(1){

				int nx = x + dx[dir],ny = y + dy[dir];

			 if(nx < 0 || nx >= n + 1 || ny < 0 || ny >= n + 1 || s[nx][ny] == '#') break;

s[x][y] = '#';

flag = true;

				x = nx;

				y = ny;

			}

if(x)x -= dx[dir];

if(y)y -= dy[dir];

			if(!flag) break;

			dir = (dir + 1) % 4;

		}

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

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

cout << s[i][j];

}

cout << endl;}

	}

}

#include <iostream>

#include <string>

using namespace std;

??

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

??

int main(){

	int d;

	cin >> d;

	for(int t = 0;t < d;t++){

		if(t) cout << endl;

		char s[100][100];

		int n;

		cin >> n;

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

			for(int j = 0;j < n;j++) s[i][j] = ' ';

		}

		int x = n - 1,y = 0,dir = 0;

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

			bool flag = false;

			while(1){

				int nx = x + dx[dir],ny = y + dy[dir];

			 if(nx < 0 || nx >= n + 1 || ny < 0 || ny >= n + 1 || s[nx][ny] == '#') break;

s[x][y] = '#';

flag = true;

				x = nx;

				y = ny;

			}

if(x)x -= dx[dir];

if(y)y -= dy[dir];

			if(!flag) break;

			dir = (dir + 1) % 4;

		}

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

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

cout << s[i][j];

}

cout << endl;}

	}

}

Compiler output:
a.cc:7:1: error: expected unqualified-id before '?' token
    7 | ??
      | ^
a.cc:9:22: error: expected unqualified-id before ',' token
    9 | int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
      |                      ^
a.cc:9:28: error: expected constructor, destructor, or type conversion before '=' token
    9 | int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
      |                            ^
a.cc:11:1: error: expected unqualified-id before '?' token
   11 | ??
      | ^
a.cc:87:1: error: expected unqualified-id before '?' token
   87 | ??
      | ^
a.cc:89:22: error: expected unqualified-id before ',' token
   89 | int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
      |                      ^
a.cc:89:28: error: expected constructor, destructor, or type conversion before '=' token
   89 | int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
      |                            ^
a.cc:91:1: error: expected unqualified-id before '?' token
   91 | ??
      | ^
Language: C++

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

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
int nx,ny,nr;
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
int a[100][100];
bool plot(int x, int y, int r, int n){
  int count = 0;
  bool flag = true;
  if((x+2*dx[r]>=0&&x+2*dx[r]<n)&&
      y+2*dy[r]>=0&&y+2*dy[r]<n&&a[x+2*dx[r]][y+2*dy[r]]==1)
    return false;
  x+=dx[r]; y+=dy[r];
  while((x>=0&&x<n)&&(y>=0&&y<n)){
    if((x+2*dx[r]>=0&&x+2*dx[r]<n)&&y+2*dy[r]>=0&&y+2*dy[r]<n&&a[x+2*dx[r]][y+2*dy[r]]==1) flag = false;
    a[x][y] = 1;
    x+=dx[r]; y+=dy[r];
    count++;
    if(!flag) break;
  }
  x-=dx[r];y-=dy[r]; nx=x; ny=y; nr=(r+1)%4;
  if(count<2) return false;
  return true;
}
int main(void){
  int d;
  cin>>d;
  while(d--){
    int n;
    cin>>n;
    memset(a,0,sizeof(a));
    a[0][n-1]=1;
    nx=0; ny=n-1; nr=3;
    while(plot(nx,ny,nr,n));
    REP(i,n){
      REP(j,n)
        printf("%c",(a[j][i]==1)?'#':' ');
      cout << endl;
    }
  }
  return 0;
}

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

ar MAP[104][104];
int nx,ny,vx=0,vy=-1;
void rotate(){ //EñèÉñ]·é
	int tx=vx,ty=vy;
	vx=-ty;vy=tx;
}
int main(){
	int s; //}bvÌL³
	int n; //·éÂ
	int t; //I¹»èp
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&s);
		memset(MAP,'#',104*104);
		for(int x=1;x<1+s+2;x++){
			for(int y=1;y<1+s+2;y++){
				MAP[x][y]=' ';
			}
		}
		nx=2,ny=s+1;t=0;vx=0;vy=-1;
		while(1){
			MAP[nx][ny]='#';
			if(MAP[nx+vx*2][ny+vy*2]=='#'){
				if(t>0) break;
				t=2;
				rotate();
			} else {
				t--;
				nx+=vx;ny+=vy;
			}
		}
		//\¦
		if(i!=0) puts("");
		for(int y=2;y<1+s+1;y++){
			for(int x=2;x<1+s+1;x++){
				printf("%c",MAP[x][y]);
			}
			puts("");
		}
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'ar' does not name a type; did you mean 'char'?
    1 | ar MAP[104][104];
      | ^~
      | char
a.cc: In function 'int main()':
a.cc:11:9: error: 'scanf' was not declared in this scope
   11 |         scanf("%d",&n);
      |         ^~~~~
a.cc:14:24: error: 'MAP' was not declared in this scope
   14 |                 memset(MAP,'#',104*104);
      |                        ^~~
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(MAP,'#',104*104);
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | ar MAP[104][104];
a.cc:33:26: error: 'puts' was not declared in this scope
   33 |                 if(i!=0) puts("");
      |                          ^~~~
a.cc:36:33: error: 'printf' was not declared in this scope
   36 |                                 printf("%c",MAP[x][y]);
      |                                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | ar MAP[104][104];
a.cc:38:25: error: 'puts' was not declared in this scope
   38 |                         puts("");
      |                         ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

main(){
  int n;
  char data[100][100];
  int dx[] = {0, 1, 0, -1};
  int dy[] = {-1, 0, 1, 0};
  int t;
  while(cin >> t){
  {
    for(int tc=0;tc<t;tc++){
      cin >> n;
      if(tc != 0) cout << endl;
      if(n == 1){
	cout << "#" << endl;
	f = false;
	continue;
      }
      int y = n-1;
      int x = 0;
      fill(data[0], data[100], ' ');
      data[y][x] = '#';
      int d = 0;
      while(1){
	int ty = y + dy[d];
	int tx = x + dx[d];
	if(ty<0 || ty>=n){ d = (d+1)%4; continue; }
	if(tx<0 || tx>=n){ d = (d+1)%4; continue; }
	if(data[ty][tx] == '#') break;
	int tty = ty + dy[d];
	int ttx = tx + dx[d];
	if((tty>=0 || tty<n) && (ttx>=0 || ttx<n)){
	  if(data[tty][ttx] == '#'){
	    d = (d+1)%4; 
	    continue; 
	  }
	}
	int cnt = 0;
	for(int i=0;i<4;i++){
	  int tty = ty + dy[i];
	  int ttx = tx + dx[i];
	  if(tty<0 || tty>=n) continue;
	  if(ttx<0 || ttx>=n) continue;
	  if(data[tty][ttx] == '#') cnt++;
	}
	if(cnt > 1) break;
	data[ty][tx] = '#';
	y = ty;
	x = tx;
      }
      for(int i=0;i<n;i++){
	for(int j=0;j<n;j++){
	  cout << data[i][j];
	}
	cout << endl;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:9: error: 'f' was not declared in this scope
   19 |         f = false;
      |         ^
a.cc:63:2: error: expected '}' at end of input
   63 | }
      |  ^
a.cc:6:7: note: to match this '{'
    6 | main(){
      |       ^
Language: C++

import java.util.Scanner;


public class Main {

	char[][] makeSpiral(int n){
		char[][] pattern=new char[n][n];
		int dir=0;
		int x=0,y=n-n%2;
		int[] dx={0,1,0,-1};
		int[] dy={-1,0,1,0};
		for(int i=0;i<n;++i){
			for(int j=0;j<n;++j){
				pattern[i][j]=' ';
			}
		}
		int notTurn=2;
		boolean end=false;
		while(!end){

			if(n%2==0||notTurn<2){
				x+=dx[dir];
				y+=dy[dir];
			}
			--notTurn;
			
			switch(dir){
			case 0:
				if(y<=0||(y!=1&&pattern[x][y-2]=='*')){
					if(notTurn>0){
						end=true;
					}
					else{
						dir=1;
						notTurn=2;
					}
				}
				break;
			case 1:
				if(x>=n-1||(x!=n-2&&pattern[x+2][y]=='*')){
					if(notTurn>0){
						end=true;
					}
					else{
						dir=2;
						notTurn=2;
					}
				}
				break;
			case 2:
				if(y>=n-1||(y!=n-2&&pattern[x][y+2]=='*')){
					if(notTurn>0){
						end=true;
					}
					else{
						dir=3;
						notTurn=2;
					}
				}
				break;
			case 3:
				if(x<=0||(x!=1&&pattern[x-2][y]=='*')){
					if(notTurn>0){
						end=true;
					}
					else{
						dir=0;
						notTurn=2;
					}
				}
				break;
			}
			pattern[x][y]='*';
		}
		return pattern;
	}
	
	void io(){
		Scanner s=new Scanner(System.in);
		int setnum=s.nextInt();
		for(int i=0;i<setnum;++i){
			int n=s.nextInt();
			char[][] pattern=makeSpiral(n);
			
			if(i>0)System.out.println();
			for(int y=0;y<n;++y){
				for(int x=0;x<n;++x){
					System.out.print(pattern[x][y]);
				}
				System.out.println();
			}
		}
		s.close();
	}

	public static void main(String[] args) {
		new Main().io();
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include<queue>
#include<map>
#include<cstring>
using namespace std;
#define fr first
#define sc second
#define INF 100
typedef pair<int,int>Pt;
int main(){
  int d,n,dx[]={-1,0,1,0},dy[]={0,1,0,-1};
  char mas[101][101]; //上右下左
  bool ok = false;
  cin >> d;
  while(d--){
    if(ok) cout << endl;
    memset(mas,' ',sizeof(mas));
    cin >> n;
    for(int i=0,x=n-1,MUKI=0,y=0;i<n;i++,x+=dx[MUKI],y+=dy[MUKI]) mas[x][y] = '#';
    for(int i=0,cnt=n,x=0,y=0,MUKI=1;i<n-1;i++,MUKI=(MUKI+1)%4){
      for(int j=0;j<cnt;j++,x+=dx[MUKI],y+=dy[MUKI]) mas[x][y] = '#';
      x-=dx[MUKI],y-=dy[MUKI];
      if(i%2==1)cnt-=2;
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++) cout << mas[i][j];
      cout << endl;
    }
    ok = true;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope
   13 |   cin >> d;
      |   ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstring>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:15:12: error: 'cout' was not declared in this scope
   15 |     if(ok) cout << endl;
      |            ^~~~
a.cc:15:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |     if(ok) cout << endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstring>
  +++ |+#include <ostream>
    4 | using namespace std;
a.cc:25:28: error: 'cout' was not declared in this scope
   25 |       for(int j=0;j<n;j++) cout << mas[i][j];
      |                            ^~~~
a.cc:25:28: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:7: error: 'cout' was not declared in this scope
   26 |       cout << endl;
      |       ^~~~
a.cc:26:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:15: error: 'endl' was not declared in this scope
   26 |       cout << endl;
      |               ^~~~
a.cc:26:15: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
using namespace std;


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

int main(){
	bool fst=true;
	int n;
	cin>>n;
	while(n--){
		memset(a,' ',sizeof(a));
		int m,y,x,dir;
		cin>>m;
		y=m;x=1;dir=0;
		a[y][x]='#';
		while(1){
			for(int i=0;i<m-1;i++){
				if(a[y+2*dy[dir]][x+2*dx[dir]]=='#')break;
				y+=dy[dir];
				x+=dx[dir];
				a[y][x]='#';
			}
			dir=(dir+1)%4;
			if(a[y+2*dy[dir]][x+2*dx[dir]]=='#')break;
			if(a[y-1][x-1]=='#'||a[y-1][x+1]=='#'||a[y+1][x-1]=='#'||a[y+1][x+1]=='#')break;
		}
		for(int i=1;i<=m;i++){
			for(int j=1;j<=m;j++)cout<<a[i][j];
			cout<<endl;
		}
		if(!fst)cout<<endl;
		fst=false;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(a,' ',sizeof(a));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>

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

int main()
{
	char b[100][100];
	int n, d, dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
	
	cin >> d;
	rep(t, d) {
		memset(b, ' ', sizeof(b));
		
		cin >> n;
		rep(i, n) b[0][i]='#';
		int x=0, y=0, nn = n, direct=0;
		
		while (1) {
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			
			if (n%2==0 && nn<=2) break;
			
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			nn-=2;
			
			if (nn<=1)
				break;
		}
		rep(y, n) {
			rep(x, n)
			cout << b[x][y];
			cout << endl;
		}

	}
	return 0;
}

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

#include <iostream>
#include <set>
using namespace std;
const int MAX = 10001;

int main(void){
    int square[MAX];
    for (int i=1; i < MAX+1; i++) square[i-1] = i*i;
    
    while (true){
        int n;
        cin >> n;
        if (n == 0) break;
        int m = (n-1)/2;
        
        int raw_mod[n-1],mod[m];
        for(int i = 0; i < n-1; i++) raw_mod[i] = square[i]%n;

        sort(raw_mod,raw_mod+n-1);
        mod[0] = raw_mod[0];
        int size;
        for(int i = 1, j = 1; i < n-1; i++){
            if (mod[j-1] != raw_mod[i]){
                mod[j] = raw_mod[i];
                j++;
            }
            size = j;
        }

        int hist[MAX] = {};
        for (int i = 0; i < size-1; i++)
            for (int j = i+1; j < size; j++){
                int tmp1 = mod[i]-mod[j];
                if (tmp1 < 0) tmp1 += n;
                if (tmp1 > m) tmp1 = n-tmp1;
                int tmp2 = mod[j]-mod[i];
                if (tmp2 < 0) tmp2 += n;
                if (tmp2 > m) tmp2 = n-tmp2;
                hist[tmp1-1] += 1;
                hist[tmp2-1] += 1;
            }

        for(int i = 0; i < m; i++)
            cout << hist[i] << endl;
    }
    return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(raw_mod,raw_mod+n-1);
      |         ^~~~
      |         short
Language: C++

using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        while (true)
        {
            var n = int.Parse(Console.ReadLine().Trim());
            if (n == 0) break;
            var n2 = (n - 1) / 2;
            var w1 = new List<int>();
            for (int i = 1; i < n; i++) w1.Add(i * i  % n);
            var w2 = w1.Distinct().ToArray();
            var ret = new int[n2];
            for (int i = 0; i < w2.Length; i++)
                for (int j = 0; j < w2.Length; j++)
                    if (i != j)
                    {
                        var z = w2[i] - w2[j];
                        if (z < 0) z += n;
                        if (z > n2) z = n - z;
                        ret[z-1]++; 
                    }
            foreach (var x in ret)
                Console.WriteLine(x);
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System.Linq;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System;
      |       ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Hello
      | ^~~~~~
Language: C++

#include <set>
#include <cstdio>
int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S;s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}

Compiler output:
a.cc:3:17: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S;s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:3:106: error: declaration of 'auto S' has no initializer
    3 | int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S;s!=t.end();s++)for(S=s;++S!=t.end();v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}
      |                                                                                                          ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <cstring>
using namespace std;
typedef pair<int,int> P;

int n;

int main(){
  while(cin >> n ,n){
    int ans[(n-1)/2];
    memset(ans,0,sizeof(ans));
    vector<int> v;
    vector<int> nv;
    int nn = n;

    for(int i = 1 ; i < nn ; i++){      
      v.push_back(i*i%n);
    }
    sort(v.begin(),v.end());
    for(int i = 1 ; i < nn ; i++){ 
      if(v[i] != v[i-1]){ 
	nv.push_back(v[i-1]);
      }       
    }
   
    for(int i = 0 ; i < nv.size(); i++){
      for(int j = 0 ; j < nv.size() ; j++){
	if(i == j) continue;

	int res = nv[i]-nv[j];
	if(res < 0){
	  res += nn;
	}
	if(res > (nn-1)/2){
	  res = nn - res;
	}
	ans[res-1]++;
      }
    }

    int i;
    for(i = 0 ; i < (n-1)/2 ; i++){
      cout << ans[i] << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   21 |     sort(v.begin(),v.end());
      |     ^~~~
      |     sqrt
Language: C++

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

int main()
{
  int n;
  for(;cin>>n,n;)
    {

      map<int,bool>hash;
      vector<int> data;
      for(int i=1;i<n;i++)
	{
	  if(hash.count(i*i%n)==0)
	    {
	      hash[i*i%n]=true;
	      data.push_back(i*i%n);
	    }
	}
      int ans[(n-1)/2+2];
      memset(ans,0,sizeof(ans));
      for(int i=0;i<data.size()-1;i++)
	for(int j=i+1;j<data.size();j++)
	  {
	    int tmp=data[i]-data[j];
	    if(tmp<0)
	      tmp+=n;
	    if(tmp>(n-1)/2)
	      tmp=n-tmp;
	    ans[tmp]++;

	    tmp=data[j]-data[i];
	    if(tmp<0)
	      tmp+=n;
	    if(tmp>(n-1)/2)
	      tmp=n-tmp;
	    ans[tmp]++;
	  }
      for(int i=1;i<=(n-1)/2;i++)
	cout<<ans[i]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: 'memset' was not declared in this scope
   26 |       memset(ans,0,sizeof(ans));
      |       ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<algorithm>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: Java

import java.util.Scanner;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		int N=in.nextInt();
		while(N-->0)
		{
			double xp1=in.nextDouble(),yp1=in.nextDouble();
			double xp2=in.nextDouble(),yp2=in.nextDouble();
			double xp3=in.nextDouble(),yp3=in.nextDouble();
			double xk=in.nextDouble(),yk=in.nextDouble();
			double xs=in.nextDouble(),ys=in.nextDouble();
			int k=0;
			if(judge(xp1,yp1,xp2,yp2,xk,yk,xs,ys))//壁と交差する
				k++;
			if(judge(xp2,yp2,xp3,yp3,xk,yk,xs,ys))
				k++;
			if(judge(xp3,yp3,xp1,yp1,xk,yk,xs,ys))
				k++;
			System.out.println(kabe==1 ? "OK":"NG");
		}
	}
	
	static boolean judge(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4)
	{
		double jc1=(x1-x2)*(y3-y1)+(y1-y2)*(x1-x3);
		double jd1=(x1-x2)*(y4-y1)+(y1-y2)*(x1-x4);
		double jc2=(x3-x4)*(y1-y3)+(y3-y4)*(x3-x1);
		double jd2=(x3-x4)*(y2-y3)+(y3-y4)*(x3-x2);
		return jc1*jd1<0 && jc2*jd2<0;
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
			System.out.println(kabe==1 ? "OK":"NG");
			                   ^
  symbol:   variable kabe
  location: class Main
1 error
Language: C++

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

int main(void){
    int n;
    cin >> n;
    rep(i,n) {
        int count = 0;
        double x[8],y[8],a,b,c,d,p,q,det;
        //入力を多少簡略化
        for(int i=0;i<8;i++) {
            printf("x%d =? ",i+1); scanf("%lf" ,&x[i]);
            printf("y%d =? ",i+1); scanf("%lf" ,&y[i]);
        }
        rep(j,3) {
            //(x1,y1)(x2,y2)を結ぶax+by=p の係数
            a = y[j]-y[j+1];  b = x[j+1]-x[j];
            p = x[j+1]*y[j]-x[j]*y[j+1];
            //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
            c = y[6]-y[7];  d = x[7]-x[6];
            q = x[7]*y[6]-x[6]*y[7];
            //係数についての行列式
            det = a*d-c*b;
            //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
            if(fabs(det) < 0.00001){
            } else {
                ansx = (d*p - b*q)/det;
                ansy = (-c*p + a*q)/det;
                //ansxがどちらの線分のx座標範囲にも含まれるかを判定
                if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[6] - ansx)*(x[7] - ansx) <= 0.00001 ) {
                    count++;
                }
            }
        }
        if(count == 1) cout << "OK" << endl;
        else cout << "NG" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
    6 |     cin >> n;
      |     ^~~
      |     sin
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope; did you mean 'frexp'?
    7 |     rep(i,n) {
      |     ^~~
      |     frexp
Language: C++

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int main(void){
    int n;
    cin >> n;
    rep(i,n) {
        int count = 0;
        double x[8],y[8],a,b,c,d,p,q,det;
        //入力を多少簡略化
        for(int i=0;i<8;i++) {
            cin >> x[i] >> y[i];
        }
        rep(j,3) {
            //(x1,y1)(x2,y2)を結ぶax+by=p の係数
            a = y[j]-y[j+1];  b = x[j+1]-x[j];
            p = x[j+1]*y[j]-x[j]*y[j+1];
            //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
            c = y[6]-y[7];  d = x[7]-x[6];
            q = x[7]*y[6]-x[6]*y[7];
            //係数についての行列式
            det = a*d-c*b;
            //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
            if(fabs(det) < 0.00001){
            } else {
                ansx = (d*p - b*q)/det;
                ansy = (-c*p + a*q)/det;
                //ansxがどちらの線分のx座標範囲にも含まれるかを判定
                if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[6] - ansx)*(x[7] - ansx) <= 0.00001 ) {
                    count++;
                }
            }
        }
        if(count == 1) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'ansx' was not declared in this scope
   39 |                 ansx = (d*p - b*q)/det;
      |                 ^~~~
a.cc:40:17: error: 'ansy' was not declared in this scope
   40 |                 ansy = (-c*p + a*q)/det;
      |                 ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int main(void){
    int n;
    cin >> n;
    rep(i,n) {
        int count = 0;
        double x[8],y[8],a,b,c,d,p,q,det;
        //入力を多少簡略化
        for(int k=0;k<8;k++) {
            cin >> x[k] >> y[k];
        }
        rep(j,3) {
            //(x1,y1)(x2,y2)を結ぶax+by=p の係数
            a = y[j]-y[j+1];  b = x[j+1]-x[j];
            p = x[j+1]*y[j]-x[j]*y[j+1];
            //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
            c = y[6]-y[7];  d = x[7]-x[6];
            q = x[7]*y[6]-x[6]*y[7];
            //係数についての行列式
            det = a*d-c*b;
            //det=0で解は存在しない(この問題については２線分は同一直線上にないから)
            if(fabs(det) < 0.00001){
            } else {
                ansx = (d*p - b*q)/det;
                ansy = (-c*p + a*q)/det;
                //ansxがどちらの線分のx座標範囲にも含まれるかを判定
                if((x[0] - ansx)*(x[1] - ansx) <= 0.00001 && (x[6] - ansx)*(x[7] - ansx) <= 0.00001 ) {
                    count++;
                }
            }
        }
        if(count == 1) cout << "OK" << endl;
        else cout << "NG" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'ansx' was not declared in this scope
   39 |                 ansx = (d*p - b*q)/det;
      |                 ^~~~
a.cc:40:17: error: 'ansy' was not declared in this scope
   40 |                 ansy = (-c*p + a*q)/det;
      |                 ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define EPS 1e-10
using namespace std;

int main(void){
    int n;
    cin >> n;
    rep(i,n) {
        int count = 0;
        double x[5],y[5],a,b,c,d,p,q,det,ansx;
        //入力を多少簡略化
        for(int k=0;k<5;k++) {
            cin >> x[k] >> y[k];
        }
        rep(j,3) {
            //(x1,y1)(x2,y2)を結ぶax+by=p の係数
            if(j != 2) {
                a = y[j]-y[j+1];  b = x[j+1]-x[j];
                p = x[j+1]*y[j]-x[j]*y[j+1];
                //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
                c = y[3]-y[4];  d = x[4]-x[3];
                q = x[4]*y[3]-x[3]*y[4];
                //係数についての行列式
                det = a*d-c*b;
                //det=0で解は存在しない(この問題については２線分は同一直線上にないから
                if(fabs(det) > EPS){
                    ansx = (d*p - b*q)/det;
                    ansy = (-c*p + a*q)/det;
                    //ansxがどちらの線分のx座標範囲にも含まれるかを判定
                    if((x[j] - ansx)*(x[j+1] - ansx) <= EPS && (x[3] - ansx)*(x[4] - ansx) <= EPS ) {
                        count++;
                    }
                }
            } else {
                a = y[j]-y[0];  b = x[0]-x[j];
                p = x[0]*y[j]-x[j]*y[0];
                //(x3,y3)(x4,y4)を結ぶcx+dy=q の係数
                c = y[3]-y[4];  d = x[4]-x[3];
                q = x[4]*y[3]-x[3]*y[4];
                //係数についての行列式
                det = a*d-c*b;
                //det=0で解は存在しない(この問題については２線分は同一直線上にないから
                if(fabs(det) > EPS){
                    ansx = (d*p - b*q)/det;
                    //ansxがどちらの線分のx座標範囲にも含まれるかを判定
                    if((x[j] - ansx)*(x[0] - ansx) <= EPS && (x[3] - ansx)*(x[4] - ansx) <= EPS ) {
                        count++;
                    }
                }
            }
        }
        if(count == 1) cout << "OK" << endl;
        else cout << "NG" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:21: error: 'ansy' was not declared in this scope; did you mean 'ansx'?
   41 |                     ansy = (-c*p + a*q)/det;
      |                     ^~~~
      |                     ansx
Language: C++

#include <bits/stdc++.h>
  
using namespace std;
  
typedef double D;
typedef complex<D> P;
#define EPS (1e-10)
 
D dot(P a, P b)
{
    return real(conj(a) * b);
}
 
D cross(P a, P b)
{
    return imag(conj(a) * b);
} 
 
int ccw(P p0, P p1, P p2)
{
    P a = p1 - p0;
    P b = p2 - p0;
  
    if (cross(a,b) > EPS) return 1;
    if (cross(a,b) < -EPS) return -1;
    if (dot(a,b) < -EPS) return 2;
    if (norm(a) < norm(b)) return -2;
    return 0;
}
 
bool check(P p1, P p2, P p3, P p4)
{
    return (ccw(p1, p2, p3)*ccw(p1, p2, p4) <= 0 &&
	    ccw(p3, p4, p1)*ccw(p3, p4, p2) <= 0);
}
  
int main()
{
    int n;
    P P[3], T[2];
  
    scanf("%d", &n);
    while (n--) {
	for (int i = 0; i < 3; i++) {
	    scanf("%lf %lf", &P[i].real(), &P[i].imag());
	}
 
	for (int i = 0; i < 2; i++) {
	    scanf("%lf %lf", &T[i].real(), &T[i].imag());
	}
 
	int cnt = 0; 
	if (check(P[0], P[1], T[0], T[1])) {
	    cnt++;
	}   
	if (check(P[0], P[2], T[0], T[1])) {
	    cnt++;
	} 
	if (check(P[1], P[2], T[0], T[1])) {
	    cnt++;
	} 
	if (cnt % 2) {
	    puts("OK");
	} else {
	    puts("NG");
	}
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:40: error: lvalue required as unary '&' operand
   45 |             scanf("%lf %lf", &P[i].real(), &P[i].imag());
      |                               ~~~~~~~~~^~
a.cc:45:54: error: lvalue required as unary '&' operand
   45 |             scanf("%lf %lf", &P[i].real(), &P[i].imag());
      |                                             ~~~~~~~~~^~
a.cc:49:40: error: lvalue required as unary '&' operand
   49 |             scanf("%lf %lf", &T[i].real(), &T[i].imag());
      |                               ~~~~~~~~~^~
a.cc:49:54: error: lvalue required as unary '&' operand
   49 |             scanf("%lf %lf", &T[i].real(), &T[i].imag());
      |                                             ~~~~~~~~~^~
Language: C++

#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
 
using namespace std;
 
double EPS = 1e-10;
 
double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}
 
struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}
 
  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }
 
  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }
 
  point operator * (double d){
    return point(x*d,y*d);
  }
};
 
struct segment{
  point a,b;
};
 
double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}
 
double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}
 
int is_intersected_ls(point a1, point a2, point b1, point b2) {
  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
         ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

 double vec_abs(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

int ccw(point p0, point p1, point p2){
  point a = p1 - p0;
  point b = p2 - p0;
  if(cross(a,b)>EPS)return +1;
  if(cross(a,b)<EPS)return -1;
  if(dot(a,b)<-EPS)return +2;
  if(a.x*a.x+a.y*a.y<b.x*b.x+b.y*b.y)return -2;
  return 0;
}

 int inside(point t,point* p,int N){
  int i,count=0,j=0;
  segment lt,lp;

  p[N]=p[0];
  p[N+1]=p[1];

  lt.a=lt.b=t;
  lt.b.x=INT_MAX;

  for(i=1;i<=N;i++){
    lp.a=lp.b=p[i];

    if(!is_intersected_ls(lp.a,lp.b,lt.a,lt.b)){
      if(i==j+1){
	lp.b=p[j];
	if(is_intersected_ls(lp.a,lp.b,lt.a,lt.b))count++;
      }
      else if(ccw(lt.a,lt.b,p[i])*ccw(lt.a,lt.b,p[j])<0)count++;
      j=i;
    }
  }
  return count & 1;
}

int main(void){
  int n;
  point p[5],k,s;
 
  cin >> n;
  while(n--){

    for(int i=0;i<3;i++)
      cin >> p[i].x >> p[i].y;
     
    cin >> k.x >> k.y >> s.x >> s.y;
 
    if(inside(k,p,3)!=inside(s,p,3))cout << "OK" << endl;
    else cout << "NG" << endl;
     
  }
 
  return 0;
}

Compiler output:
a.cc: In function 'int inside(point, point*, int)':
a.cc:72:10: error: 'INT_MAX' was not declared in this scope
   72 |   lt.b.x=INT_MAX;
      |          ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<vector>
  +++ |+#include <climits>
    5 |
Language: Java

import java.util.*;

public class Main
{
    static final int inf = 99999;
    int[][] a;

    Main(){
	Scanner sc = new Scanner(System.in);
	int n, m, s, t;

	while(sc.hasNext()){
	    n = sc.nextInt();
	    a = new int[n+1][n+1];

	    for(int i = 0; i <= n; ++i)
		for(int j = i+1; j <= n; ++j)
		    a[i][j] = a[j][i] = inf;

	    for(int i = 0; i < n; ++i){
		s = sc.nextInt();
		m = sc.nextInt();
		for(int j = 0; j < m; ++j){
		    t = sc.nextInt();
		    a[s][t] = 1;
		}
	    }

	    for(int k = 1; k <= n; ++k)
		for(int i = 1; i <= n; ++i)
		    for(int j = 1; j <= n; ++j)
			a[i][j] = Math.min(a[i][j], a[i][k]+a[k][j]);

	    n = sc.nextInt();
	    for(int i = 0; i < n; ++i){
		s = sc.nextInt();
		t = sc.nextInt();
		m = sc.nextInt();
		if(a[s][t] < u)
		    System.out.println(Integer.toString(a[s][t]+1));
		else
		    System.out.println("NA");
	    }
	}
    }

    public static void main(String[] args){
	new Main();
    }
}

Compiler output:
Main.java:39: error: cannot find symbol
		if(a[s][t] < u)
		             ^
  symbol:   variable u
  location: class Main
1 error
Language: Java


import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {

	int INF = 1 << 28;
	//long INF = 1L << 62;
	double EPS = 1e-10;
	
	int n;
	int[][] es;
	
	void run() {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		es = new int[n][n];
		for (int[] a: es) fill(a, INF);
		for (int i=0;i<n;i++) es[i][i] = 0;
		for (int i=0;i<n;i++) {
			int r = sc.nextInt()-1, k = sc.nextInt();
			for (int j=0;j<k;j++) {
				int t = sc.nextInt()-1;
				es[r][t] = 1;
			}
		}
		
		for (int k=0;k<n;k++) for (int i=0;i<n;i++) for (int j=0;j<n;j++) {
			es[i][j] = min(es[i][j], es[i][k] + es[k][j]);
		}
		int p = sc.nextInt();
		for (int i=0;i<p;i++) {
			int s = sc.nextInt()-1, d = sc.nextInt()-1, v = sc.nextInt();
			System.out.println((es[s][d] + 1 <= v ? es[s][d] + 1 : "NA"));
		}
	}
	
	String bfs(int s, int t, int v) {
		LinkedList<V> q = new LinkedList<V>();
		q.add(new V(s, v));
		boolean[] used = new boolean[n];
		used[s] = true;
		for (;! q.isEmpty();) {
			V cur = q.removeFirst();
			if (t == cur.p) return "" + (v - cur.c + 1);
			if (cur.c == 1) continue;
			for (int i=0;i<n;i++) if (! used[i] && es[cur.p][i] ) {
				used[i] = true;
				q.addLast(new V(i, cur.c - 1));
			}
		}
		return "NA";
	}
	
	class V {
		int p, c;
		V(int p, int c) {
			this.p = p;
			this.c = c;
		}
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
Main.java:50: error: bad operand types for binary operator '&&'
			for (int i=0;i<n;i++) if (! used[i] && es[cur.p][i] ) {
			                                    ^
  first type:  boolean
  second type: int
1 error
Language: C

#include <stdio.h>

#define N 101

int check(int s,int d,int v);

int root[N][N]; /* rooter path */
int distance[N]; /* already visited flag */

int main(){
    int n,r,k,t;
    int p,s,d,v;
    int i,j;
    char c;
    int ans;

    /* init root */
    for(i=0;i<N;i++){
        for(j=0;j<N;j++){
            root[i][j]=0;
        }
    }

    /* input */
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&r);
        scanf("%d",&k);
        for(j=0;j<k;j++){
            scanf("%d",&t);
            root[r][j] = t;
        }
    }


    scanf("%d",&p);
    for(i=0;i<p;i++){
        scanf("%d %d %d",&s,&d,&v);
        ans = check(s,d,v);
        printf(ans?"%d\n":"NA\n",ans);
    }
    return 0;
}
  
  
int check(int s,int d,int v){
    int i,ret,id,num,nextid;

    for(i=0;i<N;i++)distance[i]=0;

    distance[s]=1;

    for(i=1;i<v;i++){
        for(j=0;j<N;j++){
            if(distance[j]==i){
                for(k=0;root[id][k]>0;k++){
                    nextid=root[id][k];
                    if(distance[nextid]==0){
                        distance[nextid]=i+1;
                    }
                }
            }
        }
    }

    return distance[d];
}

Compiler output:
main.c: In function 'check':
main.c:54:13: error: 'j' undeclared (first use in this function)
   54 |         for(j=0;j<N;j++){
      |             ^
main.c:54:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:56:21: error: 'k' undeclared (first use in this function)
   56 |                 for(k=0;root[id][k]>0;k++){
      |                     ^
Language: C

#include<stdio.h>
#define N 100000

int main(void)
{
  int n,p,r,k,t,a,count[101];
  int queue[1000000],head=0,tail=0;
  int router[101][101],visited[101],i,j,b;
  
  struct mail{
    int s;
    int d;
    int v;
  }packet[N];
  
  for(i=0;i<101;i++)
    {
      for(j=0;j<101;j++)
	{
	  router[i][j]=0;
	}
    }
  
  scanf("%d",&n);
  
  for(i=1;i<=n;i++)
    {
      scanf("%d%d",&r,&k);
      
      for(j=1;j<=k;j++)
	{
	  scanf("%d",&t);
	  router[r][t]=1;
	}
    }
  
  for(i=1;i<=n;i++)
    {
      router[i][i]=0;
    }

  scanf("%d",&p);
  
  for(i=1;i<=p;i++)
    {
      scanf("%d%d%d",&packet[i].s,&packet[i].d,&packet[i].v);
    }
  
  for(i=1;i<=p;i++)
    {
      for(b=0;b<101;b++)
	count[b]=0;

      count[packet[i].s]=1;
      queue[tail++]=packet[i].s;
      
      for(b=0;b<=n;b++)
	visited[b]=0;
	    

      visited[packet[i].s]=1;

      while(head!=tail)
	{
	  
	  a=queue[head++];

	  for(j=1;j<=n;j++)
	    {
	      if(router[a][j]==1 && visited[j]==0)
		{
		  queue[tail++]=j;
		  visited[j]=1;
		  count[j]=count[a]+1;	
		} 	      
	    }
	}
        if(count[packet[i].d]<=packet[i].v && count[packet[i].d]!=0)printf("%d\n",count[packet[i].d]);
	else printf("NA\n");
		  
    }
  return 0;
}
#include<stdio.h>
#define N 100000

int main(void)
{
  int n,p,r,k,t,a,count[101];
  int queue[1000000],head=0,tail=0;
  int router[101][101],visited[101],i,j,b;
  
  struct mail{
    int s;
    int d;
    int v;
  }packet[N];
  
  for(i=0;i<101;i++)
    {
      for(j=0;j<101;j++)
	{
	  router[i][j]=0;
	}
    }
  
  scanf("%d",&n);
  
  for(i=1;i<=n;i++)
    {
      scanf("%d%d",&r,&k);
      
      for(j=1;j<=k;j++)
	{
	  scanf("%d",&t);
	  router[r][t]=1;
	}
    }
  
  for(i=1;i<=n;i++)
    {
      router[i][i]=0;
    }

  scanf("%d",&p);
  
  for(i=1;i<=p;i++)
    {
      scanf("%d%d%d",&packet[i].s,&packet[i].d,&packet[i].v);
    }
  
  for(i=1;i<=p;i++)
    {
      for(b=0;b<101;b++)
	count[b]=0;

      count[packet[i].s]=1;
      queue[tail++]=packet[i].s;
      
      for(b=0;b<=n;b++)
	visited[b]=0;
	    

      visited[packet[i].s]=1;

      while(head!=tail)
	{
	  
	  a=queue[head++];

	  for(j=1;j<=n;j++)
	    {
	      if(router[a][j]==1 && visited[j]==0)
		{
		  queue[tail++]=j;
		  visited[j]=1;
		  count[j]=count[a]+1;	
		} 	      
	    }
	}
        if(count[packet[i].d]<=packet[i].v && count[packet[i].d]!=0)printf("%d\n",count[packet[i].d]);
	else printf("NA\n");
		  
    }
  return 0;
}

Compiler output:
main.c:87:5: error: redefinition of 'main'
   87 | int main(void)
      |     ^~~~
main.c:4:5: note: previous definition of 'main' with type 'int(void)'
    4 | int main(void)
      |     ^~~~
Language: C

#include<stdio.h>

int main(void)

{
int n,p,r,k,t,a,count[101];

int queue[1000000],head=0,tail=0;

int router[101][101],visited[101],i,j,b;

struct mail{

int s;

int d;

int v;

}packet[100000];

for(i=0;i<101;i++)

{

for(j=0;j<101;j++)

{

router[i][j]=0;

}

}

scanf("%d",&n);

for(i=1;i<=n;i++)

{

scanf("%d%d",&r,&k);

for(j=1;j<=k;j++)

{

scanf("%d",&t);

router[r][t]=1;

}

}

for(i=1;i<=n;i++)

{

router[i][i]=0;

}

scanf("%d",&p);

for(i=1;i<=p;i++)

{

scanf("%d%d%d",&packet[i].s ,&packet[i].d ,&packet[i].v);

}

for(i=1;i<=p;i++)

{

for(b=0;b<101;b++)

count[b]=0;

count[packet[i].s]=1;

queue[tail++]=packet[i].s;

for(b=0;b<101;b++)

visited[b]=0;

visited[packet[i].s]=1;

while(head!=tail)

{
a=queue[head++];

for(j=1;j<=n;j++)

{

if(router[a][j]==1 && visited[j]==0)

{

queue[tail++]=j;

visited[j]=1;

count[j]=count[a]+1;

}

}

}

if(count[packet[i].d<=packet[i].v && count[packet[i].d] != 0)printf("%d\n",count[packet[i].d]);

else printf("NA\n");

}

return 0;

}

Compiler output:
main.c: In function 'main':
main.c:117:61: error: expected ']' before ')' token
  117 | if(count[packet[i].d<=packet[i].v && count[packet[i].d] != 0)printf("%d\n",count[packet[i].d]);
      |                                                             ^
      |                                                             ]