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

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=1;i<=n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int solve(int n)
{
	int n;
	int ans = 1;
	veci x(n + 1);
	int num = n; // 素因数分解する変数num 
	for (int i = 2; i*i<= n; i++) {
		while (!(num%i)) { // 素数で割り切れなくなるまで割っていく
			x[i]++;　//割った個数を配列に足す
			num /= i;
		}
	}
	for (int i=2;i<=n;i++){	
		ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
	}
	return ans;
}
int main() {
  int n; cin>>n;
  ll ans=0;
  rep(i,n){ans+=solve(i)*i;}
  cout<<ans<<endl;
}

Compiler output:
a.cc:22:32: error: extended character 　 is not valid in an identifier
   22 |                         x[i]++;　//割った個数を配列に足す
      |                                ^
a.cc:27:36: error: extended character 　 is not valid in an identifier
   27 |                 ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
      |                                    ^
a.cc: In function 'int solve(int)':
a.cc:16:13: error: declaration of 'int n' shadows a parameter
   16 |         int n;
      |             ^
a.cc:14:15: note: 'int n' previously declared here
   14 | int solve(int n)
      |           ~~~~^
a.cc:22:32: error: '\U00003000' was not declared in this scope
   22 |                         x[i]++;　//割った個数を配列に足す
      |                                ^~
a.cc:27:36: error: '\U00003000' was not declared in this scope
   27 |                 ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
      |                                    ^~
Language: C++

#include<iostream>
using namespace std;

int f(k){
    int　a;
    if(k % 2 == 0){
        a = 4;
        for(int i = 3; i < k/2;i++){
            if(k%i==0) a++;
        }
    }else{
        a = 2;
        for(int i = 3; i < (k-1)/2;i++){
            if(k%i==0) a++;
        }
    }
    return a;
}

int main(){
    int N;
    std::cin >> N;
    std::cout << N << std::endl;
    int sum = 0;
    for(int i = 1;1 <= N ; i++){
        sum += i*f(i);
    }
    std::cout << sum << std::endl;
    return 0;
}



Compiler output:
a.cc:5:5: error: extended character 　 is not valid in an identifier
    5 |     int　a;
      |     ^
a.cc:4:7: error: 'k' was not declared in this scope
    4 | int f(k){
      |       ^
a.cc: In function 'int main()':
a.cc:26:19: error: 'f' cannot be used as a function
   26 |         sum += i*f(i);
      |                  ~^~~
Language: C

#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <stack>
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define elif else if
#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define append push_back
#define pb push_back
#define str to_string
#define gcd __gcd
#define optimise cout.tie(0);cin.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
using namespace std;
const ll MOD = 998244353;
void solve()
{
    ll n;cin>>n;
    ull ans=0;
    for(ll i=2;i<=n;i++)
        for(ll j=i<<1;j<=n;j+=i)ans+=j;
    cout<<ans+n*(n+1)-1;
}
int main()
{
    optimise
    ll t=1;
    while(t--)solve();
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int dev(int n){
  int c=0;
  if(sqrt(n)%1==0)	c++;
  for(int i=1;i<sqrt(n);i++){
    if(n%i==0)	c+=2;
  }
  return c;
}

int main() {
  int n;
  cin >> n;
  
  long long sum=0;
  for(int i=n;i>0;i--){
    sum += n*dev(n);
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int dev(int)':
a.cc:6:13: error: invalid operands of types '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} and 'int' to binary 'operator%'
    6 |   if(sqrt(n)%1==0)      c++;
      |      ~~~~~~~^~
      |          |   |
      |          |   int
      |          __gnu_cxx::__enable_if<true, double>::__type {aka double}
Language: C++

#include <stdio.h>
#include <stdint.h>

int32_t main(void)
{
    uint64_t n;
    if (scanf("%u", &n) < 0) {
        return 1;
    }

    uint64_t total = 0;
    for (uint64_t i = 1; i <= n; ++i) {
        uint64_t yakusu = 1;
        for (uint64 j = 1; j < i; ++j) {
            if ((i % j) == 0) {
                ++yakusu;
            }
        }

        total += i * yakusu;
    }

    printf("%u", total);
    fflush(stdout);

    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:14:14: error: 'uint64' was not declared in this scope; did you mean 'uint64_t'?
   14 |         for (uint64 j = 1; j < i; ++j) {
      |              ^~~~~~
      |              uint64_t
a.cc:14:28: error: 'j' was not declared in this scope
   14 |         for (uint64 j = 1; j < i; ++j) {
      |                            ^
Language: C++

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

#define ll long long
#define ld long double
#define db double
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)
#define tc int tt=1;cin>>tt;while(tt--)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const ld pi=2*acos(0.0);

const int N=(int)1e7+7;
ll prm[N];

seive(){
    for(int i=2;i<N;i++){
        if(prm[i]==0){
            for(int j=i;j<N;j+=i)
                prm[j]=i;
        }
    }
}

int main(){
    nimble
    seive();
    ll n;
    cin>>n;
    ll as=1;
    for(ll i=2;i<=n;i++){
        ll x=i;
        ll tmp=1;
        while(x>1){
            ll f=0;
            ll y=prm[x];
            while(x%y==0){
                x/=y;
                f++;
            }
            tmp*=(f+1);
        }
        as+=i*tmp;
    }
    cout<<as<<nl;
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

ll yakusuu(ll n){
  ll count=0;
  for(ll i=1;i<=n;i++){
    if(n%i==0)count++;
  }
  return count;
}

int main() {
  ll n;
  cin >> n;
  ll sum=0;
  
  for(ll i=1;i<=n;i++){
    ll yaku;
    yaku=yakusuu(i);
    sum+=i*yaku;
  }
  
  cout < sum << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<'
   25 |   cout < sum << endl;
      |          ~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  long long sum=0;
  for(int i=1;i<=n;i++){
    int count=0;
    for(int j=1;j<=sqrt(i);j++){
      if(i%j==0){
        count+=1;
      }
      sum+=i*count;
    }
    cout<<sum;
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define all(x) (x).begin(), (x).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define inputv(a) forall(i,0,a.size()) cin>>a[i]
#define outputv(a) for(auto i:a) cout<<i<<" ";br;
#define fs first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define minv(a) *min_element(all(a))
#define maxv(a) *max_element(all(a))
#define br cout<<"\n"
using namespace std;
int dr[]={1,-1,0,0};
int dc[]={0,0,1,-1};
ll mod=1000000007;
ll po(ll x,ll n){
    ll res = 1;
    while(n>0){
        if(n%2==1)
            res = ((res)*(x));
        x = (x*x);
        n = n/2;
    }
    return res;
}
ll ceil(ll x,ll y)
{
    if(x%y==0)
        return x/y;
    else
        return(x/y)+1;
}
ll reverse(ll num)
{
     ll n, reversedNumber = 0, remainder;
     n=num;
    while(n != 0)
    {
        remainder = n%10;
        reversedNumber = reversedNumber*10 + remainder;
        n /= 10;
    }
    return reversedNumber;
}
bool divisor(ll n)
{
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
            return 0;
    }
    return 1;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   int n;
   cin>>n;
   int div[n + 1]={0};
    memset(div, 0, sizeof div);

    for (int i = 1; i <= n; i++) {

        for (int j = 1; j * i <= n; j++)
            div[i * j]++;
    }

   ll ans=0;
    for (int i = 1; i <= n; i++)
        ans+=i4*div[i];
    cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:14: error: 'i4' was not declared in this scope; did you mean 'i'?
   74 |         ans+=i4*div[i];
      |              ^~
      |              i
Language: C++

/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

vector<pair<ll,ll>> prime_pow;
void sieveOfEratosthenes(ll N, ll s[]){ 
    vector <bool> prime(N+1, false); 
    for (ll i=2; i<=N; i+=2) 
        s[i] = 2;  
    for (ll i=3; i<=N; i+=2) { 
        if (prime[i] == false) {  
            s[i] = i;  
            for (ll j=i; j*i<=N; j+=2) { 
                if (prime[i*j] == false) { 
                    prime[i*j] = true; 
                    s[i*j] = i; 
                } 
            } 
        } 
    } 
} 
void primefactor(ll N){ 
    ll s[N+1];  
    sieveOfEratosthenes(N, s); 
    ll curr = s[N], cnt = 1;    
    while (N > 1){ 
        N /= s[N];  
        if (curr == s[N]) { 
            cnt++; 
            continue; 
        } 
        prime_pow.push_back({curr,cnt});  
        curr = s[N], cnt = 1; 
    } 
}
ll fac(ll num){
    ll cnt = 0;
    for(auto i=1; i<=sqrt(num);i++){
        if(n%i == 0){
            if(n/i == i) cnt ++;
            else cnt +=2;
        }
    }
    return cnt;
}
void virus(){
        ll num;
        cin>>num;
        ll sum = 0;
        for(auto i=1;i<=num;i++){
            sum += (i * fac(i));
        }    
        cout<<sum;
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Compiler output:
a.cc: In function 'long long int fac(long long int)':
a.cc:63:12: error: 'n' was not declared in this scope
   63 |         if(n%i == 0){
      |            ^
Language: C++

#include<iostream>
#include<
#define ll long long
using namespace std;

int main(){
  ll n,m; cin>>n>>m; ll dp[n+1];
  dp[1]=m*(m-1);
  for(int i=2;i<n;i++){
    dp[i];
  }
  cout<<dp[n];
}

Compiler output:
a.cc:2:10: error: missing terminating > character
    2 | #include<
      |          ^
a.cc:2:9: error: empty filename in #include
    2 | #include<
      |         ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    long N, M, A, B;
    cin >> N >> M;
    if (M<N*2){
        N = M-N;
    }
    ans = N;
    for (int a=N+0;a>0;a--){
        ans = ans*a;
    }
    if (M==N){
        N = N-1;
    }
    A = 0;
    for (int c=M+0;c>0;c--){
        A = A*2+1
    }
    B = A;
    for (int b=A+0;b>0;b--){
        B = B*b;
    }
    cout <<ans*B;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans = N;
      |     ^~~
      |     abs
a.cc:18:18: error: expected ';' before '}' token
   18 |         A = A*2+1
      |                  ^
      |                  ;
   19 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    long N, M, A, B;
    cin >> N >> M;
    if (M<N*2){
        N = M-N;
    }
    long ans = N;
    for (int a=N;a>0;a--){
        ans = ans*a;
    }
    if (M==N){
        N = N-1;
    }
    long A = 0;
    for (int c=M;c>0;c--){
        A = A*2+1
    }
    long B = A;
    for (int b=A;b>0;b--){
        B = B*b;
    }
    cout <<ans*B;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: redeclaration of 'long int A'
   16 |     long A = 0;
      |          ^
a.cc:4:16: note: 'long int A' previously declared here
    4 |     long N, M, A, B;
      |                ^
a.cc:18:18: error: expected ';' before '}' token
   18 |         A = A*2+1
      |                  ^
      |                  ;
   19 |     }
      |     ~             
a.cc:20:10: error: redeclaration of 'long int B'
   20 |     long B = A;
      |          ^
a.cc:4:19: note: 'long int B' previously declared here
    4 |     long N, M, A, B;
      |                   ^
Language: C

#include <iostream>
using namespace std;
int main(void){
    long N, M, A, B;
    cin >> N >> M;
    if (M<N*2){
        N = M-N;
    }
    long ans = N;
    for (int a=N;a>0;a--){
        ans = ans*a;
    }
    if (M==N){
        N = N-1;
    }
    long A = 0;
    for (int c=M;c>0;c--){
        A = A*2+1
    }
    long B = A;
    for (int b=A;b>0;b--){
        B = B*b;
    }
    cout <<ans*B;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int N, M;
    cin >> N >> M;
    int A=M+0;
    int B=M-1;
    for(int a=N;1<a;a--){
        A=A*a;
    }
    for(int b=N;1<b;b--){
        B=B*b;
    }
    cout << (A*B)/;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected primary-expression before ';' token
   14 |     cout << (A*B)/;
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ull = unsigned long long;
#define repi(n) for (int i = 0; i < (n); i++)
#define repj(n) for (int j = 0; j < (n); j++)
#define repk(n) for (int k = 0; k < (n); k++)
#define rep(i, a, b) for (auto i = (a); i < (b); i++)
#define itr(itr) for (auto&& v : (itr))
#define updatemax(t, v) (t = std::max(t, (v)))
#define updatemin(t, v) (t = std::min(t, (v)))
 
#include <boost/operators.hpp>
 
class modint : private boost::operators<modint>, private boost::equivalent<modint> {
  modint(const long long x, const bool y)
      : x(x) {}
 
 public:
  static long long M;
  long long x;
  modint(const long long x = 0)
      : x((x % M + M) % M) {}
  modint operator-() const { return modint(x ? M - x : 0, true); }
  modint& operator+=(const modint& b) { return ((x += b.x) >= M ? x -= M : 0), *this; }
  modint& operator++() { return (++x >= M ? x -= M : 0), *this; }
  modint& operator-=(const modint& b) { return ((x -= b.x) < 0 ? x += M : 0), *this; }
  modint& operator--() { return (--x < 0 ? x += M : 0), *this; }
  modint& operator*=(const modint& b) { return x = x * b.x % M, *this; }
  modint& operator/=(const modint& b) { return *this *= b.pow(-1); }
  modint pow(long long b) const {
    long long r = 1, a = x;
    b = (b % (M - 1) + (M - 1)) % (M - 1);
    while (b) {
      if (b & 1) r = r * a % M;
      b = b >> 1;
      a = a * a % M;
    }
    return modint(r, true);
  }
  friend bool operator<(const modint& a, const modint& b) { return a.x < b.x; }
  friend std::istream& operator>>(std::istream& s, modint& a) { return s >> a.x, a = a.x, s; }
  friend std::ostream& operator<<(std::ostream& s, const modint& a) { return s << a.x; }
};
long long modint::M = 1e9 + 7;
 
main() {
  modint n, m;
  cin >> n >> m;
  modint re(0), nci(1), mpi(1), mipni(1);
  rep(i, modint(0), n) mipni *= m - i;
  rep(i, modint(0), n + 1) {
    re += nci * pow(-1, i) * mpi * mipni.pow(2);
    nci *= n - i;
    nci /= i + 1;
    mpi *= m - i;
    mipni /= m - i;
  }
  cout << re << endl;
}

Compiler output:
a.cc:14:10: fatal error: boost/operators.hpp: No such file or directory
   14 | #include <boost/operators.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define FOR(i, j, k, in) for (int i = j; i < k; i += in)
#define RFOR(i, j, k, in) for (int i = j; i >= k; i -= in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)

constexpr ll mod = 1000000007ll;
vector<ll> p, ip;

ll fpow(ll base, ll exp) {
    ll ret = 1ll;
    while (exp != 0) {
        if (exp % 2 == 1) ret = (ret * base) % mod;
        exp >>= 1;
        base = (base * base) % mod;
    }
    return ret;
}

void init(ll m) {
    p.resize(m + 1);
    ip.resize(m + 1);
    p[0] = 1ll;
    for (ll i = 1; i < m + 1; i++) {
        p[i] = (p[i - 1] * i) % mod;
    }
    ip[m] = fpow(p[m], mod - 2);
    for (ll i = m - 1; i >= 0; i--) ip[i] = ((i + 1ll) * ip[i + 1]) % mod;
}

ll comb(ll a, ll b) {
    ll ret = (p[a] * ip[b]) % mod;
    ret = (ret * ip[a - b]) % mod;
    return ret;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n, m;
    cin >> n >> m;
    init(m);
    ll ans = (comb(m, n) * p[n]) % mod;
    ll sum = 0ll;
    ll sign = -1;
    for (ll k = 0; k < n + 1, k++) {
        sign *= -1;
        ll curr = sign;
        curr = (curr * comb(n, k)) % mod;
        curr = (curr * comb(m - k, n - k)) % mod;
        curr = (curr * p[n - k]) % mod;
        sum = (sum + curr) % mod;
    }
    ans = (ans * sum) % mod;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:34: error: expected ';' before ')' token
   50 |     for (ll k = 0; k < n + 1, k++) {
      |                                  ^
      |                                  ;
Language: C++

//
//  main.cpp
//  ABC172E
#include <iostream>
#include<vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

// auto mod int

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// c(i,j) Combination
// c.p(i,j) Permutation
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint p(int n, int k) {
    return fact[n]*ifact[n-k];
  }
} c(1000005);
mint factrial(int k){
    int f=1;
    for (int i=2; i<=k; i++) {
        f=(f*i)%mod;
    }
    return f%mod;
}
int main(int argc, const char * argv[]) {
    int n,m;
    cin>>n>>m;
    mint c_sum;
    mint p_sum;
    mint ans=0;
    mint a_all=c.p(m,n);
    rep(k,n+1){
        c_sum=c(n,k);
        p_sum=c.p(m-k, n-k);
        if(k%2==0){
            ans+=(c_sum*p_sum);
        } else {
            ans-=(c_sum*p_sum);
        }
    }
    cout<<a_all*ans<<endl;
    return 0;
}


Compiler output:
a.cc: In constructor 'combination::combination(int)':
a.cc:50:5: error: 'assert' was not declared in this scope
   50 |     assert(n < mod);
      |     ^~~~~~
a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    5 | #include<vector>
  +++ |+#include <cassert>
    6 | #define rep(i,n) for (int i = 0; i < (n); ++i)
Language: C++

int mod = 1000000007;
class Solution {
    ll qmul(ll a, ll b) {
        ll res = 1, tp = a;
        while(b) {
            if(b & 1ll) {
                res *= tp;
                res %= mod;
            }
            tp *= tp;
            tp %= mod;
            b >>= 1ll;
        }
        return res;
    }
    ll inv(ll x) {
        return qmul(x, mod - 2);
    }
    vector<ll> p;
public:
    ll e(int N, int M) {
        p = vector<ll>(M + 1, 1);
        for(int i = 1; i <= M; ++i) {
            p[i] = p[i - 1] * i;
            p[i] %= mod;
        }
        ll P1 = 1;
        for(int i = 0; i < N; ++i) {
            P1 *= (M - i);
            P1 %= mod;
        }
        P1 *= P1;
        P1 %= mod;
        ll del = 0;
		ll invt = inv(p[M - N]);
        for(int i = 1; i <= N; ++i) {
            ll nCi = p[N] * inv(p[N - i]) % mod * inv(p[i]) % mod;
            ll tmp = nCi;
            tmp *= p[M]; tmp %= mod;
            tmp *= invt; tmp %= mod;
            tmp *= p[M - i]; tmp %= mod;
            tmp *= invt; tmp %= mod;
            if(i & 1) {
                del += tmp;
            }
            else {
                del -= tmp;
            }
            del = (del + mod) % mod;
        }
        return (P1 - del + mod) % mod;
    }
};

Compiler output:
a.cc:3:5: error: 'll' does not name a type
    3 |     ll qmul(ll a, ll b) {
      |     ^~
a.cc:16:5: error: 'll' does not name a type
   16 |     ll inv(ll x) {
      |     ^~
a.cc:19:5: error: 'vector' does not name a type
   19 |     vector<ll> p;
      |     ^~~~~~
a.cc:21:5: error: 'll' does not name a type
   21 |     ll e(int N, int M) {
      |     ^~
Language: C++

#include<iostream>
#include<vector>

const int MOD = 1e9 + 7;
 
std::vector<long long> fact, fact_inv, inv;
 
void init_nCk(int SIZE) {
    fact.resize(SIZE + 5);
    fact_inv.resize(SIZE + 5);
    inv.resize(SIZE + 5);
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < SIZE + 5; i++) {
        fact[i] = fact[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
}
 
long long nCk(int n, int k) {
    return long long fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
}
long long nPk(int n,int k){

    return long long fact[n]*(fact_inv[n-k]%MOD)%MOD;//

}

int main(){
    int M,N;
    long long temp,ans;
    std::cin>>N>>M;
    init_nCk(N);
        for(int i=0;i<=N;i++){
            temp=nCk(N,i)*(1-i%2*2)*nPk(M,i)*(nPk(M-i,N-i))*(nPk(M-i,N-i));
        }
    ans=nPk(M,N)*nPk(M,N)-temp;
    std::cout<<ans; 
    return 0;
   
}


Compiler output:
a.cc: In function 'long long int nCk(int, int)':
a.cc:23:12: error: expected primary-expression before 'long'
   23 |     return long long fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
      |            ^~~~
a.cc:23:11: error: expected ';' before 'long'
   23 |     return long long fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
      |           ^~~~~
      |           ;
a.cc:23:30: error: expected initializer before '*' token
   23 |     return long long fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
      |                              ^
a.cc: In function 'long long int nPk(int, int)':
a.cc:27:12: error: expected primary-expression before 'long'
   27 |     return long long fact[n]*(fact_inv[n-k]%MOD)%MOD;//
      |            ^~~~
a.cc:27:11: error: expected ';' before 'long'
   27 |     return long long fact[n]*(fact_inv[n-k]%MOD)%MOD;//
      |           ^~~~~
      |           ;
a.cc:27:29: error: expected initializer before '*' token
   27 |     return long long fact[n]*(fact_inv[n-k]%MOD)%MOD;//
      |                             ^
Language: C++

#include<iostream>
#include<vector>

const int MOD=1e9+7;
std::vector<long long>fact,fact_inv,inv;

// 前処理
void init_nCk(int size){
    fact.resize(size+5);
    fact_inv.resize(size+5);
    inv.resize(size+5);
    fact[0]=fact[1]=1;
    fact_inv[0]=1;

        for(int i=2;i<size+5;i++){
            fact[i]=fact[i-1]*i%MOD;
            inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
            fact_inv[i]=fact_inv[i-1]*inv[i]%MOD;
        }
}

long long nCk(int n,int k){

    return fact[n]*(fact_inv[k]*fact_inv[n-k]%MOD)%MOD;

}

long long nPk(int n,int k){

    return fact[n]*fact_inv[n-k]%MOD;

}

int main(){
    int M,N;
    long long temp,ans;
    std::cin>>N>>M;
  init_nCk(int N)
        for(int i=0;i<=N;i++){
            temp=nCk(N,i)*(1-i%2*2)*nPk(M,i)*(nPk(M-i,N-i))*(nPk(M-i,N-i));
        }
    ans=nPk(M,N)*nPk(M,N)-temp;
    std::cout<<ans;     
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: expected primary-expression before 'int'
   38 |   init_nCk(int N)
      |            ^~~
a.cc:39:21: error: 'i' was not declared in this scope
   39 |         for(int i=0;i<=N;i++){
      |                     ^
Language: C++

#include<vector>
#include<iostream>
#include<list>
#include<algorithm>
#include<chrono>
#include<map>
#include<set>
#include<string>
#include<unordered_map>


using namespace std;
typedef long long ll;
const int mod=1e9+7;

ll qpow(ll a,ll n){
    ll res=1;
    while(n)
    {
        if(n&1) res = res*a%mod;
        a=a*a%mod;
        n >> = 1;
    }
    return res;
}

int n,m;
ll ans,f[500005]={1},inv[500005]={1};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >>n >>m;
    for(int i=1;i<=5e5;i++){
        f[i] = f[i-1] * i%mod;
        inv[i] = qpow(f[i],mod-2); //质数模下的逆元，根据费马定理
    }
    for(int i=0;i<=n;i++){
        ans = (ans+ ((i&1)?-1:1)*f[n]*inv[i]%mod*inv[n-i]%mod*f[m]%mod*inv[m-i]%mod*f[m-i]%mod*inv[m-n]%mod*f[m-i]%mod*inv[m-n]%mod)%mod;
    }
    cout<<(ans+mod)%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'll qpow(ll, ll)':
a.cc:22:14: error: expected primary-expression before '=' token
   22 |         n >> = 1;
      |              ^
Language: C++

#include<vector>
#include<iostream>
#include<list>
#include<algorithm>
#include<chrono>
#include<map>
#include<set>
#include<string>
#include<unordered_map>

typedef long long ll;
const int mod=1e9+7;

ll qpow(ll a,ll n){
    ll res=1;
    while(n)
    {
        if(n&1) res = res*a%mod;
        a=a*a%mod;
        n >> = 1;
    }
    return res;
}

int n,m;
ll ans,f[500005]={1},inv[500005]={1};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >>n >>m;
    for(int i=1;i<=5e5;i++){
        f[i] = f[i-1] * i%mod;
        inv[i] = qpow(f[i],mod-2); //质数模下的逆元，根据费马定理
    }
    for(int i=0;i<=n;i++){
        ans = (ans+ ((i&1)?-1:1)*f[n]*inv[i]%mod*inv[n-i]%mod*f[m]%mod*inv[m-i]%mod*f[m-i]%mod*inv[m-n]%mod*f[m-i]%mod*inv[m-n]%mod)%mod;
    }
    cout<<(ans+mod)%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'll qpow(ll, ll)':
a.cc:20:14: error: expected primary-expression before '=' token
   20 |         n >> = 1;
      |              ^
a.cc: In function 'int main()':
a.cc:29:5: error: 'ios' has not been declared
   29 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:30:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   30 |     cin.tie(0);
      |     ^~~
      |     std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout.tie(0);
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:40:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   40 |     cout<<(ans+mod)%mod<<endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

typedef long long ll;
const int mod=1e9+7;

ll qpow(ll a,ll n){
    ll res=1;
    while(n)
    {
        if(n&1) res = res*a%mod;
        a=a*a%mod;
        n >> = 1;
    }
    return res;
}

int n,m;
ll ans,f[500005]={1},inv[500005]={1};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >>n >>m;
    for(int i=1;i<=5e5;i++){
        f[i] = f[i-1] * i%mod;
        inv[i] = qpow(f[i],mod-2); //质数模下的逆元，根据费马定理
    }
    for(int i=0;i<=n;i++){
        ans = (ans+ ((i&1)?-1:1)*f[n]*inv[i]%mod*inv[n-i]%mod*f[m]%mod*inv[m-i]%mod*f[m-i]%mod*inv[m-n]%mod*f[m-i]%mod*inv[m-n]%mod)%mod;
    }
    cout<<(ans+mod)%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'll qpow(ll, ll)':
a.cc:12:14: error: expected primary-expression before '=' token
   12 |         n >> = 1;
      |              ^
a.cc: In function 'int main()':
a.cc:21:5: error: 'ios' has not been declared
   21 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:22:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   22 |     cin.tie(0);
      |     ^~~
      |     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:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout.tie(0);
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:32:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   32 |     cout<<(ans+mod)%mod<<endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#include "../Algo/NumberTheory/modulo.h"

ModuloOps MOD(1e9 + 7);

ModuloNumber calc(int n, int m) {
    return MOD.fact(m) / MOD.fact(m-n);
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n, m;
    cin >> n >> m;
    auto ans = MOD.number(0);
    for (int c = 0; c <= n; c++) {
        ans += (c % 2 == 0 ? 1 : -1) * calc(n-c, m-c) * MOD.comb(n, c);
    }
    ans *= calc(n, m);
    cout << ans.value() << endl;
}


Compiler output:
a.cc:5:10: fatal error: ../Algo/NumberTheory/modulo.h: No such file or directory
    5 | #include "../Algo/NumberTheory/modulo.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
long long INF = (long long)1E17;
#define i_7 (long long)(1E9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE = 500010;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  using namespace std;
  long long n, m;
  cin>>n>>m;
  long long all_cases = po(mod(comb(m, n) * kai[n]), 2);
  long long negate = 0;
  for(long long k = 1; k <= n; k++){
    long long temp = mod(comb(m, k) * kai[k]);
    temp *= po(mod(comb(m - k, n - k) * kai[n - k]), 2);
    temp = mod(temp);
    temp *= comb(n, k);
    temp = mod(temp);
    if(i % 2 == 1){
      negate += temp;
    }else{
      negate -= temp;
    }
    negate = mod(temp);
  }
  long long ans = mod(all_cases - negate);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:8: error: 'i' was not declared in this scope
   67 |     if(i % 2 == 1){
      |        ^
Language: C++

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli M=1e9+7,N=5e5+5;
lli fact[N];

lli binpow(lli a,lli b) 
{
    if (b == 0) return 1;
    lli res = binpow(a,b/2);
    res= (res*res)%M;
    
    if(b%2) return (res*a)%M;
    return res;
}
 
lli inv(lli a)
{
    return binpow(a,M-2);
}

lli add(lli a, lli b)
{
	lli res = a + b;
	if(res >= M)
		return res - M;
	return res;
}
 
lli mul(lli a, lli b)
{
	lli  res = a * b;
		return res % M;
	return res;
}
 
lli sub(lli a, lli b)
{
	return (a%M -b%M +M) %M;
}

void pre()
{
    fact[0]=1;
    for(int i=1;i<N;i++)
        fact[i] = mul(fact[i-1], i);
}

lli npr(lli n, lli r)
{
    return mul(fact[n], inv(fact[n-r]));
}

lli ncr(lli n, lli r)
{
    return mul(fact[n], inv(mul(fact[n-r], fact[r])));    
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    pre();
    
    lli n,m;
    cin>>n>>m;
    lli i, ans=0, rem=0, sign=-1;
    
    ans=mul(npr(m, n), npr(m, n));
    
    for(i=1;i<=n;i++)
    {
        sign*=-1;
        rem=add(rem, mul(mul(mul(mul(ncr(m, i), npr(n, i)), npr(m-i, n-i)), npr(m-i, n-i)), sign))
    }
    ans=sub(ans, rem);
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:99: error: expected ';' before '}' token
   75 |         rem=add(rem, mul(mul(mul(mul(ncr(m, i), npr(n, i)), npr(m-i, n-i)), npr(m-i, n-i)), sign))
      |                                                                                                   ^
      |                                                                                                   ;
   76 |     }
      |     ~
Language: C++

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

const long long N = 500005;
const long long mod = 1000000007;
long long fact[N]; 

void set_fact() {
	fact[0] = 1; for (long long i = 1; i < N; i ++) fact[i] = (fact[i-1] * i) % mod;
}

long long power(long long x, long long y) {
    long long ans = 1;
  	while (y > 0) {
        if (y % 2 == 1) ans = (ans*x) % mod;
        y /= 2; x = (x*x) % mod;  
    } return ans % mod;
}

long long nCr(long long n, long long r) {
	return (fact[n] * power(fact[n - r], mod - 2)) % mod * power(fact[r], mod - 2) % mod;
}

int main() {
    set_fact(); long long n, m; cin >> n >> m; 
    long long fact_arr[n+1]; for (long long i = 0; i <= n; i ++) fact_arr[i] = nCr(n, i);
    long long sgn_arr[n+1]; sgn_arr[0] = 1; for (long long i = 1; i <= n; i++) sgn_arr[i] = sgn_arr[i-1] * (-1);
    long long perm_arr[n+1]; perm_arr[0] = 1;
    for (long long i = 1; i <= n; i ++) perm_arr[i] = (perm_arr[i-1] * ((m-n)+i)) % mod;
    long long ans = 0;
    for (long long fill = 0; fill <= n; fill ++) {
        long long prod = fact_arr[fill] * sgn_arr[fill] * perm_arr[n-fill]
        ans = (ans + prod) % mod;
    } ans = (ans * perm_arr[n]) % mod;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: expected ',' or ';' before 'ans'
   33 |         ans = (ans + prod) % mod;
      |         ^~~
Language: Java

import java.util.*;
import java.io.*;
public class Beg172E{
	static int mod = 1000000007;
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int n = Integer.parseInt(st.nextToken());
      int m = Integer.parseInt(st.nextToken());
      long[] fact = new long[m+1];
      fact[0] = 1;
      for(int i = 1; i <= m; i++)
    	  fact[i] = (fact[i-1]*i)%mod;
      long total = 0;
      int sign = 1;
      for(int i = n; i >= 0; i--) {
    	  long add = (fact[m-n+i]*pow(fact[m-n], mod-2))%mod;
    	  add = (add*pow(fact[n - i], mod-2))%mod;
    	  add = (add*pow(fact[i], mod-2))%mod;
    	  add = (add*fact[n])%mod;
    	  total += sign*add;
    	  total = (total + mod)%mod;
    	  sign *= -1;
      }
      long mult = (fact[m]*pow(fact[m-n], mod-2))%mod;
      total = (total*mult)%mod;
      out.println(total);
      out.close();
   }
   static long pow(long l, int p) {
	   if(p == 1 || l == 1)
		   return l;
	   long root = pow(l, p/2);
	   long temp = (root*root)%mod;
	   if(p%2 == 1)
		   temp = (temp*l)%mod;
	   return temp;
   }
}

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

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MOD  1000000007
#define ll long long
#define int long long 
# define INF 2e5+5
#define ar array
# define fr first
# define sc second
#define wt(x) int x;cin>>x;while(x--)
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
//#define cerr if(false)cerr
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> pbds;

void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
 
#ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);
  freopen("output1.txt","w",stdout);
#endif
 }
 
int power(int a,int b,int mod){
    a=a%mod;
    if(a==0){
        return 1;
    }
    int res=1;
    while(b){
        if(b&1){
            res=(res*a)%mod;
        }
        b>>=1;
        a=(a*a)%mod;
    }
    return res;
 }
 
int  MMI(int p){
    return power(p,MOD-2,MOD);
}
const int mxN=5e5;
int n,m;
int iv[mxN+1],f1[mxN+1],f2[mxN+1];
int nck(int n,int k){
    return f1[n]*f2[k]%mod*f2[n-k]%mod;
}
int32_t main()
{
    c_p_c();
    
    cin>>n>>m;
    iv[1]=1;
    for(int i=2;i<=mxN;i++){
        iv[i]=mod-mod/i*iv[mod%i]%mod;
    }
    f1[0]=f2[0]=1;
    for(int i=1;i<=mxN;i++){
        f1[i]=f1[i-1]*i%mod;
        f2[i]=f2[i-1]*iv[i]%mod;
    }
     int ans=0;
     for(int i=0;i<=n;i++){
        ll c=i&1?M-1:1;
        c=c*nck(n, i)%M*nck(m, i)%M*f1[i]%M*nck(m-i, n-i)%M*nck(m-i, n-i)%M*f1[n-i]%M*f1[n-i]%M;
        ans=(ans+c)%M;
     }
     cout<<ans<<"\n";



    


        



         
 
 
    
      return 0;
       
        }
        
        
 
        
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
        

        


























//abcdef-abcdef
//factorial vs power
//multiplication table
//salary changing
//Obtain a Permutation
//Shift and Replace

Compiler output:
a.cc: In function 'long long int nck(long long int, long long int)':
a.cc:51:24: error: 'mod' was not declared in this scope; did you mean 'modf'?
   51 |     return f1[n]*f2[k]%mod*f2[n-k]%mod;
      |                        ^~~
      |                        modf
a.cc: In function 'int32_t main()':
a.cc:60:15: error: 'mod' was not declared in this scope; did you mean 'modf'?
   60 |         iv[i]=mod-mod/i*iv[mod%i]%mod;
      |               ^~~
      |               modf
a.cc:64:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   64 |         f1[i]=f1[i-1]*i%mod;
      |                         ^~~
      |                         modf
a.cc:69:18: error: 'M' was not declared in this scope
   69 |         ll c=i&1?M-1:1;
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
const ll mod = 1e9+7
ll int fact(ll int n)
{
	if(n==0||n==1)
		return 1;
	return n * fact(n-1) % mod;
}
ll int choose(ll int n, ll int k)
{
	return (fact(n)/(fact(n-k)*fact(k))) % mod;
}
int main()
{
	IOS
	ll int n,m;
	cin>>n>>m;
	ll int k=min(m-n,n);
	ll int s=0;
	ll int ans=0;
	for(ll int i=0;i<=k;i++)
	{
		s+= pow(-1,i)/fact(i);
		ll int b= choose(n,i) * choose(m-n,n-i) * s;
		ans = (ans+b) % mod;
	}
	ans= ans*choose(m,n)%mod;
	cout<<ans;
}

Compiler output:
a.cc:5:12: error: expected ',' or ';' before 'long'
    5 | #define ll long long
      |            ^~~~
a.cc:7:1: note: in expansion of macro 'll'
    7 | ll int fact(ll int n)
      | ^~
a.cc: In function 'long long int choose(long long int, long long int)':
a.cc:15:17: error: 'fact' was not declared in this scope
   15 |         return (fact(n)/(fact(n-k)*fact(k))) % mod;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:27:31: error: 'fact' was not declared in this scope
   27 |                 s+= pow(-1,i)/fact(i);
      |                               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define mod 1e9+7
ll int fact(ll int n)
{
	if(n==0||n==1)
		return 1;
	return n*fact(n-1)%mod;
}
ll int choose(ll int n, ll int k)
{
	return (fact(n)/(fact(n-k)*fact(k)))%mod;
}
int main()
{
	IOS
	ll int n,m;
	cin>>n>>m;
	ll int k=min(m-n,n);
	ll int s=0;
	int ans=0;
	for(ll int i=0;i<=k;i++)
	{
		s+= pow(-1,i)/fact(i);
		b= choose(n,i)*choose(m-n,n-i)*s;
		ans = (ans+b)%mod;
	}
	ans= ans*choose(m,n)%mod;
	cout<<ans;
}

Compiler output:
a.cc: In function 'long long int fact(long long int)':
a.cc:11:27: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   11 |         return n*fact(n-1)%mod;
      |                ~~~~~~~~~~~^
      |                 |
      |                 long long int
a.cc: In function 'long long int choose(long long int, long long int)':
a.cc:15:45: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   15 |         return (fact(n)/(fact(n-k)*fact(k)))%mod;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      |                        |
      |                        long long int
a.cc: In function 'int main()':
a.cc:28:17: error: 'b' was not declared in this scope
   28 |                 b= choose(n,i)*choose(m-n,n-i)*s;
      |                 ^
a.cc:31:29: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   31 |         ans= ans*choose(m,n)%mod;
      |              ~~~~~~~~~~~~~~~^
      |                 |
      |                 long long int
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
int main(){
    ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
    FOR(i,2,n) ansl[i]=((((m-n+i)*(m-n+i-1))%MOD)*((ansl[i-1]+((i-1)*ansl[i-2]))%MOD)%MOD)%MOD;
    cout << ansl[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:77: error: 'MOD' was not declared in this scope
    6 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                                                                             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
int main(){
    ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
    FOR(i,2,n) ansl[i]=((((m-n+i)*(m-n+i-1))%MOD)*((ansl[i-1]+((i-1)*ansl[i-2]))%MOD)%MOD)%MOD;
    cout << ansl[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |     ^~
a.cc:5:21: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                     ^
      |                     yn
a.cc:5:26: error: 'm' was not declared in this scope; did you mean 'tm'?
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                          ^
      |                          tm
a.cc:5:38: error: template argument 2 is invalid
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                                      ^
a.cc:5:50: error: expression list treated as compound expression in initializer [-fpermissive]
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                                                  ^
a.cc:5:57: error: invalid types 'int[int]' for array subscript
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                                                         ^
a.cc:5:77: error: 'MOD' was not declared in this scope
    5 |     ll n, m; cin >> n >> m; vector<ll> ansl(n+1,1); ansl[1]=((m-n+1)*(m-n))%MOD;
      |                                                                             ^~~
a.cc:6:9: error: expected ';' before 'i'
    6 |     FOR(i,2,n) ansl[i]=((((m-n+i)*(m-n+i-1))%MOD)*((ansl[i-1]+((i-1)*ansl[i-2]))%MOD)%MOD)%MOD;
      |         ^
a.cc:3:27: note: in definition of macro 'FOR'
    3 | #define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
      |                           ^
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     FOR(i,2,n) ansl[i]=((((m-n+i)*(m-n+i-1))%MOD)*((ansl[i-1]+((i-1)*ansl[i-2]))%MOD)%MOD)%MOD;
      |         ^
a.cc:3:33: note: in definition of macro 'FOR'
    3 | #define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
      |                                 ^