Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;

string s,w;

vector<int> z;

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

   cin >> n >> m;
   if(Abs(n,m)!=1 && Abs(n,m)!=0){
       Cout(0);
   }
   else{
       if(Abs(n,m)==0){
           rrrep(i,n,0){
               ans*=i;
               ans%=1000000007;
           }
           Cout((ans*4)%1000000007);
       }
       else{
           rrrep(i,n,0){
               ans*=i;
               ans%=1000000007;
           }
           rrrep(i,m,0){
               anss*=i;
               anss%=1000000007;
           }
           Cout((ans*anss)%1000000007);
       }
   }
return 0;
}
#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;

string s,w;

vector<int> z;

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

   cin >> n >> m;
   if(Abs(n,m)!=1 && Abs(n,m)!=0){
       Cout(0);
   }
   else{
       if(Abs(n,m)==0){
           rrrep(i,n,0){
               ans*=i;
               ans%=1000000007;
           }
           Cout((ans*4)%1000000007);
       }
       else{
           rrrep(i,n,0){
               ans*=i;
               ans%=1000000007;
           }
           rrrep(i,m,0){
               anss*=i;
               anss%=1000000007;
           }
           Cout((ans*anss)%1000000007);
       }
   }
return 0;
}


Compiler output:
a.cc:94:11: error: redefinition of 'const int INF'
   94 | const int INF = 1e9,MOD = 1e9 + 7;
      |           ^~~
a.cc:18:11: note: 'const int INF' previously defined here
   18 | const int INF = 1e9,MOD = 1e9 + 7;
      |           ^~~
a.cc:94:21: error: redefinition of 'const int MOD'
   94 | const int INF = 1e9,MOD = 1e9 + 7;
      |                     ^~~
a.cc:18:21: note: 'const int MOD' previously defined here
   18 | const int INF = 1e9,MOD = 1e9 + 7;
      |                     ^~~
a.cc:95:10: error: redefinition of 'const ll LINF'
   95 | const ll LINF = 1e18;
      |          ^~~~
a.cc:19:10: note: 'const ll LINF' previously defined here
   19 | const ll LINF = 1e18;
      |          ^~~~
a.cc:117:15: error: redefinition of 'long long int n'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |               ^
a.cc:41:15: note: 'long long int n' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |               ^
a.cc:117:19: error: redefinition of 'long long int cnt'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                   ^~~
a.cc:41:19: note: 'long long int cnt' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                   ^~~
a.cc:117:25: error: redefinition of 'long long int ans'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                         ^~~
a.cc:41:25: note: 'long long int ans' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                         ^~~
a.cc:117:31: error: redefinition of 'long long int anss'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                               ^~~~
a.cc:41:31: note: 'long long int anss' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                               ^~~~
a.cc:117:38: error: redefinition of 'long long int a'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                      ^
a.cc:41:38: note: 'long long int a' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                      ^
a.cc:117:40: error: redefinition of 'long long int b'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                        ^
a.cc:41:40: note: 'long long int b' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                        ^
a.cc:117:42: error: redefinition of 'long long int c'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                          ^
a.cc:41:42: note: 'long long int c' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                          ^
a.cc:117:44: error: redefinition of 'long long int d'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                            ^
a.cc:41:44: note: 'long long int d' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                            ^
a.cc:117:46: error: redefinition of 'long long int cmp'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                              ^~~
a.cc:41:46: note: 'long long int cmp' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                              ^~~
a.cc:117:50: error: redefinition of 'long long int cmpp'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                  ^~~~
a.cc:41:50: note: 'long long int cmpp' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                  ^~~~
a.cc:117:55: error: redefinition of 'long long int data'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                       ^~~~
a.cc:41:55: note: 'long long int data' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                       ^~~~
a.cc:117:60: error: redefinition of 'long long int m'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                            ^
a.cc:41:60: note: 'long long int m' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                            ^
a.cc:117:62: error: redefinition of 'long long int h'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                              ^
a.cc:41:62: note: 'long long int h' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                              ^
a.cc:117:64: error: redefinition of 'long long int x'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                ^
a.cc:41:64: note: 'long long int x' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                ^
a.cc:117:66: error: redefinition of 'long long int y'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                  ^
a.cc:41:66: note: 'long long int y' previously declared here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                  ^
a.cc:117:68: error: redefinition of 'long long int xcmp'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                    ^~~~
a.cc:41:68: note: 'long long int xcmp' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                    ^~~~
a.cc:117:75: error: redefinition of 'long long int ycmp'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                           ^~~~
a.cc:41:75: note: 'long long int ycmp' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                           ^~~~
a.cc:117:82: error: redefinition of 'long long int sum'
  117 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                                  ^~~
a.cc:41:82: note: 'long long int sum' previously defined here
   41 | long long int n=1,cnt=0,ans=1,anss=1,a,b,c,d,cmp,cmpp,data,m,h,x,y,xcmp=0,ycmp=0,sum=0;
      |                                                                                  ^~~
a.cc:119:8: error: redefinition of 'std::string s'
  119 | string s,w;
      |        ^
a.cc:43:8: note: 'std::string s' previously declared here
   43 | string s,w;
      |        ^
a.cc:119:10: error: redefinition of 'std::string w'
  119 | string s,w;
      |          ^
a.cc:43:10: note: 'std::string w' previously declared here
   43 | string s,w;
      |          ^
a.cc:121:13: error: redefinition of 'std::vector<int> z'
  121 | vector<int> z;
      |             ^
a.cc:45:13: note: 'std::vector<int> z' previously declared here
   45 | vector<int> z;
      |             ^
a.cc:123:5: error: redefinition of 'int main()'
  123 | int main(void){
      |     ^~~~
a.cc:47:5: note: 'int main()' previously defined here
   47 | int main(void){
      |     ^~~~