Language: Java

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main()
{
    long long int n,a[51][51],i,j,k,x,y,z,l;
    cin>>n>>k;
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
    vector<long long int >dp(n,1);
    for(i=0;i<k;i++)
    {
        vector<long long int>new_dp(n,0);
        for(j=0;j<n;j++)
        {
            for(l=0;l<n;l++)
            {
                if(a[j][l])
                new_dp[l]=(new_dp[l]+dp[j]+mod)%mod;
            }
        }
        dp=new_dp;
    }
    long long int ans=0;
    for(i=0;i<n;i++)
    ans=(ans+dp[i]+mod)%mod;
    cout<<ans;
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: illegal character: '#'
#define mod 1000000007
^
Main.java:3: error: class, interface, enum, or record expected
#define mod 1000000007
        ^
Main.java:7: error: class, interface, enum, or record expected
    cin>>n>>k;
    ^
Main.java:8: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
    ^
Main.java:8: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
            ^
Main.java:8: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
                ^
Main.java:8: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
                            ^
Main.java:8: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)for(j=0;j<n;j++)cin>>a[i][j];
                                ^
Main.java:9: error: class, interface, enum, or record expected
    vector<long long int >dp(n,1);
    ^
Main.java:10: error: class, interface, enum, or record expected
    for(i=0;i<k;i++)
    ^
Main.java:10: error: class, interface, enum, or record expected
    for(i=0;i<k;i++)
            ^
Main.java:10: error: class, interface, enum, or record expected
    for(i=0;i<k;i++)
                ^
Main.java:13: error: class, interface, enum, or record expected
        for(j=0;j<n;j++)
        ^
Main.java:13: error: class, interface, enum, or record expected
        for(j=0;j<n;j++)
                ^
Main.java:13: error: class, interface, enum, or record expected
        for(j=0;j<n;j++)
                    ^
Main.java:15: error: class, interface, enum, or record expected
            for(l=0;l<n;l++)
                    ^
Main.java:15: error: class, interface, enum, or record expected
            for(l=0;l<n;l++)
                        ^
Main.java:19: error: class, interface, enum, or record expected
            }
            ^
Main.java:22: error: class, interface, enum, or record expected
    }
    ^
Main.java:24: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)
    ^
Main.java:24: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)
            ^
Main.java:24: error: class, interface, enum, or record expected
    for(i=0;i<n;i++)
                ^
Main.java:26: error: class, interface, enum, or record expected
    cout<<ans;
    ^
Main.java:27: error: class, interface, enum, or record expected
    return 0;
    ^
Main.java:28: error: class, interface, enum, or record expected
}
^
27 errors