Language: C++

#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;

int field[15][15];
int dp[15][15];

int main(){
    while(1){
        int X,Y;
        scanf("%d %d",&X,&Y);
        if(X==0)break;
        for(int i=0;i<Y;i++){
            for(int j=0;j<X;j++){
                scanf("%d",&field[i][j]);
            }
        }

        for(int j=0;j<X;j++){
            dp[Y-1][j] = field[Y-1][j] == 1 ? 0 : 1;
        }

        for(int i=Y-2;i>=0;i--){
            for(int j=0;j<X;j++){
                if(field[i][j]==1){
                    dp[i][j] = 0;
                }else if(field[i][j]==2){
                    dp[i][j] = i+2<Y ? dp[i+2][j] : 1;
                }else{
                    dp[i][j] = 0;
                    if(j-1>=0 && field[i+1][j-1]==0){
                        dp[i][j] += dp[i+1][j-1];
                    }
                    if(j+1<X && field[i+1][j+1]==0){
                        dp[i][j] += dp[i+1][j+1];
                    }
                    if(field[i+1][j]!=1){
                        dp[i][j] += dp[i+1][j];
                    }
                }
            }
        }
        int ans = 0;
        for(int j=0;j<X;j++){
            ans += dp[0][j];
        }
        printf("%d\n",ans);
    }

    return 0;
}
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
using namespace std;
typedef pair<int,int> P;
const int INF = ~(1<<31) / 2;

int field[15][15];
int dp[15][15];

int main(){
    while(1){
        int X,Y;
        scanf("%d %d",&X,&Y);
        if(X==0)break;
        for(int i=0;i<Y;i++){
            for(int j=0;j<X;j++){
                scanf("%d",&field[i][j]);
            }
        }

        for(int j=0;j<X;j++){
            dp[Y-1][j] = field[Y-1][j] == 1 ? 0 : 1;
        }

        for(int i=Y-2;i>=0;i--){
            for(int j=0;j<X;j++){
                if(field[i][j]==1){
                    dp[i][j] = 0;
                }else if(field[i][j]==2){
                    dp[i][j] = i+2<Y ? dp[i+2][j] : 1;
                }else{
                    dp[i][j] = 0;
                    if(j-1>=0 && field[i+1][j-1]==0){
                        dp[i][j] += dp[i+1][j-1];
                    }
                    if(j+1<X && field[i+1][j+1]==0){
                        dp[i][j] += dp[i+1][j+1];
                    }
                    if(field[i+1][j]!=1){
                        dp[i][j] += dp[i+1][j];
                    }
                }
            }
        }
        int ans = 0;
        for(int j=0;j<X;j++){
            ans += dp[0][j];
        }
        printf("%d\n",ans);
    }

    return 0;
}

Compiler output:
a.cc:80:11: error: redefinition of 'const int INF'
   80 | const int INF = ~(1<<31) / 2;
      |           ^~~
a.cc:16:11: note: 'const int INF' previously defined here
   16 | const int INF = ~(1<<31) / 2;
      |           ^~~
a.cc:82:5: error: redefinition of 'int field [15][15]'
   82 | int field[15][15];
      |     ^~~~~
a.cc:18:5: note: 'int field [15][15]' previously declared here
   18 | int field[15][15];
      |     ^~~~~
a.cc:83:5: error: redefinition of 'int dp [15][15]'
   83 | int dp[15][15];
      |     ^~
a.cc:19:5: note: 'int dp [15][15]' previously declared here
   19 | int dp[15][15];
      |     ^~
a.cc:85:5: error: redefinition of 'int main()'
   85 | int main(){
      |     ^~~~
a.cc:21:5: note: 'int main()' previously defined here
   21 | int main(){
      |     ^~~~