Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

using int64 = long long;

map< int64, int > prime_factor(int64 n)
{
	map< int64, int > ret;
	for (int64 i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return (ret);
}

int calc(int n) {
	int ret = 1;
	while (n) {
		ret *= n;
		ret %= MOD;
		n--;
	}
	return ret;
}

int calc2(int n, int limit) {
	int ret = 1;
	while (limit) {
		ret *= n;
		ret %= MOD;
		limit--;
	}
	return ret;
}

signed main() {
	int n, m;
	cin >> n >> m;
	map<int64, int> mp = prime_factor(m);
	int sum = 1;
	for (auto e : mp) {
		sum += e.second;
	}
	cout << "DEBUG" << endl;
	cout << (calc(n) * calc2(n, sum - n)) % MOD << endl;
	return 0;
}#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

using int64 = long long;

map< int64, int > prime_factor(int64 n)
{
	map< int64, int > ret;
	for (int64 i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return (ret);
}

int64 mod_pow(int64 x, int64 n, int64 mod)
{
	int64 ret = 1;
	while (n > 0) {
		if (n & 1) (ret *= x) %= mod;
		(x *= x) %= mod;
		n >>= 1;
	}
	return ret;
}


int calc(int n) {
	int ret = 1;
	while (n) {
		ret *= n;
		ret %= MOD;
		n--;
	}
	return ret;
}

signed main() {
	int n, m;
	cin >> n >> m;
	map<int64, int> mp = prime_factor(m);
	int sum = 1;
	for (auto e : mp) {
		sum += e.second;
	}
	cout << "sum:" << sum << endl;
	cout << (calc(n) * mod_pow(n, sum - n, MOD)) % MOD << endl;
	return 0;
}

Compiler output:
a.cc:54:2: error: stray '#' in program
   54 | }#include <bits/stdc++.h>
      |  ^
a.cc:54:3: error: 'include' does not name a type
   54 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:57:11: error: redefinition of 'const long long int INF'
   57 | const int INF = 1e9 + 7, MOD = 1e9 + 7;
      |           ^~~
a.cc:4:11: note: 'const long long int INF' previously defined here
    4 | const int INF = 1e9 + 7, MOD = 1e9 + 7;
      |           ^~~
a.cc:57:26: error: redefinition of 'const long long int MOD'
   57 | const int INF = 1e9 + 7, MOD = 1e9 + 7;
      |                          ^~~
a.cc:4:26: note: 'const long long int MOD' previously defined here
    4 | const int INF = 1e9 + 7, MOD = 1e9 + 7;
      |                          ^~~
a.cc:58:17: error: redefinition of 'const long long int LINF'
   58 | const long long LINF = 1e18;
      |                 ^~~~
a.cc:5:17: note: 'const long long int LINF' previously defined here
    5 | const long long LINF = 1e18;
      |                 ^~~~
a.cc:59:11: error: redefinition of 'const long long int dx [4]'
   59 | const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
      |           ^~
a.cc:6:11: note: 'const long long int dx [4]' previously defined here
    6 | const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
      |           ^~
a.cc:59:34: error: redefinition of 'const long long int dy [4]'
   59 | const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
      |                                  ^~
a.cc:6:34: note: 'const long long int dy [4]' previously defined here
    6 | const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
      |                                  ^~
a.cc:63:19: error: redefinition of 'std::map<long long int, long long int> prime_factor(int64)'
   63 | map< int64, int > prime_factor(int64 n)
      |                   ^~~~~~~~~~~~
a.cc:10:19: note: 'std::map<long long int, long long int> prime_factor(int64)' previously defined here
   10 | map< int64, int > prime_factor(int64 n)
      |                   ^~~~~~~~~~~~
a.cc:88:5: error: redefinition of 'long long int calc(long long int)'
   88 | int calc(int n) {
      |     ^~~~
a.cc:23:5: note: 'long long int calc(long long int)' previously defined here
   23 | int calc(int n) {
      |     ^~~~
a.cc:98:8: error: redefinition of 'int main()'
   98 | signed main() {
      |        ^~~~
a.cc:43:8: note: 'int main()' previously defined here
   43 | signed main() {
      |        ^~~~