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

#include<bits/stdc++.h>
using namespace std;
#define abs(x) (x<0?(-x):x)
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define RF(i,L,R) for (int i = L; i > R; i--)
#define RFE(i,L,R) for (int i = L; i >= R; i--)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define ll long long
#define INF 1000000000000000000
#define nINF -2000000000
#define MOD 1e9+7
#define PI 3.1415926535897932384626
vector<int> edge[100005];
int n,m,dp[100005],vis[100005];
struct p{
	int id,dis;
};
void bfs(int id,int depth){
	queue<p> Q;
	dp[id]=max(dp[id],depth);
	Q.push((p){id,depth});
	while(!Q.empty()){
		p now=Q.front();
		Q.pop();
		vis[now.id]=1;
		F(i,0,edge[now.id].size()){
			dp[edge[now.id][i]]=max(dp[edge[now.id][i]],now.dis+1);
			if(edge[now.id][i].size()) Q.push((p){edge[now.id][i],dp[edge[now.id][i]]});
		}
	}
	return;
}
int main(){
	while(~getII(n,m)){
		FE(i,1,n){
			dp[i]=0,vis[i]=0;
			edge[i].clear();
		}
		F(i,0,m){
			VgetII(u,v);
			edge[u].push_back(v);
		}
		FE(i,1,n) if(!vis[i]) bfs(i,0);
		int ans=-1;
		FE(i,1,n) if(dp[i]>ans) ans=dp[i];
		printf("%d\n",ans);
	}
}


Compiler output:
a.cc: In function 'void bfs(int, int)':
a.cc:34:44: error: request for member 'size' in 'edge[now.p::id].std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   34 |                         if(edge[now.id][i].size()) Q.push((p){edge[now.id][i],dp[edge[now.id][i]]});
      |                                            ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;vector<int>e[1<<17],o(1<<17,0);d(int w){if(!o[w])for(auto x:e[w])d(x),o[w]=max(o[w],o[x]+1);}main(){int a=0,u,v,n,m;cin>>n>>m;while(m--)cin>>u>>v,e[u].push_back(v);for(;m++<n;)d(m),a=max(a,o[m]);cout<<a;}

Compiler output:
a.cc:2:52: error: ISO C++ forbids declaration of 'd' with no type [-fpermissive]
    2 | using namespace std;vector<int>e[1<<17],o(1<<17,0);d(int w){if(!o[w])for(auto x:e[w])d(x),o[w]=max(o[w],o[x]+1);}main(){int a=0,u,v,n,m;cin>>n>>m;while(m--)cin>>u>>v,e[u].push_back(v);for(;m++<n;)d(m),a=max(a,o[m]);cout<<a;}
      |                                                    ^
a.cc: In function 'int d(int)':
a.cc:2:113: warning: no return statement in function returning non-void [-Wreturn-type]
    2 | using namespace std;vector<int>e[1<<17],o(1<<17,0);d(int w){if(!o[w])for(auto x:e[w])d(x),o[w]=max(o[w],o[x]+1);}main(){int a=0,u,v,n,m;cin>>n>>m;while(m--)cin>>u>>v,e[u].push_back(v);for(;m++<n;)d(m),a=max(a,o[m]);cout<<a;}
      |                                                                                                                 ^
a.cc: At global scope:
a.cc:2:114: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;vector<int>e[1<<17],o(1<<17,0);d(int w){if(!o[w])for(auto x:e[w])d(x),o[w]=max(o[w],o[x]+1);}main(){int a=0,u,v,n,m;cin>>n>>m;while(m--)cin>>u>>v,e[u].push_back(v);for(;m++<n;)d(m),a=max(a,o[m]);cout<<a;}
      |                                                                                                                  ^~~~
Language: C++

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

int n,m,a,b;

vector <int> v;
vector < vector <int> > graf (100001,v);
vector <int> rj(100001,0);
vector <int> todo;


int maxv = -100001;

int rek(int cvor,int sum,int bio[]){
    for(int i=0;i<graf[cvor].size();i++){
            if(bio[graf[cvor][i]]!=0){
            sum+=rek(graf[cvor][i],1,bio);
            
    
    }else{
    sum+=rj[graf[cvor][i]];      
    }
            
    }
    
    return sum;
    }

int main(){
    int bio[100001] = {0};
    cin>>n>>m;
    for(int i=0;i<n;i++){
    cin>>a>>b;
    todo.push_back(a);
    graf[a].push_back(b);     
} 
    for(int i=0;i<todo.size();i++){
            if(rj[todo[i]]==0){
                  rj[todo[i]]=rek(todo[i],0,bio[]);    
            }
    maxv= max(maxv,rj[todo[i]]);
    }
    cout<<maxv;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:49: error: expected primary-expression before ']' token
   43 |                   rj[todo[i]]=rek(todo[i],0,bio[]);
      |                                                 ^
Language: C++

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

vector<int> v[100005];
int vis[100005];
int fans[100005];

int dfs(int n)
{
    if(fans[n]!=-1)
        return fans[n];
    int ans = 0;
    for(int i = 0 ; i<v[n].size() ; i++)
    {
        ans = max(ans , 1 + dfs(v[n][i]));
    }
    return fans[i] = ans;
}

int main()
{
    int node , edge;

    cin >> node >> edge;

    for(int i = 1 ; i<=edge ; i++)
    {
        int x , y;

        cin >> x >> y;

        v[x].push_back(y);
    }

    int ans = 0;

    for(int i = 1 ; i<=node ; i++)
    {
        ans = max(ans , dfs(i));
    }

    cout << ans;


    return 0;
}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:17:17: error: 'i' was not declared in this scope
   17 |     return fans[i] = ans;
      |                 ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int n,m,dp[200009],ans;
vector<int>v[200002];

int dfs(int x){
  if(dp[x]!=-1)return dp[x];

  int res=0;
  for(int i=0;i<v[x].size();i++){
    res=max(res,dfs(v[x][i])+1);
  }
  return dp[x]=res;
}


int main(){
  memset(dp,-1,sizeof(dp));
  cin>>n>>m;
  while(m--){
    int x,y;
    cin>>x>>y; x--; y--;
    v[x].push_back(y);
  }
  while(n--) ans=max(ans,dfs(n));

  cout<<ans<<endl;
}


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

#include <iostream>
#include <vector>

using namespace std;

int n,m,dp[200009],ans;
vector<int>v[200002];

int dfs(int x){
  if(dp[x]!=-1)return dp[x];

  int res=0;
  for(int i=0;i<v[x].size();i++){
    res=max(res,dfs(v[x][i])+1);
  }
  return dp[x]=res;
}


int main(){
  memset(dp,-1,sizeof(dp));
  cin>>n>>m;
  while(m--){
    int x,y;
    cin>>x>>y; x--; y--;
    v[x].push_back(y);
  }
  while(n--){
    ans=max(ans,dfs(n-1));
  }
  cout<<ans<<endl;
}


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

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

int dp[10008];
void dfs(int i,int dis, vector<int> pairs[]){
	for(auto x=pairs[i].begin();x!=pairs[i].end();++x){
		if(dp[*x]<dis+1)
			dp[*x]=dis+1;
		dfs(*x,dis+1,pairs);
	}
}
int main() {
	int m,n;
	cin>>m>>n;
	vector<int> pairs[m+1];
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		pairs[x].push_back(y);


Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: expected '}' at end of input
   19 |                 pairs[x].push_back(y);
      |                                       ^
a.cc:16:29: note: to match this '{'
   16 |         for(int i=0;i<n;i++){
      |                             ^
a.cc:19:39: error: expected '}' at end of input
   19 |                 pairs[x].push_back(y);
      |                                       ^
a.cc:12:12: note: to match this '{'
   12 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector< vector<long long int> >v;
vector<long long int>vis,dist;
dfs(long long int i)
{
	vis[i]=1;
	for(long long int j=0;j<v[i].size();j++)
	{
		if(dist[v[i][j]]<=dist[i]+1)
		{
			dist[v[i][j]]=dist[i]+1;
		//	cout<<v[i][j]<<" "<<dist[i]+1<<"     ";
			dfs(v[i][j]);
		}
	}
}
int main()
{
	ios_base::sync_with_stdio;
	cin.tie(NULL);
	cout.tie(NULL);
	long long int i,j,k,l,m,n,max1=0;;
	cin>>n>>m;
	v.resize(n+1);
	vis.resize(n+1);
	dist.resize(n+1);
	for(i=0;i<m;i++)
	{
		cin>>j>>k;
		v[j].push_back(k);
	}
	for(i=1;i<n+1;i++)
	{
		if(vis[i]==0)
		{
			dist[i]=0;
			dfs(i);
		}
	}
//	cout<<endl;
	for(i=1;i<n+1;i++)
	{
		//cout<<dist[i]<<" ";
			if(dist[i]>max1)
			max1=dist[i];
	}
	cout<<max1;
	return 0;
}

Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
    5 | dfs(long long int i)
      | ^~~
a.cc: In function 'int dfs(long long int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
Language: C++

//** aman**//
#include<bits/stdc++.h>
#define	MIN(a,b,c)	min(min(a,b),c)
#define	MAX(a,b,c)	max(max(a,b),c)
#define ll          long long
#define itr         vector<int>::iterator
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define mem(a,b) memset(a,b,sizeof(a))
#define sz size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define Vit std::vector<int>:: iterator
#define Sit std::set<int>:: iterator
#define Mit std::map<int,int>:: iterator
#define lbo lower_bound
#define ub upper_bound
#define bs          binary_search
#define N         100005
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;
vector<int> G[100005],v;
int in[N],vis[N],dp[N];
int main()
{
	int n,m;cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int x,y;cin>>x>>y;
		G[x].pb(y);
		in[y]++;
	}
	priority_queue<int, vector<int>, greater<int> > q;
	for(int i=1;i<=n;i++)
	{
		if(in[i]==0){
		q.push(i);
		dp[i]=0;
		}
	}
	while(!q.empty())
	{
		int p=q.top();
		q.pop();
		for(int i=0;i<G[p].size();i++)
		{
			if(!vis[G[p][i]]){
			in[G[p][i]]--;
			if(in[G[p][i]]==0){q.push(G[p][i]);dp[G[p][i]]=dp[p]+1;}
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		ans=max(ans,dp[i]);
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:2: error: expected '}' at end of input
   64 | }
      |  ^
a.cc:32:1: note: to match this '{'
   32 | {
      | ^
Language: C++

#include <BITS/STDC++.H>

using namespace std;

const int INF = (1 << 30);
int n, m, viz[100002], dist[100002];
vector<int>g[100002];
stack<int>st;

void dfs (int x) {
  for (int i = 0; i < g[x].size(); i++) {
    if (viz[g[x][i]] == 0) {
      viz[g[x][i]] = 1;
      dfs(g[x][i]);
    }
  }
  st.push(x);
}

int main()
{
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
  }
  for (int i = 1; i <= n; i++) {
    if (viz[i] == 0) {
      viz[i] = 1;
      dfs(i);
    }
  }
  for (int i = 1; i <= n; i++)
    dist[i] = -INF;
  while (st.empty() == false) {
    int u = st.top();
    st.pop();
    if (dist[u] == -INF)
      dist[u] = 0;
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      if (dist[v] < dist[u] + 1)
        dist[v] = dist[u] + 1;
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    ans = max(ans, dist[i]);
    cout << ans;
  return 0;
}


Compiler output:
a.cc:1:10: fatal error: BITS/STDC++.H: No such file or directory
    1 | #include <BITS/STDC++.H>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;

int n, m, dp[N], deg[N];
vector <int> g[N];
bool in[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        int u, v;
        cin >> u >> v;
        deg[v]++;
        g[u].push_back(v);
    }
    
    memset(dp, -0x3f, sizeof dp);
    queue <int> q;
    for (int i = 1; i <= n; i++) if (!deg[i]) dp[i] = 0, q.push(i), in[i] = 1;
    while (!q.empty()) {
        int u = q.front(); q.pop(); in[i] = 0;
        for (auto v: g[u]) {
            if (dp[v] < dp[u] + 1) {
                dp[v] = dp[u] + 1;
                if (!in[v]) in[v] = 1, q.push(v);
            }
        }
    }
    
    cout << *max_element(dp + 1, dp + n + 1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:40: error: 'i' was not declared in this scope
   27 |         int u = q.front(); q.pop(); in[i] = 0;
      |                                        ^
Language: C++

#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define ALL(obj) (obj).begin(),(obj).end()

const ll MOD = (ll)1e9 + 7;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

template<class T> void corner(bool flg, T hoge) {
	if (flg) {
		cout << hoge << endl;
		exit(0);
	}
	else return;
}

template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {
	o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;
}

template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {
	o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}

template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {
	o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;
}

template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {
	o << "{" << obj.first << ", " << obj.second << "}"; return o;
}

template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {
	o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}

void print(void) {
	cout << endl;
}

template <class Head> void print(Head&& head) {
	cout << head;
	print();
}

template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {
	cout << head << " ";
	print(forward<Tail>(tail)...);
}

void YN(bool flg) {
	cout << ((flg) ? "YES" : "NO") << endl;
}

void Yn(bool flg) {
	cout << ((flg) ? "Yes" : "No") << endl;
}

void yn(bool flg) {
	cout << ((flg) ? "yes" : "no") << endl;
}



int main() {

  int n,m;
  cin >>n>>m;
  V<ll> d(n),dp(n,0);
  V<V<ll>> e(n)
  REP(i,n){
    int a,b;
    cin>>a>>b;
    a--;b--;
    e[a].push_back(b);
    d[b]++;
  }
  queue<int>q;
  REP(i,n)if(d[i]==0)q.push(i);
  while(q.size()){
    int p=q.front();
    q.pop();
    REP(j,)
  
  }

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected ',' or ';' before 'for'
   24 | #define REP(i,n) for(int i = 0; i < int(n); i++)
      |                  ^~~
a.cc:95:3: note: in expansion of macro 'REP'
   95 |   REP(i,n){
      |   ^~~
a.cc:95:7: error: 'i' was not declared in this scope
   95 |   REP(i,n){
      |       ^
a.cc:24:33: note: in definition of macro 'REP'
   24 | #define REP(i,n) for(int i = 0; i < int(n); i++)
      |                                 ^
a.cc:109:3: error: expected primary-expression before '}' token
  109 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using namespace atcoder;
using lli = long long;
using mint = modint1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

lli h, w;

int main(void){
    cin >> h >> w;
    vector<string> m(h);
    rep(i, h) cin >> m[i];
    vector<vector<mint>> dp(h+1, vector<mint>(w+1));
    dp[0][0] = 1;
    rep(i, h){
        rep(j, w){
            if(m[i][j] == '#') continue;
            if(i+1 < h && m[i+1][j] != '#') dp[i+1][j]+=dp[i][j];
            if(j+1 < w && m[i][j+1] != '#') dp[i][j+1]+=dp[i][j];
        }
    }
    cout << dp[h-1][w-1].val() << endl;
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: atcoder/modint: No such file or directory
    2 | #include<atcoder/modint>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
void grid(int n,int m,string s[])
{
  int dp[n+1][m+1]={0};
  int f=0;
  
  for(int i=0;i<m;i++)
  {
     if(s[0][i]=='#')
     f=1;
     if(f==0)
      dp[0][i]=1;
  }
  
  f=0;
  for(int i=0;i<n;i++)
  {
     if(s[i][0]=='#')
     f=1;
    if(f==0)
      dp[i][0]=1;
   }
  
  for(int i=1;i<n;i++)
  {
    for(int j=1;j<m;j++)
    {
      if(s[i][j]=='#')
        dp[i][j] = 0;
      else
        dp[i][j] = dp[i-1][j] + dp[i][j-1]
    }
  }
  cout<<dp[n-1][m-1]<<endl;
}
int main()
{
 	int n,m;
  cin>>n>>m;
  string s[n];
  for(int i=0;i<n;i++)
    cin>>s[i];
  
  int dp[n+1][m+1]={0};
  grid(n,m,s);
}

Compiler output:
a.cc: In function 'void grid(int, int, std::string*)':
a.cc:32:43: error: expected ';' before '}' token
   32 |         dp[i][j] = dp[i-1][j] + dp[i][j-1]
      |                                           ^
      |                                           ;
   33 |     }
      |     ~
Language: Java

import java.util.*;

public class AllPaths {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] line = scanner.nextLine().split(" ");
        int rows = Integer.parseInt(line[0]);
        int cols = Integer.parseInt(line[1]);

        char[][] matrix = new char[rows][cols];

        for (int r = 0; r < rows; r++) {
            matrix[r] = scanner.nextLine().toCharArray();
        }

        long[][] dp = new long[rows][cols];
        dp[0][0] = 1;
        int c = 0;
        while (c < cols && matrix[0][c] != '#') {
            dp[0][c] = 1;
            c++;
        }

        int r = 0;
        while (r < rows && matrix[r][0] != '#') {
            dp[r][0] = 1;
            r++;
        }
        
        for (r = 1; r < rows; r++) {
            for (c = 1; c < cols; c++) {
                if (matrix[r][c] != '#') {
                    dp[r][c] = dp[r - 1][c] + dp[r][c - 1];
                }
            }
        }
        
        System.out.println((dp[rows - 1][cols - 1]) % 1000000007);
    }
}


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

20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 20 20
      | ^~
Language: C++

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

int Paths(char arr[][500], int r, int c){
	int dp[r+1][c+1];
	for(int i = 0; i <= r; i++){
		for(int j = 0; j <= c; j++){
			if(i == 0 || j == 0 || arr[i][j] == '#'){
				dp[i][j] = 0;
			}else if(i == 1 && j == 1){
				dp[i][j] = 1;
			}else{
				dp[i][j] = dp[i-1][j] + dp[i][j-1];
			}
		}
	}

	return dp[r][c];
}



int main(){

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int r, c;
	cin>>r>>c;
	char arr[500][500];#include<iostream>
#include <climits>
#include<vector>
#include<cstring>
#define mod 1000000007
using namespace std;

long long int Paths(char arr[][500], int r, int c){
	long long int dp[r+1][c+1];
	for(int i = 0; i <= r; i++){
		for(int j = 0; j <= c; j++){
			if(i == 0 || j == 0 || arr[i][j] == '#'){
				dp[i][j] = 0;
			}else if(i == 1 && j == 1){
				dp[i][j] = 1;
			}else{
				dp[i][j] = ((dp[i-1][j] % mod) + (dp[i][j-1]%mod) )% mod;
			}
		}
	}

	return dp[r][c];
}



int main(){

	int r, c;
	cin>>r>>c;
	char arr[500][500];
	for(int i = 1; i <= r; i++){
		for(int j = 1; j <= c; j++){
			cin>>arr[i][j];
		}
	}
	
	cout<<Paths(arr, r, c);

}
	for(int i = 1; i <= r; i++){
		for(int j = 1; j <= c; j++){
			cin>>arr[i][j];
		}
	}
	
	cout<<Paths(arr, r, c);

}

Compiler output:
a.cc:34:28: error: stray '#' in program
   34 |         char arr[500][500];#include<iostream>
      |                            ^
a.cc: In function 'int main()':
a.cc:34:29: error: 'include' was not declared in this scope
   34 |         char arr[500][500];#include<iostream>
      |                             ^~~~~~~
a.cc:34:45: error: expected primary-expression before '>' token
   34 |         char arr[500][500];#include<iostream>
      |                                             ^
a.cc:39:1: error: expected primary-expression before 'using'
   39 | using namespace std;
      | ^~~~~
a.cc:41:51: error: a function-definition is not allowed here before '{' token
   41 | long long int Paths(char arr[][500], int r, int c){
      |                                                   ^
a.cc:60:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   60 | int main(){
      |         ^~
a.cc:60:9: note: remove parentheses to default-initialize a variable
   60 | int main(){
      |         ^~
      |         --
a.cc:60:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:60:11: error: a function-definition is not allowed here before '{' token
   60 | int main(){
      |           ^
Language: Java

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;

public class PathsOnAGrid
{
    public static final int MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);

//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());

        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        int[][] paths = new int[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1] % MOD);
    }
}

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

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;
 
public class Main
{
    public static final long MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);
 
//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());
 
        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        long[][] paths = new long[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1]);
  

Compiler output:
Main.java:38: error: reached end of file while parsing
        System.out.println(paths[n-1][m-1]);
                                            ^
1 error
Language: Java

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;
 
public class Main
{
    public static final long MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);
 
//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());
 
        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        long[][] paths = new long[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1] % MOD);
  

Compiler output:
Main.java:38: error: reached end of file while parsing
        System.out.println(paths[n-1][m-1] % MOD);
                                                  ^
1 error
Language: Java

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Solution
{
    public static final int MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);

//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());

        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        int[][] paths = new int[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1]);
    }
}

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

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;

public class PathsOnAGrid
{
    public static final int MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);

//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());

        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        int[][] paths = new int[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1]);
    }
}

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

import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;

public class PathsOnAGrid
{
    public static final int MOD = 1_000_000_007;
    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new FileReader("pathsonagrid.txt"));
        Scanner in = new Scanner(System.in);

//        StringTokenizer line = new StringTokenizer(in.readLine());
        StringTokenizer line = new StringTokenizer(in.nextLine());

        int n = Integer.parseInt(line.nextToken());
        int m = Integer.parseInt(line.nextToken());
        
        char[][] grid = new char[n][m];
        for (int i = 0; i < n; i++)
//            grid[i] = in.readLine().trim().toCharArray();
            grid[i] = in.nextLine().trim().toCharArray();
        
        int[][] paths = new int[n][m];
        paths[0][0] = 1;
        for (int r = 0; r < n; r++) {
            for (int c = 0; c < m; c++) {
                if (grid[r][c] == '#')
                    continue;
                try { //look above
                    paths[r][c] += paths[r-1][c] % MOD;
                } catch (Exception e) {}
                try { //look left
                    paths[r][c] += paths[r][c-1] % MOD;
                } catch (Exception e) {}
            }
        }
        
        System.out.println(paths[n-1][m-1]);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.IOException;
      | ^~~~~~
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.Scanner;
      | ^~~~~~
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:5:1: error: expected unqualified-id before 'public'
    5 | public class PathsOnAGrid
      | ^~~~~~
Language: C++

#include <bits/stdc++.h> 
#define ll long long 
const int N = 5000001; 
using namespace std; 
int n,m;
int solve(int row,int column,vector<vector<char> > &v,vector<vector<int> > &dp)
{
    int count=0;
    if((row>=n)||(column>=m))
    return 0;
    if((row==n-1)&&(column==m-1))
    return 1;
    if(v[row][column]=='#')
    return 0;
    if(dp[row][column]!=-1)
        return dp[row][column];
        
        count=(solve(row+1,column,v,dp)%(int)(1e9+7))+(solve(row,column+1,v,dp)%(int)(1e9+7));
    }
    return dp[row][column]=(count%(int)(1e9+7));
}
int main()
{
    cin>>n>>m;
    vector<vector<char> > v( n , vector<char> (m));
    vector<vector<int> > dp( n , vector<int> (m,-1));
    char x;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            cin>>x;
            v[i][j]=x;
        }
    }
    int row=0;int column=0;
    cout<<solve(row,column,v,dp);
}


Compiler output:
a.cc:20:5: error: expected unqualified-id before 'return'
   20 |     return dp[row][column]=(count%(int)(1e9+7));
      |     ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
a.cc: In function 'int solve(int, int, std::vector<std::vector<char> >&, std::vector<std::vector<int> >&)':
a.cc:18:14: warning: control reaches end of non-void function [-Wreturn-type]
   18 |         count=(solve(row+1,column,v,dp)%(int)(1e9+7))+(solve(row,column+1,v,dp)%(int)(1e9+7));
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define ld long double
#define f(a, b) for (ll i = a; i <= b; i++)
#define pb push_back
#define pf push_front
#define mp make_pair
using namespace std;
#define N 200005
const int INF = 1000000001;
const int MOD = 1000000007;
 
int dp[1001][1001]={0};
int ways(int h,int w){
    //int dp[1001][1001]={0};
    if(dp[0][0]==-1){
        return 0;
    }
    for(int j=0;j<w;j++){
        if(dp[0][j]==-1){
            break;
        }
        dp[0][j]=1;
    }
    for(int i=0;i<h;i++){
        if(dp[i][0]==-1){
            break;
        }
        dp[i][0]=1;
    }
    for(int i=1;i<h;i++){
        for(int j=1;j<w;j++){
            if(dp[i][j]==-1)
            continue;
            dp[i][j]=0;
            if(dp[i][j-1]!=-1)
            dp[i][j]=dp[i][j-1] % MOD;;
            if(dp[i-1][j]!=-1){
                dp[i][j]=(dp[i][j]+dp[i-1][j])% MOD;;
            }
        }
    }
    if(dp[h-1][w-1]==-1)
    return 0;
 
    return dp[h-1][w-1];
 
    
}
int main() {
  memset(dp,0,sizeof dp);

    int h,w;
    cin>>h>>w;
   
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
          char no;
            cin>>no;
            if(no=='#'){
                dp[i][j]=-1;
            }
        }
        cout<<ways(h,w);
    }
 
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#define int long long
#define ld long double
#define f(a, b) for (ll i = a; i <= b; i++)
#define pb push_back
#define pf push_front
#define mp make_pair
using namespace std;
#define N 200005
const ll INF = 1000000001;
const int MOD = 1000000007;
 
int dp[1001][1001]={0};
int ways(char grid[1000][1000],int h,int w){
    //int dp[1001][1001]={0};
    if(dp[0][0]==-1){
        return 0;
    }
    for(int j=0;j<w;j++){
        if(dp[0][j]==-1){
            break;
        }
        dp[0][j]=1;
    }
    for(int i=0;i<h;i++){
        if(dp[i][0]==-1){
            break;
        }
        dp[i][0]=1;
    }
    for(int i=1;i<h;i++){
        for(int j=1;j<w;j++){
            if(dp[i][j]==-1)
            continue;
            dp[i][j]=0;
            if(dp[i][j-1]!=-1)
            dp[i][j]=dp[i][j-1] % MOD;;
            if(dp[i-1][j]!=-1){
                dp[i][j]=(dp[i][j]+dp[i-1][j])% MOD;;
            }
        }
    }
    if(grid[h-1][w-1]=='#')
    return 0;

    return dp[h-1][w-1];

    
}
int main() {
    int h,w;
    cin>>h>>w;
    char grid[1000][1000];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>grid[i][j];
            if(grid[i][j]=='#'){
                dp[i][j]=-1;
            }
        }
        cout<<ways(grid,h,w);
    }

}

Compiler output:
a.cc:10:7: error: 'll' does not name a type; did you mean 'ld'?
   10 | const ll INF = 1000000001;
      |       ^~
      |       ld
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f(a, b) for (ll i = a; i <= b; i++)
#define pb push_back
#define pf push_front
#define mp make_pair
using namespace std;
#define N 200005
const ll INF = 1000000001;
const ll MOD = 1000000007;
 
int dp[1001][1001];
int ways(int h,int w){
    //int dp[1001][1001]={0};
    if(dp[0][0]==-1){
        return 0;
    }
    
    for(int j=0;j<w;j++){
        if(dp[0][j]==-1){
            break;
        }
        dp[0][j]=1;
    }
    for(int i=0;i<h;i++){
        if(dp[i][0]==-1){
            break;
        }
        dp[i][0]=1;
    }
    for(int i=1;i<h;i++){
        for(int j=1;j<w;j++){
            if(dp[i][j]==-1)
            continue;
            dp[i][j]=0;
            if(dp[i][j-1]!=-1)
            dp[i][j]=dp[i][j-1] % MOD;;
            if(dp[i-1][j]!=-1){
                dp[i][j]=(dp[i][j]+dp[i-1][j])% MOD;;
            }
        }
    }
    if(dp[h-1][w-1]==-1){
      return 0;}
    //for(int i=0;i<h;i++){
        //for(int j=0;j<w;j++){
            //cout<<dp[i][j]<<" ";
        //}
        cout<<endl;
    }

    return dp[h-1][w-1];

    
}
int main() {
    int h,w;
    cin>>h>>w;
    memset(dp,0,sizeof dp);
    char grid[N][N];
    char x;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            //cin>>grid[i][j];
            cin>>x;
            if(x=='#'){
                dp[i][j]=-1;
            }
        }
        cout<<ways(h,w);
    }

}


Compiler output:
a.cc:53:5: error: expected unqualified-id before 'return'
   53 |     return dp[h-1][w-1];
      |     ^~~~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
a.cc: In function 'int ways(int, int)':
a.cc:50:15: warning: control reaches end of non-void function [-Wreturn-type]
   50 |         cout<<endl;
      |               ^~~~
Language: C++

#include<bits/stdc++.h>
#define MOD 1e9+7
using namespace std;

int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<char>> grid(h, vector<char>(w));
  vector<vector<int>> dp(h, vector<int>(w, 0));
  for(int i=0; i<h; i++) {
 	for(int j=0; j<w; j++) {
     cin >> grid[i][j];
    }
  }
  dp[0][0] = (grid[0][0] == '.') ? 1 : 0;
  for(int i=1; i<h; i++) {
    if(grid[i][0] == '.') {
      dp[i][0] = dp[i-1][0];
    }
  }
  for(int i=1; i<w; i++) {
    if(grid[0][i] == '.') {
      dp[0][i] =dp[0][i-1];
    }
  }
   for(int i=1; i<h; i++) {
 	for(int j=1; j<w; j++) {
     if(grid[i][j] == '.') {
       dp[i][j] = (dp[i][j-1] + dp[i-1][j])%MOD;
     }
    }
  }
  cout << dp[h-1][w-1]%MOD;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:44: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'double' to binary 'operator%'
   29 |        dp[i][j] = (dp[i][j-1] + dp[i-1][j])%MOD;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~^
      |                               |
      |                               __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}
a.cc:33:23: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'double' to binary 'operator%'
   33 |   cout << dp[h-1][w-1]%MOD;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
int h, w;
  cin >> h >> w;
  vector<vector<char>> grid(h, vector<char>(w, 0))
  vector<vector<int>> dp(h, vector<int>(w, -1));
  for(int i=0; i<h; i++) {
 	for(int j=0; j<h; j++) {
     cin >> grid[i][j];
    }
  }
  dp[0][0] = 1;
  for(int i=1; i<h; i++) {
    if(grid[i][0] == '.') {
      dp[i][0] = max(dp[i][0], dp[i-1][0]);
    }
  }
  for(int i=1; i<w; i++) {
    if(grid[0][i] == '.') {
      dp[0][i] = max(dp[0][i], dp[0][i-1]);
    }
  }
   for(int i=1; i<h; i++) {
 	for(int j=1; j<h; j++) {
     if(grid[i][j] == '.') {
       dp[i][j] = dp[i][j-1] + dp[i-1][j];
     }
    }
  }
  return dp[h-1][w-1];
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'vector'
    7 |   vector<vector<int>> dp(h, vector<int>(w, -1));
      |   ^~~~~~
a.cc:13:3: error: 'dp' was not declared in this scope; did you mean 'dup'?
   13 |   dp[0][0] = 1;
      |   ^~
      |   dup
a.cc: At global scope:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  int mod=pow(10,9)+7;
  int n,m;
  cin>>n>>m;
  char a[n][m];
  for(int i=0;i<n;i++)
    for(int j=0;j<m;j++)
      cin>>a[i][j];
  long long dp[n+1][m+1];
  
  dp[n][m]=1;
  for(int i=n;i>=1;i-)
  {
    for(int j=m;j>=1;j--)
    {
      if(a[i-1][j-1]=='#')
        dp[i][j]=0;
      else
      {if(i<n)
          int f=dp[i+1][j];
      if(j<n)
        int f2=dp[i][j+1];
       dp[i][j]=f+f2;
      }
    }
    cout<<dp[1][1]%mod;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: expected primary-expression before ')' token
   16 |   for(int i=n;i>=1;i-)
      |                      ^
a.cc:27:17: error: 'f' was not declared in this scope
   27 |        dp[i][j]=f+f2;
      |                 ^
a.cc:27:19: error: 'f2' was not declared in this scope
   27 |        dp[i][j]=f+f2;
      |                   ^~
a.cc:31:4: error: expected '}' at end of input
   31 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

int main()
{
  int mod=pow(10,9)+7;
  int n,m;
  cin>>n>>m;
  char a[n][m];
  for(int i=0;i<n;i++)
    for(int j=0;j<m;j++)
      cin>>a[i][j];
  long long dp[n+1][m+1];
  
  dp[n][m]=1;
  for(int i=n;i>=1;i-)
  {
    for(int j=m;j>=1;j--)
    {
      if(a[i-1][j-1]='#')
        dp[i][j]=0;
      else
      {if(i<n)
          int f=dp[i+1][j];
      if(j<n)
        int f2=dp[i][j+1];
       dp[i][j]=f+f2;
      }
    }
    cout<<dp[1][1]%mod;
  }
      

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacr'
    2 | using namespacr std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:22: error: expected primary-expression before ')' token
   16 |   for(int i=n;i>=1;i-)
      |                      ^
a.cc:27:17: error: 'f' was not declared in this scope
   27 |        dp[i][j]=f+f2;
      |                 ^
a.cc:27:19: error: 'f2' was not declared in this scope
   27 |        dp[i][j]=f+f2;
      |                   ^~
a.cc:30:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   30 |     cout<<dp[1][1]%mod;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:4: error: expected '}' at end of input
   31 |   }
      |    ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

Q = 10**9 + 7

def f(h, w, field, ans):
    if ans[h][w] >= 0:
        return ans[h][w]
    else:
        ans[h][w] = 0
        fans = 0
        if 1 <= h + 1 <= H and 1 <= w <= W and field[h + 1][w] == ".":
            fans1 = f(h + 1, w, field, ans)
        else:
            fans1 = 0
        if 1 <= h <= H and 1 <= w + 1 <= W and field[h][w + 1] == ".":
            fans2 = f(h, w + 1, field, ans)
        else:
            fans2 = 0
        fans = (fans1 + fans2) % Q
        ans[h][w] = fans
        return fans

H, W = [int(x) for x in input().split()]

field = [' ' for _ in range(H + 1)]

for i in range(1, H + 1):
    field[i] += input()

ans = [[-1 for _ in range(W + 1)] for _ in range(H + 1)]
ans[H][W] = 1

A = f(1, 1, field, ans)

print(A)

Compiler output:
a.cc:1:1: error: 'Q' does not name a type
    1 | Q = 10**9 + 7
      | ^
Language: Java

//package Educ_DP;

import java.util.Scanner;

public class H {
    public static void main(String[] args) {
        int m=1000000007;
        Scanner s = new Scanner(System.in);
        String[] l = s.nextLine().split(" ");
        int row = Integer.parseInt(l[0]);
        int col = Integer.parseInt(l[1]);
        String[] list=new String[row];
        for (int i=0;i<row;i++){
            list[i]=s.nextLine();
        }
        long[][] dp=new long[row][col];
        if (list[0].charAt(0)=='.'){
            dp[0][0]=1;
        }
        for (int i=0;i<row;i++){
            for (int j=0;j<col;j++){
                if (i!=0 || j!=0){
                    if (list[i].charAt(j)=='#'){
                        dp[i][j]=0;
                    }
                    else{
                        if (j==0){
                            dp[i][j]=dp[i-1][j]%m;
                        }
                        else if (i==0){
                            dp[i][j]=dp[i][j-1]%m;
                        }
                        else{
                            dp[i][j]=(dp[i-1][j]+dp[i][j-1])%m;
                        }
                    }
                }
            }
        }
        System.out.println((((dp[row-1][col-1])%m)+m)%m);





    }
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define Mod 1000000007
ll dp[1009][1009];
int main()
{
    ll h, w;
    cin>>h>>w;
    char mat[h+1][w+1];
    for(ll i=1;i<=h;i++)
        for(ll j=1;j<=w;j++)
            cin>>mat[i][j];
    dp[1][1]=1;
    for(ll i=1;i<=h;i++)
        for(ll j=1;j<=w;j++)
        {
            if(mat[i][j]=='#')
                dp[i][j]=0;
            else
                dp[i][j]=(dp[i-1][j]%Mod+dp[i][j-1]%Mod+dp[i][j]%Mod)%Mod;
        }
    cout<<dp[h][n]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'n' was not declared in this scope
   23 |     cout<<dp[h][n]<<endl;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll p=1e9+7;
int main()
{
  int m,n;
  char a[m][n];
  for(int i=0;i<m;i++)
    for(int j=0;j<;n;j++)
      cin>>a[i][j];
 ll dp[m][n];
 int f=0;
 for(int i=0;i<m;i++)
 {
   if(a[i][0]=='.'&&f==0)
     dp[i][0]=1;
   else{
     	dp[i][0]=0;
     	f=1;
   }
   f=0;
   for(int i=0;i<n;i++)
 {
   if(a[i][0]=='.'&&f==0)
     dp[0][i]=1;
   else{
     	dp[0][i]=0;
     	f=1;
   }
   for(int i=1;i<m;i++)
   {
     for(int j=1;j<n;j++)
     {
       if(a[i][j]=='.')
         dp[i][j]=(dp[i-1][j]+dp[i][j-1])%p;
       else
         dp[i][j]=0;
     }
   }
  ll ans=dp[m-1][n-1]%p;
    cout<<ans<<endl;
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected primary-expression before ';' token
   10 |     for(int j=0;j<;n;j++)
      |                   ^
a.cc:10:21: error: expected ')' before ';' token
   10 |     for(int j=0;j<;n;j++)
      |        ~            ^
      |                     )
a.cc:10:22: error: 'j' was not declared in this scope
   10 |     for(int j=0;j<;n;j++)
      |                      ^
a.cc:43:5: error: expected '}' at end of input
   43 |    }
      |     ^
a.cc:15:2: note: to match this '{'
   15 |  {
      |  ^
a.cc:43:5: error: expected '}' at end of input
   43 |    }
      |     ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^