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

#include<cstdio>
#include<functional>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cctype>
#include<queue>
#define MM
#define rep(i,a) for(int i=0;i<a;i++)
#define rep2(i,a) for(int i=1;i<=a;i++)
#define rep3(i,a) for(int i=1;i<a;i++)
#define rep4(i,a) for(int i=0;i<=a;i++)
using namespace std;
int dp[110][5][5];
long long int sum;
int main(void)
{
	int x,y;
	int day,al,sosu[110]={MM};
	cin>>day>>al;
	rep(i,al) {cin>>x>>y;sosu[x]=y;}
	dp[MM][MM][MM]=1;
	rep2(i,day)rep(j,4)rep(k,4)rep3(kk,4) {
		if((j!=k||k!=kk)&&(sosu[i]==MM||sosu[i]==kk)) {
            dp[i][k][kk]+=dp[i-1][j][k];
            dp[i][k][kk]%=10000;
		}
	}
	sum=0;
	rep2(i,3)rep4(j,3) sum+=dp[day][i][j];
	cout<<sum%10000<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected primary-expression before ']' token
   24 |         dp[MM][MM][MM]=1;
      |              ^
a.cc:24:18: error: expected primary-expression before ']' token
   24 |         dp[MM][MM][MM]=1;
      |                  ^
a.cc:24:22: error: expected primary-expression before ']' token
   24 |         dp[MM][MM][MM]=1;
      |                      ^
a.cc:26:47: error: expected primary-expression before '||' token
   26 |                 if((j!=k||k!=kk)&&(sosu[i]==MM||sosu[i]==kk)) {
      |                                               ^~
Language: C++

#include<iostream>
using namespace std;
int dp[105][3][2],a[105],n,m,p,q;
int main(){
	cin>>n>>m;for(int i=0;i<m;i++){cin>>p>>q;a[p]=q;}
	if(a[1]==0){dp[1][0][0]=1;dp[1][1][0]=1;dp[1][2][0]=1;}
	if(a[1]>=1)dp[1][a[i]-1][0]=1;
	for(int i=2;i<=n;i++){
		if(a[i]==0 || a[i]==1){
			dp[i][0][0]+=(dp[i-1][1][0]+dp[i-1][1][1]+dp[i-1][2][0]+dp[i-1][2][1]);dp[i][0][0]%=10000;
			dp[i][0][1]+=dp[i-1][0][0];dp[i][0][1]%=10000;
		}
		if(a[i]==0 || a[i]==2){
			dp[i][1][0]+=(dp[i-1][0][0]+dp[i-1][0][1]+dp[i-1][2][0]+dp[i-1][2][1]);dp[i][1][0]%=10000;
			dp[i][1][1]+=dp[i-1][1][0];dp[i][1][1]%=10000;
		}
		if(a[i]==0 || a[i]==3){
			dp[i][2][0]+=(dp[i-1][0][0]+dp[i-1][0][1]+dp[i-1][1][0]+dp[i-1][1][1]);dp[i][2][0]%=10000;
			dp[i][2][1]+=dp[i-1][2][0];dp[i][2][1]%=10000;
		}
	}
	cout<<(dp[n][0][0]+dp[n][0][1]+dp[n][1][0]+dp[n][1][1]+dp[n][2][0]+dp[n][2][1])%10000<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'i' was not declared in this scope
    7 |         if(a[1]>=1)dp[1][a[i]-1][0]=1;
      |                            ^
Language: C++

#include <iostream>
#include <vector>
#include <array>
#include <numeric>

int f(int, int, int);
int N;
int yotei[100];

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int k, date;
    std::cin >> N >> k;
    for (int i = 0; i < k; i++) {
        std::cin >> date;
        std::cin >> yotei[date];
    }

    std::cout << f(0, 0, 0) << "\n";
    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccmknkDS.o: in function `main':
a.cc:(.text+0xb5): undefined reference to `f(int, int, int)'
collect2: error: ld returned 1 exit status
Language: C++

int menu[101];
int dp[101][4][4];
 
int main() {
	int n, k;
	cin >> n >> k;
	int a, b;
	for (int i = 0; i < n; i++) {
		menu[i] = -1;
	}
	for (int i = 0; i < k; i++) {
		cin >> a >> b;
		menu[a - 1] = b - 1;
	}
	for (int i = 0; i < 3; i++) {
		if (menu[0] == -1 || menu[0] == i)dp[0][i][0] = 1;
	}
	for (int i = 0; i < n - 1; i++) {
		for (int j = 0; j < 3; j++) {
			for (int k = 0; k < 2; k++) {
				if (dp[i][j][k]>0) {
					for (int l = 0; l < 3; l++) {
						if (menu[i + 1] == -1 || menu[i + 1] == l) {
							if (l != j) {
								dp[i + 1][l][0] += dp[i][j][k];
								dp[i + 1][l][0] %= MOD;
							}
							if (l == j && k + 1 < 2) {
								dp[i + 1][l][k + 1] += dp[i][j][k];
								dp[i + 1][l][k + 1] %= MOD;
							}
						}
					}
				}
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 2; j++) {
			ans += dp[n - 1][i][j];
			ans %= MOD;
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n >> k;
      |         ^~~
a.cc:26:84: error: 'MOD' was not declared in this scope
   26 |                                                                 dp[i + 1][l][0] %= MOD;
      |                                                                                    ^~~
a.cc:30:88: error: 'MOD' was not declared in this scope
   30 |                                                                 dp[i + 1][l][k + 1] %= MOD;
      |                                                                                        ^~~
a.cc:42:32: error: 'MOD' was not declared in this scope
   42 |                         ans %= MOD;
      |                                ^~~
a.cc:45:9: error: 'cout' was not declared in this scope
   45 |         cout << ans << endl;
      |         ^~~~
a.cc:45:24: error: 'endl' was not declared in this scope
   45 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include <map>
#include <vector>
#include <deque>
#include <iostream>
using namespace std;

map< pair< int , deque<int> > , int > memo;
int scheduled[100];
int n , m;

int f(int pos,deque<int> prev){
	deque<int> current = prev;
	if( memo.count(make_pair(pos,prev)) ) return memo[make_pair(pos,prev)];
	
	if(prev.size() == 3 && count(prev.begin(),prev.end(),prev[0]) == 3 ) return 0;
	
	if(pos == n) return 1;
	
	if(prev.size() == 3) prev.pop_front();
	
	int ans = 0;
	if(scheduled[pos] == -1){
		for(int i = 1 ; i <= 3 ; i++){
			prev.push_back(i);
			ans = ( ans + f(pos+1,prev) ) % 10000;
			prev.pop_back();
		}
	}else{
		prev.push_back(scheduled[pos]);
		ans = ( ans + f(pos+1,prev) ) % 10000;
	}
	return memo[make_pair(pos,current)] = ans;
}

int main(){
	memset(scheduled,-1,sizeof(scheduled));
	
	cin >> n >> m;
	for(int i = 0 ; i < m ; i++){
		int a,b;
		cin >> a >> b;
		a--;
		scheduled[a] = b;
	}
	cout << f(0,deque<int>()) << endl;
}

Compiler output:
a.cc: In function 'int f(int, std::deque<int>)':
a.cc:15:32: error: 'count' was not declared in this scope
   15 |         if(prev.size() == 3 && count(prev.begin(),prev.end(),prev[0]) == 3 ) return 0;
      |                                ^~~~~
a.cc: In function 'int main()':
a.cc:36:9: error: 'memset' was not declared in this scope
   36 |         memset(scheduled,-1,sizeof(scheduled));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <iostream>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >>n;
int k;
cin >>k;
int a[n][3][3];//n+1個の最後から2番目-1,1番目-1
int b[n];
int c;
c=0;
while(c<n){
b[c]=-1;
c=c+1;}
int d;
int e;
c=0;
while(c<k){
cin >>d;
cin >>e;
b[d-1]=e-1;
c=c+1;}
int f;
int h;
c=0;
while(c<3){
f=0;
while(f<3){
h=0;
if(b[0]!=c){if(b[0]!=-1){h=1;}}
if(b[1]!=f){if(b[1]!=-1){h=1;}}
if(h==1){a[1][c][f]=0;}
if(h==0){a[1][c][f]=1;}
f=f+1;}
c=c+1;}
int g;
c=2;
while(c<n){
f=0;
while(f<3){
g=0;
while(g<3){
a[c][f][g]=a[c-1][0][f]+a[c-1][1][f]+a[c-1][2][f];
if(f==g){a[c][f][g]=a[c][f][g]-a[c-1][f][f];}
if(b[c]!=f){if(b[c]!=-1){a[c][f][g]=0;}
a[c][f][g]=a[c][f][g]%10000
g=g+1;}
f=f+1;}
c=c+1;}
cout << a[n-1][0][0]+a[n-1][0][1]+a[n-1][0][2]+a[n-1][1][0]+a[n-1][1][1]+a[n-1][1][2]+a[n-1][2][0]+a[n-1][2][1]+a[n-1][2][2]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:28: error: expected ';' before 'g'
   47 | a[c][f][g]=a[c][f][g]%10000
      |                            ^
      |                            ;
   48 | g=g+1;}
      | ~                           
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n;
int k;
int q[200]={0};
int a,b;
int ans=0;
int mem[110][110][110]={{{0}}};
int check(int x,int y,int z);//x日目,前日y,前々日z
int main(void){
    cin>>n>>k;

	for(int i=0;i<k;i++){
        cin>>a;
        cin>>b;
        q[a-1]=b;
	}



    cout<<check(0,0,0)<<endl;
	return 0;
}
int check(int x,int y,int z){
    if(mem[x][y][z]!=0)return mem[x][y][z];

    if(x==n){

        return 1;
    }
    if(q[x]!=0){
        if(q[x]==1){
            if(y!=1||z!=1){
            return check(x+1,1,y);
            }
            else return 0;
        }
        else if(q[x]==2){
            if(y!=2||z!=2){
            return check(x+1,2,y);
            }
            else return 0;
        }
        else if(q[x]==3){
            if(y!=3||z!=3){
            return check(x+1,3,y);
            }
            else return 0;
        }

    }
    else{

        if(y!=z||y==0){
            int a=check(x+1,1,y)+check(x+1,2,y)+check(x+1,3,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;

        }
        else if(y==1){

            int a=check(x+1,2,y)+check(x+1,3,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;
        }
        else if(y==2){

            int a=check(x+1,1,y)+check(x+1,3,y);
            a%=10000;
            return a;
        }
        else if(y==3){

            int a=check(x+1,1,y)+check(x+1,2,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;

        }
    }

Compiler output:
a.cc: In function 'int check(int, int, int)':
a.cc:86:6: error: expected '}' at end of input
   86 |     }
      |      ^
a.cc:28:29: note: to match this '{'
   28 | int check(int x,int y,int z){
      |                             ^
a.cc:86:6: warning: control reaches end of non-void function [-Wreturn-type]
   86 |     }
      |      ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n;
int k;
int q[200]={0};
int a,b;
int ans=0;
int mem[110][5][5]={{{0}}};
int check(int x,int y,int z);//x日目,前日y,前々日z
int main(void){
    cin>>n>>k;

	for(int i=0;i<k;i++){
        cin>>a;
        cin>>b;
        q[a-1]=b;
	}



    cout<<check(0,0,0)<<endl;
	return 0;
}
int check(int x,int y,int z){
    if(mem[x][y][z]!=0)return mem[x][y][z];

    if(x==n){

        return 1;
    }
    if(q[x]!=0){
        if(q[x]==1){
            if(y!=1||z!=1){
            return check(x+1,1,y);
            }
            else return 0;
        }
        else if(q[x]==2){
            if(y!=2||z!=2){
            return check(x+1,2,y);
            }
            else return 0;
        }
        else if(q[x]==3){
            if(y!=3||z!=3){
            return check(x+1,3,y);
            }
            else return 0;
        }

    }
    else{

        if(y!=z||y==0){
            int a=check(x+1,1,y)+check(x+1,2,y)+check(x+1,3,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;

        }
        else if(y==1){

            int a=check(x+1,2,y)+check(x+1,3,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;
        }
        else if(y==2){

            int a=check(x+1,1,y)+check(x+1,3,y);
            a%=10000;
            return a;
        }
        else if(y==3){

            int a=check(x+1,1,y)+check(x+1,2,y);
            a%=10000;
            mem[x][y][z]=a;
            return a;

        }
    }

Compiler output:
a.cc: In function 'int check(int, int, int)':
a.cc:86:6: error: expected '}' at end of input
   86 |     }
      |      ^
a.cc:28:29: note: to match this '{'
   28 | int check(int x,int y,int z){
      |                             ^
a.cc:86:6: warning: control reaches end of non-void function [-Wreturn-type]
   86 |     }
      |      ^
Language: C++

import java.util.*;
public class Main {
	static int cnt=0;
	static int n;
	static void bfs(int a,int b,int c,int day){
		if(a==b&&b==c)return;
		if(day-1==n){
			cnt++;
			return;
		}
		a=b;
		b=c;
		if(hyou[day]>0){
			bfs(a,b,hyou[day],day+1);
		}else{
			for(int i=1;i<=3;i++){
				if(a==b&&b==i){
					continue;
				}else bfs(a,b,i,day+1);
			}
		}
		return;
	}
	static int hyou[] = new int[101];
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		int k = in.nextInt();
		for(int s=0;s<n;s++)hyou[s]=0;
		int a=0,b=0,c=0;
		boolean z=false,x=false,y=false;
		for(int i=0;i<k;i++){
			int w = in.nextInt();
			hyou[w]=in.nextInt();
			if(w==1){
				a=hyou[w];
				z=true;
			}
			else if(w==2){
				b=hyou[w];
				x=true;
			}
			else if(w==3){
				c=hyou[w];
				y=true;
			}
		}
		for(int s=1;s<=3;s++){
			if(!z)a=s;
			for(int i=1;i<=3;i++){
				if(!x)b=i;
				for(int j=1;j<=3;j++){
					if(!y)c=j;
					if(a==b&&a==c)continue;
					bfs(a,b,c,4);
					if(y)break;
				}
				if(x)break;
			}
			if(z)break;
		}
		System.out.println(cnt%10000);
	}
}

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

#include<iostream>
using namespace std;
int N,K,day,sosu;
int plan[101];
int memo[101][4][4];

int solve(int n,int b1,int b2){
  if(plan[n]!=0){
    if(b1==b2&&b1==plan[n])
      return 0;
      else
       return slove(n+1,plan[n],b1)%10000;
    }
    int t=0;
    for(int i=1;i<=3;++i){
      if(b1==b2&&b1==i)continue;
      t+=solve(n+1,i,b1)%10000;
    }
    returm memo[n][b1][b2]=t%10000;
}

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

  for(int i=0;i<K;i++){
    cin>>day>>sosu;
    plan[day]=sosu;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<4;j++){
      for(int k=0;k<4;k++){
	memo[i][j][k]=-1;
      }
    }
  }
  cout<<solve(1,0,0)<<endl;
}

Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:12:15: error: 'slove' was not declared in this scope; did you mean 'solve'?
   12 |        return slove(n+1,plan[n],b1)%10000;
      |               ^~~~~
      |               solve
a.cc:19:5: error: 'returm' was not declared in this scope
   19 |     returm memo[n][b1][b2]=t%10000;
      |     ^~~~~~
Language: Java

import java.util.*;
 
public class Main{
    int[][] a;
    boolean[][] f;
    int h, w, res, dy, dx;
    int[] xdir = {0, 1, 1, 1, 0, -1};
    int[] ydir = {-1, -1, 0, 1, 1, 0};
    int[] xdir2 = {-1, 0, 1, 0, -1, -1};
    int[] ydir2 = {-1, -1, 0, 1, 1, 0};
 
    Main(){
    Scanner sc = new Scanner(System.in);
 
    while(sc.hasNext()){
        w = sc.nextInt();
        h = sc.nextInt();
 
        a = new int[h+2][];
        f = new boolean[h+2][];
        for(int i = 0; i < h+2; ++i){
        a[i] = new int[w+2];
        f[i] = new boolean[w+2];
        }
 
        for(int i = 1; i <= h; ++i)
        for(int j = 1; j <= w; ++j)
            a[i][j] = sc.nextInt();
        dfs(0, 0);
 
        res = 0;
        for(int i = 0; i < h+2; ++i)
        for(int j = 0; j < w+2; ++j)
            if(f[i][j])
            for(int k = 0; k < 6; ++k){
                if(i%2 == 1){ dy = i+ydir[k]; dx = j+xdir[k];}
                else { dy = i+ydir2[k]; dx = j+xdir2[k];}
                if(0 <= dy && dy < h+2 && 0 <= dx && dx < w+2)
                res += a[dy][dx];
            }
 
        System.out.printf("%d\n", res);
    }
    }
 
    void dfs(int y, int x){
        f[y][x] = true;
        for(int i = 0; i < 6; ++i){
        if(y%2 == 1){ dy = y+ydir[i]; dx = x+xdir[i];}
        else { dy = y+ydir2[i]; dx = x+xdir2[i];}
 
        if(0 <= dy && dy < h+2 && 0 <= dx && dx < w+2 && !f[dy][dx] && a[dy][dx]) dfs(dy, dx);
        }
    }
 
    public static void main(String[] args){
    new Main();
    }
}

Compiler output:
Main.java:52: error: bad operand types for binary operator '&&'
        if(0 <= dy && dy < h+2 && 0 <= dx && dx < w+2 && !f[dy][dx] && a[dy][dx]) dfs(dy, dx);
                                                                    ^
  first type:  boolean
  second type: int
1 error
Language: C

#include <stdio.h>
  int main(){
	  int x[102][102];
	  int y[102][102];
	  int i,j,h,w;
	  scanf("%d%d",&w,&h);
	  for(i=1;i<=w;i++){
		  for(j=1;j<=h;j++){
			  scanf("%d",&x[i][j]);
		  }
	  }
	  for(i=0;i<=w+1;i++){
		  for(j=0;j<=h+1;j++){
			  y[i][j]=0;
		  if(j%2==0){
			  if(x[i][j]==0){
				  if(x[i-1][j-1]==0){
					  y[i-1][j-1]=1;
				  }
				  if(x[i][j-1]==0){
					  y[i][j-1]=1;
				  }
				  if(x[i+1][j]==0){
					  y[i+1][j-1]=1;
				  }
				  if(x[i][j+1]==0){
					  y[i][j+1]=1;
				  }
				  if(x[i-1][j+1]==0){
					  y[i-1][j+1]=1;
				  }
				  if(x[i-1][j]==0){
					  y[i-1][j]=1;
				  }
			  }
		  }


	  

Compiler output:
main.c: In function 'main':
main.c:36:19: error: expected declaration or statement at end of input
   36 |                   }
      |                   ^
main.c:36:19: error: expected declaration or statement at end of input
main.c:36:19: error: expected declaration or statement at end of input
Language: C++

#include<iostream>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)

const int nex[2][6] = {
	{110,1,-110,-1,-111,109},
	{110,1,-110,-1,-109,111}
};

int w,h,a[12100],ret;
void dfs(int x,int y){
	if(a[x][y] == 0){
		a[x][y] = -1;
		rep(i,6)dfs(x + nex[x%2][i],y + nex[x%2][i]);
	}
}

int main(){
	rep(i,110)rep(j,110){a[110i+j] = 0; if(i == 0 || i == 109 || j == 0 || j == 109)a[110*i+j] = -2;}
	cin >> w >> h;
	rep(i,h)rep(j,w)cin >> a[110*i+j+333];
	dfs(1,1);
	rep1(i,108)rep1(j,108)rep(k,6)if(a[110*i+j]*a[i+nex[i%2][k]][j+nex[i%2][k]] < 0)ret ++;
	cout << ret/2 << endl;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |         if(a[x][y] == 0){
      |                ^
a.cc:15:21: error: invalid types 'int[int]' for array subscript
   15 |                 a[x][y] = -1;
      |                     ^
a.cc: In function 'int main()':
a.cc:21:31: error: invalid types 'int [12100][__complex__ int]' for array subscript
   21 |         rep(i,110)rep(j,110){a[110i+j] = 0; if(i == 0 || i == 109 || j == 0 || j == 109)a[110*i+j] = -2;}
      |                               ^
a.cc:25:69: error: invalid types 'int[int]' for array subscript
   25 |         rep1(i,108)rep1(j,108)rep(k,6)if(a[110*i+j]*a[i+nex[i%2][k]][j+nex[i%2][k]] < 0)ret ++;
      |                                                                     ^
Language: C++

#include<iostream>
#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
int W, H;
int X[102][102];
int dx1[6] = { -1, 0, 0, 1, 1, 1 };
int dy1[6] = { 0, -1, 1, -1, 1, 0 };
int dx2[6] = { -1, -1, -1, 0, 0, 1 };
int dy2[6] = { -1, 0, 1, -1, 1, 0 };
int main()
{
	scanf("%d%d", &W, &H);
	for (int i = 1; i <= H; i++){
		for (int j = 1; j <= W; j++){
			scanf("%d", &X[j][i]);
		}
	}
	for (int j = 1; j <= W; j++){
		for (int i = 1; i <= H; i++){
			if (X[j][i] == 0){
				bool F[102][102];
				memset(F, false, sizeof(F));
				F[j][i] = true;
				priority_queue<P>que;
				que.push(make_pair(j,i));
				
				while (!que.empty()){
					P p = que.top(); que.pop();
					if (p.second == 0 || p.second == H + 1 || p.first == 0 || p.first == W + 1)goto a;
					if (X[p.first][p.second])continue;
					
					if (p.second & 1){
						for (int k = 0; k < 6; k++){
							if (!F[p.first + dx1[k]][p.first + dy1[k]]){
								F[p.first + dx1[k]][p.first + dy1[k]] = true;
								que.push(make_pair(p.first + dx1[k], p.second + dy1[k]));
							}
						}
					}
					else{
						for (int k = 0; k < 6; k++){
							if (!F[p.first + dx2[k]][p.first + dy2[k]]){
								F[p.first + dx2[k]][p.first + dy2[k]] = true;
								que.push(make_pair(p.first + dx2[k], p.second + dy2[k]));
							}
						}
					}
				}
				X[j][i] = 1; a:;
			}
		}
		
	}
	
	int ans = 0;
	for (int i = 1; i <= W; i++){
		for (int j = 1; j <= H; j++){
			if (X[i][j] == 1){
				if (j & 1){
					for (int k = 0; k < 6; k++){
						if (!X[i + dx1[k]][j + dy1[k]])ans++;
					}
				}
				else{
					for (int k = 0; k < 6; k++){
						if (!X[i + dx2[k]][j + dy2[k]])ans++;
					}
				}
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

#include <iostream>
using namespace std;
#include <cstring>
#include <queue>

#define MK make_pair

int date[128][128], cnt[128][128];
int data_[120][120] = { 0 };
bool flg_date[128][128], flg_rec[128][128];//????????????????????????????????????????????????
int x_move[2][6] = { { +1,-1,+1,0,+1,0 }, { +1,-1,0,-1,0,-1 } }, y_move[2][6] = { { 0,0,+1,+1,-1,-1 }, { 0,0,+1,+1,-1,-1 } };

int rec(int x,int y,int count);

int main(void){

	int w, h;
	memset(cnt, 0, sizeof(cnt));
	memset(date, -1, sizeof(date));
	memset(flg_date, false, sizeof(flg_date));
	memset(flg_rec, false, sizeof(flg_rec));

	cin >> w >> h;
	for (int i = 1; i <= h+2; i++){
		for (int j = 1; j <= w+2; j++){
			if (i == 1 || i == h + 2 || j == 1 || j == w + 2){ date[i][j] = 0; continue; }
			cin >> date[i][j];
		}
	}

	cout << rec(1, 1, 0) << endl <<;
}

int rec(int x, int y, int count){

	flg_rec[y][x] = true;
	for (int k = 0; k < 6; k++){
		if (!flg_rec[y + y_move[y % 2][k]][x + x_move[y % 2][k]] && date[y + y_move[y % 2][k]][x + x_move[y % 2][k]] == 0){
			count = rec(x + x_move[y % 2][k], y + y_move[y % 2][k],count);
		}
		else if (date[y + y_move[y % 2][k]][x + x_move[y % 2][k]] == 1){ data_[y][x]++; count++; /*cout << x << ',' << y << ':' << x + x_move[y % 2][k] << ',' << y + y_move[y % 2][k] << endl;*/ cnt[y + y_move[y % 2][k]][x + x_move[y % 2][k]]++; }
	}

	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:40: error: expected primary-expression before ';' token
   31 |         cout << rec(1, 1, 0) << endl <<;
      |                                        ^
Language: C++

#include<iostream>
#include<queue>
using namespace std;
int a[105][105];//1==???
int w,h;
int d[2][6][2]={
	{{1,-1},{1,0},{1,1},{0,-1},{0,1},{-1,0}},
	{{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,0}}
};

int check(x,y){
	int i,j,k;
	if(x<0 || x>=w || y<0 || y>=h)return 0;
	if(a[x][y]==1)return 0;
	if(a[x][y]==2)return 1;
	for(i=0;i<6;i++){
		k=check(x+d[x%2][i][1],y+d[x%2][i][0]);
		if(k==1){
			a[x][y]=2;
			return 1;
		}
	}
	a[x][y]=1;
	return 0;
}

int main(){
	int i,j,k;
	int x,y;
	int s=0;
	cin>>h>>w;
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			cin>>a[i][j];
			if(i==0 || i==w-1 || j==0 || j==h-1){
				if(a[i][j]==0)a[i][j]=2;
			}
		}
	}
	
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			if(a[i][j]==0)check(i,j);
		}
	}
	
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			if(a[i][j]!=1)continue;
			for(k=0;k<6;k++){
				x=i+d[i%2][k][1]; y=j+d[i%2][k][0];
				if(x<0 || x>=w || y<0 || y>=h){
					s++;
					continue;
				}
				if(a[x][y]==2){
					s++;
				}
			}
		}
	}
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			cout<<a[i][j]<<" ";
		}
		cout<<endl;
	}
	cout<<s<<endl;
}

Compiler output:
a.cc:11:11: error: 'x' was not declared in this scope
   11 | int check(x,y){
      |           ^
a.cc:11:13: error: 'y' was not declared in this scope
   11 | int check(x,y){
      |             ^
a.cc:11:14: error: expression list treated as compound expression in initializer [-fpermissive]
   11 | int check(x,y){
      |              ^
a.cc: In function 'int main()':
a.cc:43:44: error: 'check' cannot be used as a function
   43 |                         if(a[i][j]==0)check(i,j);
      |                                       ~~~~~^~~~~
Language: C++

#include<unordered_map>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<chrono>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long ll;
int h,w,a[100][100];
int solve(int i,int j){
	for(int 
}
int main(){
	cin>>w>>h;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++)
			cin>>a[i][j];
	}
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:20:1: error: expected unqualified-id before '}' token
   20 | }
      | ^
a.cc:19:16: error: expected ';' before '}' token
   19 |         for(int
      |                ^
      |                ;
   20 | }
      | ~               
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:19:16: error: expected ';' before '}' token
   19 |         for(int
      |                ^
      |                ;
   20 | }
      | ~               
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:19:16: error: expected ')' before '}' token
   19 |         for(int
      |            ~   ^
      |                )
   20 | }
      | ~               
a.cc:20:1: error: expected primary-expression before '}' token
   20 | }
      | ^
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
typedef pair<int, int> P;
int vy[6] = {-1, -1, 0, 1, 1, 0};
int vx_0[6] = {0, 1, 1, 1, 0, -1};
int vx_1[6] = {-1, 0, 1, 0, -1, -1};
int W, H;
int b[100][100];
bool checked[100][100];
vector<P> wh;

bool bwb(int y, int x) {
  if(y < 0 || y >= H || x < 0 || x >= W) return false;
  if(checked[ny][nx] || b[ny][nx]) return true;
  checked[y][x] = true;
  wh.push_back(P(y,x));
  bool ret = true;
  FOR(i,0,6) {
    int ny = y + vy[i];
    int nx = x + (y % 2 ? vx_1[i] : vx_0[i]);
    ret &= bwb(ny, nx);
  }
  return ret;
}
int calc(int y, int x) {
  int ret = 0;
  FOR(i,0,6) {
    int ny = y + vy[i];
    int nx = x + (y % 2 ? vx_1[i] : vx_0[i]);
    if(ny < 0 || ny >= H || nx < 0 || nx >= W || b[ny][nx] == 0) ret++;
  }
  return ret;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> W >> H;
  FOR(i,0,H) FOR(j,0,W) cin >> b[i][j];
  FOR(y,0,H) {
    FOR(x,0,W) {
      if(checked[y][x] || b[y][x]) continue;
      wh.clear();
      if(bwb(y, x)) {
        FOR(j,0,wh.size()) {
          b[wh[j].first][wh[j].second] = 1;
        }
      }
    }
  }
  int ans = 0;
  FOR(y,0,H) {
    FOR(x,0,W) {
      if(b[y][x]) ans += calc(y, x);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'bool bwb(int, int)':
a.cc:32:14: error: 'ny' was not declared in this scope; did you mean 'y'?
   32 |   if(checked[ny][nx] || b[ny][nx]) return true;
      |              ^~
      |              y
a.cc:32:18: error: 'nx' was not declared in this scope; did you mean 'x'?
   32 |   if(checked[ny][nx] || b[ny][nx]) return true;
      |                  ^~
      |                  x
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
typedef long long ll;
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl;
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0;
#define HERE cout<<"         here"<<en
#define out(value) cout<<value<<en

int building[105][105];
int ranking[105][105];
bool done[105][105];

int ilumi_x[2][6]={{1,0,-1,-1,-1,0},{1,0,-1,0,1,1}};
int ilumi_y[2][6]={{0,1,1,0,-1,-1},{0,1,0,-1,1,-1}};

int main(){
  int w,h;
  cin>>w>>h;
  
  for(int i=1; i<=h; i++) for(int j=1; j<=w; j++){
    cin>>building[i][j];
    done[i][j]=false;
    if(building[i][j]) continue;
    if(i==1||j==1||i==h||j==w) ranking[i][j]=1;
  }
  
  for(int i=1; i<=h; i++){
    for(int j=1; j<=w; j++){
      if(done[i][j]) continue;
      if(building[i][j]) continue;
      if(i==1||i==h||j==1||j==w){
        ranking[i][j]=1;
        done[i][j]=1;
        queue<P> que;
        que.push(mk(i,j));
        while(!que.empty()){
          P p=que.top(); que.pop();
          int yy=p.first,xx=p.second;
          for(int k=0; k<6; k++){
            int x=xx+ilumi_x[yy%2][k];
            int y=yy+ilumi_y[yy%2][k];
            if(x<1||x>w||y<1||y>h) continue;
            if(done[y][x]==1) continue;
            if(building[y][x]==1) continue;
              
            done[y][x]=1;
            ranking[y][x]=1;
            que.push(mk(y,x));
          }
        }
      }
    }
  }
  
  int ans=0;
  for(int i=1; i<=h; i++){
    for(int j=1; j<=w; j++){
      if(building[i][j]==0) continue;
      for(int k=0; k<6; k++){
        int x=j+ilumi_x[i%2][k];
        int y=i+ilumi_y[i%2][k];
        
        if(y<1||y>h||x<1||x>w) {
          ans++;
          continue;
        }
        if(ranking[y][x]==1) ans++;
      }
    }
  }
  cout<<ans<<en
}





Compiler output:
a.cc: In function 'int main()':
a.cc:62:19: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   62 |           P p=que.top(); que.pop();
      |                   ^~~
      |                   pop
Language: C++

#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
int pent[101][101],x[101][101]={},h,w,ans=0;
typedef pair<int,int> P;
queue<P>que;
int main(){
  scanf("%d %d",&h,&w);
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      scanf("%d",&pent[j][i]);
    }
  }
  que.push(make_pair(0,0));
  while(!que.size()){
   P p=que.front; que.pop();
     if(p.second%2==0){
       for(int j=p.second-1;j<=p.second+1;j++){
           if(j==p.second){
             if(pent[p.first-1][j]==0){
               x[p.first-1][j]=1;
               que.push(make_pair((p.first-1),j));
             }else{ ans++;}
             if(pent[p.first+1][j]==0){
               x[p.first+1][j]=1;
               que.push(make_pair((p.first+1),j));
             }else{ ans++;}
           }else{
              if(pent[p.first-1][j]==0){
               x[p.first-1][j]=1;
               que.push(make_pair((p.first-1),j));
             }else{ ans++;}
             if(pent[p.first][j]==0){
               x[p.first][j]=1;
               que.push(make_pair((p.first),j));
             }else{ ans++;}
           }
         }
       }else{
        for(int j=p.second-1;j<=p.second+1;j++){
           if(j==p.second){
             if(pent[p.first-1][j]==0){
               x[p.first-1][j]=1;
               que.push(make_pair((p.first-1),j));
             }else{ ans++;}
             if(pent[p.first+1][j]==0){
               x[p.first+1][j]=1;
               que.push(make_pair((p.first+1),j));
             }else{ ans++;}
           }else{
              if(pent[p.first][j]==0){
               x[p.first][j]=1;
               que.push(make_pair((p.first),j));
             }else{ ans++;}
             if(pent[p.first+1][j]==0){
               x[p.first+1][j]=1;
               que.push(make_pair((p.first+1),j));
             }else{ ans++;}
           }
         }
       }
     }
     printf("%d\n",ans);
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: conversion from '<unresolved overloaded function type>' to non-scalar type 'P' {aka 'std::pair<int, int>'} requested
   17 |    P p=que.front; que.pop();
      |        ~~~~^~~~~
Language: C++

#include<iostream>
using namespace std;
int mas[110][110];
bool d[110][110];
int dy[6]={-1,-1, 0, 0, 1, 1};
int dx_k[6]={ 0, 1,-1, 1, 0, 1};
int dx_g[6]={-1, 0,-1, 1,-1, 0};
int wall=0;
int wall_len=0;
void dfs(int,int);
int main(){
  int x,y;

  memset(d,sizeof(d),true);
  memset(mas,sizeof(mas),0);

  cin >> x >> y;

  for(int i=1;i<y+1;i++){
    for(int j=1;j<x+1;j++){
      cin >> mas[i][j];
    }
  }
  /*
  for(int i=0;i<=y+1;i++){
    for(int j=0;j<=x+1;j++){
      cout << mas[i][j] << " ";
    }
    cout << endl;
    }*/

  dfs(0,0);
  cout << wall_len << endl;
}

void dfs(int y,int x){
  d[y][x]=false;

  for(int i=0;i<6;i++){
    int ny=dy[i];
    int nx;
    if(y&1) nx=x + dx_k[i];//yの１バイト目が１だったら（奇数だったら）
    else nx=x + dx_g[i];

    if(ny>=0 && ny<=y+1 && nx>=0 && nx<=x+1 && d[ny][nx]==true){//規定範囲外に出ない間。
      if(mas[ny][nx]==0){//壁がなかったら
	dfs(ny,nx);
      }
      else{//壁があったら
	wall_len++;
      }
    }

  }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(d,sizeof(d),true);
      |   ^~~~~~
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>
using namespace std;
int mas[110][110];
bool d[110][110];
int dy[6]={-1,-1, 0, 0, 1, 1};
int dx_k[6]={ 0, 1,-1, 1, 0, 1};
int dx_g[6]={-1, 0,-1, 1,-1, 0};
int wall=0;
int wall_len=0;
void dfs(int,int);
int main(){
  int x,y;

  memset(d,true,sizeof(d));
  memset(mas,0,sizeof(mas));

  cin >> x >> y;

  for(int i=1;i<y+1;i++){
    for(int j=1;j<x+1;j++){
      cin >> mas[i][j];
    }
  }
  /*
  for(int i=0;i<=y+1;i++){
    for(int j=0;j<=x+1;j++){
      cout << mas[i][j] << " ";
    }
    cout << endl;
    }*/

  dfs(0,0);
  cout << wall_len + 1 << endl;
}

void dfs(int y,int x){
  d[y][x]=false;

  for(int i=0;i<6;i++){
    int ny=y + dy[i];
    int nx;
    if(y&1) nx=x + dx_k[i];//yの１バイト目が１だったら（奇数だったら）
    else nx=x + dx_g[i];

    if(ny>=0 && ny< 110 && nx>=0 && nx< 111 && d[ny][nx]==true){//規定範囲外に出ない間。
      if(mas[ny][nx]==0){//壁がなかったら
	dfs(ny,nx);
      }
      else{//壁があったら
	wall_len++;
      }
    }

  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'memset' was not declared in this scope
   14 |   memset(d,true,sizeof(d));
      |   ^~~~~~
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 <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <gmp.h>

#define BUFFER_SIZE 555

bool isZigzag(mpz_t num) {
  char buffer[BUFFER_SIZE];
  mpz_get_str(buffer, 10, num);

  int len = strlen(buffer);
  if (len <= 1) return true; // one digit number.

  int previous = buffer[0] - '0';
  int current  = buffer[1] - '0';
  if (previous == current) return false; // same digits.
  if (len == 2) return true; // two digit number with different digits.

  bool flag = previous > current ? true : false;
  
  for (int i=2; i < len; i++) {
    previous = current;
    current = buffer[i] - '0';
    if ((flag && previous >= current) || (!flag && previous <= current))
      return false;
    else if (previous > current)
      flag = true;
    else
      flag = false;
  }

  return true;
}

int main() {
  mpz_t lower, upper, count;
  int m;
  char buffer[BUFFER_SIZE];

  // initialize values.
  mpz_init(count);
  
  fgets(buffer, BUFFER_SIZE, stdin);
  mpz_init_set_str(lower, buffer, 10);
  
  fgets(buffer, BUFFER_SIZE, stdin);
  mpz_init_set_str(upper, buffer, 10);
  
  scanf("%d", &m);
  
  // set lower to a multiple of m.
  while (!mpz_divisible_ui_p(lower, m))
    mpz_add_ui(lower, lower, 1);

  // count multiples that are also zig-zag number.
  while (mpz_cmp(lower, upper) <= 0) {
    if (isZigzag(lower)) {
      mpz_add_ui(count, count, 1);
    }
    mpz_add_ui(lower, lower, m);
  }

  // print result
  mpz_mod_ui(count, count, 10000);
  mpz_out_str(stdout, 10, count);
  puts("");
  
  // free used memories.
  mpz_clear(lower);
  mpz_clear(upper);
  mpz_clear(count);
  
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccpcvBQx.o: in function `isZigzag':
main.c:(.text+0x29): undefined reference to `__gmpz_get_str'
/usr/bin/ld: /tmp/ccpcvBQx.o: in function `main':
main.c:(.text+0x11f): undefined reference to `__gmpz_init'
/usr/bin/ld: main.c:(.text+0x155): undefined reference to `__gmpz_init_set_str'
/usr/bin/ld: main.c:(.text+0x18b): undefined reference to `__gmpz_init_set_str'
/usr/bin/ld: main.c:(.text+0x1c0): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x1d5): undefined reference to `__gmpz_divisible_ui_p'
/usr/bin/ld: main.c:(.text+0x203): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x21c): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x22f): undefined reference to `__gmpz_cmp'
/usr/bin/ld: main.c:(.text+0x24b): undefined reference to `__gmpz_fdiv_r_ui'
/usr/bin/ld: main.c:(.text+0x263): undefined reference to `__gmpz_out_str'
/usr/bin/ld: main.c:(.text+0x27e): undefined reference to `__gmpz_clear'
/usr/bin/ld: main.c:(.text+0x28a): undefined reference to `__gmpz_clear'
/usr/bin/ld: main.c:(.text+0x296): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <gmp.h>

#define BUFFER_SIZE 555

bool isZigzag(mpz_t num) {
  int i;
  char buffer[BUFFER_SIZE];
  mpz_get_str(buffer, 10, num);

  int len = strlen(buffer);
  if (len <= 1) return true; // one digit number.

  int previous = buffer[0] - '0';
  int current  = buffer[1] - '0';
  if (previous == current) return false; // same digits.
  if (len == 2) return true; // two digit number with different digits.

  bool flag = previous > current ? true : false;
  
  for (i=2; i < len; i++) {
    previous = current;
    current = buffer[i] - '0';
    if ((flag && previous >= current) || (!flag && previous <= current))
      return false;
    else if (previous > current)
      flag = true;
    else
      flag = false;
  }

  return true;
}

int main() {
  mpz_t lower, upper, count;
  int m;
  char buffer[BUFFER_SIZE];

  // initialize values.
  mpz_init(count);
  
  fgets(buffer, BUFFER_SIZE, stdin);
  mpz_init_set_str(lower, buffer, 10);
  
  fgets(buffer, BUFFER_SIZE, stdin);
  mpz_init_set_str(upper, buffer, 10);
  
  scanf("%d", &m);
  
  // set lower to a multiple of m.
  while (!mpz_divisible_ui_p(lower, m))
    mpz_add_ui(lower, lower, 1);

  // count multiples that are also zig-zag number.
  while (mpz_cmp(lower, upper) <= 0) {
    if (isZigzag(lower)) {
      mpz_add_ui(count, count, 1);
    }
    mpz_add_ui(lower, lower, m);
  }

  // print result
  mpz_mod_ui(count, count, 10000);
  mpz_out_str(stdout, 10, count);
  puts("");
  
  // free used memories.
  mpz_clear(lower);
  mpz_clear(upper);
  mpz_clear(count);
  
  return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccMNwQiG.o: in function `isZigzag':
main.c:(.text+0x29): undefined reference to `__gmpz_get_str'
/usr/bin/ld: /tmp/ccMNwQiG.o: in function `main':
main.c:(.text+0x11f): undefined reference to `__gmpz_init'
/usr/bin/ld: main.c:(.text+0x155): undefined reference to `__gmpz_init_set_str'
/usr/bin/ld: main.c:(.text+0x18b): undefined reference to `__gmpz_init_set_str'
/usr/bin/ld: main.c:(.text+0x1c0): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x1d5): undefined reference to `__gmpz_divisible_ui_p'
/usr/bin/ld: main.c:(.text+0x203): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x21c): undefined reference to `__gmpz_add_ui'
/usr/bin/ld: main.c:(.text+0x22f): undefined reference to `__gmpz_cmp'
/usr/bin/ld: main.c:(.text+0x24b): undefined reference to `__gmpz_fdiv_r_ui'
/usr/bin/ld: main.c:(.text+0x263): undefined reference to `__gmpz_out_str'
/usr/bin/ld: main.c:(.text+0x27e): undefined reference to `__gmpz_clear'
/usr/bin/ld: main.c:(.text+0x28a): undefined reference to `__gmpz_clear'
/usr/bin/ld: main.c:(.text+0x296): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

constexpr int mod = 10000000;
constexpr int MAX_DIGIT = 500;
constexpr int MAX_M = 500;

int dp[MAX_DIGIT + 1][MAX_M][10][2][2]; // digit, modulo m, prev, less flag, zig-zag flag

int calc(const string &limit, int m) {
	const int n = limit.size();

	memset(dp, 0, sizeof(dp));

	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < 10; ++j) {
			const bool lt = (j < limit[i] - '0');
			const bool le = (j <= limit[i] - '0');

			if(j && (i || le)) {
				(dp[i + 1][j % m][j][i || lt][true] += 1) %= mod;
				(dp[i + 1][j % m][j][i || lt][false] += 1) %= mod;
			}

			for(int k = 0; k < m; ++k) {
				const int next_rest = (k * 10 + j) % m;

				for(int l = 0; l < j; ++l) {
					(dp[i + 1][next_rest][j][true][true] += dp[i][k][l][true][false]) %= mod;

					if(le) {
						(dp[i + 1][next_rest][j][lt][true] += dp[i][k][l][false][false]) %= mod;
					}
				}

				for(int l = j + 1; l < 10; ++l) {
					(dp[i + 1][next_rest][j][true][false] += dp[i][k][l][true][true]) %= mod;

					if(le) {
						(dp[i + 1][next_rest][j][lt][false] += dp[i][k][l][false][true]) %= mod;
					}
				}
			}
		}
	}

	int res = 0;
	for(int i = 0; i < 10; ++i) {
		res += dp[n][0][i][true][true];
		res += dp[n][0][i][true][false];

		if(i && (n > 1 || i < limit.back() - '0') && i % m == 0) {
			--res;
		}
	}

	return res % mod;
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	string a, b;
	int m;

	cin >> a >> b >> m;

	int carry = 1;
	for(int i = b.size() - 1; i >= 0; --i) {
		b[i] += carry;
		if(b[i] <= '9') {
			carry = 0;
			break;
		}
		else {
			b[i] = '0';
		}
	}

	if(carry) b = '1' + b;

	cout << (calc(b, m) - calc(a, m) + mod) % mod << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int calc(const std::string&, int)':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
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>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
using namespace std;
#define LATTE 10000

int dp[502][10][500][2][3];


int main(){
	char A[502],B[502];
	int M,lenA,lenB;
	cin>>A>>B>>M;
	lenA = strlen(A); lenB = strlen(B);
	for(int i=0;i<lenB;i++){
		B[i]-='0';
		if(lenA-i-1<0) A[lenB-i-1]=0;
		else A[lenB-i-1]=A[lenA-i-1]-'0';
	}
	if(A[0]!=0) dp[0][A[0]][A[0]%M][0][0] = dp[0][A[0]][A[0]%M][1][0] = 1;
	dp[0][B[0]][B[0]%M][0][2] = dp[0][B[0]][B[0]%M][1][2] = 1;
	for(int j=A[0]+1;j<B[0];j++){
		dp[0][j][j%M][0][1] = dp[0][j][j%M][1][1] = 1;
	}
	bool flag=false;
	int latte = lenB-lenA;
	for(int i=0;i<lenB-1;i++){
		if(i+1<latte){
			for(int j=1;j<10;j++){
				dp[i+1][j][j%M][0][1] += 1;
				if(i+1!=lenB-1) dp[i+1][j][j%M][1][1] += 1;
			}
		}
		else if(i+1==latte){
			dp[i+1][A[i+1]][A[i+1]%M][0][0] += 1;
			if(i+1!=lenB-1) dp[i+1][A[i+1]][A[i+1]%M][1][0] += 1;
			for(int j=A[i+1]+1;j<10;j++){
				dp[i+1][j][j%M][0][1] += 1;
				if(i+1!=lenB-1) dp[i+1][j][j%M][1][1] += 1;
			}
		}
		for(int j=0;j<10;j++){
			for(int k=0;k<M;k++){
				for(int l=j+1;l<10;l++){
					dp[i+1][l][(k*10+l)%M][1][1] += dp[i][j][k][0][1]%LATTE;
					if(A[i+1]<l) dp[i+1][l][(k*10+l)%M][1][1] += dp[i][j][k][0][0]%LATTE;
					else if(A[i+1]==l) dp[i+1][l][(k*10+l)%M][1][0] += dp[i][j][k][0][0]%LATTE;
					if(B[i+1]>l) dp[i+1][l][(k*10+l)%M][1][1] += dp[i][j][k][0][2]%LATTE;
					else if(B[i+1]==l) dp[i+1][l][(k*10+l)%M][1][2] += dp[i][j][k][0][2]%LATTE;
				}
				for(int l=j-1;l>=0;l--){
					dp[i+1][l][(k*10+l)%M][0][1] += dp[i][j][k][1][1]%LATTE;
					if(A[i+1]<l) dp[i+1][l][(k*10+l)%M][0][1] += dp[i][j][k][1][0]%LATTE;
					else if(A[i+1]==l) dp[i+1][l][(k*10+l)%M][0][0] += dp[i][j][k][1][0]%LATTE;
					if(B[i+1]>l) dp[i+1][l][(k*10+l)%M][0][1] += dp[i][j][k][1][2]%LATTE;
					else if(B[i+1]==l) dp[i+1][l][(k*10+l)%M][0][2] += dp[i][j][k][1][2]%LATTE;
				}
			}
		}
	}
	int ans=0;
	for(int i=0;i<10;i++){
		for(int j=0;j<3;j++){
			ans += (dp[lenB-1][i][0][0][j]+dp[lenB-1][i][0][1][j])%LATTE;
		}
	}
	printf("%d\n",ans%LATTE);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: 'strlen' was not declared in this scope
   20 |         lenA = strlen(A); lenB = strlen(B);
      |                ^~~~~~
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<functional>
  +++ |+#include <cstring>
    9 | #include<string>
Language: C++

#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define MOD 10000

char A[510], B[510];
int M;
int memo[510][10][3][3][500];

int f(char *x, int i, int d, int c, int u, int r) {
  if (memo[i][c][d][u][r] >= 0) return memo[i][c][d][u][r];
  if (i == strlen(x)) {
    int ret = 0;
    if (u != 2) ret = r == 0;
    return memo[i][c][d][u][r] = ret;
  }
  int ret = r == 0;
  for (int k=0; k<10; k++) {
    int nu = u;
    if (c == k) continue;
    if (d == 0 && c < k) continue;
    if (d == 1 && c > k) continue;
    int nd;
    if (d == 2) nd = c > k;
    else        nd = 1-d;
    if (u == 1 && k > (int)(x[i] - '0')) nu = 2;
    if (u == 1 && k < (int)(x[i] - '0')) nu = 0;
    ret += f(x, i+1, nd, k, nu, (k + r*10) % M);
    ret %= MOD;
  }
  return memo[i][c][d][u][r] = ret;
}

int f(char *x) {
  int ret = 0;
  for (int i=0; i<510; i++) {
    for (int j=0; j<10; j++) {
      for (int d=0; d<3; d++) {
        for (int k=0; k<3; k++) {
          for (int l=0; l<500; l++) {
            memo[i][j][d][k][l] = -1;
          }
        }
      }
    }
  }
  for (int i=1; i<10; i++) {
    char c = (int)(x[0] - '0');
    ret += f(x, 1, 2, i, i > c ? 2 : (i == c ? 1 : 0), i % M);
    ret %= MOD;
  }
  return ret;
}

void decrement(char *x) {
  int L = strlen(x);
  int h = L - 1;
  while (x[h] == '0') {
    x[h] = '9';
    h -= 1;
  }
  x[h] = (char)(x[h] - 1);
  if (L > 1 && h == 0) {
    for (int i=0; i<L-1; i++) x[i] = x[i+1];
    x[L-1] = '\0';
  }
}

int main() {
  cin >> A >> B >> M;
  decrement(A);
  cout << (f(B) - f(A) + MOD) % MOD << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int f(char*, int, int, int, int, int)':
a.cc:17:12: error: 'strlen' was not declared in this scope
   17 |   if (i == strlen(x)) {
      |            ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cmath>
  +++ |+#include <cstring>
    7 | using namespace std;
a.cc: In function 'void decrement(char*)':
a.cc:61:11: error: 'strlen' was not declared in this scope
   61 |   int L = strlen(x);
      |           ^~~~~~
a.cc:61:11: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C

#include<iostream>
#include<string.h>
using namespace std;
int main() {
	int n, k = 0, ans = 0, i;
	char s[1000001];
	int JOI = -1, J = 0, O = 0, I = 0;
	cin >> s;
	n = strlen(s);
	s[n] = 'A';
	for (i = 0; i <= n; i++) {
		if (s[i] == 'J' && JOI <= 0) {
			JOI = 0;
			++J;
		}
		else if (s[i] == 'O' && (JOI == 0 || JOI == 1)) {
			++O;
			JOI = 1;
		}
		else if (s[i] == 'I' && (JOI == 1 || JOI == 2)) {
			++I;
			JOI = 2;
		}
		else if (JOI == 2) {
			if (O <= J && O <= I)k = O;
			if (k > ans)ans = k;
			J = 0, O = 0, I = 0, JOI = -1, --i;
		}
		else J = 0, O = 0, I = 0, JOI = -1;
	}
	cout << ans << endl;
	return 0;
}


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

#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
	char vv[100000];
	char x[100000];
int main(){ 
    scanf("%s",vv);
        int leng;
		leng=strlen(vv);
            for(int i=leng/3;i>=0;i--){
                    for(int j=0;j<i;j++){
                     x[j]='J';
                    }
                    for(int j=i;j<2*i;j++){
                        x[j]='O';
                    }
                    for(int j=2*i;j<3*i;j++){
                        x[j]='I';
                    }
                if(strstr(vv,x)!='\0'){
                    printf("%d\n",i);
					break;
                }
				for(int j=3*i-3;j<3*i;j++){
					x[j]=NULL;
				}
            }
    return 0;
}

Compiler output:
main.c:3:10: fatal error: string: No such file or directory
    3 | #include <string>
      |          ^~~~~~~~
compilation terminated.