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

#include<bits/stdc++.h>
#define ll long long int
#define mod 1e9+7
using namespace std;
signed main()
{
	int n,m;
	cin>>n>>m;
	int dp[n+1][m+1];
	//cout<<"h"<<endl;
	for (int i = 0; i < m+1; ++i)
	{
		dp[0][i]=0;
	}
	for (int i = 0; i < n+1; ++i)
	{
		dp[i][0]=0;
	}
	int a[n][m];
	int x=0;
	
	for (int i = 0; i < n; ++i)
	{
		string s;
		cin>>s;
		int c=0;
		for (int i = 0; i < m; ++i)
		{
			if(s[i]=='.')
			{
				a[x][c]=1;
				c++;
			}
			else if(s[i]=='#')
			{
				a[x][c]=0;
				c++;
			}

		}
		x++;
	}
	dp[1][0]=1;
	for(int i=1; i<n+1; i++)
	{
		for(int j=1; j<m+1; j++)
		{
			if(a[i-1][j-1]==1)
			{
				dp[i][j]= (dp[i-1][j]+dp[i][j-1])%MOD;
			}
			else dp[i][j]=0;
		}
	}
	
	cout<<dp[n][m]%MOD<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:67: error: 'MOD' was not declared in this scope
   50 |                                 dp[i][j]= (dp[i-1][j]+dp[i][j-1])%MOD;
      |                                                                   ^~~
a.cc:56:24: error: 'MOD' was not declared in this scope
   56 |         cout<<dp[n][m]%MOD<<endl;
      |                        ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 7;
int main(){
    int h, w;
    cin >> h >> w;
    char v[h+1][w+1];
    for(int i = 1; i <= h; i++)
        for(int j = 1; j <= w; j++) 
            cin >> v[i][j];
    int d[h+1][w+1];
    d[1][1] = 1;
    for(int i = 0; i <= h; i++) d[i][0] = 0;
    for(int i = 0; i <= w; i++) d[0][i] = 0;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            if(i != 1 || j != 1){
                if(v[i][j] == '#') d[i][j] = 0;
                else{
                    d[i][j] = (d[i-1][j] + d[i][j-1)%INF;
                }
            }
        }
    }
    cout << d[h][w];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:52: error: expected ']' before ')' token
   31 |                     d[i][j] = (d[i-1][j] + d[i][j-1)%INF;
      |                                                    ^
      |                                                    ]
Language: C++

def valid(i,j):
    if i>=0 and i<h and j>=0 and j<w:
        return 1
    return 0
def paths(i,j):

    if valid(i,j)==0 or  a[i][0][j]=='#':
        return 0
    if i==h-1 and j==w-1:
        return 1

    if dp[i][j]==-1:
           a=0
           a+=paths(i+1,j)%m
           a+=paths(i,j+1)%m
           dp[i][j]=a%m
           return dp[i][j]
    else:
            return dp[i][j]



h,w=map(int,input().split())
a=[[]for _ in range(h)]
m=1000000007
for i in range(h):
   a[i].extend(input().split())
dp=[[-1 for _ in range(1000)]for _ in range(1000)]
print(paths(0,0))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def valid(i,j):
      | ^~~
Language: C++

#inclu<bits/stdc++.h>
using namespace std;
 
const int M = 1e9 + 7;
int h, w, dp[1000][1000];
char g[1000][1000];
 
int ans (int i, int j) {
	if (dp[i][j] != -1) return dp[i][j];
	int ret = 0;
	if (i + 1 < h) ret = (ret + ans(i+1,j)) %M;
	if (j + 1 < w) ret = (ret + ans(i,j+1)) %M;
	return dp[i][j] = ret;
}
 
int main ()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cin >> h >> w;
	memset(dp, -1, sizeof(dp));
	dp[h-1][w-1] = 1;
	for (int i=0; i<h; ++i)
		for (int j=0; j<w; ++j) {
			cin >> g[i][j];
			if (g[i][j] == '#')
				dp[i][j] = 0;
		}
	cout << ans(0, 0) << endl;
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclu; did you mean #include?
    1 | #inclu<bits/stdc++.h>
      |  ^~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:9: error: 'ios_base' has not been declared
   18 |         ios_base::sync_with_stdio(false); cin.tie(NULL);
      |         ^~~~~~~~
a.cc:18:43: error: 'cin' was not declared in this scope
   18 |         ios_base::sync_with_stdio(false); cin.tie(NULL);
      |                                           ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclu<bits/stdc++.h>
a.cc:18:51: error: 'NULL' was not declared in this scope
   18 |         ios_base::sync_with_stdio(false); cin.tie(NULL);
      |                                                   ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | #inclu<bits/stdc++.h>
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(dp, -1, sizeof(dp));
      |         ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | #inclu<bits/stdc++.h>
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << ans(0, 0) << endl;
      |         ^~~~
a.cc:28:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:30: error: 'endl' was not declared in this scope
   28 |         cout << ans(0, 0) << endl;
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclu<bits/stdc++.h>
Language: C++

#include<iostream>
#include<queue>
using namespace std;
int main () {
  int MOD = 1e9 + 7;
  int dp[1003][1003];
  char map[1003][1003];
  int H, W;
  cin >> H >> W;
  for (int i = 0; i < H; i ++) {
    for (int j = 0; j < W; j ++) {
      cin >> map[i][j];
    }
  }
  for (int i = 0; i < H; i ++) {
    for (int j = 0; j < W; j ++) {
      dp[i][j] = 0;
    }
  }
  dp[0][0] = 1;
  queue<int>x;
  queue<int>y;
  x.push(0);
  y.push(0);
  int mx[] = {1, 0};
  int my[] = {0, 1};
  while(!x.empty()) {
    ux = x.front();
    uy = y.front();
    x.pop();
    y.pop();
    for (int i = 0; i < 2; i ++) {
      int px = ux + mx[i];
      int py = uy + my[i];
      if (px >= H || py >= W || map[px][py] == '#') continue;
      dp[px][py] = (dp[px][py] + dp[ux][uy]) % MOD;
      x.push(px);
      y.push(py);
    }
  }
  cout << dp[H - 1][W - 1] << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'ux' was not declared in this scope; did you mean 'mx'?
   28 |     ux = x.front();
      |     ^~
      |     mx
a.cc:29:5: error: 'uy' was not declared in this scope; did you mean 'my'?
   29 |     uy = y.front();
      |     ^~
      |     my
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define mod 1e9+7
vector<vector<char> > grid;
vector<vector<ll> > ans;
int main()
{
    ll h,w;    
    grid.resize(h,vector<char> (w));
    ans.resize(h,vector<ll> (w));
    for(ll i=0;i<h;i++)
    {
        for(ll j=0;j<w;j++)
        {
            cin>>grid[i][j];
        }
    }
    ans[0][0]=1;
    for(ll i=1;i<h;i++)
    {
        if(grid[i][0] == '#')
        ans[i][0]=0;
        else
        ans[i][0]=ans[i-1][0];
    }
    for(ll i=1;i<w;i++)
    {
        if(grid[0][i]=='#')
        ans[0][i]=0;
        else
        ans[0][i]=ans[0][i-1];
    }
    for(ll i=1;i<h;i++)
    {
        for(ll j=1;j<w;j++)
        {
            if(grid[i][j] == '#')
            ans[i][j]=0;
            else
            ans[i][j]=(ans[i-1][j] + ans[i][j-1])%mod;
        }
    }
    cout<<ans[h-1][w-1];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:50: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   41 |             ans[i][j]=(ans[i-1][j] + ans[i][j-1])%mod;
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      |                                    |
      |                                    __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
Language: C++

/**
    @Author:Monk78
    @Topic:H-Grid1
**/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll>Vl;
typedef pair<ll,ll>PII;
typedef vector<PII>Vll;
typedef vector<pair<ll,pair<ll,ll> > >Vlll;
typedef priority_queue<ll>PQL;
typedef map<ll,ll>MP;
#define S second;
#define F first;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end));i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define mod 1e9+7
#define MAX 100005
#define f(i,a,b) for(int i=(a);i<(b);i++)
#define rf(i,a,b) for(int i=(a);i>=b;i--)
#define sl(n) scanf("%lld",&n)
#define pl(n) printf("%lld",n)
#define vpshVar() int main()
vpshVar(){
    ll H,W;
    sl(H);sl(W);
    char str[H][W];
    for(ll i=0;i<H;i++){
     for(ll j=0;j<W;j++){
        cin>>str[i][j];
     }
    }
    ll dp[H+1][W+1];
    dp[0][0]=0;
    bool check=true;
    for(ll i=0;i<W;i++){
        if(str[0][i]=='.'&& check)
        {
            dp[0][i]=1;
        }
        else {
                dp[0][i]=0;
            check=false;
        }
    }
    check=true;
    for(ll i=0;i<H;i++){
        if(str[i][0]=='.' && check)dp[i][0]=1;
        else {
                dp[i][0]=0;
            check=false;
        }
    }

    for(ll i=1;i<H;i++){
        for(ll j=1;j<W;j++){
                if(str[i][j]=='.')
                    dp[i][j]=dp[i-1][j]+dp[i][j-1];

                else
                    dp[i][j]=0;
                dp[i][j]=dp[i][j]%mod;
            }
        }
    pl(dp[H-1][W-1]%mod)
;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:34: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   65 |                 dp[i][j]=dp[i][j]%mod;
      |                          ~~~~~~~~^
      |                                 |
      |                                 ll {aka long long int}
a.cc:68:20: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
   68 |     pl(dp[H-1][W-1]%mod)
      |        ~~~~~~~~~~~~^
      |                   |
      |                   ll {aka long long int}
a.cc:25:29: note: in definition of macro 'pl'
   25 | #define pl(n) printf("%lld",n)
      |                             ^
Language: C++

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

const mod = 1e9+7;

int main()
{
  int m, n;
  cin >> m >> n;
  char a[m][n];
  for(int i = 0; i < m; i++)
    for(int j = 0; j < n; j++)
      cin >> a[i][j];
  
  int DP[m + 1][n + 1];
    
    for (int i = 0; i <= m; ++i)
        for (int j = 0; j <= n; ++j)
        {
            if (i == 0 || j == 0)
                DP[i][j] = 0;
            else if (a[i - 1][j - 1] == '#')
                DP[i][j] = 0;
            else if (i == 1 && j == 1)
                DP[i][j] = 1;
            else
                DP[i][j] = (DP[i][j - 1] % mod + DP[i - 1][j]%mod)%mod;
        }
    
    cout << DP[m][n] << endl;
  
  return 0;
}


Compiler output:
a.cc:4:7: error: 'mod' does not name a type
    4 | const mod = 1e9+7;
      |       ^~~
a.cc: In function 'int main()':
a.cc:27:44: error: 'mod' was not declared in this scope; did you mean 'modf'?
   27 |                 DP[i][j] = (DP[i][j - 1] % mod + DP[i - 1][j]%mod)%mod;
      |                                            ^~~
      |                                            modf
Language: Java

import java.util.*;

public class Main2 {
    public static void main(String[] args) {
        ProblemH.main();
    }
}

class ProblemH {
    private static int H;
    private static int W;
    private static int[][] dp;
    private static int m = (int) Math.pow(10,9) + 7;

    static void main() {
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        sc.nextLine();

        char[][] grid = new char[H][W];
        dp = new int[H][W];
        for (int i = 0; i < H; i++) {
            grid[i] = sc.nextLine().toCharArray();
        }
        // initial assertion
        for (int j = W-1; j>=0; j--) {
            if (grid[H-1][j] == '#') {
                break;
            } else {
                dp[H - 1][j] = 1;
            }
        }
        for (int i = H-2; i>=0; i--) {
            if (grid[i][W-1] == '#') {
                break;
            } else {
                dp[i][W - 1] = 1;
            }
        }
        // compute dp
        for (int i = H-2; i >= 0; i--) {
            for (int j = W-2; j >= 0; j--) {
                if (grid[i][j] == '.') {
                    dp[i][j] = dp[i+1][j] +  dp[i][j+1];
                    dp[i][j] %= m;
                } else {
                    continue;
                }
            }
        }
        // compute modulus
        int ans = dp[0][0] % m;
        System.out.println(ans);
    }
}

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

import java.util.*;

public class Solution
{
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        int r = scan.nextInt(), c = scan.nextInt();
        scan.nextLine();
        char[][] grid = new char[r][c];
        for (int i = 0; i < r; i++)
        {
            String s = scan.nextLine();
            for (int j = 0; j < c; j++)
                grid[i][j] = s.charAt(j);
        }
        int[][] dp = new int[r][c];
        dp[0][0] = 1;
        for (int i = 0; i < r; i++)
        {
            for (int j = 0; j < c; j++)
            {
                if (grid[i][j] == '#')
                    continue;
                if (i != 0)
                    dp[i][j] += dp[i - 1][j];
                if (j != 0)
                    dp[i][j] += dp[i][j - 1];
                dp[i][j] %= (int) 1e9  + 7;
            }
        }
        System.out.println(dp[r - 1][c - 1]);
    }
}

Compiler output:
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution
       ^
1 error
Language: Java


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Grid {
	static FastReader input = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);

	static int n, m;
	static long[][] memo;
	static char[][] a;
	static boolean[][] visited;

	static long solve(int i, int j) {

		if (i >= n || j >= m || a[i][j] == '#')
			return 0;

		if (i == n - 1 && j == m - 1)
			return 1L;

		if (visited[i][j])
			return memo[i][j];

		visited[i][j] = true;

		long x = solve(i + 1, j);
		long y = solve(i, j + 1);

		return memo[i][j] = ((x + y) % ((long) 1e9 + 7));
	}

	public static void main(String[] args) throws NumberFormatException, IOException {

		n = input.nextInt();
		m = input.nextInt();

		a = new char[n][m];

		memo = new long[n + 10][m + 10];
		visited = new boolean[n + 10][m + 10];

		for (int i = 0; i < n; i++) {
			a[i] = input.nextLine().toCharArray();
		}

		System.out.println(solve(0, 0));

	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		String nextLine() throws IOException {
			String str = "";
			str = br.readLine();
			return str;
		}
	}
}


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

h,w=map(int,input().split())
mod=10e9+7
dp=[[0]*(w+1) for i in range(h+1)]
dp[1][0]=1
for i in range(1,h+1):
    line=input()
    for j in range(1,w+1):
        if line[j-1]!='#':
            dp[i][j]+=dp[i-1][j]+dp[i][j-1] 
            if dp[i][j]>=mod:
                dp[i][j]-=mod
print(dp[-1][-1])


Compiler output:
a.cc:1:1: error: 'h' does not name a type
    1 | h,w=map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
int i,j,m,n,A[1001][1001];
paths(int m,int n){
  if(m==1 || n==1)
    return 1;
  if(A[m-1][n]=='.' && A[m][n-1]=='.')
    return paths(m-1,n)+paths(m,n-1);
  else if(A[m-1][n]=='.')
    return paths(m-1,n);
  else
    return paths(m,n-1);}
    
int main(){
  cin>>m>>n;
  for(i=0;i<m;i++){
    for(j=0;j<n;j++){
      cin>>A[i][j];}}
  cout<<paths(m,n);}

Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'paths' with no type [-fpermissive]
    5 | paths(int m,int n){
      | ^~~~~
Language: C

#include <stdio.h>
#define MOD (1000000007)
int main(){
  long w,h,path[1001][1001]={0};
  char grid[1001][1001];
  scanf("%ld%ld",&h,&w);
  for (long i=1;i<h+1;i++){
    for (long j=1;j<w+1;j++) scanf("%c",&grid[j][i]);
  }
  for (long i=0;i<h+1;i++){
    grid[0][i]='#';
    grid[i][0]='#';
  }
  for (long i=1;i<h+1;i++){
    for (long j=1;j<w+1;j++){
      if (grid[j][i]='.'){
        if (grid[j-1][i]='.') path[j][i]+=path[j-1][i];
        if (grid[j+1][i]='.') path[j][i]+=path[j+1][i];
      }
      path[j][i]%=MOD;
    }
  }
  printf("%ld\n",path[w][h]);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:24:3: error: expected declaration or statement at end of input
   24 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
#define MOD (1000000007)
int main(){
  long w,h,path[1001][1001]={0};
  char grid[1001][1001];
  scanf("%ld%ld",&h,&w);
  for (long i=1;i<h+1;i++){
    for (long j=1;j<w+1;j++) scanf("%c",grid[j][i]);
  }
  for (long i=0;i<h+1;i++){
    grid[0][i]='#';
    grid[i][0]='#';
  }
  for (long i=1;i<h+1;i++){
    for (long j=1;j<w+1;j++){
      if (grid[j][i]='.'){
        if (grid[j-1][i]='.') path[j][i]+=path[j-1][i];
        if (grid[j+1][i]='.') path[j][i]+=path[j+1][i];
      }
      path[j][i]%=MOD;
    }
  }
  printf("%ld\n",path[w][h]);
  return 0;

Compiler output:
main.c: In function 'main':
main.c:24:3: error: expected declaration or statement at end of input
   24 |   return 0;
      |   ^~~~~~
Language: C++

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

#define mod 1e9+7

int main(){
  int h,w; cin>>h>>w;
  vector<string> arr(h);
  string str;
  for(int i=0; i<h; i++){
    cin>>str; arr[i]=str;
  }
  
  vector<vector<long long> > tab(h);
  vector<long long> temp(w);
  for(int i=0; i<h; i++) tab[i]=temp;
  
  tab[0][0]=1;
  for(int i=0; i<h-1; i++){
    for(int j=0; j<w-1; j++){
      if(arr[i][j]=="."){
        if(arr[i+1][j]==".") tab[i+1][j]=(tab[i+1][j]+tab[i][j])%mod;
        if(arr[i][j+1]==".") tab[i][j+1]=(tab[i][j+1]+tab[i][j])%mod;
      }
    }
  }
  
  cout<<tab[h-1][w-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |       if(arr[i][j]=="."){
a.cc:23:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |         if(arr[i+1][j]==".") tab[i+1][j]=(tab[i+1][j]+tab[i][j])%mod;
a.cc:23:65: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   23 |         if(arr[i+1][j]==".") tab[i+1][j]=(tab[i+1][j]+tab[i][j])%mod;
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~^
      |                                                      |
      |                                                      __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
a.cc:24:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |         if(arr[i][j+1]==".") tab[i][j+1]=(tab[i][j+1]+tab[i][j])%mod;
a.cc:24:65: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'double' to binary 'operator%'
   24 |         if(arr[i][j+1]==".") tab[i][j+1]=(tab[i][j+1]+tab[i][j])%mod;
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~^
      |                                                      |
      |                                                      __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long
const int mx = 1005;
const int mod = 1000000007;
char grid[mx][mx];
ll val[mx][mx];
ll func(int h, int w)
{
    bool f = false;
    for(int j=0; j<=w; j++)
        if(grid[0][j]=='#')f=true;
        if(!f)val[0][j]=1;
        else if(f)val[0][j]=0;
    f = false;
    for(int i=0; i<=h; i++){
        if(grid[i][0]=='#')f=true;
        if(!f)val[i][0]=1;
        else if(f)val[i][0]=0;
    }
    for(int i=1; i<=h; i++)
        for(int j=1; j<=w; j++)
            if(grid[i][j]!='#')
                val[i][j] = (val[i-1][j] + val[i][j-1])%mod;
    return val[h][w];
}
int main()
{
    int h,w;
    cin >> h >> w;
    for(int i=0; i<h; i++)
        for(int j=0; j<w; j++)
            cin >> grid[i][j];
    memset(val,0,sizeof val);
    ll res = func(h-1,w-1);
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'long long int func(int, int)':
a.cc:14:22: error: 'j' was not declared in this scope
   14 |         if(!f)val[0][j]=1;
      |                      ^
a.cc:15:26: error: 'j' was not declared in this scope
   15 |         else if(f)val[0][j]=0;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define pb push_back
typedef pair<int, int> ii;
typedef long long ll;

const int maxn = 1005;
const int md = 1e9+7;

void add(int &a, int b)
{
	a += b;
	if(a>= md) a -= md;
}

char s[maxn][maxn];

int n, m;

int solve(int a, int b)
{
	if(a> n || b> m) return 0;
	if(s[a][b] == '#') return 0;
	if(a == n && b == m) return 1;
	if(dp[a][b] != -1) return dp[a][b];
	int tot = solve(a+1, b);
	add(tot, solve(a, b+1));
	return dp[a][b] = tot;
}

int main()
{
	scanf("%d %d", &n, &m);
	for(int i = 1; i<= n; i++)
	{
		scanf("%s", s[i]+1);
	}
	printf("%d\n", solve(1, 1));
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:27:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
   27 |         if(dp[a][b] != -1) return dp[a][b];
      |            ^~
      |            dup
a.cc:30:16: error: 'dp' was not declared in this scope; did you mean 'dup'?
   30 |         return dp[a][b] = tot;
      |                ^~
      |                dup
Language: Java

import java.util.*;

public class Main
{
  static int h, w;
  static long mod = (long)1e9+7;
  static char[][] G;
  static Long[][] memo;
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    h = in.nextInt();
    w = in.nextInt();
    G = new char[h][w];
    for (int i = 0; i < h; i++)
      G[i] = in.next().toCharArray();
    memo = new Long[h][w];
    System.out.println(dp(0, 0));
    in.close();
  }
  
  public static long dp(int r, int c)
  {
    if (r == h-1 && c == w-1)
      return 1;
    if (memo[r][c] != null)
      return memo[r][c];
    long ans = 0;
    if (r+1 < h && G[r+1][c] != '#')
      ans += dp(r+1, c);
    ans %= mod;
    if (c+1 < w && G[r][c+1] != '#')
      ans += dp(r, c+1);
    ans %= mod;
    return memo[r][c] = ans;
}


Compiler output:
Main.java:36: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;

public class Main
{
  static int h, w;
  static long mod = (long)1e9+7;
  static char[][] G;
  static Long[][] memo;
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    h = in.nextInt();
    w = in.nextInt();
    G = new char[h][w];
    for (int i = 0; i < h; i++)
      G[i] = in.next().toCharArray();
    System.out.println(dp(0, 0));
    in.close();
  }
  
  public static long dp(int r, int c)
  {
    if (r == h-1 && c == w-1)
      return 1;
    if (memo[r][c] != null)
      return memo[r][c];
    long ans = 0;
    if (r+1 < h && G[r+1][c] != '#')
      ans += dp(r+1, c);
    ans %= mod;
    if (c+1 < w && G[r][c+1] != '#')
      ans += dp(r, c+1);
    ans %= mod;
    return memo[r][c] = ans;
}

Compiler output:
Main.java:35: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

typedef long long ll;
typedef vector<long long> vl;
typedef pair<long , long> pll;
typedef vector< pll > vll;
typedef set<ll> sl;
typedef map<string, int> msi;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define inf 0x3f3f3f3f
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))

const ll md = 1000000007;
//void mod(ll &x){if (x >= md) x -= md; if (x < 0) x += md;}

ll dp[h][w];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll h,w,i,j;
	cin>>h>>w;
	string s[h];
//	ll dp[h][w];
	memset(dp,0,sizeof(dp));
	dp[0][0] = 1;
	for(i=0;i<h;i++){
		cin>>s[i];
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(i>0&&j>0&&s[i-1][j]=='.'&&s[i][j-1]=='.')
				dp[i][j] = (dp[i-1][j]%md + dp[i][j-1]%md)%md;
			else if(i>0&&s[i-1][j]=='.')
				dp[i][j] = dp[i-1][j]%md;
			else if(j>0&&s[i][j-1]=='.')
				dp[i][j] = dp[i][j-1]%md;
		}
	}
	cout<<dp[h-1][w-1];
    return 0;
}




Compiler output:
a.cc:22:7: error: 'h' was not declared in this scope
   22 | ll dp[h][w];
      |       ^
a.cc:22:10: error: 'w' was not declared in this scope
   22 | ll dp[h][w];
      |          ^
a.cc: In function 'int main()':
a.cc:32:16: error: 'dp' was not declared in this scope; did you mean 'dup'?
   32 |         memset(dp,0,sizeof(dp));
      |                ^~
      |                dup
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n, m; cin>>n>>m;
    char slika[n][m];
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
         cin>>slika[i][j];   
        }
    }
    
    int mat[n][m];
    mat[0][0]=1;
    for(int i=1; i<n; i++)
    {
        if(slika[i][0]=='#') mat[i][0]=0;
        else mat[i][0]=mat[i-1][0];
    }
    for(int j=1; j<m; j++)
     {
        if(slika[0][j]=='#') mat[0][j]=0;
        else mat[0][j]=mat[0][j-1];
    }
    
    for(int i=1; i<n; i++)
    {
        for(int j=1; j<m; j++)
        {
            if(slika[i][j]=='#') mat[i][j]=0;
            else mat[i][j]= (mat[i-1][j]+ mat[i][j-1])%1000000007;
        }
    }
    
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++)
        {
       //     cout<<mat[i][j]<<" ";
        }
     //   cout<<endl;
    }
    cout<<mat[n-1][m-1]%<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:25: error: expected primary-expression before '<<' token
   47 |     cout<<mat[n-1][m-1]%<<endl;
      |                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
ll INF = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
bool visited[1001][1001];
int H,W;
char a[1010][1010];
ll dist[1010][1010];

void dfs(int y, int x){
    if(visited[y][x]) return 0;
    //else
    visited[y][x] = true;
    for(int i = 2; i < 4; i++){
        int ny = y + dy[i];
        int nx = x + dx[i];
        if(visited[ny][nx]){
            dist[y][x] += dist[ny][nx];
        } else continue;
    }
    dist[y][x] %= MOD;
    for(int i = 2; i < 4; i++){
        int ny = y + dy[i];
        int nx = x + dx[i];
        dfs(ny, nx);
    }
}
int main(){
    cin >> H >> W;
    for(int i = 0; i <= H+1; i++){
        a[i][0] = '#';
        a[i][W+1] = '#';
        visited[i][0] = true;
        visited[i][W+1] = true;
        dist[i][0] = 0;
        dist[i][W+1] = 0;
    }
    for(int i = 0; i <= W+1; i++){
        a[0][i] = '#';
        a[H+1][i] = '#';
        visited[0][i] = true;
        visited[H+1][i] = true;
        dist[0][i] = 0;
        dist[H+1][i] = 0;
    }
    for(int i = 1; i <= H; i++){
        for(int j = 1; j <= W; j++){
            cin >> a[i][j];
            if(a[i][j] == '#'){
                visited[i][j] = true;
            } else {
                visited[i][j] = false;
            }
            dist[i][j] = 0;
        }
    }
    dist[1][1] = 1;
    dfs(1,1);
    ll ans = dist[H][W];
    ans %= MOD;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:21:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
   21 |     if(visited[y][x]) return 0;
      |                              ^
Language: C++

#include "pch.h"
#include <iostream>

using namespace std;

const long long base = 1000000007;

char chr[1003][1003];
long long sum[1003][1003];

int n, m;

int main()
{
	cin >> n >> m;

	sum[1][1] = 1;

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			cin >> chr[i][j];

			if (chr[i][j] == '#') continue;
			
			sum[i][j] = (sum[i][j] + sum[i - 1][j]) % base;
			sum[i][j] = (sum[i][j] + sum[i][j - 1]) % base;
		}
	}

	cout << sum[n][m] << endl;

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>

using namespace std;

const long long base = 1000000007;

char chr[1003][1003];
long long sum[1003][1003];

int n, m;

int main()
{
	cin >> n >> m;

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			scanf("%c", &chr[i][j];);

			if (i == 1 && j == 1)
			{
				sum[i][j] = 1;
				continue;
			}

			if (chr[i][j] == '#')
				sum[i][j] = 0;
			else
				sum[i][j] = (sum[i - 1][j] + sum[i][j - 1]) % base;
		}
	}

	cout << sum[n][m] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:47: error: expected ')' before ';' token
   21 |                         scanf("%c", &chr[i][j];);
      |                              ~                ^
      |                                               )
a.cc:21:48: error: expected primary-expression before ')' token
   21 |                         scanf("%c", &chr[i][j];);
      |                                                ^
Language: C++

#include <iostream>
using namespace std;

#define MOD 1000000007
#define MAXN 1010

long long dp[MAXN][MAXN];
int grid[MAXN][MAXN];

int H,W;

int main() {
  cin >> H >> W;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      char c; cin >> c;
      if (c == '#') {
        grid[i][j] = 1;
      }
    }
  }
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (grid[i][j] == 1) {
        dp[i][j] = 0;
      } else {
        if (i == H-1 && j == W-1) {
          dp[i][j] = 1;
        } else if (i == H-1) {
          dp[i][j] = dp[i][j+1];
        } else if (j == W-1) {
          dp[i][j] = dp[i+1][j];
        } else {
          dp[i][j] = (dp[i+1][j]+dp[i][j+1])%MOD;
        }
      }
    }
  }
  cout << dp[0][0] << endl;
}
      }

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

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

const int N = 1010;
const int MOD = 1000000007;

int f[N][N];
string a[N];

int main() {
	memset(f, 0, sizeof(f));
	int n, m; cin >> n >> m;
	for(int i = 0 ; i < n ; i++) {
		cin >> a[i];
	}
	f[0][0] = (a[0][0] == '.' ? 1 : 0);
	for(int i = 1 ; i < n ; i++) {
		f[i][0] = f[i - 1][0];
		if(a[i - 1][0] == '#') {
			f[i][0] = 0;
			break;
		}
	}
	for(int j = 1 ; j < m ; j++) {
		f[0][j] = f[0][j - 1];
		if(a[0][j - 1] == '#') {
			f[0][j] = 0;
			break;
		}
	}
	for(int i = 1 ; i < n ; i++) {
		for(int j = 1 ; j < m ; j++) {
			if(a[i - 1][j] == '.') {
				f[i][j] = f[i - 1][j];
			}
			if(a[i][j - 1] == '.') {
				f[i][j] = (f[i][j] + f[i][j - 1]) % MOD;
			}
		}
	}
	cout << f[n - 1][m - 1] << "\n";
}


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

#include<bits/stdc++.h>
using namespace std;
char a[1002][1002];
int main()
{
	int i,j,h,w;
	scanf("%d %d",&h,&w);
	for(i=1;i<=h;i++)
	{
		for(j=1;j<=w;j++)
		{
			scanf("%c",&a[i][j]);
		}
	}
	for(i=1;i<=h;i++)
	{
		for(j=1;j<=w;j++)
		{
			if(a[i][j]=='#')
				f[i][j]=0;
			else if(i==1&&i==j)
				f[i][j]=1;
			else if(a[i][j]=='.')
				f[i][j]=f[i-1][j]+f[i][j-1];
		}
	}
	printf("%d",a[h][w]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'f' was not declared in this scope
   20 |                                 f[i][j]=0;
      |                                 ^
a.cc:22:33: error: 'f' was not declared in this scope
   22 |                                 f[i][j]=1;
      |                                 ^
a.cc:24:33: error: 'f' was not declared in this scope
   24 |                                 f[i][j]=f[i-1][j]+f[i][j-1];
      |                                 ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#include <queue>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MOD 1000000007

int dp[1005][1005];
int main(){
    int h, w; cin >> h >> w;
    char map[h][w+1];
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    rep(i,h) cin >> map[i];
    rep(i,h) rep(j, w){
        if(map[i][j] != '#'){
            if(j+1 < w && map[i][j+1] != '#') dp[i][j+1] = (dp[i][j+1] + dp[i][j]) % MOD;
            if(i+1 < h && map[i+1][j] != '#') dp[i+1][j] = (dp[i+1][j] + dp[i][j]) % MOD;
        }
    }
    cout << dp[h-1][w-1] << endl;
    return 0;
}

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

#pragma GCC optimize "Ofast"
#pragma GCC optimize "unroll-loops"
#pragma GCC target "sse,sse2,sse3,sse4,abm,avx,mmx,popcnt,tune=native"
#include <bits/stdc++.h>
#define scan(x) do{while((x=getchar_unlocked())<'0'); for(x-='0'; '0'<=(_=getchar_unlocked()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define ll long long
#define ull unsigned long long
#define MAXN 1010
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define min(a, b) (a) < (b) ? (a) : (b)
#define max(a, b) (a) < (b) ? (b) : (a)
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define f first
#define s second
#define mii map<int, int>
#define umii unordered_map<int, int>
#define allof(x) x.begin(), x.end()
#define DEBUG 1
// #define NOT_DMOJ 0
#ifdef DEBUG
	#define D(x...) printf(x)
#else
	#define D(x...)
#endif
using namespace std;

inline int GCD (int a, int b) { return b == 0 ? a : GCD(b, a % b); }
inline int LCM (int a, int b) { return a * b / GCD(a, b); }
inline ll PowMod (ll a, ll b, ll mod) { ll val = 1; while (b) { if (b & 1) val = (val * a) % mod; a = (a * a) % mod; b >>= 1; } return val; }

int H, W;
string s;
char grid[MAXN][MAXN];
ll DP[MAXN][MAXN];

inline ll Mod (ll a) {
	return ((a % MOD) + MOD) % MOD;
}

inline ll Solve (int a, int b) {
	if (a == H && b == W) return 1;
	if (a > H || b > W || grid[a][b] == '#') return 0;
	int &res = DP[a][b];
	if (~res) return res;
	return res = Mod(Mod(Solve(a + 1, b)) + Mod(Solve(a, b + 1)));
}

int main (int argc, char const *argv[]) {
	#ifdef NOT_DMOJ
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	#endif // NOT_DMOJ
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> H >> W;
	for (int i=1; i<=H; i++) {
		cin >> s;
		for (int j=1; j<=W; j++) {
			grid[i][j] = s[j - 1];
		}
	}
	memset(DP, -1, sizeof(DP));
	cout << Solve(1, 1) << "\n";
	return 0;
}

/* 
 * Look for:
 * the exact constraints (multiple sets are too slow for n=10^6 :( ) 
 * special cases (n=1?)
 * overflow (ll vs int?)
 * array bounds
 */

Compiler output:
a.cc: In function 'long long int Solve(int, int)':
a.cc:49:27: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   49 |         int &res = DP[a][b];
      |                    ~~~~~~~^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  int n,i,j,m
  scanf("%d %d",&n,&m);
  string a[n];
  vector<vector<int>>dp(n,vector<int>(m,0));
  for(i=0;i<n;i++){
    cin>>a[i];
  }
  dp[0][0] = 1;
  for(i=1;i<n;i++){
    if(a[i][0] == '.')
      dp[i][0] = max(0,dp[i-1][0]);
    else dp[i][0] = 0;
  }
  for(i=1;i<m;i++){
    if(a[0][i] == '.')
      dp[0][i] = max(0,dp[0][i-1]);
    else dp[0][i] = 0;
  }
  for(i=1;i<n;i++){
    for(j=1;j<m;j++){
      if(a[i][j] == '#'){
        dp[i][j] = 0;
        continue ;
      }
      dp[i][j] = dp[i-1][j] + dp[i][j-1];
    }
  }
  printf("%d\n",dp[n-1][m-1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'scanf'
    7 |   scanf("%d %d",&n,&m);
      |   ^~~~~
a.cc:9:39: error: 'm' was not declared in this scope
    9 |   vector<vector<int>>dp(n,vector<int>(m,0));
      |                                       ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
  int n,i,j,m;
  scanf("%d %d",&n,&m);
  string a[n];
  vector<vector<int>>dp(n,vector<int>(m,0));
  for(i=0;i<n;i++){
    cin>>a[i];
  }
  dp[0][0] = 1;
  for(i=1;i<n;i++){
    if(a[i][0] == '.')
      dp[i][0] = max(0,dp[i-1][0]);
    else dp[i][0] = 0;
  }
  for(i=1;i<m;i++){
    if(a[0][i] == '.')
      dp[0][i] = max(0,dp[0][i-1]);
    else dp[0][i] = 0;
  }
  for(i=1;i<n;i++){
    for(j=1;j<m;j++){
      if(a[i][j] == '#'){
        dp[i][j] = 0;
        continue ;
      }
      dp[i][j] = dp[i-1][j] + dp[i][j-1];
    }
  }
  p(dp[n-1][m-1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:3: error: 'p' was not declared in this scope; did you mean 'dp'?
   33 |   p(dp[n-1][m-1]);
      |   ^
      |   dp
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n,i,j,m
  scanf("%d %d",&n,&m);
  string a[n];
  vector<vector<int>>dp(n,vector<int>(m,0));
  for(i=0;i<n;i++){
    cin>>a[i];
  }
  dp[0][0] = 1;
  for(i=1;i<n;i++){
    if(a[i][0] == '.')
      dp[i][0] = max(0,dp[i-1][0]);
    else dp[i][0] = 0;
  }
  for(i=1;i<m;i++){
    if(a[0][i] == '.')
      dp[0][i] = max(0,dp[0][i-1]);
    else dp[0][i] = 0;
  }
  for(i=1;i<n;i++){
    for(j=1;j<m;j++){
      if(a[i][j] == '#'){
        dp[i][j] = 0;
        continue ;
      }
      dp[i][j] = dp[i-1][j] + dp[i][j-1];
    }
  }
  p(dp[n-1][m-1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'scanf'
    7 |   scanf("%d %d",&n,&m);
      |   ^~~~~
a.cc:9:39: error: 'm' was not declared in this scope
    9 |   vector<vector<int>>dp(n,vector<int>(m,0));
      |                                       ^
a.cc:33:3: error: 'p' was not declared in this scope; did you mean 'dp'?
   33 |   p(dp[n-1][m-1]);
      |   ^
      |   dp
Language: Java

import java.util.*;
import java.io.*;
public class Grid {
	static char[][] a;
	static int H,W;
	static long[][] memo;

	public static long Main(int i, int j)
	{
		if ( i==H || j==W || a[i][j] == '#')
			return 0;
		if (memo[i][j]!=-1)
			return memo[i][j];
		if(i==H-1 && j==W-1)
			return 1;
		long down = move(i+1,j);
		long right = move(i,j+1);
		return down+right;
	}
	public static void main(String[] args) throws Exception
	{
		PrintWriter out = new PrintWriter(System.out);
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		a=new char[H][W]; 

		for (int i =0;i<H;i++)
		{
			String s = sc.nextLine();
			for(int j=0;j<W;j++)
			{
				char k = s.charAt(j);
				a[i][j] = k;
			}
		}
			memo = new long[H][W];
			for (long[] a : memo)
			{
				Arrays.fill(a, -1);
			}
			System.out.println(move(0,0)%1000000000);
		}

	}

	class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}

Compiler output:
Main.java:3: error: class Grid is public, should be declared in a file named Grid.java
public class Grid {
       ^
Main.java:16: error: cannot find symbol
		long down = move(i+1,j);
		            ^
  symbol:   method move(int,int)
  location: class Grid
Main.java:17: error: cannot find symbol
		long right = move(i,j+1);
		             ^
  symbol:   method move(int,int)
  location: class Grid
Main.java:42: error: cannot find symbol
			System.out.println(move(0,0)%1000000000);
			                   ^
  symbol:   method move(int,int)
  location: class Grid
4 errors
Language: C++

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

const int N = 1010;
const int md = 1e9 + 7;

int h, w;
char a[N][N];
int cnt[N][N];

inline void add(int &a, int b) {
	a += b;
	if (a >= b) {
		a -= md;
	}
}

int main() {
	cin >> h >> w;

	for (int i = 1; i <= h; ++i) {
		for (int j = 1; j <= w; ++j) {
			cin >> a[i][j];
		}
	}

	cnt[h][w] = 1;

	for (int i = h; i > 0; --i) {
		for (int j = w; i > 0; --j) {
			if (i != h && j != w) {
				bool up = a[i - 1][j] == '.';
				bool left = a[i][j - 1] == '.';
				if (a[i][j] == '.' && i > 1 && j > 1 && up && left) {
					cnt[i][j] = add(cnt[i][j], cnt[i - 1][j] + cnt[i][j - 1]);
				} else if(i > 1 && up) {
					cnt[i][j] = cnt[i - 1][j];
				} else if (j > 1 && left) {
					cnt[i][j] = cnt[i][j - 1];
				}
			}
		}
	}

	cout << cnt[1][1];

}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:56: error: void value not ignored as it ought to be
   35 |                                         cnt[i][j] = add(cnt[i][j], cnt[i - 1][j] + cnt[i][j - 1]);
      |                                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

const int N = 1010;
const int md = 1e9 + 7;

int h, w;
char a[N][N];
int cnt[N][N];

inline void add(int a, int b) {
	a += b;
	if (a >= md) {
		a -= md;
	}
}

int route(int i, int j) {
	if (i == 1 && j == 1) {
		return 1;
	}
	int &res = cnt[i][j];
	if (res > 0) {
		return res;
	}
	if (a[i][j] == '.') {
		if (a[i - 1][j] == '.' && a[i][j - 1]) {
			res = add(res, route(i - 1, j) + route(i, j - 1));
		} else if (a[i - 1][j] == '.') {
			res = route(i - 1, j);
		} else if (a[i][j - 1] == '.') {
			res = route(i, j - 1);
		}
	}
	return res;
}

int main() {
	cin >> h >> w;

	for (int i = 1; i <= h; ++i) {
		for (int j = 1; j <= w; ++j) {
			cin >> a[i][j];
		}
	}

	cout << route(h, w) << endl;
}

Compiler output:
a.cc: In function 'int route(int, int)':
a.cc:28:34: error: void value not ignored as it ought to be
   28 |                         res = add(res, route(i - 1, j) + route(i, j - 1));
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Main {
    static final int UNCALC = -1;
    static final long INF = (long) 1e18;
    static final int mod = (int) (1e9 + 7);
    static int n, m;
    static char[][] grid;
    static int memo[][];

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        n = sc.nextInt();
        m = sc.nextInt();
        grid = new char[n][m];
        for (int i = 0; i < n; i++)
            grid[i] = sc.next().toCharArray();
        memo = new int[n][m];
        for (int[] a : memo)
            Arrays.fill(a, UNCALC);
        out.println(Math.max(0,dp(0, 0)));
        out.flush();
        out.close();

    }

    static int dp(int x, int y) {
        if (x == n - 1 && y == m - 1) return 1;
        if (!valid(x, y)) return 0;
        if (memo[x][y] != UNCALC) return memo[x][y];
        int right = dp(x + 1, y);
        int down = dp(x, y + 1);
        return memo[x][y] = add(right,down);
    }

    static boolean valid(int x, int y) {
        return x < n && y < m && grid[x][y] != '#';
    }

    static int add(int a, int b) {
        return ((a+b) % mod);
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }


    }

}

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

#include <bits/stdc++.h>

using namespace std;

char grid[1003][1003];

long long solve(int n, int m){
  	swap(n,m);
	dp[m-1][n-1] = 1;
    for (int slice = (m+n-2); slice >=0; --slice) {
        //printf("Slice %d: ", slice);
        int z1 = slice < n ? 0 : slice - n + 1;
        int z2 = slice < m ? 0 : slice - m + 1;
        for (int j = slice - z2; j >= z1; --j) {
          		int curx = j;
          		int cury = slice-j;
          		if(grid[curx][cury]!='.'){
                	dp[curx][cury] = 0;
                  	continue;
                }
          		if(curx+1<m){
                	dp[curx][cury]  += dp[curx+1][cury];
                }
          		if(cury+1<n){
                	dp[curx][cury]  += dp[curx][cury+1];
                }
          		dp[curx][cury] = dp[curx][cury]%1000000007;
        }
    }
  	return dp[0][0];
}

int main(){
	int n,m;
  	scanf("%d %d",&n,&m);
    for(int i = 0; i<n; ++i){
    	scanf("%s",grid[i]);
    }
  	long long ans = solve(n,m);
  	cout<<ans<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'long long int solve(int, int)':
a.cc:9:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
    9 |         dp[m-1][n-1] = 1;
      |         ^~
      |         dup