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

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

int main(){
    int n, m, i;
    long long a = 1;
    if(abs(m-n) > 1){
        cout << 0;
    }else{
        for(i=1; i<=n; i++){
            a *= (long long)i;
            a %= 1000000007;
        }
        for(i=1; i<=n; i++){
            a *= (long long)i;
            a %= 1000000007;
        }
        if(a == b){
            a *= 2;
            a %= 1000000007;
        }
        cout << a;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'b' was not declared in this scope
   18 |         if(a == b){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
int main(){
	ll n,m;
	cin >> n >> m;
	ll ans = 1;
	if(max(n,m)-min(n,m) >= 2)ans = 0;
	FOR(i,1,m+1)(ans*=i)%=MOD;
	FOR(i,1,n+1)(ans*=i)%=MOD;
	if(n==m)(ans*=2)%=MOD;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: 'MOD' was not declared in this scope
   10 |         FOR(i,1,m+1)(ans*=i)%=MOD;
      |                               ^~~
a.cc:11:31: error: 'MOD' was not declared in this scope
   11 |         FOR(i,1,n+1)(ans*=i)%=MOD;
      |                               ^~~
a.cc:12:27: error: 'MOD' was not declared in this scope
   12 |         if(n==m)(ans*=2)%=MOD;
      |                           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  long N, M;
  cin >> N >> M;
  int flag = 0;
  if(abs(N - M) != 0 && abs(N - M) != 1) flag++;
  long ans = 0, a = 1, b = 1;
  if(flag == 1) {
    for(int i = N; i != 0; i--) {
      a *= i;
      a %= 100000007;
    }
    for(int i = M; i != 0; i--) {
      b *= i;
      b %= 100000007;
    }
    ans = (a * B) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'B' was not declared in this scope
   18 |     ans = (a * B) % 1000000007;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;

signed main(){

    int n, m; cin >> n >> m;
    if(abs(n - m <= 1)){
        cout << 0 << endl;
        return 0;
    }else{
        int ans = 1;
        for(int i = 1; i <= n; i++){
            ans *= i;
            ans %= MOD;
        }

        for(int i = 1; i <= m; i++){
            ans *= i;
            ans %= MOD;
        }

        if(n == m){
            ans *= 2;
            ans %= MOD;
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  int n,m;
  cin>>n>>m;
  ll c=1;
  for(int i=1;i<=n;i++){
    c*=i;
    c%=1000000007;
  }
  for(int i=1;i<=m;i++){
    c*=i;
    c%=1000000007;
  }
  if(n==m){
    c*=2;
    c%=1000000007;
  }
  cout<<c;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n>>m;
      |   ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<<c;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll mo=1000000007
int main(){
  ll a,b;
  cin>>a,b;
  if(a<b) swap(a,b);
  if(a-b>1) cout<<0;
  else if(a==b){
    ll c=1;
    for(int i=a;i>0;i++){
      c*=i;
      c%=mo;
    }
    cout<<c*4%mo;
  }else{
    ll c=1;
    for(int i=a;i>0;i++){
      c*=i;
      c%=mo;
    }
    for(int i=b;i>0;i++){
      c*=i;
      c%=mo;
    }
    cout<<c;
  }
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main(){
      | ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<iomanip>

using ll = long long;
using ull = unsigned long long;
static ull tenq = 1000000000;
static ull mod = tenq + 7;

using namespace std;

int main(){
  ll n, m; cin >> n >> m;
  ull na = 1, ma = 1;

  ll diff = 0;
  if(n == m) diff = 2;
  else if (abs(n - m) == 1) diff = 1;

  for(int i = 2; i <= n; i++) na = (na*i) % mod;
  for(int i = 2; i <= m; i++) ma = (ma*i) % mod;

  ull ans = (na*nm*diff) % mod;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'nm' was not declared in this scope; did you mean 'na'?
   26 |   ull ans = (na*nm*diff) % mod;
      |                 ^~
      |                 na
Language: C++

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

int main(){
  long long n,m,ansn=1,ansm=1;
  cin>>n>>m;
  if(abs(n-m)>=2){
    cout<<0<<endl;
    return 0;
  }
  while(n){
    ansn*=n;
    ansn%=(1e9+7);
    n--;
  }
  while(m){
    ansm*=m;
    ansm%=(1e9+7);
    m--;
  }
  cout<<(n-m?(ansn*ansm)%(1e9+7):((ansn*ansm)*2)%(1e9+7))<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   13 |     ansn%=(1e9+7);
      |     ~~~~^~~~~~~~~
a.cc:13:9: note:   in evaluation of 'operator%=(long long int, double)'
a.cc:18:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   18 |     ansm%=(1e9+7);
      |     ~~~~^~~~~~~~~
a.cc:18:9: note:   in evaluation of 'operator%=(long long int, double)'
a.cc:21:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   21 |   cout<<(n-m?(ansn*ansm)%(1e9+7):((ansn*ansm)*2)%(1e9+7))<<endl;
      |              ~~~~~~~~~~~^~~~~~~~
      |                   |          |
      |                   |          double
      |                   long long int
a.cc:21:49: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   21 |   cout<<(n-m?(ansn*ansm)%(1e9+7):((ansn*ansm)*2)%(1e9+7))<<endl;
      |                                  ~~~~~~~~~~~~~~~^~~~~~~~
      |                                              |       |
      |                                              |       double
      |                                              long long int
Language: C++

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


Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll s[100100];
      | ^~
a.cc: In function 'int main()':
a.cc:9:5: error: 's' was not declared in this scope
    9 |     s[0]=1;
      |     ^
Language: C++

let ( *@ ) a b = (a * b) mod 1000000007
let fact = let rec f v n = if n <= 0 then v else f (n *@ v) (n-1) in f 1
let n, m = Scanf.scanf "%d %d" (fun x y -> x, y)
let () =
  let mul = 2 - abs (n - m) |> max 0 in
  fact n *@ fact m *@ mul |> Printf.printf "%d\n"

Compiler output:
a.cc:1:8: error: stray '@' in program
    1 | let ( *@ ) a b = (a * b) mod 1000000007
      |        ^
a.cc:2:56: error: stray '@' in program
    2 | let fact = let rec f v n = if n <= 0 then v else f (n *@ v) (n-1) in f 1
      |                                                        ^
a.cc:6:11: error: stray '@' in program
    6 |   fact n *@ fact m *@ mul |> Printf.printf "%d\n"
      |           ^
a.cc:6:21: error: stray '@' in program
    6 |   fact n *@ fact m *@ mul |> Printf.printf "%d\n"
      |                     ^
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | let ( *@ ) a b = (a * b) mod 1000000007
      |     ^
Language: C++

import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		if(Math.abs(m - n) > 1) {
			System.out.println("1");
		}
		else {
			long factorial = 2;
			for(int i = 2; i <= n; i++) {
				factorial = factorial * i % 1000000007;
			}
			for(int i = 2; i <= m; i++) {
				factorial = factorial * i % 1000000007;
			}
			System.out.println(factorial);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		if(Math.abs(m - n) > 1) {
			System.out.println("1");
		}
		else {
			long factorial = 2;
			for(int i = 2; i <= n; i++) {
				factorial = factorial * i % 1000000007;
			}
			for(int i = 2; i <= m; i++) {
				factorial = factorial * i % 1000000007;
			}
			System.out.println(factorial);
		}
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		if(Math.abs(m - n) > 1) {
			System.out.println("1");
		}
		else {
			long factorial = 2;
			for(int i = 2; i <= n; i++) {
				factorial = factorial * i % 1000000007;
			}
			for(int i = 2; i <= m; i++) {
				factorial = factorial * i % 1000000007;
			}
			System.out.println(factorial);
		}
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <string>
#include <iostream>
 
using namespace std;
 
long main() {
  long n,m,i,ans=1;
  cin >> n>>m;
  if(n-m==1 || m-n==1){
    for(i=1;i<=n;i++){
      ans = ans*i;
      ans = ans%(1000000007);
    }
    for(i=1;i<=m;i++){
      ans = ans*i;
      ans = ans %(1000000007);
    }
  }else if(n==m){
    for(i=1;i<=n;i++){
      ans = ans * i * i;
      ans = ans %(1000000007);
    }
    ans *= 2;
    ans = ans %(1000000007);
  }else{
    ans = 0;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b;
cin>>a>>b;
long long ans=1;
if(abs(a-b)>1)ans=0;
else if(a==b){
for(int i=1;i<=a;i++){
ans=(ans*i)%1000000007;
ans=(ans*2)%1000000007;
}
}else{
ll ans2=1;
for(int i=1;i<=min(a,b);i++){
ans=(ans*i)%1000000007;
ans2=(ans2*i)%1000000007;
}
ans2=(ans2*max(a,b))%1000000007;
ans=ans*ans2;
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'll' was not declared in this scope
   14 | ll ans2=1;
      | ^~
a.cc:17:1: error: 'ans2' was not declared in this scope; did you mean 'ans'?
   17 | ans2=(ans2*i)%1000000007;
      | ^~~~
      | ans
a.cc:19:1: error: 'ans2' was not declared in this scope; did you mean 'ans'?
   19 | ans2=(ans2*max(a,b))%1000000007;
      | ^~~~
      | ans
Language: C++

import static java.lang.System.out;
import java.util.Scanner;
import java.util.Arrays;
public class Main{
   public static void main(String[]aa){
      Scanner sc = new Scanner(System.in); 
      int N = sc.nextInt();
      int M = sc.nextInt();
      int max = 1000000007;

      if(Math.abs(N-M)>1){
         out.println(0);
      }else if(Math.abs(N-M) ==0){
         long data = (getFactional(N)+getFactional(M))*2;
         out.println(data%max); 
      }else{
         long data = (getFactional(N)*getFactional(M));
         out.println(data%max); 
      }

      sc.close();
   }
   public static int getFactional(int n){
      if(n == 0){
         return 1;
      }else{
         return n * getFactional(n-1);
      }
   }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import static java.lang.System.out;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Arrays;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main{
      | ^~~~~~
Language: C++

ar = [int(i) for i in input().split()]
n = ar[0]
m = ar[1]
res = 1
if(abs(n-m)>1):
  res = -1
elif(abs(n-m) == 1):
	max = max(n, m)
	min = min(n, m)
	for i in range(max-1):
		res = res * max * min
		res %= (10**9+7)
		max -= 1
		min -= 1
else:
	max = max(n, m)
	res = res * 2*n * m
	n -= 1
	m -= 1
	for i in range(max-2):
		res = res * n * m
		res %= (10**9+7)
		n -= 1
		m -= 1
res %= (10**9+7)
print(res)


Compiler output:
a.cc:1:1: error: 'ar' does not name a type; did you mean 'char'?
    1 | ar = [int(i) for i in input().split()]
      | ^~
      | char
Language: C++

#include <stdio.h>
using namespace std;
#define R 1000000007	
int main() {
	int N, M;
	long long int ans;
	long long int a = 1;
	long long int b = 1;
	scanf_s("%d%d",&N,&M);
	bool nTurn = true;
	int curN = N;
	int curM = M;
	for (int i = 0; i < (N + M); i++) {
		if (nTurn) {
			if (curN == 0) {
				a = 0;
				break;
			}
			a *= (curN);
			a %= R;
			curN--;
			nTurn = !nTurn;
		}
		else {
			if (curM == 0) {
				a = 0;
				break;
			}
			a *= (curM);
			a %= R;
			curM--;
			nTurn = ~nTurn;
		}
	}
	nTurn = false;
	curN = N;
	curM = M;
	for (int i = 0; i < (N + M); i++) {
		if (nTurn) {
			if (curN == 0) {
				b = 0;
				break;
			}
			b *= (curN);
			b %= R;
			curN--;
			nTurn = !nTurn;
		}
		else {
			if (curM == 0) {
				b = 0;
				break;
			}
			b *= (curM);
			b %= R;
			curM--;
			nTurn = ~nTurn;
		}
	}
	printf_s("%d", (a+b)%R);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d%d",&N,&M);
      |         ^~~~~~~
      |         scanf
a.cc:60:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   60 |         printf_s("%d", (a+b)%R);
      |         ^~~~~~~~
      |         printf
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long int mod = 10e9+7;

int fact(int n){
    int factorial = 1;
    for (int i=1;i<=n;i++){
        factorial*= i;
    }
    return factorial;
}
int main() {
    int d,m;long long int ans=0;
    cin>>d>>m;
    if(abs(d-m) >= 2) {cout<<"0";return 0;}
    if((d+m)%2!=0){
        ans = fact(d)*fact(m);
    }
    else {
            ans = 2*(fact(d)*fact(m);
    }
    cout<<ans%mod;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ')' before ';' token
   24 |             ans = 2*(fact(d)*fact(m);
      |                     ~               ^
      |                                     )
Language: C++

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

int mod_fact(int n, int mod) {
  if ( n <= 1 ) return 1;
  return (n * mod_fact(n-1)) % mod;
}

int main( void ) {
  int N, M;
  std::cin >> N >> M;

  const int mod = 1000000007;

  const int max = std::max(N, M);
  const int min = std::min(N, M);

  if( max - min >= 2 ) {
    std::cout << 0 << std::endl;
    return 0;
  }

  const int fact_max = mod_fact(max % mod);
  const int fact_min = mod_fact(min % mod);

  const bool can_swap = ((max - min) == 0);
  const int swap_coef = can_swap ? 2 : 1;

  const int result = (fact_max * fact_min * swap_coef) % mod;
  std::cout << result << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int mod_fact(int, int)':
a.cc:7:23: error: too few arguments to function 'int mod_fact(int, int)'
    7 |   return (n * mod_fact(n-1)) % mod;
      |               ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
a.cc: In function 'int main()':
a.cc:24:32: error: too few arguments to function 'int mod_fact(int, int)'
   24 |   const int fact_max = mod_fact(max % mod);
      |                        ~~~~~~~~^~~~~~~~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
a.cc:25:32: error: too few arguments to function 'int mod_fact(int, int)'
   25 |   const int fact_min = mod_fact(min % mod);
      |                        ~~~~~~~~^~~~~~~~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
Language: C++

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

int mod_fact(int n, int mod) {
  if ( n <= 1 ) return 1;
  return (n * mod_fact(n-1)) % mod;
}

int main( void ) {
  int N, M;
  std::cin >> N >> M;

  const int mod = 1000000007;

  const int max = std::max(N, M);
  const int min = std::min(N, M);

  if( max - min >= 2 ) {
    std::cout << 0 << std::endl;
    return 0;
  }

  const int fact_max = mod_fact(max);
  const int fact_min = mod_fact(min);

  const bool can_swap = ((max - min) == 0);
  const int swap_coef = can_swap ? 2 : 1;

  const int result = (fact_max * fact_min * swap_coef) % mod;
  std::cout << result << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int mod_fact(int, int)':
a.cc:7:23: error: too few arguments to function 'int mod_fact(int, int)'
    7 |   return (n * mod_fact(n-1)) % mod;
      |               ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
a.cc: In function 'int main()':
a.cc:24:32: error: too few arguments to function 'int mod_fact(int, int)'
   24 |   const int fact_max = mod_fact(max);
      |                        ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
a.cc:25:32: error: too few arguments to function 'int mod_fact(int, int)'
   25 |   const int fact_min = mod_fact(min);
      |                        ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
    5 | int mod_fact(int n, int mod) {
      |     ^~~~~~~~
Language: C++

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

typedef long long ll;

int mod_fact(int n, int mod) {
  if ( n <= 1 ) return 1;
  return (n * factorial(n-1)) % mod;
}

int main( void ) {
  int N, M;
  std::cin >> N >> M;

  const int mod = 1000000007;

  const int max = std::max(N, M);
  const int min = std::min(N, M);

  if( max - min >= 2 ) {
    std::cout << 0 << std::endl;
    return 0;
  }

  const int fact_max = factorial(max % mod) % mod;
  const int fact_min = factorial(min % mod) % mod;

  const bool can_swap = ((max - min) == 0);
  const int swap_coef = can_swap ? 2 : 1;

  const int result = (fact_max * fact_min * swap_coef) % mod;
  std::cout << result << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int mod_fact(int, int)':
a.cc:9:15: error: 'factorial' was not declared in this scope
    9 |   return (n * factorial(n-1)) % mod;
      |               ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:26:24: error: 'factorial' was not declared in this scope
   26 |   const int fact_max = factorial(max % mod) % mod;
      |                        ^~~~~~~~~
Language: C++

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <sstream>
#include <deque>
#define ll long long
using namespace std;
const int maxn=100000;
const int mod=1000000007;
int n,m;

int factorial(int n){
	int ans=1;
	for(int i=1;i<n+1;i++){
		ans*=i;
		ans=ans%mod;
	}
	
	ans=ans%mod;
	return ans;
	
	
	
}

int main(){
	cin>>n>>m;
	if(n==m){
		
		int ans_n=factorial(n);
		int ans_m=factorial(m);
		
		int out=((ans_n*ans_m))%mod;
		int out=(2*out)%mod;
		cout<<out;
		return 0;
		
		
	}
	if(abs(n-m)==1){
		int ans_n=factorial(n);
		int ans_m=factorial(m);
		
		int out=((ans_n*ans_m))%mod;
		cout<<out;
		return 0;
	}
	cout<<"0";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:21: error: redeclaration of 'int out'
   39 |                 int out=(2*out)%mod;
      |                     ^~~
a.cc:38:21: note: 'int out' previously declared here
   38 |                 int out=((ans_n*ans_m))%mod;
      |                     ^~~
Language: C++

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <sstream>
#include <deque>
#define ll long long
using namespace std;
const int maxn=100000;
const int mod=1000000007;
int n,m;

int factorial(int n){
	int ans=1;
	for(int i=1;i<n+1;i++){
		ans*=i;
		ans=ans%mod;
	}
	
	ans=ans%mod;
	return ans;
	
	
	
}

int main(){
	cin>>n>>m;
	if(n==m){
		
		ans_n=factorial(n);
		ans_m=factorial(m);
		
		out=(2*(ans_n+ans_m))%mod;
		cout<<out;
		return 0;
		
		
	}
	if(abs(n-m)==1){
		int ma=max(n,m);
		int ans=factorial(ma);
		out=(2*(ans))%mod;
		cout<<out;
		return 0;		
	}
	cout<<"0";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: 'ans_n' was not declared in this scope
   35 |                 ans_n=factorial(n);
      |                 ^~~~~
a.cc:36:17: error: 'ans_m' was not declared in this scope
   36 |                 ans_m=factorial(m);
      |                 ^~~~~
a.cc:38:17: error: 'out' was not declared in this scope
   38 |                 out=(2*(ans_n+ans_m))%mod;
      |                 ^~~
a.cc:47:17: error: 'out' was not declared in this scope
   47 |                 out=(2*(ans))%mod;
      |                 ^~~
Language: C++

#include <stdio.h>
#include <math.h>
#include <algorithm>
 
long long int f(long long num)
{
if (num == 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long int ans = 1;
if (N == M) ans *= 2;
printf("%lld\n", ((((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:69: error: expected ')' before ';' token
   20 | printf("%lld\n", ((((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
      |       ~                                                             ^
      |                                                                     )
Language: C++

#include <stdio.h>
#include <math.h>
#include <algorithm>
 
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%lld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:66: error: expected ';' before ')' token
   20 | printf("%lld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
      |                                                                  ^
      |                                                                  ;
Language: C++

#include <stdio.h>
#include <math.h>
#include <algorithm>
 
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:65: error: expected ';' before ')' token
   20 | printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
      |                                                                 ^
      |                                                                 ;
Language: C++

#include <stdio.h>
#include <math.h>
 
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:65: error: expected ';' before ')' token
   19 | printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
      |                                                                 ^
      |                                                                 ;
Language: C++

#include <stdio.h>
#include <math>
 
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

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

#include <stdio.h>
#include <math.h>
 
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007)
}
 
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

Compiler output:
a.cc: In function 'long long int f(long long int)':
a.cc:7:41: error: expected ';' before '}' token
    7 | return (num * f(num - 1)) % (1000000007)
      |                                         ^
      |                                         ;
    8 | }
      | ~                                        
a.cc: In function 'int main()':
a.cc:19:65: error: expected ';' before ')' token
   19 | printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
      |                                                                 ^
      |                                                                 ;
Language: C++

#include <stdio.h>
#include <math>

long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007)
}

int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
 long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
}
return 0;
}

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

#include<iostream>
using namespace std;
int factorial(int long long);
int main(){
	int n,m;
	cin>>n>>m;
	if(n-m==0){
		cout<<(2*factorial(n)*factorial(m))%1000000007<<endl;
	}
	else if(n-m==1 || n-m==-1){
		cout<<(factorial(n)*factorial(m))%1000000007<<endl;
	}
	else{
		cout<<"0"<<endl;
	}
	return 0;
}
int factorial(long longint M){
	int some;
	some=M;
	for(int i=1;i<some;i++){
		M=M*i;
	}
	return M;
}


Compiler output:
a.cc:18:28: error: expected ',' or '...' before 'M'
   18 | int factorial(long longint M){
      |                            ^
a.cc: In function 'int factorial(long int)':
a.cc:20:14: error: 'M' was not declared in this scope
   20 |         some=M;
      |              ^
Language: Java

import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextInt();
		long m = scanner.nextInt();
		int ans = 1;
		if(Math.abs(n,m) >= 2){
			System.out.println(0);
		}else if (n == m) {
			for(int i = 1; i < n+1; i++){
				ans = (ans % 1000000007) * i;
			}
			System.out.println((ans*2) % 1000000007);
		}else {
			for(int i = 1; i < Math.max(n, m); i++){
				ans = (ans % 1000000007) * i;
			}
			System.out.println(ans * ans/(Math.max(n, m))%1000000007);
		}
	}
}


Compiler output:
Main.java:11: error: no suitable method found for abs(long,long)
		if(Math.abs(n,m) >= 2){
		       ^
    method Math.abs(int) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(long) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(float) is not applicable
      (actual and formal argument lists differ in length)
    method Math.abs(double) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: C

#include <stdio.h>

int kaijou(x);

int main(void){
  int n,m;
  float x;
  scanf("%d %d",&n,&m);
  if((n-m)>1||(n-m)<-1)
    printf("0\n");
  else{
    x=kaijou(n)*kaijou(m)*2;
    if(x>1.0e9 + 7)
      printf("%d\n",x%1.0e9+7);
    else
      printf("%d\n",x);
  }
  return 0;
}
int kaijou(x){
  int a=1;
  int i;
  for(i=1;i<=x;i++){
    a=a*i;
  }
  return x;
}


Compiler output:
main.c:3:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    3 | int kaijou(x);
      | ^~~
main.c: In function 'main':
main.c:14:22: error: invalid operands to binary % (have 'float' and 'double')
   14 |       printf("%d\n",x%1.0e9+7);
      |                      ^
main.c: In function 'kaijou':
main.c:20:5: error: type of 'x' defaults to 'int' [-Wimplicit-int]
   20 | int kaijou(x){
      |     ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	if(n*m%2==0){
		cout<<"0"<<endl;
	}
	if(n*m%2!=0){
		int sum=a*b*2
		cout<<sum%1000000007<<endl;
	}
	/*int n,a[100000],ans=0,count=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i]==j+1){
				count+=1;
				i=j-1;
				if(i==1){
					break;
				}
				if(count==n && i!=1){
					cout<<"-1"<<endl;
					break;
				}
			}
		}
	}
	cout<<count<<endl;*/
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'a' was not declared in this scope
   10 |                 int sum=a*b*2
      |                         ^
a.cc:10:27: error: 'b' was not declared in this scope
   10 |                 int sum=a*b*2
      |                           ^
Language: C

#include<stdio.h>
#include<string.h>
#include<math.h>
int plzh(long long a)
{
	const long long maple = 1e9+7;
	if(a==0||a==1)
	return 1;
	else
	return(a*plzh(a-1)%maple);
}
int main()
{
	long long x,m,n;
	while(scanf("%lld%lld",&m,&n)!=EOF)
	{
		if(fabs(m-n)>1)
		printf("0\n");
		else if(m!=n)
		{
			x=plzh(m)*plzh(n)%maple;
			printf("%lld\n",x);
		}
		else
		{
			x=plzh(m)*plzh(n)*2%maple;
			printf("%lld\n",x);
		} 
	}
}

Compiler output:
main.c: In function 'main':
main.c:21:43: error: 'maple' undeclared (first use in this function)
   21 |                         x=plzh(m)*plzh(n)%maple;
      |                                           ^~~~~
main.c:21:43: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	if(n*m%2==0){
		cout<<"0"<<endl;
	}
	if(n*m%2!=0){
		cout<<(a*b*2)%1000000007<<endl;
	}
	/*int n,a[100000],ans=0,count=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i]==j+1){
				count+=1;
				i=j-1;
				if(i==1){
					break;
				}
				if(count==n && i!=1){
					cout<<"-1"<<endl;
					break;
				}
			}
		}
	}
	cout<<count<<endl;*/
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'a' was not declared in this scope
   10 |                 cout<<(a*b*2)%1000000007<<endl;
      |                        ^
a.cc:10:26: error: 'b' was not declared in this scope
   10 |                 cout<<(a*b*2)%1000000007<<endl;
      |                          ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	if (abs(n - m) > 1) {
		cout << 0 << endl;
		return 0;
	}
	long nr = 1, mr = 0;
	for (int i = n; i > 1; i++) {
		nr *= i;
	}
	for (int i = 0; i < n + 1; i++) {
		mr *= (m - i) / (n + 1 - i);
	}
	long n = 1;
	for (int i = 0; i < 9; i++) {
		n *= 10;
	}
	n += 7;
	long res = nr * mr % n;
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: conflicting declaration 'long int n'
   18 |         long n = 1;
      |              ^
a.cc:5:13: note: previous declaration as 'int n'
    5 |         int n, m;
      |             ^
Language: C++

# coding: utf-8
# Here your code !

n,m=input().split()

l=[1]
for i in range(1,100001):
    l.append(l[i-1]*(i)%1000000007)
n=int(n)
m=int(m)

if n==m:
    print(l[n]*l[m]*2%1000000007)
elif (n-m==1):
    print(l[n]*l[m])
else:
    print(0)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Here
    2 | # Here your code !
      |   ^~~~
a.cc:4:1: error: 'n' does not name a type
    4 | n,m=input().split()
      | ^
Language: C

#include <stdio.h>
#define int64 long long int
int64 F[100005];
const int md = 1000000007;
int n, m;

int abs (int x) { return x < 0 ? -x : x; }

int main ()
{
	F[0] = 1;
	for (int i = 1; i < 100005; i++) F[i] = F[i - 1] * i, F[i] %= md;
	scanf ("%d %d", &n, &m);
	if (abs (n - m) => 2) {
		puts ("0");
		return 0;
	}
	int64 ans = 1;
	ans = (ans * 1ll * F[n]) % md;
	ans = (ans * 1ll * F[m]) % md;
	if (n == m) ans *= 2;
	printf ("%lld\n", ans % md);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:26: error: expected expression before '>' token
   14 |         if (abs (n - m) => 2) {
      |                          ^
Language: C++

from math import *
a,b = map(int, input().split())
if abs(a-b) > 1 :
    print(0)
else  :
    print((1 if abs(a-b) else 2)*factorial(a)*factorial(b)%1000000007)


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import *
      | ^~~~
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  vector<pll> p;
  rep(i,n){
    ll x,y;
    cin>>x>>y;
    p[i]=pll(x,y);
  }
  sort(all(p));
  set<ll> s;
  ll ans=0;
  rep(i,n){
    if(i==0){
      s.insert(p[i].S);
      continue;
    }
    ll cu=p[i].F-p[i-1].F;
    ll ccu;
    if(*rbegin(s)<p[i].S){
      ccu=p[i].S-*rbegin(s);
      s.insert(p[i].S);
    }
    else{
      auto itr=s.lowerbound(p[i].S);
      ccu=*itr-p[i].S;
      s.insert(p[i].S);
    }
    ans+=min(ccu,cu);
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:18: error: 'class std::set<long long int>' has no member named 'lowerbound'; did you mean 'lower_bound'?
   71 |       auto itr=s.lowerbound(p[i].S);
      |                  ^~~~~~~~~~
      |                  lower_bound
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define pb push_back

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b); i >= (a); i--)
#define R0F(i, a) ROF(i, 0, a-1)
#define trav(x, a) for (auto& x: a)

const int MX  = 2e5+5;
const int MOD = 1e9+7;
const ll  INF = 1061109567; // 4557430888798830399LL
const ld  EPS = 1e-9;
const ld  PI  = acos(-1);

struct DSU {
    vi e; void init(int n) { e = vi(n,-1); }
    int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
    bool sameSet(int a, int b) { return get(a) == get(b); }
    int size(int x) { return -e[get(x)]; }
    bool unite(int x, int y) { // union by size
        x = get(x), y = get(y); if (x == y) return 0;
        if (e[x] > e[y]) swap(x,y);
        e[x] += e[y]; e[y] = x; return 1;
    }
};

int N; DSU DS;
vector<tuple<int,int,int>> adj;

ll Kruskal() {
    sort(all(adj)); DS.init(N); ll res = 0;
    trav(x,adj) {
        int u,v,w; tie(w,u,v) = x;s
        if (unite(u,v)) {
            res += w;
        }
    }
    return res;
}

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    cin >> N;

    vector<tuple<int,int,int>> v;
    F0R(i,N) {
        int x,y; cin >> x >> y;
        v.pb(tie(x,y,i));
    }

    sort(all(v));

    F0R(i,N-1) {
        int x1,y1,ii,x2,y2,jj;
        tie(x1,y1,ii) = v[i];
        tie(x2,y2,jj) = v[i+1];

        int cost = min(abs(x1-x2),abs(y1-y2));
        adj.pb(tie(cost,ii,jj));
    }

    F0R(i,N) {
        int x1,y1,ii;
        tie(x1,y1,ii) = v[i];
        v[i] = tie(y1,x2,ii);
    }

    sort(all(v));

    F0R(i,N-1) {
        int x1,y1,ii,x2,y2,jj;
        tie(x1,y1,ii) = v[i];
        tie(x2,y2,jj) = v[i+1];

        int cost = min(abs(x1-x2),abs(y1-y2));
        adj.pb(tie(cost,ii,jj));
    }

    cout << Kruskal() << "\n";

}


Compiler output:
a.cc: In function 'll Kruskal()':
a.cc:11:11: error: 'second' was not declared in this scope
   11 | #define s second
      |           ^~~~~~
a.cc:47:35: note: in expansion of macro 's'
   47 |         int u,v,w; tie(w,u,v) = x;s
      |                                   ^
a.cc: In function 'int main()':
a.cc:82:23: error: 'x2' was not declared in this scope; did you mean 'x1'?
   82 |         v[i] = tie(y1,x2,ii);
      |                       ^~
      |                       x1
Language: C++

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

using ll = long long;

struct Node {
  int id;
  int x;
  int y;
};

struct Edge {
  int from;
  int to;
  int distance;

  bool operator<(const Edge &e) const { return distance < e.distance; }
};

int cmpx(Node a, Node b) { return a.x < b.x; }
int cmpy(Node a, Node b) { return a.y < b.y; }

struct UnionFind {
  vector<int> par;
  vector<ll> sizes;

  UnionFind(int N) : par(N), sizes(N, 1) { rep(i, N) par[i] = i; }

  // find root parent
  int find(int x) {
    if (x == par.at(x)) {
      return x;
    } else {
      // update x's parent
      return par.at(x) = find(par.at(x));
    }
  }

  // merge x's and y's trees
  void unite(int x, int y) {
    x = find(x);
    y = find(y);

    if (x == y)
      return;

    if (sizes.at(x) < sizes.at(y))
      swap(x, y);

    // merge x as y's parent
    par.at(y) = x;
    sizes.at(x) += sizes.at(y);
  }

  // is same parents
  bool same(int x, int y) { return find(x) == find(y); }
};

void solve(ll N, vector<Node> ns) {
  ll cost = 0;
  vector<Edge> es;

  sort(ns.begin(), ns.end(), cmpx);
  rep(i, N - 1) {
    es.push_back((Edge){
      from : ns.at(i).id,
      to : ns.at(i + 1).id,
      distance : ns.at(i + 1).x - ns.at(i).x
    });
  }

  sort(ns.begin(), ns.end(), cmpy);
  rep(j, N - 1) {
    es.push_back((Edge){
      from : ns.at(j).id,
      to : ns.at(j + 1).id,
      distance : ns.at(j + 1).y - ns.at(j).y
    });
  }

  sort(all(es)); // sort by distance

  UnionFind uf(N);
  for (Edge e : es) {
    if (!uf.same(e.from, e.to)) {
      cost += e.distance;
      uf.unite(e.from, e.to);
    }
  }

  cout << cost << endl;
}

int main() {
  ll N;
  scanf("%lld", &N);
  vector<Node> ns(N);
  for (int i = 0; i < N; i++) {
    (&ns[i])->id = i;
    scanf("%lld", &ns[i].x);
    scanf("%lld", &ns[i].y);
  }
  solve(N, std::move(ns));
  return 0;
}


Compiler output:
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:27:48: error: 'i' was not declared in this scope
   27 |   UnionFind(int N) : par(N), sizes(N, 1) { rep(i, N) par[i] = i; }
      |                                                ^
a.cc:27:44: error: 'rep' was not declared in this scope
   27 |   UnionFind(int N) : par(N), sizes(N, 1) { rep(i, N) par[i] = i; }
      |                                            ^~~
a.cc: In function 'void solve(ll, std::vector<Node>)':
a.cc:64:7: error: 'i' was not declared in this scope
   64 |   rep(i, N - 1) {
      |       ^
a.cc:64:3: error: 'rep' was not declared in this scope
   64 |   rep(i, N - 1) {
      |   ^~~
a.cc:73:7: error: 'j' was not declared in this scope
   73 |   rep(j, N - 1) {
      |       ^
a.cc:81:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   81 |   sort(all(es)); // sort by distance
      |        ^~~
      |        std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

int prim(vector<vector<edge>>& G){
    int V(G.size());
    int res = 0;
    //Pi_i first: 距離　second: 頂点
    priority_queue<Pi_i, vector<Pi_i>, greater<Pi_i>> que;
    VI d(V, INF);
    d[0] = 0;
    que.push(MP(0, 0));

    while(!que.empty()){
        Pi_i p = que.top(); que.pop();
        int v = p.second;
        if(d[v] < p.first) continue;
        d[v] = 0;
        res += p.first;
        for(edge &e : G[v]){
            if(d[e.to] > e.cost){
                d[e.to] = e.cost;
                que.push(MP(d[e.to], e.to));
            }
        }
    }
    return res;
}

Compiler output:
a.cc:1:10: error: 'vector' was not declared in this scope
    1 | int prim(vector<vector<edge>>& G){
      |          ^~~~~~
a.cc:1:17: error: 'vector' was not declared in this scope
    1 | int prim(vector<vector<edge>>& G){
      |                 ^~~~~~
a.cc:1:24: error: 'edge' was not declared in this scope
    1 | int prim(vector<vector<edge>>& G){
      |                        ^~~~
a.cc:1:32: error: 'G' was not declared in this scope
    1 | int prim(vector<vector<edge>>& G){
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

struct UnionFind {
    vector<ll> par;
    
    //要素nで初期化
    UnionFind(ll n) : par(n, -1) { }
    void init(ll n) { par.assign(n, -1); }
    
    //xが属する集合の根を返す
    ll root(ll x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    //xとyが同じ集合に属しているかを判定
    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    //xが属する集合とyが属する集合をマージ
    bool merge(ll x, ll y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // 計算量が減るよ
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    //xが属する集合のサイズ
    ll size(ll x) {
        return -par[root(x)];
    }
};

struct edge { ll u, v, cost; };
bool comp(const edge& e1, const edge& e2) { return e1.cost < e2.cost;}
edge es[500000];
ll E = 0; // 辺数
ll kruskal(ll V) {
	sort(es, es + E, comp); // edge.costが小さい順にソートする 
	UnionFind uf(V); // Union-Findの初期化
	ll res = 0;
	for (ll i = 0; i < E; i++) {
		edge e = es[i];
		if (!uf.issame(e.u, e.v)) {
			uf.merge(e.u, e.v);
			res += e.cost; 
		}
	}
	return res; 
}




int main(){
	ll n;cin>>n;
	vector<P> a(n);
	vector<P> b(n);
	for(ll i = 0; i < n; i++) {
		ll x,y;cin>>x>>y;
		a[i] = mp(x,i);
		b[i] = mp(y,i);
	}
	sort(ALL(a));
	sort(ALL(b));
	for(ll i = 0; i < n - 1; i++) {
		es[E] = {a[i].sc,a[i + 1].sc,abs(a[i].fs - a[i + 1].fs)};
		E++;
		es[E] = {a[i + 1].sc,a[i].sc,abs(a[i].fs - a[i + 1].fs)};
		E++;
		cost[a[i].sc][a[i + 1].sc] = abs(a[i].fs - a[i + 1].fs);
		cost[a[i + 1].sc][a[i].sc] = abs(a[i].fs - a[i + 1].fs);
	}
	for(ll i = 0; i < n - 1; i++) {
		es[E] = {b[i].sc,b[i + 1].sc,abs(b[i].fs - b[i + 1].fs)};
		E++;
		es[E] = {b[i + 1].sc,b[i].sc,abs(b[i].fs - b[i + 1].fs)};
		E++;
		cost[b[i].sc][b[i + 1].sc] = min(cost[b[i].sc][b[i + 1].sc],abs(b[i].fs - b[i + 1].fs));
		cost[b[i + 1].sc][b[i].sc] = min(cost[b[i + 1].sc][b[i].sc],abs(b[i].fs - b[i + 1].fs));
	}

	cout << kruskal(n) << endl; 

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:87:17: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   87 |                 cost[a[i].sc][a[i + 1].sc] = abs(a[i].fs - a[i + 1].fs);
      |                 ^~~~
      |                 cosl
a.cc:95:17: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   95 |                 cost[b[i].sc][b[i + 1].sc] = min(cost[b[i].sc][b[i + 1].sc],abs(b[i].fs - b[i + 1].fs));
      |                 ^~~~
      |                 cosl
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

struct UnionFind {
    vector<ll> par;
    
    //要素nで初期化
    UnionFind(ll n) : par(n, -1) { }
    void init(ll n) { par.assign(n, -1); }
    
    //xが属する集合の根を返す
    ll root(ll x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    //xとyが同じ集合に属しているかを判定
    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    //xが属する集合とyが属する集合をマージ
    bool merge(ll x, ll y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // 計算量が減るよ
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    //xが属する集合のサイズ
    ll size(ll x) {
        return -par[root(x)];
    }
};

struct edge { ll u, v, cost; };
bool comp(const edge& e1, const edge& e2) { return e1.cost < e2.cost;}
edge es[200001];
ll E = 0; // 辺数
ll kruskal(ll V) {
	sort(es, es + E, comp); // edge.costが小さい順にソートする 
	UnionFind uf(V); // Union-Findの初期化
	ll res = 0;
	for (ll i = 0; i < E; i++) {
		edge e = es[i];
		if (!uf.issame(e.u, e.v)) {
			uf.merge(e.u, e.v);
			res += e.cost; 
		}
	}
	return res; 
}




ll main(){
	ll n;cin>>n;
	vector<P> a(n);
	vector<P> b(n);
	for(ll i = 0; i < n; i++) {
		ll x,y;cin>>x>>y;
		a[i] = mp(x,i);
		b[i] = mp(y,i);
	}
	sort(ALL(a));
	sort(ALL(b));
	for(ll i = 0; i < n - 1; i++) {
		es[E] = {a[i].sc,a[i + 1].sc,abs(a[i].fs - a[i + 1].fs)};
		E++;
		es[E] = {a[i + 1].sc,a[i].sc,abs(a[i].fs - a[i + 1].fs)};
		E++;
		// cost[a[i].sc][a[i + 1].sc] = abs(a[i].fs - a[i + 1].fs);
		// cost[a[i + 1].sc][a[i].sc] = abs(a[i].fs - a[i + 1].fs);
	}
	for(ll i = 0; i < n - 1; i++) {
		es[E] = {b[i].sc,b[i + 1].sc,abs(b[i].fs - b[i + 1].fs)};
		E++;
		es[E] = {b[i + 1].sc,b[i].sc,abs(b[i].fs - b[i + 1].fs)};
		E++;
		// cost[b[i].sc][b[i + 1].sc] = min(cost[b[i].sc][b[i + 1].sc],abs(b[i].fs - b[i + 1].fs));
		// cost[b[i + 1].sc][b[i].sc] = min(cost[b[i + 1].sc][b[i].sc],abs(b[i].fs - b[i + 1].fs));
	}

	cout << kruskal(n) << endl; 

	return 0;
}

Compiler output:
a.cc:71:1: error: '::main' must return 'int'
   71 | ll main(){
      | ^~