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

#include<iostream>
using namespace std;

typedef long long ll;
#define MOD 1000000007

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);

    ll n, m;
    scanf("%lld %lld", &n, &m);
    
    if (m < n - 1 || n + 1 < m) {
        printf("%d\n", 0);
        return 0;
    }

    ll ans = 1;
    if (abs(m - n) == 1) {
        maxi = max(m, n)
        for (ll i = 1; i <= maxi; i++) ans = ans * i % MOD;
        ans = ans * (ans / maxi) % MOD;
    } else {
        for (ll i = 1; i <= n; i++) ans = ans * i % MOD;
        ans = ans * ans * 2 % MOD;
    }

    printf("%lld\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'maxi' was not declared in this scope
   21 |         maxi = max(m, n)
      |         ^~~~
a.cc:22:24: error: 'i' was not declared in this scope
   22 |         for (ll i = 1; i <= maxi; i++) ans = ans * i % MOD;
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, m; scanf("%d%d", &n, &m);
    if(abs(n - m) > 1) { 
        printf("0\n");
        return 0;
    }
    // 同数の場合 N! * M! * 2
    // 1個違いの場合 N! * M!
    ll n_kai = 1;
    ll m_kai = 1;
    for(int i = 1; i <= n; i++) n_kai = (n_kai * i) % MOD;
    for(int i = 1; i <= m; i++) m_kai = (m_kai * i) % MOD;

    ll ans = 1;
    if(n == m) {
        ans = (n_kai * m_kai * 2) % MOD;
    }
    else {
        ans = (n_kai * m_kai) % MOD;
    }
    printf("%lld\n", ans % MOD);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'll' was not declared in this scope
   11 |     ll n_kai = 1;
      |     ^~
a.cc:12:7: error: expected ';' before 'm_kai'
   12 |     ll m_kai = 1;
      |       ^~~~~~
      |       ;
a.cc:13:33: error: 'n_kai' was not declared in this scope
   13 |     for(int i = 1; i <= n; i++) n_kai = (n_kai * i) % MOD;
      |                                 ^~~~~
a.cc:13:55: error: 'MOD' was not declared in this scope
   13 |     for(int i = 1; i <= n; i++) n_kai = (n_kai * i) % MOD;
      |                                                       ^~~
a.cc:14:33: error: 'm_kai' was not declared in this scope
   14 |     for(int i = 1; i <= m; i++) m_kai = (m_kai * i) % MOD;
      |                                 ^~~~~
a.cc:14:55: error: 'MOD' was not declared in this scope
   14 |     for(int i = 1; i <= m; i++) m_kai = (m_kai * i) % MOD;
      |                                                       ^~~
a.cc:16:7: error: expected ';' before 'ans'
   16 |     ll ans = 1;
      |       ^~~~
      |       ;
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         ans = (n_kai * m_kai * 2) % MOD;
      |         ^~~
      |         abs
a.cc:18:16: error: 'n_kai' was not declared in this scope
   18 |         ans = (n_kai * m_kai * 2) % MOD;
      |                ^~~~~
a.cc:18:24: error: 'm_kai' was not declared in this scope
   18 |         ans = (n_kai * m_kai * 2) % MOD;
      |                        ^~~~~
a.cc:18:37: error: 'MOD' was not declared in this scope
   18 |         ans = (n_kai * m_kai * 2) % MOD;
      |                                     ^~~
a.cc:21:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |         ans = (n_kai * m_kai) % MOD;
      |         ^~~
      |         abs
a.cc:21:16: error: 'n_kai' was not declared in this scope
   21 |         ans = (n_kai * m_kai) % MOD;
      |                ^~~~~
a.cc:21:24: error: 'm_kai' was not declared in this scope
   21 |         ans = (n_kai * m_kai) % MOD;
      |                        ^~~~~
a.cc:21:33: error: 'MOD' was not declared in this scope
   21 |         ans = (n_kai * m_kai) % MOD;
      |                                 ^~~
a.cc:23:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     printf("%lld\n", ans % MOD);
      |                      ^~~
      |                      abs
a.cc:23:28: error: 'MOD' was not declared in this scope
   23 |     printf("%lld\n", ans % MOD);
      |                            ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
const int MOD = 1e9+7;
using mint = Fp<MOD>
 
int main() {
  int N,M;
  mint A=1;
  int B=0;
  cin>>N>>M;
  if(N==M){
    for(int X=1;X<=N;X++){
      A*=X;
    }
    cout<<A*A*2<<endl;
  }
  else if(abs(N-M)>1){
    cout<<0<<endl;
  }
  else{
    for(int X=1;X<=max(N,M);X++){
      A*=X;
      if(X=min(N,M)){
        B+=A;
      }
    }
    cout<<A*B<<endl;
  }
}


Compiler output:
a.cc:59:14: error: two or more data types in declaration of 'type name'
   59 | using mint = Fp<MOD>
      |              ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define MOD = 1000000007ULL;
#define rep(i,n) for(int i=0;i<n;i++)

int main() {
	ll N,M;
  	cin>>N>>M;
  	ll mod=1;
  
  	rep(i,N) mod=mod*i%MOD;
  	rep(j,M) mod=mod*j%MOD;
  
  	cout<<mod<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before '=' token
    8 | #define MOD = 1000000007ULL;
      |             ^
a.cc:16:28: note: in expansion of macro 'MOD'
   16 |         rep(i,N) mod=mod*i%MOD;
      |                            ^~~
a.cc:8:13: error: expected primary-expression before '=' token
    8 | #define MOD = 1000000007ULL;
      |             ^
a.cc:17:28: note: in expansion of macro 'MOD'
   17 |         rep(j,M) mod=mod*j%MOD;
      |                            ^~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
using namespace std;

#define rep(i, n) for (int i=0; i<int(n); i++)
using ll = long long;


int main() {
	int n, m;
	cin >> n >> m;
	if (abs(n-m)>1) {
		cout << 0 << endl;
		return 0;
	}
	else {
		ll nn = 1;
		int nc = n;
		int mc = m;
		while(n>0) {
			nn *= n;
			nn %= mod;
			n--;
		}
		ll mm = 1;
		while(m>0) {
			mm *= m;
			mm %= mod;
			m--;
		}
		if (nc==mc) cout << (2*mm*nn)%mod << endl;
		else cout << (mm*nn)%mod << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:31: error: 'mod' was not declared in this scope; did you mean 'modf'?
   34 |                         nn %= mod;
      |                               ^~~
      |                               modf
a.cc:40:31: error: 'mod' was not declared in this scope; did you mean 'modf'?
   40 |                         mm %= mod;
      |                               ^~~
      |                               modf
a.cc:43:47: error: 'mod' was not declared in this scope; did you mean 'modf'?
   43 |                 if (nc==mc) cout << (2*mm*nn)%mod << endl;
      |                                               ^~~
      |                                               modf
a.cc:44:38: error: 'mod' was not declared in this scope; did you mean 'modf'?
   44 |                 else cout << (mm*nn)%mod << endl;
      |                                      ^~~
      |                                      modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long int

int facctorialMethod(int k){
    ll sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum = sum*i%(1000000000+7);
    }
    return sum;
}
int main()
{
  
  int n,m;
  ll ans=0;
  cin >> n >>m;
  ll N,M;
  N=facctorialMethod(n);
  M=facctorialMethod(m);
  if(max(n,m)-min(n,m)>1)ans=-1;
  else if(n==m){
    ans = N * M *2　%(1000000000+7);  
  }
  else{
    ans = N * M　%(1000000000+7);
  }
  cout <<ans << endl;
      return 0;
}


Compiler output:
a.cc:24:18: error: extended character 　 is not valid in an identifier
   24 |     ans = N * M *2　%(1000000000+7);
      |                  ^
a.cc:27:15: error: extended character 　 is not valid in an identifier
   27 |     ans = N * M　%(1000000000+7);
      |               ^
a.cc: In function 'int main()':
a.cc:24:18: error: unable to find numeric literal operator 'operator""\U00003000'
   24 |     ans = N * M *2　%(1000000000+7);
      |                  ^~~
a.cc:27:15: error: 'M\U00003000' was not declared in this scope
   27 |     ans = N * M　%(1000000000+7);
      |               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
#include <list>
#include <deque>
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int MOD = 1000000007;
const ll INF = 1LL << 60;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) {return a / GCD(a, b) * b;}

int main()
{
	int N,M;
	cin >> N >> M;
	ll a,b;
	a = 1;
	for(int i = 1; i <= N; i++)
	{
		a *= i;
		a %= MOD;
	}
	b = 1;
	for(int i = 1; i <= M; i++)
	{
		b *= i;
		b %= MOD;
	}
	ll ans = a % MOD * b;
	if(N == M) ans = ans % MOD * 2;
	cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:43:29: error: expected '}' at end of input
   43 |         cout << ans << endl;
      |                             ^
a.cc:25:1: note: to match this '{'
   25 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll r = 1000000007;

ll np(int a){
    ll ans=1;
    while(a>0){
        ans *= a;
        ans %= r
        a--;
    }
    return ans;
}


int main(){
    int n,m;
    cin >> n >> m;
    if(abs(n-m) > 1){
        cout << 0 << endl;
    }
    else if(abs(n-m) == 1){
       cout <<(np(n)*np(m))%r << endl;
    }
    else{
        cout << (2*np(n)*np(m))%r << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'long long int np(int)':
a.cc:11:17: error: expected ';' before 'a'
   11 |         ans %= r
      |                 ^
      |                 ;
   12 |         a--;
      |         ~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;

int main() {
  ll n, m;
  cin >> n >> m;
  if(n-m>1||m-n>1){
    cout << 0 << endl;
    return 0;
    }

    ll a = 1;
  rep(i,n+1){
    a*= i;
    }
    
    ll b = 1;
    rep(i,m+1)){
      b *= i;
    }
    
    if(n==m){
      a*=2;
    }
    cout << a*b%100000007<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected primary-expression before ')' token
   20 |     rep(i,m+1)){
      |               ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 1; (i) < (n); i++)
#define ll long long
using namespace std;

int main(){
  ll n,m;
  cin>>n,m;
  ll ans=0;
  if(n-m>=2||m-n>2){
    cout<<'0'<<endl;
    return 0;
  }
  else if(n-m=1||m-n=1){
    for(ll i=n;i>=1;i--){
      for(ll j=m;j>=1;j--){
        ans=i*j;
      }
    }
  }
  else if(n==m){
    rep(i,n+1){
      rep(j,m+1){
        ans=2*i*j;
      }
    }
  }
  cout<<ans%100000007<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: lvalue required as left operand of assignment
   14 |   else if(n-m=1||m-n=1){
      |               ~^~~~~
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  if (abs(n-m)>1) cout << 0 << endl;
  else {
      long long kaim=1;
      long long kain=1;
      for (int i=2;i<=m;++i){
        kaim*=i;
      }
      for (int i=2;i<=n;++i){
        kain*=i;
      }
      long long ans=2*kain*kain%(1e9+7);
      if (n==m) cout << ans << endl;
      if (n-m==1){
          long long ans=2*n*kaim%(1e9+7);
          cout << ans << endl;
      }
      if (m-n==1){
          long long ans=2*m*kain%(1e9+7);
          cout << ans << endl;
      }
   }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   17 |       long long ans=2*kain*kain%(1e9+7);
      |                     ~~~~~~~~~~~^~~~~~~~
      |                           |         |
      |                           |         double
      |                           long long int
a.cc:20:33: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   20 |           long long ans=2*n*kaim%(1e9+7);
      |                         ~~~~~~~~^~~~~~~~
      |                            |         |
      |                            |         double
      |                            long long int
a.cc:24:33: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   24 |           long long ans=2*m*kain%(1e9+7);
      |                         ~~~~~~~~^~~~~~~~
      |                            |         |
      |                            |         double
      |                            long long int
Language: C++

import math
mod=10**9+7

def main():
    N,M=map(int,input().split())
    ans=0
    
    if abs(N-M)>=2:
        print(0)
    else:
        if N==M:
            ans+=(math.factorial(N)*math.factorial(M))*2
            ans%=mod
            print(ans)
            
        else:
            ans+=(math.factorial(N)*math.factorial(M))
            ans%=mod
            print(ans)
        
if __name__=="__main__":
    main()


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
using Graph = vector<vector<int>>;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}




//-------------------------------------------------
// メモ
/*






*/
//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n, m ;
  cin >> n >> m ;
  
  vll kaizyo(100000+1) ;
  kaizyo[0] = 1 ;
  kaizyo[1] = 1 ; 
  for(ll i=2;i<=100000){
    kaizyo[i] = kaizyo[i-1]*i%MOD ;
  }
    
  if(max(n,m)-min(n,m)>=2;i++){
    cout << 0 <<endl ;
  }
  else{
    if(n==m){
      cout << kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
    else{
      cout << 2*kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
  }
      
  
  
  
  
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:69:23: error: expected ';' before ')' token
   69 |   for(ll i=2;i<=100000){
      |                       ^
      |                       ;
a.cc:73:27: error: 'i' was not declared in this scope
   73 |   if(max(n,m)-min(n,m)>=2;i++){
      |                           ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
using Graph = vector<vector<int>>;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}




//-------------------------------------------------
// メモ
/*






*/
//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n, m ;
  cin >> n >> m ;
  
  vll kaizyo(100000+1) ;
  kaizyo[0] = 1 ;
  kaizyo[1] = 1 ; 
  for(ll i=2;i<=100000){
    kaizyo[i] = kaizyo[i-1]*i%MOD ;
  }
    
  if(max(n,m)-min(n,m)>=2){
    cout << 0 <<endl ;
  }
  else{
    if(n==m){
      cout << kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
    else{
      cout << 2*kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
  }
      
  
  
  
  
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:69:23: error: expected ';' before ')' token
   69 |   for(ll i=2;i<=100000){
      |                       ^
      |                       ;
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
using Graph = vector<vector<int>>;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}




//-------------------------------------------------
// メモ
/*






*/
//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n, m ;
  cin >> n >> m ;
  
  vll kaizyo(100000+1) ;
  kaizyo[0] = 1 ;
  kaizyo[1] = 1 ; 
  for(ll i=2;i<=100000){
    kaizyo[i] = kaizyo[i-1]*i%MOD ;
  }
    
  if(max(n,m)-min(n,m)>=2){
    cout << 0 <<endl ;
  }
  else{
    if(n==m){
      cout << kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
    else{
      cout << 2*kaizyo[n]*kaizyo[m]%MOD <<endl ;
    }
  }
      
  
  
  
  
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:65:3: error: 'vll' was not declared in this scope; did you mean 'll'?
   65 |   vll kaizyo(100000+1) ;
      |   ^~~
      |   ll
a.cc:66:3: error: 'kaizyo' was not declared in this scope
   66 |   kaizyo[0] = 1 ;
      |   ^~~~~~
a.cc:68:23: error: expected ';' before ')' token
   68 |   for(ll i=2;i<=100000){
      |                       ^
      |                       ;
Language: C++

N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
     fact.append(fact[-1]*i%mod)

n,m = map(int, input().split())

if n-m  > 1 or m-n >1:
     ans=0
elif n-m == 0:
     ans = 2*fact[n]*fact[m]%mod
else:
     ans = fact[n] * fact[m] % mod
print(ans)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = 10**6
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

using ll = long long;

ll factorial(ll x) {
    if (x==0 || x==1) return 1;
    return ((x % 1000000007) * factorial(x-1)) % 1000000007;
}

int main() {
    ll n, m;
    cin >> n >> m;
    ll a = max(n, m);
    ll b = min(n, m);
    if ( a > b+1 ) {
        cout << 0 << endl;
    } else if ( a == b+1 ) {
        ll temp = factorial(b);
        cout << (temp*factrial(a)) % 1000000007 << endl;
    } else if(a == b) {
        ll temp = factorial(b);
        cout << (temp*temp*2)% 1000000007 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'factrial' was not declared in this scope; did you mean 'factorial'?
   24 |         cout << (temp*factrial(a)) % 1000000007 << endl;
      |                       ^~~~~~~~
      |                       factorial
Language: C++

// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const ll MOD = TEN(9) + 7;
int n, m;

ll fact(ll x) {
    ll ans = 1;
    forn1(i, x) {
        ans = ans * i % MOD;
    }
    return ans;
}

int main() {
    fastio();

    cin >> n >> m;
    if (abs(n - m) >= 2) {
        cout << 0 << endl;
        return 0;
    }

    ll x = fact(n);
    ll y = fact(m)

        //cout << x * y % MOD * (n == m ? 2 : 1) % MOD << endl;
        while (true);
    cout << "ce" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:9: error: expected ',' or ';' before 'while'
   62 |         while (true);
      |         ^~~~~
Language: C++

// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const ll MOD = TEN(9) + 7;
int n, m;

ll fact(ll x) {
    ll ans = 1;
    forn1(i, x) {
        ans = ans * i % MOD;
    }
    return ans;
}

int main() {
    fastio();

    cin >> n >> m;
    if (abs(n - m) >= 2) {
        cout << 0 << endl;
        return 0;
    }

    ll x = fact(n);
    ll y = fact(m)

    //cout << x * y % MOD * (n == m ? 2 : 1) % MOD << endl;
    
    cout << "ce" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:5: error: expected ',' or ';' before 'cout'
   63 |     cout << "ce" << endl;
      |     ^~~~
Language: C++

#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;

ll MOD = 1000000007;

int main(){

    ll N, M; cin >> N >> M;

    if(N + 1 < M || M + 1 < N){
        cout << 0 << endl;
        return;
    }

    ll ans = 1;

    for(ll i = N; i > 0; i--){
        ans *= i;
        ans %= MOD;
    }
    for(ll i = M; i > 0; i--){
        ans *= i;
        ans %= MOD;
    }

    if(N == M){
        ans *= 2;
        ans %= MOD;
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   14 |         return;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int A,B,ans=0;
  cin>>A>>B;
  if(abs(A-B)<=1){
    ans=1;
    REP(i,2,N){
      ans*=i;
      ans%=MOD;
    }
    REP(i,2,M){
      ans*=i;
      ans%=MOD;
    }
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'N' was not declared in this scope
   20 |     REP(i,2,N){
      |             ^
a.cc:4:48: note: in definition of macro 'REP'
    4 | #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
      |                                                ^
a.cc:24:13: error: 'M' was not declared in this scope
   24 |     REP(i,2,M){
      |             ^
a.cc:4:48: note: in definition of macro 'REP'
    4 | #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
      |                                                ^
Language: C++

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

ll fact(ll a) {
  ll ret = 1;
  for (ll i = 1; i <= a; ++i) ret *= a;
  return ret%mod;
}

int main() {
  ll n,m; cin >> n >> m;
  ll mod = 1000000000+7;
  if (abs(n-m) > 1) cout << 0 << endl;
  else {
    ll ans = 0;
  	if (n==m) ans = 2*fact(n)*fact(n);
    else ans = fact(n)*fact(m);
    cout << ans%mod << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'long long int fact(long long int)':
a.cc:8:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
    8 |   return ret%mod;
      |              ^~~
      |              modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int n,m,ansn,ansm;
  cin >> n >> m;
  
  ansn = 1;
  ansm = 1;
  
  if(n==m){
   for (n ;n>0;--n){ 
     ansn *= n;  
   }
   for (m ;m>0;--m){ 
     ansm *= m;  
   }
    cout << ansn * ansm%1000000007 << endl;
    break;
  }
  else if ( n+1 == m || n-1 == m){
    for (n ;n>0;--n){ 
     ansn *= n;  
   }
   for (m ;m>0;--m){ 
     ansm *= m;  
   }
    cout << 2*ansn * ansm%1000000007 << endl;
    break;
  }
  else {
    cout << 0 << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: break statement not within loop or switch
   19 |     break;
      |     ^~~~~
a.cc:29:5: error: break statement not within loop or switch
   29 |     break;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int n,m,ansn,ansm;
  cin >> n >> m;
  
  ansn = 1;
  ansm = 1;
  
  if(n==m){
   for (n ;n>0;--n){ 
     ansn *= n;  
   }
   for (m ;m>0;--m){ 
     ansm *= m;  
   }
    cout << ansn * ansm%1000000007 << endl;
    break; }
  else if ( n+1 == m || n-1 == m){
    for (n ;n>0;--n){ 
     ansn *= n;  
   }
   for (m ;m>0;--m){ 
     ansm *= m;  
   }
    cout << 2*ansn * ansm%1000000007 << endl;
    break; }
  else {
    cout << 0 << endl;
    break;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: break statement not within loop or switch
   19 |     break; }
      |     ^~~~~
a.cc:28:5: error: break statement not within loop or switch
   28 |     break; }
      |     ^~~~~
a.cc:31:5: error: break statement not within loop or switch
   31 |     break;
      |     ^~~~~
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)


int Len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}


int Sint(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int GCD(int a,int b)
{
  int r, tmp;
   /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}


long long int Factorial(long long int n){
  int m=1;
  while(n>=1) m*=n,m%=mod,n--;
  return m;
}


int Svec(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  long long int n,m,ans;
  cin>>n>>m;
  ans=(Factorial(n)*Factorial(m))%mod;
  if(n%2==m%2){
    ans*=2;
  }
  cout<<ans%mod<<endl:
}
///////////////////////////




Compiler output:
a.cc: In function 'int main()':
a.cc:63:22: error: expected ';' before ':' token
   63 |   cout<<ans%mod<<endl:
      |                      ^
      |                      ;
Language: C++

#include <stdio.h>
#include <iostream>
using namespace std;


const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

int main(){
    long long N, M;
    std::cin >> N >> M;
    #printf("%d", 0);
    COMinit();
    if (M == N){
        printf("%lld\n", ((fac[N] * fac[M]) % MOD * 2) % MOD);
    }
    else if (M == N + 1 | M + 1 == N){
        printf("%lld\n", (fac[N] * fac[M]) % MOD);
    }
    else{
        printf("%d\n", 0);
    }
    return 1;
}


Compiler output:
a.cc:26:6: error: invalid preprocessing directive #printf
   26 |     #printf("%d", 0);
      |      ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

long long int MOD = 1000000007;

int main(){
  int M, D;
  cin >> M >> D;
  if(abs(M - D) > 1){
    cout << 0;
    return 1;
  }else{
    long long int ans = 1LL;
    for(int i = M; i >=1; i--){
      ans *= i;
      ans %= MOD;
    }
    
    for(int i = N; i >=1; i--){
      ans *= i;
      ans %= MOD;
    }
    ans *=2;
    cout << ans;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'N' was not declared in this scope
   21 |     for(int i = N; i >=1; i--){
      |                 ^
Language: C++

#include <isotream>
#include <vector>

using namespace std;

long long int MOD = 1000000007;

int main(){
  int M, D;
  cin >> M >> D;
  if(abs(M - D) > 1){
    cout << 0;
    return 1;
  }else{
    long long int ans = 1LL;
    for(int i = M; i >=1; i--){
      ans *= i;
      ans %= MOD;
    }
    
    for(int i = N; i >=1; i--){
      ans *= i;
      ans %= MOD;
    }
    ans *=2;
    cout << ans;
  }
}

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

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

constexpr int32_t MOD = 1e9 + 7; //10^9

template<int32_t MAX> struct cominit{
    int64_t Fac[MAX], Finv[MAX], Inv[MAX];
    constexpr cominit(): Fac(), Finv(), Inv(){
        Fac[0] = Fac[1] = 1;
        Finv[0] = Finv[1] = 1;
        Inv[1] = 1;
        for (int i = 2; i < MAX; i++){
            Fac[i] = Fac[i - 1] * i % MOD;
            Inv[i] = MOD - Inv[MOD%i] * (MOD / i) % MOD;
            Finv[i] = Finv[i - 1] * Inv[i] % MOD;
        }        
    }
    
};

//#define int int64_t
signed main()
{
    constexpr auto com = cominit<MAX>();
	int n, m; cin >> n >> m;
    if(abs(n-m)>=2){
        cout << 0 << endl;
    }
    else{
        if(n>m || m > n){
            cout << com.Fac[n]*com.Fac[m]%MOD << endl;
        }
        else
        {
            cout << (com.Fac[n]*com.Fac[m]%MOD)*2%MOD << endl;
        }
        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:34: error: 'MAX' was not declared in this scope
   24 |     constexpr auto com = cominit<MAX>();
      |                                  ^~~
a.cc:24:37: error: template argument 1 is invalid
   24 |     constexpr auto com = cominit<MAX>();
      |                                     ^
Language: C++

#include<iostream>
#define M 1000000007L
long n,m;long f(long x){return x-1?x*f(x-1):1;}
main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*max(0,2-abs(n-m));}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*max(0,2-abs(n-m));}
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:46: error: 'max' was not declared in this scope; did you mean 'std::max'?
    4 | main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*max(0,2-abs(n-m));}
      |                                              ^~~
      |                                              std::max
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
#define M 1000000007L
long n,m;long f(long x){return x-1?x*f(x-1):1}
main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*fmax(0,2-abs(n-m));}

Compiler output:
a.cc: In function 'long int f(long int)':
a.cc:3:46: error: expected ';' before '}' token
    3 | long n,m;long f(long x){return x-1?x*f(x-1):1}
      |                                              ^
      |                                              ;
a.cc: At global scope:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*fmax(0,2-abs(n-m));}
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:46: error: 'fmax' was not declared in this scope
    4 | main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*fmax(0,2-abs(n-m));}
      |                                              ^~~~
Language: C

#include<iostream>
#include<cmath>
long f(long x){if(x==1)return 1l;return x*f(x-1)%1000000007;}
int main()
{
	long n,m;std::cin>>n>>m;
	if(abs(n-m)<2)std::cout<<(abs(n-m)<2?f(n)*f(m)%1000000007*(2-abs(n-m))%1000000007:0)<<std::endl;
}

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

#include<bits/stdc++.h>
using namespace std;
using long long = ll;
const ll mod=1e9+7;
int main(){
  ll n,m,ans=1; cin>>n >>m;
  if(abs(n-m)>1){
    cout<<0<<endl;
    return 0;
  }
  if(n==m)ans=2;
  for(int i=1;i<=n;i++){
    ans*=i;
    ans%=mod;
  }
  for(int i=1;i<=m;i++){
    ans*=i;
    ans%=mod;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'long'
    3 | using long long = ll;
      |       ^~~~
a.cc:4:7: error: 'll' does not name a type
    4 | const ll mod=1e9+7;
      |       ^~
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll n,m,ans=1; cin>>n >>m;
      |   ^~
a.cc:6:22: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   ll n,m,ans=1; cin>>n >>m;
      |                      ^
      |                      yn
a.cc:6:26: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |   ll n,m,ans=1; cin>>n >>m;
      |                          ^
      |                          tm
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   if(n==m)ans=2;
      |           ^~~
      |           abs
a.cc:13:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     ans*=i;
      |     ^~~
      |     abs
a.cc:14:10: error: 'mod' was not declared in this scope; did you mean 'modf'?
   14 |     ans%=mod;
      |          ^~~
      |          modf
a.cc:17:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     ans*=i;
      |     ^~~
      |     abs
a.cc:18:10: error: 'mod' was not declared in this scope; did you mean 'modf'?
   18 |     ans%=mod;
      |          ^~~
      |          modf
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   cout<<ans<<endl;
      |         ^~~
      |         abs
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++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

int n;//頂点数
int parent[100010];//iの親parent[i]を格納する配列
int my_rank[100010];//iを根とする部分木の高さみたいな量?
void init(int n){
    for(int i=0;i<n;i++){
        parent[i]=i;
        my_rank[i]=0;
    }
}
int root(int x){
    if(parent[x]==x)return x;
    else return root(parent[x]);
}
void unite(int x,int y){
    x=root(x);
    y=root(y);
    if(x==y)return ;
    if(my_rank[x]<my_rank[y])parent[x]=y;
    else{
        parent[y]=x;
        if(my_rank[x]==my_rank[y])my_rank[x]++;
    }
}
bool same(int x,int y){
    return root(x)==root(y);
}
struct edge {int u,v,cost;};
bool comp(const edge& e1,const edge& e2){
    return e1.cost<e2.cost;
}

vector <edge> edges;
//vector <pair<int,int>>p1,p2;
int kruskal(){
    sort(edges.begin(),edges.end(),comp);
    init(n);
    long long res=0;
    rep(i,edges.size()){
        edge e=edges[i];
        if(!same(e.u,e.v)){
            unite(e.u,e.v);
            res += (long long)e.cost;
        }
    }
    return res;
}

int main(){
  cin>>n;
  
  int x,y;
  vector<pair<int,int>> xs,ys;
  REP(i,n){
    cin>>x>>y;
    xs.push_back(make_pair(x,i));
    ys.push_back(make_pair(y,i));
  }
  
  sort(xs.begin(),xs.end());
  sort(ys.begin(),ys.end());
  
  REP(i,n-1){
    edge e;
    e.u = xs[i].second;
    e.v = xs[i+1].second;
    e.cost = xs[i+1].first - xs[i].first;
    edges.push_back(e);
  }
  REP(i,n-1){
    edge e;
    e.u = ys[i].second;
    e.v = ys[i+1].second;
    e.cost = ys[i+1].first - ys[i].first;
    edges.push_back(e);
  }
  
  long long ans;
  ans = kruskal();
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int kruskal()':
a.cc:52:9: error: 'i' was not declared in this scope
   52 |     rep(i,edges.size()){
      |         ^
a.cc:52:5: error: 'rep' was not declared in this scope; did you mean 'res'?
   52 |     rep(i,edges.size()){
      |     ^~~
      |     res
Language: C++

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

llong f(int x){
	llong res=1;
	for(int i=1;i<=x;++i){
		res*=i;
		res%=MOD;
	}
	return res;
}

int main(){
	int n,m;
	cin>>n>>m;
	
	if(abs(n-m)>1){
		cout<<0<<endl;
		return 0;
	}
	
	llong ans=f(n);
	ans*=f(m);
	ans%=MOD;
	
	if(abs(n-m)==0){
		ans*=2;
		ans%=MOD;
	}
	
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'llong f(int)':
a.cc:9:22: error: 'MOD' was not declared in this scope
    9 |                 res%=MOD;
      |                      ^~~
a.cc: In function 'int main()':
a.cc:25:14: error: 'MOD' was not declared in this scope
   25 |         ans%=MOD;
      |              ^~~
Language: C++

#include <bits/stdc++.h>

#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

using namespace std;

/**
 * calculate GCD(greatest common divisor)
 * @param a
 * @param b
 * @return
 */
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

/**
 * change minimum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMinimum(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * change maximum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMaximum(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * output answer
 * @tparam T
 * @param answer
 * @return
 */
template<typename T>
T output(T answer) {
    cout << answer << endl;
    return 0;
}

/** ----from here ---------------------------------------------------------- */


ll facctorialMethod(ll k) {
    ll sum = 1;
    for (ll i = 1; i <= k; ++i) {
        sum *= i;
    }
    return sum;
}

int main() {
    ll N, M;
    cin >> N >> M;
    ll max = max(N, M);
    ll min = min(N, M);

    ll k = facctorialMethod(max - 1);
    ll kk = facctorialMethod(min);
    ll ans = k * kk * max;
    ans = ans % (10e + 9);

    cout << ans << endl;
}

Compiler output:
a.cc:97:18: error: exponent has no digits
   97 |     ans = ans % (10e + 9);
      |                  ^~~
a.cc: In function 'int main()':
a.cc:91:17: error: 'max' cannot be used as a function
   91 |     ll max = max(N, M);
      |              ~~~^~~~~~
a.cc:92:17: error: 'min' cannot be used as a function
   92 |     ll min = min(N, M);
      |              ~~~^~~~~~
Language: Java

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		solve();
    }
    
    static long MOD = (long)1e9+7;

	public static long fact(long x) {
		long ret = 1;
		for(int i = 1; i <=x ; i++)
			ret = ret * i % MOD;
		return ret;
	}
 
	public static long count(long n, long m) {
		if(Math.abs(n-m) > 1)
			return 0;
		long tmp = fact(n) * fact(m) % MOD;
		if(n == m) return 2 * tmp % mod;
		else return tmp;
	}

	public static void solve() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        sc.close();
        out.println(count(n,m));
        out.flush();
	}
}

Compiler output:
Main.java:28: error: cannot find symbol
		if(n == m) return 2 * tmp % mod;
		                            ^
  symbol:   variable mod
  location: class Main
1 error
Language: C++

#include<iostream>

using namespace std;

long long abs(long long x,long long y){ long c;
  if( x >= y){ c = x - y;}
  else{c = y - x;}
                    return c;}

long long Fac( long long n){
     int rep = 1;
  for(int i = 1; i <= n; i++){ 
     rep = rep * j;  rep = rep % 1000000007;} 
   
  
  return rep;}
    


int main()
{long long N, M ; cin >> N >> M;
 
 if(abs(N,M) == 1){cout << Fac( M ) * Fac( N ) % 1000000007 << endl;}
 else if(abs(N,M) == 0){cout << 2*Fac( M ) * Fac( N ) % 1000000007 << endl;}
 else{cout << 0 << endl;}
 
 return 0;}


Compiler output:
a.cc: In function 'long long int Fac(long long int)':
a.cc:13:18: error: 'j' was not declared in this scope
   13 |      rep = rep * j;  rep = rep % 1000000007;}
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    cin>>a>>b;
    cout<<a*b*2;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'a' was not declared in this scope
    4 |     cin>>a>>b;
      |          ^
a.cc:4:13: error: 'b' was not declared in this scope
    4 |     cin>>a>>b;
      |             ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const long long mod 1e9+7;
int main() {
  long long n,m,ans=1;
  cin >> n >> m;
  if(abs(n-m)>1) {
    cout << 0 << endl;
    return 0;
  }
  for(long long i=2; i<=n; i++) {
    ans*=i;
    ans%=mod;
  }
  for(long long i=2; i<=m; i++) {
    ans*=i;
    ans%=mod;
  }
  if(n==m) {
    ans=ans*2%mod;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:5:21: error: expected initializer before numeric constant
    5 | const long long mod 1e9+7;
      |                     ^~~
a.cc: In function 'int main()':
a.cc:15:10: error: 'mod' was not declared in this scope; did you mean 'modf'?
   15 |     ans%=mod;
      |          ^~~
      |          modf
a.cc:19:10: error: 'mod' was not declared in this scope; did you mean 'modf'?
   19 |     ans%=mod;
      |          ^~~
      |          modf
a.cc:22:15: error: 'mod' was not declared in this scope; did you mean 'modf'?
   22 |     ans=ans*2%mod;
      |               ^~~
      |               modf
Language: C++

#include <bits/stdc++.h> 

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

ll fact(ll n) {
    if (n == 1) {
        return 1;
    } else {
        return (n * fact(n - 1)) % MOD;
    }
}

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, M;
    cin >> N >> M;

    ll ans = 0;
    if (abs(N-M) == 0) {
        ans = fact(N)*fact(M)*2
        ans %= MOD;
    } else if (abs(N-M) == 1) {
        ans = fact(N)*fact(M);
        ans %= MOD;
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:37:32: error: expected ';' before 'ans'
   37 |         ans = fact(N)*fact(M)*2
      |                                ^
      |                                ;
   38 |         ans %= MOD;
      |         ~~~