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

#include <math.h>
#include <utility>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
 
int m;
int n;
int map[10][10] = {0};
int cnt = 0;
int churchx;
int churchy;
int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,-1,1};
 
int saiki( int xinput, int yinput, int nokori ) {
    for ( int i = 0; i < 4; i++ ) {
        int x = xinput;
        int y = yinput;
        if ( nokori == 0 ) {
            if ( y == churchy && x > churchx && i != 0 ) continue;
            if ( y == churchy && x < churchx && i != 1 ) continue;
            if ( x == churchx && y > churchy && i != 2 ) continue;
            if ( x == churchx && y < churchy && i != 3 ) continue;
        }
	
        while(true) {
            x += dx[i];
            y += dy[i];
            if ( x < 0 || x >= m || y < 0 || y >= n ) break;
            
	    if (map[x][y] == 1){
                map[x][y] = 3;
                saiki(x, y, nokori-1);
                map[x][y] = 1;
		break;
            }else if(map[x][y] == 2 ){
                if(nokori == 0){
                    cnt++;
                    return 0;
                }
            }
        }
    }
    return 0;
}
 
int main(){
    while(true) {
        cin >> m;
        cin >> n;
        if ( m == 0 ) break;
        int nokori = 0;
        for ( int i = 0; i < n; i++ ) {
            for ( int j = 0; j < m; j++ ) {
                cin >> map[j][i];
		//unvisited
                if ( map[j][i] == 1 ) {
                    nokori++;
		    
		//is_church
                }else if(map[j][i] == 2) {
                    churchx = j;
                    churchy = i;
                }
            }
        }
	
	cnt = 0;
	saiki( churchx, churchy, nokori );
	cout << cnt << endl;
    
    }
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <math.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <math.h>
         ^
Main.java:2: error: illegal character: '#'
#include <utility>
^
Main.java:3: error: illegal character: '#'
#include <string>
^
Main.java:4: error: illegal character: '#'
#include <vector>
^
Main.java:5: error: illegal character: '#'
#include <algorithm>
^
Main.java:6: error: illegal character: '#'
#include <iostream>
^
Main.java:9: error: unnamed classes are a preview feature and are disabled by default.
int m;
^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
int map[10][10] = {0};
^
Main.java:15: error: class, interface, enum, or record expected
int dx[4] = {-1,1,0,0};
^
Main.java:16: error: class, interface, enum, or record expected
int dy[4] = {0,0,-1,1};
^
Main.java:52: error: not a statement
        cin >> m;
            ^
Main.java:53: error: not a statement
        cin >> n;
            ^
Main.java:58: error: not a statement
                cin >> map[j][i];
                    ^
Main.java:73: error: not a statement
	cout << cnt << endl;
	            ^
15 errors
Language: C

#include <stdio.h>

int chousa(int[][],int,int,int,int,int);

int main(void) {
	int x,y;
	int map[10][10];
	int m,n;
	int kx,ky;
	int kazu=0;
	scanf("%d %d",&m,&n);
	/*読み込み*/
	for(y=0;y<n;y++) {
		for(x=0;x<m;x++) {
			scanf("%d",&map[x][y]);
			if(map[x][y]==2) {/*教会*/
				kx=x;
				ky=y;
			} else if(map[x][y]==1)kazu++;/*家*/
		}
	}
	/*計算*/
	printf("%d\n",chousa(map,kx,ky,kazu,m,n));
	return 0;
}

int chousa(int map[10][10],int kx,int ky,int nokori,int m,int n) {
	int x,y;
	int result=0;
	int house=0;
	if(map[kx][ky]==1) {/*今いる家を通ったことにする*/
		map[kx][ky]=0;
		house=1;
	}
	/*左に道順を調査*/
	for(x=kx-1;x>=0;x--) {
		/*家に降りる*/
		if(map[x][ky]==1) {
			result+=chousa(map,x,ky,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[x][ky]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[x][ky]==3)break;
	}
	/*右に道順を調査*/
	for(x=kx+1;x<m;x++) {
		/*家に降りる*/
		if(map[x][ky]==1) {
			result+=chousa(map,x,ky,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[x][ky]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[x][ky]==3)break;
	}
	/*上に道順を調査*/
	for(y=ky-1;y>=0;y--) {
		/*家に降りる*/
		if(map[kx][y]==1) {
			result+=chousa(map,kx,y,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[kx][y]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[kx][y]==3)break;
	}
	/*下に道順を調査*/
	for(y=ky+1;y<n;y++) {
		/*家に降りる*/
		if(map[kx][y]==1) {
			result+=chousa(map,kx,y,nokori-1,m,n);
			break;/*家の上を通る場合には必ずプレゼントを拾う*/
		}
		/*教会に戻る*/
		else if(map[kx][y]==2 && nokori==0) {
			result++;
			break;
		}
		/*通れない*/
		else if(map[kx][y]==3)break;
	}
	if(house)map[kx][ky]=1;/*通った家を元に戻す*/
	return result;
}

Compiler output:
main.c:3:15: error: array type has incomplete element type 'int[]'
    3 | int chousa(int[][],int,int,int,int,int);
      |               ^
main.c:3:15: note: declaration of multidimensional array must have bounds for all dimensions except the first
main.c: In function 'main':
main.c:23:30: error: type of formal parameter 1 is incomplete
   23 |         printf("%d\n",chousa(map,kx,ky,kazu,m,n));
      |                              ^~~
Language: C

#include<stdio.h>
bool hs[10][10];
bool used[10][10];
int cx,cy;
int nh;
int dx[4]={-1,0,1,0};
int dy[4]={0,1,0,-1};
int w,h;
int dfs(int x,int y,int f){
	if(f==nh){
		if(x==cx||y==cy)return 1;
		return 0;
	}
	int i,j;
	int res=0;
	for(i=0;i<4;i++){
		for(j=1;j<10;j++){
			int nx=x+j*dx[i];
			int ny=y+j*dy[i];
			if(nx<0||nx>=h||ny<0||ny>=w)break;
			if(hs[nx][ny]){
				if(!used[nx][ny]){
					used[nx][ny]=true;
					res+=dfs(nx,ny,f+1);
					used[nx][ny]=false;
					break;
				}
			}
		}
	}
	return res;
}
int main(){
	while(1){
	int i,j;
	scanf("%d %d",&w,&h);
	if(w==0)return 0;
	for(i=0;i<h;i++)for(j=0;j<w;j++){
		hs[i][j]=false;
		used[i][j]=false;
	}
	nh=0;
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			char c;
			scanf(" %c",&c);
			if(c=='1'){
				hs[i][j]=true;
				used[i][j]=false;
				nh++;
			}
			if(c=='2'){cx=i;cy=j;}
		}
	}
	printf("%d\n",dfs(cx,cy,0));
	}
}

Compiler output:
main.c:2:1: error: unknown type name 'bool'
    2 | bool hs[10][10];
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | bool hs[10][10];
main.c:3:1: error: unknown type name 'bool'
    3 | bool used[10][10];
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'dfs':
main.c:23:54: error: 'true' undeclared (first use in this function)
   23 |                                         used[nx][ny]=true;
      |                                                      ^~~~
main.c:23:54: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:23:54: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:54: error: 'false' undeclared (first use in this function)
   25 |                                         used[nx][ny]=false;
      |                                                      ^~~~~
main.c:25:54: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:39:26: error: 'false' undeclared (first use in this function)
   39 |                 hs[i][j]=false;
      |                          ^~~~~
main.c:39:26: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:48:42: error: 'true' undeclared (first use in this function)
   48 |                                 hs[i][j]=true;
      |                                          ^~~~
main.c:48:42: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

/* よいウンコードの例 *.

#include <cstdio>
#include <stack>

using namespace std;

#define EMPTY 0
#define YET_DELIVERED 1
#define CHURCH 2
#define DELIVERED 3

int m;
int n;
int count;
int house_num;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0,  0, -1, 1};
int map[10][10];

void rec(char x, char y) {
	char i;
	char times = 0;
    char x2;
    char y2;
    stack<char> s;
	char k;

call:
    i = 0;

loop:
    x2 = x;
    y2 = y;

	while (1) {
		x2 += dx[i];
		y2 += dy[i];

		if (x2 >= m || x2 < 0 || y2 >= n || y2 <0) break;
		if (map[y2][x2] == DELIVERED) break;

		if (map[y2][x2] == CHURCH) {
			if (times == house_num) {
				++count;
			}
		} else if (map[y2][x2] == YET_DELIVERED) {
			map[y2][x2] = DELIVERED;
			s.push(i);
			s.push(x);
			s.push(y);
			x = x2;
			y = y2;
			++times;
			goto call;
		}

resume:
        ;
	}

	++i;
	if (i < 4) {
    	goto loop;
    }

	if (s.empty()) return ;

    map[y][x] = YET_DELIVERED;
	--times;
	x2 = x;
	y2 = y;
	y = s.top(); s.pop();
	x = s.top(); s.pop();
	i = s.top(); s.pop();

	goto resume;
}


int main() {
	while (1) {
		int i;
		int church_x, church_y;

		scanf("%d %d", &m, &n);
		if ((m | n) == 0) {
			return 0;
		}

		count = 0;
		house_num = 0;

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

			for (j=0; j<m; j++) {
				scanf("%d", &map[i][j]);
				if (map[i][j] == YET_DELIVERED) {
					++house_num;
				} else if (map[i][j] == CHURCH) {
					church_x = j;
					church_y = i;
				}
			}
		}

		rec((char)church_x, (char)church_y);
		printf("%d\n", count);
	}
}

Compiler output:
a.cc:1:1: error: unterminated comment
    1 | /* よいウンコードの例 *.
      | ^
Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)     (x).begin(),(x).end()
# define UNIQ(c)    (c).erase(unique(ALL((c))), end((c)))
# define mp         make_pair
# define eb         emplace_back
# define FOR(i,a,b) for(int i=(a);i<(b);++i)
# define REP(i,n)   FOR(i,0,n)
# define INIT       std::ios::sync_with_stdio(false);std::cin.tie(0);


int m, n;
int maze[11][11];
int house[11][11];
int housecount;

int dfs(int y, int x, int depth) {
	int ret = 0;
	for (int i = y - 1; i >= 0; --i) {
		if (depth == housecount && maze[i][x] == 2)
			return 1;

		if (maze[i][x] == 1) {
			maze[i][x] = 0;
			ret += dfs(i, x, depth + 1);
			maze[i][x] = 1;

			break;
		}
	}
	for (int i = y + 1; i < n; ++i) {
		if (depth == housecount && maze[i][x] == 2)
			return 1;

		if (maze[i][x] == 1) {
			maze[i][x] = 0;
			ret += dfs(i, x, depth + 1);
			maze[i][x] = 1;

			break;
		}
	}
	for (int i = x - 1; i >= 0; --i) {
		if (depth == housecount && maze[y][i] == 2)
			return 1;

		if (maze[y][i] == 1) {
			maze[y][i] = 0;
			ret += dfs(y, i, depth + 1);
			maze[y][i] = 1;

			break;
		}
	}
	for (int i = x + 1; i < m; ++i) {
		if (depth == housecount && maze[y][i] == 2)
			return 1;

		if (maze[y][i] == 1) {
			maze[y][i] = 0;
			ret += dfs(y, i, depth + 1);
			maze[y][i] = 1;

			break;
		}
	}

	if (depth == housecount)
		return 0;

	return ret;
}

int main() {
	while (cin >> m >> n && (m || n)) {
		for (int i = 0; i < 11; i++)for (int j = 0; j < 11; j++)maze[i][j] = housecount[i][j] = 0;
		int si, sj;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				cin >> maze[i][j];
				if (maze[i][j] == 1) {
					house[i][j] = housecount;
					housecount++;
				}
				if (maze[i][j] == 2) {
					si = i, sj = j;
				}
			}
		}
		cout << dfs(si, sj, 0) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:96: error: invalid types 'int[int]' for array subscript
  101 |                 for (int i = 0; i < 11; i++)for (int j = 0; j < 11; j++)maze[i][j] = housecount[i][j] = 0;
      |                                                                                                ^
Language: C++

#include<cstdio>
#include<vector>
using namespace std;
int ans;
int vec[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
int tab[12][12];
int wx,wy;
void solve(int nx,int ny,int rem){
    for(int v=0;v<4;v++){
        int nowx=nx,nowy=ny;
LA:
            nowx+=vec[v][0],nowy+=vec[v][1];
            if(!(0<=nowx&&nowx<wx&&0<=nowy&&nowy<wy)) goto LB;
            if(tab[nowx][nowy]==2&&rem==0)ans++;
            if(tab[nowx][nowy]==1){
                tab[nowx][nowy]=-1;
                solve(nowx,nowy,wx,wy,rem-1);
                tab[nowx][nowy]=1;
                goto LB;
            }
            goto LA;
LB:         
        }
    }
}
int main(){
    for(;;){
        int m,n;
        scanf("%d%d",&m,&n);
        if(m==0&&n==0)break;
        int stx,sty,homec=0;
        for(int i=0;i<n;i++)for(int j=0;j<m;j++){
            scanf("%d",&tab[i][j]);
            if(tab[i][j]==1)homec++;
            else if(tab[i][j]==2){stx=i;sty=j;}
        }
        wx=n;wy=m;
        ans=0;
        solve(stx,sty,n,m,homec);
        printf("%d\n",ans);
    }
}

Compiler output:
a.cc: In function 'void solve(int, int, int)':
a.cc:17:22: error: too many arguments to function 'void solve(int, int, int)'
   17 |                 solve(nowx,nowy,wx,wy,rem-1);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:6: note: declared here
    8 | void solve(int nx,int ny,int rem){
      |      ^~~~~
a.cc:23:9: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   23 |         }
      |         ^
a.cc: At global scope:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
a.cc: In function 'int main()':
a.cc:39:14: error: too many arguments to function 'void solve(int, int, int)'
   39 |         solve(stx,sty,n,m,homec);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:8:6: note: declared here
    8 | void solve(int nx,int ny,int rem){
      |      ^~~~~
Language: C++

#include <iostream>
#include <map>
#include <cmath>
#include <memory>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for(int i = 0; i < n; i++)

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int field[12][12];
int nums[12][12];
map<P, bool> ng;

int dfs(int state, int x, int y){
  if(ng[P(state, nums[y][x])]) return 0;
  if(state == 0){
    rep(i, 4){
      int x2 = x + dx[i];
      int y2 = y + dy[i];
      while(field[y2][x2] == 0){
	y2 += dy[i];
	x2 += dx[i];
      }
      if(field[y2][x2] == 2) return 1;
    }
    ng[P(state, nums[y][x])] = true;
    return 0;
  }
  int res = 0;
  rep(i, 4){
    int x2 = x + dx[i];
    int y2 = y + dy[i];
    while(field[y2][x2] != 3){
      if(field[y2][x2] == 1){
	field[y2][x2] = 3;
	res += dfs(state - (1 << nums[y2][x2]), x2, y2);
	field[y2][x2] = 1;
      }
      x2 += dx[i];
      y2 += dy[i];
    }
  }
  return res;
}


int main(){
  int n, m, sx, sy, cnt;
  while(cin >> m >> n && (n || m)){
    cnt = 0;
    fill(&field[0][0], &field[11][11] + 1, 3);
    memset(nums, 0, sizeof(nums));
    ng.clear();
    rep(i, n){
      rep(j, m){
	cin >> field[i+1][j+1];
	if(field[i+1][j+1] == 2){
	  sx = j + 1;
	  sy = i + 1;
	}
	if(field[i+1][j+1] == 1){
	  nums[i+1][j+1] = cnt++;
	}
      }
    }
    cout << dfs((1 << cnt) - 1, sx, sy) << endl;
  }
  return 0;
}
    

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

#include<iostream>
#include<cmath>
#define MAX 12
using namespace std;
int h,w;
int sum;
int sx,sy;
int dp[(1<<18)][23];
int s[MAX][MAX];
int housInd[MAX][MAX];
/*
 2
1 3
 0
*/
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
	if(housInd[ny][nx] != -1 && bit < (1 << 18) && dp[bit][housInd[ny][nx]] != -1)
		return dp[bit][housInd[ny][nx]];
	
	int ret = 0;
	bool isLast = bit == (1 << sum) - 1;
	for (int i = 0; i < 4; i++) {
		for (int x = nx+dx[i], y = ny+dy[i]; 0 <= x && x < w && 0 <= y && y < h; x += dx[i], y += dy[i]) {
			int ind = housInd[y][x];
			if (ind == -1) {
				if (isLast && s[y][x] == 2) return dp[bit][housInd[ny][nx]] = 1;
			}
			else {
				if ((bit & 1 << ind) != 0) break;
				if (!isLast)ret += func(y, x, bit | (1 << ind));
			}
		}
	}
	
	return housInd[ny][nx] != -1 && bit < (1 << 18) ? (dp[bit][housInd[ny][nx]] = ret) : ret;
}
int main(){
	while(cin>>w>>h,w||h){
		sum=0;
		memset(dp,-1,sizeof(dp));
		for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					cin>>s[i][j];
					housInd[i][j] = -1;
					if(s[i][j]==2){
						sy=i;sx=j;
					}else if(s[i][j]==1) {
						housInd[i][j] = sum++;
					}
				}
		}
		int ans=func(sy,sx,0);
		cout<<ans<<endl;
	}
	return 0;
}

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

#include<iostream>
#include<cmath>
#include<stdlib.h>
#define MAX 12
using namespace std;
int h,w;
int sum;
int sx,sy;
int dp[(1<<18)][23];
int s[MAX][MAX];
int housInd[MAX][MAX];
/*
 2
1 3
 0
*/
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
	if(housInd[ny][nx] != -1 && bit < (1 << 18) && dp[bit][housInd[ny][nx]] != -1)
		return dp[bit][housInd[ny][nx]];
	
	int ret = 0;
	bool isLast = bit == (1 << sum) - 1;
	for (int i = 0; i < 4; i++) {
		for (int x = nx+dx[i], y = ny+dy[i]; 0 <= x && x < w && 0 <= y && y < h; x += dx[i], y += dy[i]) {
			int ind = housInd[y][x];
			if (ind == -1) {
				if (isLast && s[y][x] == 2) return dp[bit][housInd[ny][nx]] = 1;
			}
			else {
				if ((bit & 1 << ind) != 0) break;
				if (!isLast)ret += func(y, x, bit | (1 << ind));
			}
		}
	}
	
	return housInd[ny][nx] != -1 && bit < (1 << 18) ? (dp[bit][housInd[ny][nx]] = ret) : ret;
}
int main(){
	while(cin>>w>>h,w||h){
		sum=0;
		memset(dp,-1,sizeof(dp));
		for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					cin>>s[i][j];
					housInd[i][j] = -1;
					if(s[i][j]==2){
						sy=i;sx=j;
					}else if(s[i][j]==1) {
						housInd[i][j] = sum++;
					}
				}
		}
		int ans=func(sy,sx,0);
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: 'memset' was not declared in this scope
   42 |                 memset(dp,-1,sizeof(dp));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<stdlib.h>
  +++ |+#include <cstring>
    4 | #define MAX 12
Language: C++

#include<iostream>
#define MAX 11
using namespace std;
int h,w;
int sum;
int sx,sy;
int s[MAX][MAX];
int housInd[MAX][MAX];
int dx[]={0,-1,0,1},dy[]={1,0,-1,0};
int func(int ny, int nx, int bit){
//	cout << "hi" << bit << endl;
	
	int ret = 0;
	bool isLast = bit == (1 << sum) - 1;
	
	for (int i = 0; i < 4; i++) {
		for (int x = nx+dx[i], y = ny+dy[i]; 0 <= x && x < w && 0 <= y && y < h; x += dx[i], y += dy[i]) {
			int ind = housInd[y][x];
			if (ind == -1) {
				if (isLast && s[y][x] == 2) return 1;
			}
			else {
				if (!isLast) {
					if ((bit & 1 << ind) == 0) {
						ret += func(y, x, bit | (1 << ind));
						break;
					}
				}
			}
		}
	}
	
	return ret;
}
int main(){
	while(cin>>w>>h,w||h){
		sum=0;
		dp.clear();
		for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					cin>>s[i][j];
					housInd[i][j] = -1;
					if(s[i][j]==2){
						sy=i;sx=j;
					}else if(s[i][j]==1) {
						housInd[i][j] = sum++;
					}
				}
		}
		int ans=func(sy,sx,0);
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'dp' was not declared in this scope; did you mean 'dy'?
   38 |                 dp.clear();
      |                 ^~
      |                 dy
Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>

#define PLANE (-1)
#define HOUSE (1)
#define CHURCH (100)

using namespace std;

int x, y;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int home[10][10];
int n;
map<int, int> memo[24];

int goChurch(int ty, int tx)
{
    int i;
    int my, mx;
    for (i = 0; i < 4; i++){
        my = ty + dy[i];
        mx = tx + dx[i];
        while (0 <= my && my < y && 0 <= mx && mx < x){
            if (home[my][mx] == CHURCH){
                return (1);
            }
            my += dy[i];
            mx += dx[i];
        }
    }
    return (0);
}

int dfs(int v, int bit, int ty, int tx, char state[][11])
{
    int i;
    int ky, kx;
    int ans;
    
    if (memo[pos].find(bit) != memo[pos].end()){
        return (memo[v][bit]);
    }
    
    if (bit == (1 << n) - 1){
        if (__builtin_popcount(bit) < 19){
            return (memo[v][bit] = goChurch(ty, tx));
        }
        return (goChurch(ty, tx));
    }
    
    ans = 0;
    
    for (i = 0; i < 4; i++){
		kx = tx + dx[i];
        ky = ty + dy[i];
        //ツ逆ツ渉づ可プツδ個ゼツδ督トツづーツ置ツつ「ツづつ「ツつュ
		while (0 <= kx && kx < x && 0 <= ky && ky < y && (home[ky][kx] == PLANE || home[ky][kx] == CHURCH || state[ky][kx] == 1)){
			ky += dy[i];
            kx += dx[i];
		}
		if (0 <= kx && kx < x && 0 <= ky && ky < y){
			state[ky][kx] = 1;
			ans += dfs(home[ky][kx] , bit | (1 << home[ky][kx]) , ky, kx, state);
			state[ky][kx] = 0;
		}
	}
    
    if (__builtin_popcount(bit) < 19){
        memo[v][bit] = ans;
    }
	return (ans);
}


int main(void)
{
    int sy, sx;
    int i, j;
    char state[10][11];
    
    while (1){
        scanf("%d%d", &x, &y);
        
        if (x + y == 0){
            break;
        }
        n = 0;
        for (i = 0; i < y; i++){
            for (j = 0; j < x; j++){
                scanf("%d", &home[i][j]);
                if (home[i][j] == 2){
                    home[i][j] = CHURCH;
                    sy = i;
                    sx = j;
                }
                else if (home[i][j] == HOUSE){
                    home[i][j] = n++;
                }
                else if (home[i][j] == 0){
                    home[i][j] = PLANE;
                }
            }
        }
        memset(state, 0, sizeof(state));
        for (i = 0; i < 24; i++){
            memo[i].clear();
        }
        printf("%d\n", dfs(n, 0, sy, sx, state));
    }
    
    return (0);
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int, char (*)[11])':
a.cc:43:14: error: 'pos' was not declared in this scope
   43 |     if (memo[pos].find(bit) != memo[pos].end()){
      |              ^~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>

#define PLANE (-1)
#define HOUSE (1)
#define CHURCH (100)

using namespace std;

int x, y;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int home[10][10];
int n;
map<int, int> memo[24];

int goChurch(int ty, int tx)
{
    int i;
    int my, mx;
    for (i = 0; i < 4; i++){
        my = ty + dy[i];
        mx = tx + dx[i];
        while (0 <= my && my < y && 0 <= mx && mx < x){
            if (home[my][mx] == CHURCH){
                return (1);
            }
            my += dy[i];
            mx += dx[i];
        }
    }
    return (0);
}

int dfs(int v, int bit, int ty, int tx, char state[][11])
{
    int i;
    int ky, kx;
    int ans;
    
    if (memo[pos].find(bit) != memo[v].end()){
        return (memo[v][bit]);
    }
    
    if (bit == (1 << n) - 1){
        if (__builtin_popcount(bit) < 19){
            return (memo[v][bit] = goChurch(ty, tx));
        }
        return (goChurch(ty, tx));
    }
    
    ans = 0;
    
    for (i = 0; i < 4; i++){
		kx = tx + dx[i];
        ky = ty + dy[i];
        //ツ逆ツ渉づ可プツδ個ゼツδ督トツづーツ置ツつ「ツづつ「ツつュ
		while (0 <= kx && kx < x && 0 <= ky && ky < y && (home[ky][kx] == PLANE || home[ky][kx] == CHURCH || state[ky][kx] == 1)){
			ky += dy[i];
            kx += dx[i];
		}
		if (0 <= kx && kx < x && 0 <= ky && ky < y){
			state[ky][kx] = 1;
			ans += dfs(home[ky][kx] , bit | (1 << home[ky][kx]) , ky, kx, state);
			state[ky][kx] = 0;
		}
	}
    
    if (__builtin_popcount(bit) < 19){
        memo[v][bit] = ans;
    }
	return (ans);
}


int main(void)
{
    int sy, sx;
    int i, j;
    char state[10][11];
    
    while (1){
        scanf("%d%d", &x, &y);
        
        if (x + y == 0){
            break;
        }
        n = 0;
        for (i = 0; i < y; i++){
            for (j = 0; j < x; j++){
                scanf("%d", &home[i][j]);
                if (home[i][j] == 2){
                    home[i][j] = CHURCH;
                    sy = i;
                    sx = j;
                }
                else if (home[i][j] == HOUSE){
                    home[i][j] = n++;
                }
                else if (home[i][j] == 0){
                    home[i][j] = PLANE;
                }
            }
        }
        memset(state, 0, sizeof(state));
        for (i = 0; i < 24; i++){
            memo[i].clear();
        }
        printf("%d\n", dfs(n, 0, sy, sx, state));
    }
    
    return (0);
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int, char (*)[11])':
a.cc:43:14: error: 'pos' was not declared in this scope
   43 |     if (memo[pos].find(bit) != memo[v].end()){
      |              ^~~
Language: C++

#include<iostream>

using namespace std;

int x,y;
int map[10][10];
int hmx[24],hmy[24];
int gx,gy;
int home;
int ans;
bool hm[24];
int dx[5]={0,0,1,0,-1};
int dy[5]={0,1,0,-1,0};

void dfs(int mx,int my,int d,int ho2,int map2[10][10],int hmmx[24],int hmmy[24],bool hm2[24]){
	if(ho2==0){
		if(mx==gx || my==gy){
			bool ch=true;
			if(mx==gx){
				if(my>gy){
					for(int j=0;j<home;j++){
						if(mx==hmmx[j] && my>hmmy[j] && hmmy[j]>gy && hm2[j]==true)ch=false;
					}
				}
				if(my<gy){
					for(int j=0;j<home;j++){
						if(mx==hmmx[j] && my<hmmy[j] && hmmy[j]<gy && hm2[j]==true)ch=false;
					}
				}
			}
			if(my==gy){
				if(mx>gx){
					for(int j=0;j<home;j++){
						if(my==hmmy[j] && mx>hmmx[j] && hmmx[j]>gx && hm2[j]==true)ch=false;
					}
				}
				if(mx<gx){
					for(int j=0;j<home;j++){
						if(my==hmmy[j] && mx<hmmx[j] && hmmx[j]<gx && hm2[j]==true)ch=false;
					}
				}
			}
			if(ch)ans++;
		}
	}else for(int i=0;i<home;i++){
		if(hm2[i]==false)if(mx==hmmx[i] || my==hmmy[i]){
			bool ch=true;
			if(mx==hmmx[i]){
				if(my>hmmy[i]){
					for(int j=0;j<home;j++){
						if(mx==hmmx[j] && my>hmmy[j] && hmmy[j]>hmmy[i] && hm2[j]==true)ch=false;
					}
				}
				if(my<hmmy[i]){
					for(int j=0;j<home;j++){
						if(mx==hmmx[j] && my<hmmy[j] && hmmy[j]<hmmy[i] && hm2[j]==true)ch=false;
					}
				}
			}
			if(my==hmmy[i]){
				if(mx>hmmx[i]){
					for(int j=0;j<home;j++){
						if(my==hmmy[j] && mx>hmmx[j] && hmmx[j]>hmmx[i] && hm2[j]==true)ch=false;
					}
				}
				if(mx<hmmx[i]){
					for(int j=0;j<home;j++){
						if(my==hmmy[j] && mx<hmmx[j] && hmmx[j]<hmmx[i] && hm2[j]==true)ch=false;
					}
				}
			}
			if(ch){
				hm2[i]=true;
				dfs(hmmx[i],hmmy[i],0,ho2-1,map2,hmmx,hmmy,hm2);
				hm2[i]=false;
			}
		}
	}
	/*if(map2[mx][my]==2 && ho2==0)ans++;
	else{
		if(map2[mx][my]==1){
			map2[mx][my]=3;
			ho2-=1;
			dfs(mx,my,0,ho2,map2);
			map2[mx][my]=1;
			ho2+=1;
		}
		if(d==0){
			for(int i=1;i<=4;i++){
				int kx=mx+dx[i],ky=my+dy[i];
				if(kx>=0 && kx<x && ky>=0 && ky<y && map2[kx][ky]!=3){
					dfs(kx,ky,i,ho2,map2);
				}
			}
		}else{
			int kx=mx+dx[d],ky=my+dy[d];
			if(kx>=0 && kx<x && ky>=0 && ky<y && map2[kx][ky]!=3){
				dfs(kx,ky,d,ho2,map2);
			}
		}
	}*/
}

int main(void){
	while(1){
		scanf("%d%d",&x,&y);
		if(x==0 && y==0)break;
		home=0;
		ans=0;
		memset(hm,false,sizeof(hm));
		for(int i=0;i<y;i++){
			for(int j=0;j<x;j++){
				scanf("%d",&map[j][i]);
				if(map[j][i]==2)gx=j,gy=i;
				if(map[j][i]==1)hmx[home]=j,hmy[home]=i;
				if(map[j][i]==1)home++;
			}
		}
		dfs(gx,gy,0,home,map,hmx,hmy,hm);
		printf("%d\n",ans);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:110:17: error: 'memset' was not declared in this scope
  110 |                 memset(hm,false,sizeof(hm));
      |                 ^~~~~~
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<cstdio>

int n, m, field[11][11], si, sj, num;

int dfs(int x, int y){
  int ans = 0;
  if(num == 0){
    if(x == si || y == sj)return 1;
    else return 0;
  }
  field[x][y] = 0;
  for(int i = x + 1;i < m;i++){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  } 
  for(int i = x - 1;i >= 0;i--){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  } 
  for(int i = y + 1;i < n;i++){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  } 
  for(int i = y - 1;i >= 0;i--){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  }  
  field[x][y] = 1;
  return ans;
}

int main(){
  while(1){
    scanf("%d%d", &n, &m);
    if(n == 0 && m == 0)return 0;
    memset(field, 0, sizeof(field));
    num = 0;
    for(int i = 0;i < m;i++){
      for(int j = 0;j < n;j++){
	scanf("%d", &field[i][j]);
	if(field[i][j] == 2){
	  si = i;
	  sj = j;
	}
	else num += field[i][j];
      }
    }
    printf("%d\n", dfs(si, sj));
  }
}

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

#include <iostream>

using namespace std;

int n, m, field[11][11], si, sj, num;
 
int dfs(int x, int y){
  int ans = 0;
  if(num == 0){
    if(x == si || y == sj)return 1;
    else return 0;
  }

  field[x][y] = 0;
  for(int i = x + 1 ; i < m ; i++){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  }
  for(int i = x - 1 ; i >= 0 ; i--){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  }
  for(int i = y + 1 ; i < n ; i++){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  }
  for(int i = y - 1 ; i >= 0 ; i--){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  } 
  field[x][y] = 1;
  return ans;
}
 
int main(void){

  while(cin >> n >> m, n + m){
    
    memset(field, 0, sizeof(field));
    num = 0;
    for(int i = 0;i < m;i++){
      for(int j = 0;j < n;j++){
	cin >> field[i][j];
	if(field[i][j] == 2){
	  si = i;
	  sj = j;
	}
	else num += field[i][j];
      }
    }
    cout << dfs(si, sj) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:5: error: 'memset' was not declared in this scope
   55 |     memset(field, 0, sizeof(field));
      |     ^~~~~~
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++

//Bokann ga bokka--nn!!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
map<P,int>ma;
int f[15][15];
int linkk[15][15];
P za[25];
int n,m;
int val;
int dp(int mask,int cur)
{
	int ret=0;
	if(ma[mp(mask,cur)]) return ma[mp(mask,cur)];
	int x=za[cur].first;
	int y=za[cur].second;
	if(mask==(1<<val)-1)
	{
		if(x==za[23].first || y==za[23].second) return 1;
		else return 0;
	}
	for(int i=x-1;i>=0;i--)
	{
		int s=linkk[i][y];
		if(f[i][y]==1 && !((mask>>s)&1))
		{
			ret+=dp(mask | (1<<link[i][y]),link[i][y]);
			break;
		}
	}
	for(int i=x+1;i<m;i++)
	{
		int s=linkk[i][y];
		if(f[i][y]==1 && !((mask>>s)&1))
		{
			ret+=dp(mask | (1<<link[i][y]),link[i][y]);
			break;
		}
	}
	
	for(int i=y-1;i>=0;i--)
	{
		int s=linkk[x][i];
		if(f[x][i]==1 && !((mask>>s)&1))
		{
			ret+=dp(mask | (1<<link[x][i]),link[x][i]);
			break;
		}
	}
	for(int i=y+1;i<n;i++)
	{
		int s=linkk[x][i];
		if(f[x][i]==1 && !((mask>>s)&1))
		{
			ret+=dp(mask | (1<<link[x][i]),link[x][i]);
			break;
		}
	}
	if(ret) ma[mp(mask,cur)]=ret;
	return ret;
}
int main(){
	while(1)
	{
		cin >> n >> m;
		ma.clear();
		if(!n) return 0;
		int num=0; val=0;
		for(int i=0;i<15;i++)for(int j=0;j<15;j++) { f[i][j]=INF; linkk[i][j]=-1;}
		
		for(int i=0;i<m;i++)
		{
			for(int j=0;j<n;j++)
			{
				cin >> f[i][j];
				if(f[i][j]==1) { linkk[i][j]=num; za[num++]=mp(i,j); val++;}
				if(f[i][j]==2) za[23]=mp(i,j);
			}
		
		}
		cout << dp(0,23) << endl;
	}
}

Compiler output:
a.cc: In function 'int dp(int, int)':
a.cc:46:44: error: 'link' was not declared in this scope; did you mean 'linkk'?
   46 |                         ret+=dp(mask | (1<<link[i][y]),link[i][y]);
      |                                            ^~~~
      |                                            linkk
a.cc:55:44: error: 'link' was not declared in this scope; did you mean 'linkk'?
   55 |                         ret+=dp(mask | (1<<link[i][y]),link[i][y]);
      |                                            ^~~~
      |                                            linkk
a.cc:65:44: error: 'link' was not declared in this scope; did you mean 'linkk'?
   65 |                         ret+=dp(mask | (1<<link[x][i]),link[x][i]);
      |                                            ^~~~
      |                                            linkk
a.cc:74:44: error: 'link' was not declared in this scope; did you mean 'linkk'?
   74 |                         ret+=dp(mask | (1<<link[x][i]),link[x][i]);
      |                                            ^~~~
      |                                            linkk
Language: C

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

int main()
{
	ll n, m;
	cin >> n >> m;
	vector<ll> pos(n);
	for (int i = 1; i < n; i++) {
		cin >> pos[i];
		pos[i] += pos[i - 1];
	}
	ll res = 0, tmp = 0, ai;
	while (m--) {
		cin >> ai;
		res += abs(pos[ai + tmp] - pos[tmp]);
		tmp += ai;
	}
	cout << res << endl;
	return 0;
}

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

#define abs(a) (a>0?a:-a)

int main(){
 int n,a,b,i,dist[100000];
 scanf("%d%d",&n,&m);
dist[0]=0;
for(i=1;i<=n;i++){
  scanf("%d",&a);
  dist[i]=dist[i-1]+a;
 }
 b=i=0;
 while(m--){
  scanf("%d",&a);
  i+=abs(dist[b]-dist[b+a]);
  b+=a;
  i%=100000;
 }
 a=!printf("%d",i);
}

Compiler output:
main.c: In function 'main':
main.c:5:2: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |  scanf("%d%d",&n,&m);
      |  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define abs(a) (a>0?a:-a)
main.c:5:2: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |  scanf("%d%d",&n,&m);
      |  ^~~~~
main.c:5:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:19: error: 'm' undeclared (first use in this function)
    5 |  scanf("%d%d",&n,&m);
      |                   ^
main.c:5:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |  a=!printf("%d",i);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

n,m,b,a=1e5,t[a],i;
int main(){
	for(scanf("%d%*d",&n);i++<n;t[i]=t[i-1]+a)scanf("%d",&a);
	for(;~scanf("%d",&a);b%=a){
		b+=abs(t[m]-t[m+=a]);		
	}
	n=!printf("%d\n",b);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,m,b,a=1e5,t[a],i;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    1 | n,m,b,a=1e5,t[a],i;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    1 | n,m,b,a=1e5,t[a],i;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | n,m,b,a=1e5,t[a],i;
      |       ^
main.c:1:13: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | n,m,b,a=1e5,t[a],i;
      |             ^
main.c:1:13: error: variably modified 't' at file scope
main.c:1:18: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | n,m,b,a=1e5,t[a],i;
      |                  ^
main.c: In function 'main':
main.c:3:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         for(scanf("%d%*d",&n);i++<n;t[i]=t[i-1]+a)scanf("%d",&a);
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n,m,b,a=1e5,t[a],i;
main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         for(scanf("%d%*d",&n);i++<n;t[i]=t[i-1]+a)scanf("%d",&a);
      |             ^~~~~
main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         for(;~scanf("%d",&a);b%=a){
      |               ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:20: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    5 |                 b+=abs(t[m]-t[m+=a]);
      |                    ^~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
  +++ |+#include <stdlib.h>
    1 | n,m,b,a=1e5,t[a],i;
main.c:7:12: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |         n=!printf("%d\n",b);
      |            ^~~~~~
main.c:7:12: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:12: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
int x[100005],w=1,n,m,a,i;
long s=0;
main(){
scanf("%d %d",&n,&m);
for(i=1;i<n;i++){
scanf("%d",&x[i]);
}
for(i=0;i<m;i++){
scanf("%d",&a);
if(a>0){
for(int j=0;j<a;j++){
s+=x[w+j];
}
}else{
for(int j=a;j<0;j++){
s+=x[w+j];
}
}
w+=a;
}
printf("%ld\n",s%100000);
return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
Language: C

#include <stdio.h>
int x[100005],w=1,n,m,a,i;
long s=0;
main(){
scanf("%d %d",&n,&m);
for(i=1;i<n;i++){
scanf("%d",&x[i]);
}
for(i=0;i<m;i++){
scanf("%d",&a);
if(a>0){
for(n=0;n<a;n++){
s+=x[w+j];
}
}else{
for(n=a;n<0;n++){
s+=x[w+j];
}
}
w+=a;
}
printf("%ld\n",s%100000);
return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:8: error: 'j' undeclared (first use in this function)
   13 | s+=x[w+j];
      |        ^
main.c:13:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAXN 100000
using namespace std;

int main(void){
  int mm=0;
  int nn=0;
  scanf("%d",&nn);
  scanf("%d",&mm);
  int i=0;
  int n[MAXN]={0};
  int m[MAXN]={0};
  for(i=0;i<nn-1;i++){
    scanf("%d",&(n[i]));
  }
  for(i=0;i<mm;i++){
    scanf("%d",&(m[i]));
  }
  int ans=0;
  int im=0;
  int is=0;
  for(i=0;i<mm;i++){
    im+=m[i];
    if(m[i]>0){
      while(is!=im){
	ans=((ans+(n[is]%MAXN))%MAXN);
	is++;
      }
    }
    else{
      while(is!=im){
	is--;
	ans=((ans+(n[is]%MAXN))%MAXN);
      }
    }
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;
int dist[100000];
int main(){
	int n,m,i,d;
	while(cin>>n>>m){
		memset(dist,0,sizeof(dist));
		for(i=1;i<n;i++){
			cin>>d;
			dist[i]=dist[i-1]+d;
		}
		int sum=0;
		int p=0;
		for(i=0;i<m;i++){
			cin>>d;
			sum+=(d>0)?(dist[p+d]-dist[p]):(dist[p]-dist[p+d]);
			p+=d;
		}
		cout<<sum<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'memset' was not declared in this scope
    7 |                 memset(dist,0,sizeof(dist));
      |                 ^~~~~~
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++

//AOJ 0549 A Traveler
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m, now, t[MAX_N], p[MAX_M], res = 0;
void solve(int plan){
	if (plan > 0){
const int INF = 100000000, MAX_N = 1000000, MAX_M = 1000000;
		for (int i = 0; i < plan; i++){
			res += t[now + i];
		}
	}
	else{
		for (int i = 0; i > plan; i--){
			res += t[now + i - 1];
		}
	}
	if (res >= 100000)
		res = res % 100000;
}
int main(){
	now = 1;
	res = 0;
	cin >> n >> m;
	for (int i = 1; i < n; i++){
		cin >> t[i];
	}
	for (int i = 1; i <= m; i++){
		cin >> p[i];
		solve(p[i]);
		now += p[i];
	}
	cout << res % 100000 << endl;
	return 0;
}

Compiler output:
a.cc:6:18: error: 'MAX_N' was not declared in this scope
    6 | int n, m, now, t[MAX_N], p[MAX_M], res = 0;
      |                  ^~~~~
a.cc:6:28: error: 'MAX_M' was not declared in this scope
    6 | int n, m, now, t[MAX_N], p[MAX_M], res = 0;
      |                            ^~~~~
a.cc: In function 'void solve(int)':
a.cc:11:32: error: 't' was not declared in this scope
   11 |                         res += t[now + i];
      |                                ^
a.cc:16:32: error: 't' was not declared in this scope
   16 |                         res += t[now + i - 1];
      |                                ^
a.cc: In function 'int main()':
a.cc:27:24: error: 't' was not declared in this scope
   27 |                 cin >> t[i];
      |                        ^
a.cc:30:24: error: 'p' was not declared in this scope
   30 |                 cin >> p[i];
      |                        ^
Language: C++

//AOJ 0549 A Traveler
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX_N=100001,MAX_M=100001
int n, m, now, t[MAX_N], p[MAX_M], res = 0;
void solve(int plan){
	if (plan > 0){
const int INF = 100000000, MAX_N = 1000000, MAX_M = 1000000;
		for (int i = 0; i < plan; i++){
			res += t[now + i];
		}
	}
	else{
		for (int i = 0; i > plan; i--){
			res += t[now + i - 1];
		}
	}
	if (res >= 100000)
		res = res % 100000;
}
int main(){
	now = 1;
	res = 0;
	cin >> n >> m;
	for (int i = 1; i < n; i++){
		cin >> t[i];
	}
	for (int i = 1; i <= m; i++){
		cin >> p[i];
		solve(p[i]);
		now += p[i];
	}
	cout << res % 100000 << endl;
	return 0;
}

Compiler output:
a.cc:7:1: error: expected ',' or ';' before 'int'
    7 | int n, m, now, t[MAX_N], p[MAX_M], res = 0;
      | ^~~
a.cc: In function 'void solve(int)':
a.cc:12:25: error: 'res' was not declared in this scope
   12 |                         res += t[now + i];
      |                         ^~~
a.cc:12:32: error: 't' was not declared in this scope
   12 |                         res += t[now + i];
      |                                ^
a.cc:12:34: error: 'now' was not declared in this scope
   12 |                         res += t[now + i];
      |                                  ^~~
a.cc:17:25: error: 'res' was not declared in this scope
   17 |                         res += t[now + i - 1];
      |                         ^~~
a.cc:17:32: error: 't' was not declared in this scope
   17 |                         res += t[now + i - 1];
      |                                ^
a.cc:17:34: error: 'now' was not declared in this scope
   17 |                         res += t[now + i - 1];
      |                                  ^~~
a.cc:20:13: error: 'res' was not declared in this scope
   20 |         if (res >= 100000)
      |             ^~~
a.cc: In function 'int main()':
a.cc:24:9: error: 'now' was not declared in this scope
   24 |         now = 1;
      |         ^~~
a.cc:25:9: error: 'res' was not declared in this scope
   25 |         res = 0;
      |         ^~~
a.cc:26:16: error: 'n' was not declared in this scope
   26 |         cin >> n >> m;
      |                ^
a.cc:26:21: error: 'm' was not declared in this scope; did you mean 'tm'?
   26 |         cin >> n >> m;
      |                     ^
      |                     tm
a.cc:28:24: error: 't' was not declared in this scope
   28 |                 cin >> t[i];
      |                        ^
a.cc:31:24: error: 'p' was not declared in this scope
   31 |                 cin >> p[i];
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//BITを用いる解法O(mlogn)
const int mod=100000;
int n,m;
int bitsize=1<<20;
int s[100010];
int a[100010];
int bit[bitsize];
void makebit(){
	while(n>bitsize)	bitsize*=2;
	for(int i=1;i<n;i++){//扱いやすさの都合上0は用いない
		int now=i;
		while(now<=bitsize){
			(bit[now]+=s[i])%=mod;
			now+=(now&-now);
		}
	}
}
int cntbit(int now){
	now--;
	int ans=0;
	while(now>0){
		(ans+=bit[now])%=mod;
		now-=now&-now;
	}
	return ans;
}
int main(){
	cin>>n>>m;
	for(int i=1;i<n;i++)	cin>>s[i];
	makebit();
	int now=1;
	int ans=0;
	for(int i=0;i<m;i++){
		cin>>a[i];
		int next=now+a[i];
		(ans+=abs(cntbit(next)-cntbit(now)))%=mod;
		now=next;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:9:9: error: size of array 'bit' is not an integral constant-expression
    9 | int bit[bitsize];
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
    int m;
    int a;
    int pos;
    int dis;
    int ans = 0;
    int x[100010];
    scanf("%d %d",&n,&m);
    x[0] = 0;
    for(int i = 1;i < n;i++){
        scanf("%d", &dis);
        x[i] = x[i - 1] + dis;
    }
    while( m-- ){
        scanf("%d", &a);
        dis = x[pos + a] - x[pos];
        pos += dis
        if(dis < 0){
            dis = (-1) * dis;
        }
        ans += dis;
    }

    ans = ans / 100000;
    printf("%d\n", result);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: expected ';' before 'if'
   21 |         pos += dis
      |                   ^
      |                   ;
   22 |         if(dis < 0){
      |         ~~         
a.cc:29:20: error: 'result' was not declared in this scope
   29 |     printf("%d\n", result);
      |                    ^~~~~~