Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>

#define pb push_back
#define mp make_pair
#define taskname "A"

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef tree <int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const int maxn = 3e2 + 5;
const int mod = 1e9 + 7;

int f[maxn][maxn][maxn];
int n ,m;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if(fopen(taskname".INP","r")){
		freopen(taskname".INP", "r",stdin);
		freopen(taskname".OUT", "w",stdout);
    }
    cin >> n >> m;
    f[0][1][1] = 1;
    for(int i = 0 ; i < m ; ++i){
        for(int j = 1 ; j <= n ; ++j){
            for(int t = 1 ; t <= j ; ++t){
                auto add = [&](int & x , int y){
                    x += y;if(x>=mod)x-=mod;
                };
                add(f[i + 1][j + 1][t] , (ll)f[i][j][t] * (n - j) % mod);//
                add(f[i + 1][j][t] , (ll)f[i][j][t] * (j - t) % mod);
                add(f[i + 1][j][j] , (ll)f[i][j][t] * t % mod);
            }
        }
    }
    cout << f[m][n][n];
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>

#define pb push_back
#define mp make_pair
#define taskname "A"

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef tree <int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const int maxn = 3e2 + 5;
const int mod = 1e9 + 7;

int f[maxn][maxn][maxn];
int n ,m;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if(fopen(taskname".INP","r")){
		freopen(taskname".INP", "r",stdin);
		freopen(taskname".OUT", "w",stdout);
    }
    cin >> n >> m;
    f[0][1][1] = 1;
    for(int i = 0 ; i < m ; ++i){
        for(int j = 1 ; j <= n ; ++j){
            for(int t = 1 ; t <= j ; ++t){
                auto add = [&](int & x , int y){
                    x += y;if(x>=mod)x-=mod;
                };
                add(f[i + 1][j + 1][t] , (ll)f[i][j][t] * (n - j) % mod);//
                add(f[i + 1][j][t] , (ll)f[i][j][t] * (j - t) % mod);
                add(f[i + 1][j][j] , (ll)f[i][j][t] * t % mod);
            }
        }
    }
    cout << f[m][n][n];
}


Compiler output:
a.cc:63:11: error: redefinition of 'const int maxn'
   63 | const int maxn = 3e2 + 5;
      |           ^~~~
a.cc:17:11: note: 'const int maxn' previously defined here
   17 | const int maxn = 3e2 + 5;
      |           ^~~~
a.cc:64:11: error: redefinition of 'const int mod'
   64 | const int mod = 1e9 + 7;
      |           ^~~
a.cc:18:11: note: 'const int mod' previously defined here
   18 | const int mod = 1e9 + 7;
      |           ^~~
a.cc:66:5: error: redefinition of 'int f [305][305][305]'
   66 | int f[maxn][maxn][maxn];
      |     ^
a.cc:20:5: note: 'int f [305][305][305]' previously declared here
   20 | int f[maxn][maxn][maxn];
      |     ^
a.cc:67:5: error: redefinition of 'int n'
   67 | int n ,m;
      |     ^
a.cc:21:5: note: 'int n' previously declared here
   21 | int n ,m;
      |     ^
a.cc:67:8: error: redefinition of 'int m'
   67 | int n ,m;
      |        ^
a.cc:21:8: note: 'int m' previously declared here
   21 | int n ,m;
      |        ^
a.cc:69:5: error: redefinition of 'int main()'
   69 | int main()
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main()
      |     ^~~~