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

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

signed main(){
	int n;cin>>n;
	vector<int> a(n),b(n),c(n);
	for(auto&& w:a)cin>>w;
	for(auto&& w:b)cin>>w;
	for(auto&& w:c)cin>>w;
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	int ans=0;
	for(auto&& w:b){
	int x=lower_bound(a.begin(),a.end(),w)-a.begin();
	int y=c.end()-upper_bound(c.begin(),c.end(),w);
	ans+=x*y;
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define int long long
      | ^~~~~~
Language: C++

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

int main(){
	int n;cin>>n;
	vector<int> a(n),b(n),c(n);
	for(auto&& w:a)cin>>w;
	for(auto&& w:b)cin>>w;
	for(auto&& w:c)cin>>w;
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	int ans=0;
	for(int i=0;i<n;i++){
	int x=lower_bound(a.begin(),a.end(),b[i])-a.begin();
	int y=c.end()-upper_bound(c.begin(),c.end(),b[i]);
        int z=n-(lower_bound(c.begin(),c.end(),b[i])-c.begin());
 	ans+=x*y;
	}
	cout<<ans<<endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        long[] A = new long[N];
        long[] B = new long[N];
        long[] C = new long[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextLong();
        }
        for (int i = 0; i < N; i++) {
            B[i] = sc.nextLong();
        }
        for (int i = 0; i < N; i++) {
            C[i] = sc.nextLong();
        }

        Arrays.sort(A);
        Arrays.sort(B);
        Arrays.sort(C);

        // Bを固定して尺取り法
        int aIndex = 0;
        int cIndex = 0;
        long cnt = 0;
        for (int i = 0; i < N; i++) {

            // bより小さいところまで
            while (aIndex < N && A[aIndex] < B[i]) {
                aIndex++;
            }

            while (cIndex < N && C[cIndex] <= B[i]) {
                cIndex++;
            }

            cnt += aIndex * (N - cIndex);
        }

        out.println(cnt);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
.util.*;
^
Main.java:3: error: class, interface, enum, or record expected
import static java.lang.System.*;
^
2 errors
Language: C++

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

int main() {
     int N; cin >> N;
     int A[100010], B[100010], C[100010];
     for (int i = 0; i < N; i++) cin >> A[i];
     for (int i = 0; i < N; i++) cin >> B[i];
     for (int i = 0; i < N; i++) cin >> C[i];

     sort(A, A + N);
     sort(B, B + N);
     sort(C, C + N);

    int ans = 0;

     for (int i = 0; i < N; i++) {
         int b = B[i];
         int *pos_a, *pos_c, dis_a, dis_c;

         pos_a = lower_bound(A, A + N, b);
         pos_c = upper_bound(C, C + N, b);

         dis_a = distance(A, pos_a);
         dis_c = distance(pos_c, C + N;

         ans += dis_a * dis_c;
     }

     cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:39: error: expected ')' before ';' token
   25 |          dis_c = distance(pos_c, C + N;
      |                          ~            ^
      |                                       )
Language: C++

//encoding:utf-8
#include<iostream> //c++
#include<time.h> //時間にかんして
#include<stack> //スタックに関して　最新のデータから捨てる
#include<queue> //キューに関して　最古のデータから捨てる
#include<math.h>
#include<vector>
#include<algorithm> //sort とかにいる
#include<bits/stdc++.h>
#define int long long //int　宣言をlong longとする

using namespace std;
// int inf = INFINITY;
int main(){
  int N;
  cin>>N;
  ll A[N],B[N],C[N];//これはリスト
  //v()を使いたいなvector

  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  for(int i=0;i<N;i++){
    cin>>B[i];
  }
  for(int i=0;i<N;i++){
    cin>>C[i];
  }

  sort(A,A+N);
  sort(B,B+N);
  sort(C,C+N);

  ll sum = 0;
  for(int i=0;i<N;i++){
    auto itr1 = lower_bound(A,A+N,B[i]);
    int a = itr1-A;
    // cout<<a<<endl;

    auto itr2 = upper_bound(C,C+N,B[i]);
    int c = C+N-itr2;
    // cout<<c<<endl;
    sum = sum + c*a;
  }
  cout<<sum<<endl;


  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:17:3: error: 'll' was not declared in this scope
   17 |   ll A[N],B[N],C[N];//これはリスト
      |   ^~
a.cc:21:10: error: 'A' was not declared in this scope
   21 |     cin>>A[i];
      |          ^
a.cc:24:10: error: 'B' was not declared in this scope
   24 |     cin>>B[i];
      |          ^
a.cc:27:10: error: 'C' was not declared in this scope
   27 |     cin>>C[i];
      |          ^
a.cc:30:8: error: 'A' was not declared in this scope
   30 |   sort(A,A+N);
      |        ^
a.cc:31:8: error: 'B' was not declared in this scope
   31 |   sort(B,B+N);
      |        ^
a.cc:32:8: error: 'C' was not declared in this scope
   32 |   sort(C,C+N);
      |        ^
a.cc:34:5: error: expected ';' before 'sum'
   34 |   ll sum = 0;
      |     ^~~~
      |     ;
a.cc:43:5: error: 'sum' was not declared in this scope
   43 |     sum = sum + c*a;
      |     ^~~
a.cc:45:9: error: 'sum' was not declared in this scope
   45 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include <bits/stdc++.h>

#define int long long
#define MOD 1000000007

 
using namespace std;

signed main(){

    int N;
    cin >> N;
    int A[N],B[N],C[N];

    

    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    
    for(int i=0;i<N;i++){
        cin >> B[i];
    }

    for(int i=0;i<N;i++){
        cin >> C[i];
    }

    sort(A,A+N);
    sort(B,B+N);
    sort(C,C+N);

    int sum = 0;

    for(int i=0;i<N;i++){
        auto itr1 = lower_bound(A,A+N,B[i]);

        int a = itr1-A;
        //cout <<c <<endl;
        auto itr2 = upper_bound(C,C+N,B[i]);
        int a = C+N-itr2;
        //cout <<a <<endl;
        sum = sum + c*a;
    }

    cout <<sum <<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:13: error: redeclaration of 'long long int a'
   41 |         int a = C+N-itr2;
      |             ^
a.cc:38:13: note: 'long long int a' previously declared here
   38 |         int a = itr1-A;
      |             ^
a.cc:43:21: error: 'c' was not declared in this scope
   43 |         sum = sum + c*a;
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
using namespace std;

const long long INF=9000000000000000;
int main(){
  long long n,ans=0;
  cin>>n;
  long long a[n];
  long long b[n];
  long long c[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n;i++){
    cin>>b[i];
  }
  for(int i=0;i<n;i++){
    cin>>c[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  sort(c,c+n);
  for(int i=0;i<n;i++){
    ans+=1*(lower_bound(a,a+n,b[i])-a)*(n-upper_bound(c,c+n,b[i]));
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:42: error: invalid operands of types 'long long int' and 'long long int*' to binary 'operator-'
   26 |     ans+=1*(lower_bound(a,a+n,b[i])-a)*(n-upper_bound(c,c+n,b[i]));
      |                                         ~^~~~~~~~~~~~~~~~~~~~~~~~
      |                                         |            |
      |                                         |            long long int*
      |                                         long long int
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin>>N;
	vector<int> vea(N);
	vector<int> veb(N);
	vector<int> vec(N);
    for(int i=0; i<N; i++){
		cin>>vea.at(i);
	}	
	for(int i=0; i<N; i++){
		cin>>veb.at(i);
	}	
	for(int i=0; i<N; i++){
		cin>>vec.at(i);
	}	

	int A=0;
	for(int j=0; j<N; j++){
		for(int k=0; k<N; k++){
			for(int l=0; l<N; l++){
				if((vea.at(j)<veb.at(k))&&(veb.at.(k)<vec.at(l)))
			}
		}
	}
	cout<<A<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:64: error: invalid use of member function 'std::vector<int>::at' (did you forget the '()' ?)
   23 |                                 if((vea.at(j)<veb.at(k))&&(veb.at.(k)<vec.at(l)))
      |                                                            ~~~~^~
a.cc:24:25: error: expected primary-expression before '}' token
   24 |                         }
      |                         ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<stdint.h>

using namespace std;

int main () {

  int N, a;
  cin >> N;
  vector<int> top, middle, bottom;

  for (int i = 0; i < N; ++i){
    cin >> a;
    top.push_back(a);
  }

  for (int i = 0; i < N; ++i){
    cin >> a;
    middle.push_back(a);
  }

  for (int i = 0; i < N; ++i){
    cin >> a;
    bottom.push_back(a);
  }

  sort(top.begin(), top.end());
  sort(bottom.begin(), bottom.end());

  int num = 0;

  for (int i = 0; i < N; ++i) {
    num += distance(top.begin(), lower_bound(top.begin(), top.end() , middle[n]))
    * (N - distance(bottom.begin(), upper_bound(bottom.begin(), bottom.end() , middle[n])));
  }

  cout << num << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:78: error: 'n' was not declared in this scope
   35 |     num += distance(top.begin(), lower_bound(top.begin(), top.end() , middle[n]))
      |                                                                              ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<stdint.h>

using namespace std;

int count1 (const vector<int> upper, const vector<int> lower, int n) {
  return N - distance(lower.begin(), upper_bound(lower.begin(), lower.end() , upper[n]));
}

int count2 (const vector<int> upper, const vector<int> lower, int n) {
  return distance(upper.begin(), lower_bound(upper.begin(), upper.end() , lower[n]));
}

int main () {

  int N;
  int a;
  cin >> N;
  vector<int> top;
  vector<int> middle;
  vector<int> bottom;

  for (int i = 0; i < N; ++i){
    cin >> a;
    top.push_back(a);
  }

  for (int i = 0; i < N; ++i){
    cin >> a;
    middle.push_back(a);
  }

  for (int i = 0; i < N; ++i){
    cin >> a;
    bottom.push_back(a);
  }

  sort(top.begin(), top.end());
  sort(middle.begin(), middle.end());
  sort(bottom.begin(), bottom.end());

  int num = 0;

  for (int i = 0; i < N; ++i) {
    num += count2(top, middle, i, N) * count1(middle, bottom, i, N);
  }

  cout << num << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int count1(std::vector<int>, std::vector<int>, int)':
a.cc:9:10: error: 'N' was not declared in this scope
    9 |   return N - distance(lower.begin(), upper_bound(lower.begin(), lower.end() , upper[n]));
      |          ^
a.cc: In function 'int main()':
a.cc:47:18: error: too many arguments to function 'int count2(std::vector<int>, std::vector<int>, int)'
   47 |     num += count2(top, middle, i, N) * count1(middle, bottom, i, N);
      |            ~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:12:5: note: declared here
   12 | int count2 (const vector<int> upper, const vector<int> lower, int n) {
      |     ^~~~~~
a.cc:47:46: error: too many arguments to function 'int count1(std::vector<int>, std::vector<int>, int)'
   47 |     num += count2(top, middle, i, N) * count1(middle, bottom, i, N);
      |                                        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:8:5: note: declared here
    8 | int count1 (const vector<int> upper, const vector<int> lower, int n) {
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
ll INF = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int N;
int A[100100],B[100100],C[100100];

int main(){
    cin >> N;
    A[0] = 0; A[N+1] = MOD;
    B[0] = 0; B[N+1] = MOD;
    C[0] = 0; C[N+1] = MOD;
    for(ll i = 1; i <= N; i++) cin >> A[i];
    sort(A,A+N+2);
    for(ll i = 1; i <= N; i++) cin >> B[i];
    sort(B,B+N+2);
    for(ll i = 1; i <= N; i++) cin >> C[i];
    sort(C,C+N+2);

    ll ans = 0;
    for(ll i = 0; i < N; i++){
        int countL = lower_bound(A,A+N+2,B[i]) - A[0];
        int countR = upper_bound(C,C+N+2,B[i]) - C[N+1];
        ans += countL * (N - countR);
    }
    cout << ans << endl;
}



Compiler output:
a.cc:13:1: error: expected initializer before 'll'
   13 | ll INF = 1e18;
      | ^~
a.cc: In function 'int main()':
a.cc:33:48: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   33 |         int countL = lower_bound(A,A+N+2,B[i]) - A[0];
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
      |                                                |
      |                                                int*
a.cc:34:48: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   34 |         int countR = upper_bound(C,C+N+2,B[i]) - C[N+1];
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
      |                                                |
      |                                                int*
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int lli
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
ll INF = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
ll N;
ll A[100100],B[100100],C[100100];

int main(){
    cin >> N;
    A[0] = -INF; A[N+1] = INF;
    B[0] = -INF; B[N+1] = INF;
    C[0] = -INF; C[N+1] = INF;
    for(ll i = 1; i <= N; i++) cin >> A[i];
    sort(A,A+N+2);
    for(ll i = 1; i <= N; i++) cin >> B[i];
    sort(B,B+N+2);
    for(ll i = 1; i <= N; i++) cin >> C[i];
    sort(C,C+N+2);

    ll ans = 0;
    for(ll i = 0; i < N; i++){
        ll countL = lower_bound(A,A+N+2,B[i]) - A[0];
        ll countR = upper_bound(C,C+N+2,B[i]) - C[N+1];
        ans += countL * (N - countR);
    }
    cout << ans << endl;
}



Compiler output:
a.cc:13:1: error: expected initializer before 'll'
   13 | ll INF = 1e18;
      | ^~
a.cc: In function 'int main()':
a.cc:21:13: error: 'INF' was not declared in this scope
   21 |     A[0] = -INF; A[N+1] = INF;
      |             ^~~
a.cc:33:47: error: invalid conversion from 'long long int*' to 'll' {aka 'long long int'} [-fpermissive]
   33 |         ll countL = lower_bound(A,A+N+2,B[i]) - A[0];
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
      |                                               |
      |                                               long long int*
a.cc:34:47: error: invalid conversion from 'long long int*' to 'll' {aka 'long long int'} [-fpermissive]
   34 |         ll countR = upper_bound(C,C+N+2,B[i]) - C[N+1];
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
      |                                               |
      |                                               long long int*
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 10100000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int H,W;
char s[51][51];
bool masu[51][51];

int main(){
    ll N; cin >> N;
    ll A[N],B[N],C[N];
    for(ll i = 0; i < N; i++){
        cin >> A[i] >> B[i] >> C[i];
    }
    ll sum = 0;
    sort(A,A+N); reverse(A,A+N);
    sort(B,B+N); reverse(B,B+N);
    sort(C,C+N); reverse(C,C+N);
    ll dp[MAX][MAX][MAX];
    int a = 0, b = 0, c = 0;
    for(ll a = 0; a < N; a++){
        while(A[a] < B[b]){
            b++;
        }
        for(ll j = b; j < N; j++){
            while(B[b] < C[c]){
                c++;
            }
            for(ll k = c; k < N; k++){
                if(dp[A[a]][B[b]][C[c]] == 0){
                    dp[A[a]][B[b]][C[c]]++;
                    sum++;
                }
            }
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: size of array 'dp' exceeds maximum object size '9223372036854775807'
   28 |     ll dp[MAX][MAX][MAX];
      |        ^~
a.cc:39:20: error: 'dp' was not declared in this scope; did you mean 'dy'?
   39 |                 if(dp[A[a]][B[b]][C[c]] == 0){
      |                    ^~
      |                    dy
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int H,W;
char s[51][51];
bool masu[51][51];

int main(){
    ll N; cin >> N;
    ll A[N],B[N],C[N];
    for(ll i = 0; i < N; i++){
        cin >> A[i] >> B[i] >> C[i];
    }
    ll sum = 0;
    sort(A,A+N); reverse(A,A+N);
    sort(B,B+N); reverse(B,B+N);
    sort(C,C+N); reverse(C,C+N);
    ll dp[MM][MM][MM];
    int a = 0, b = 0, c = 0;
    for(ll a = 0; a < N; a++){
        while(A[a] < B[b]){
            b++;
        }
        for(ll j = b; j < N; j++){
            while(B[b] < C[c]){
                c++;
            }
            for(ll k = c; k < N; k++){
                if(dp[A[a]][B[b]][C[c]] == 0){
                    dp[A[a]][B[b]][C[c]]++;
                    sum++;
                }
            }
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: size of array 'dp' exceeds maximum object size '9223372036854775807'
   28 |     ll dp[MM][MM][MM];
      |        ^~
a.cc:39:20: error: 'dp' was not declared in this scope; did you mean 'dy'?
   39 |                 if(dp[A[a]][B[b]][C[c]] == 0){
      |                    ^~
      |                    dy
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int H,W;
char s[51][51];
bool masu[51][51];

int main(){
    ll N; cin >> N;
    ll A[N],B[N],C[N];
    for(ll i = 0; i < N; i++){
        cin >> A[i] >> B[i] >> C[i];
    }
    ll sum = 0;
    sort(A,A+N); reverse(A,A+N);
    sort(B,B+N); reverse(B,B+N);
    sort(C,C+N); reverse(C,C+N);
    ll dp[MM][MM][MM];
    int a = 0, b = 0, a = 0;
    for(ll a = 0; a < N; a++){
        while(A[a] < B[b]){
            b++;
        }
        for(ll j = b; j < N; j++){
            while(B[b] < C[c]){
                c++;
            }
            for(ll k = c; k < N; k++){
                if(dp[A[a]][B[b]][C[c]] == 0){
                    dp[A[a]][B[b]][C[c]]++;
                    sum++;
                }
            }
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: size of array 'dp' exceeds maximum object size '9223372036854775807'
   28 |     ll dp[MM][MM][MM];
      |        ^~
a.cc:29:23: error: redeclaration of 'int a'
   29 |     int a = 0, b = 0, a = 0;
      |                       ^
a.cc:29:9: note: 'int a' previously declared here
   29 |     int a = 0, b = 0, a = 0;
      |         ^
a.cc:35:28: error: 'c' was not declared in this scope
   35 |             while(B[b] < C[c]){
      |                            ^
a.cc:38:24: error: 'c' was not declared in this scope
   38 |             for(ll k = c; k < N; k++){
      |                        ^
a.cc:39:20: error: 'dp' was not declared in this scope; did you mean 'dy'?
   39 |                 if(dp[A[a]][B[b]][C[c]] == 0){
      |                    ^~
      |                    dy
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int H,W;
char s[51][51];
bool masu[51][51];

int main(){
    ll N; cin >> N;
    ll A[N],B[N],C[N];
    for(ll i = 0; i < N; i++){
        cin >> A[i] >> B[i] >> C[i];
    }
    ll sum = 0;
    sort(A,A+N); reverse(A,A+N);
    sort(B,B+N); reverse(B,B+N);
    sort(C,C+N); reverse(C,C+N);
    ll dp[MM][MM][MM];
    int a = 0, b = 0, a = 0;
    for(ll i = 0; i < N; i++){
        while(A[i] < B[num_b]){
            num_b++;
        }
        for(ll j = num_b; j < N; j++){
            while(B[num_b] < C[num_c]){
                num_c++;
            }
            for(ll k = num_c; k < N; k++){
                if(dp[A[i]][B[num_b]][C[num_c]] == 0){
                    dp[A[i]][B[num_b]][C[num_c]]++;
                    sum++;
                }
            }
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: size of array 'dp' exceeds maximum object size '9223372036854775807'
   28 |     ll dp[MM][MM][MM];
      |        ^~
a.cc:29:23: error: redeclaration of 'int a'
   29 |     int a = 0, b = 0, a = 0;
      |                       ^
a.cc:29:9: note: 'int a' previously declared here
   29 |     int a = 0, b = 0, a = 0;
      |         ^
a.cc:31:24: error: 'num_b' was not declared in this scope
   31 |         while(A[i] < B[num_b]){
      |                        ^~~~~
a.cc:34:20: error: 'num_b' was not declared in this scope
   34 |         for(ll j = num_b; j < N; j++){
      |                    ^~~~~
a.cc:35:32: error: 'num_c' was not declared in this scope
   35 |             while(B[num_b] < C[num_c]){
      |                                ^~~~~
a.cc:38:24: error: 'num_c' was not declared in this scope
   38 |             for(ll k = num_c; k < N; k++){
      |                        ^~~~~
a.cc:39:20: error: 'dp' was not declared in this scope; did you mean 'dy'?
   39 |                 if(dp[A[i]][B[num_b]][C[num_c]] == 0){
      |                    ^~
      |                    dy
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
  int N;
  cin >> N;
  
  vector< vector<int> > A(3, vector<int>(N));
  
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < N; j++) {
    	cin >> A[i][j];
    }
    sort(A[i].begin(), A[i].end());
  }
  
  vector< vector<int> > step(3, vector<int>(N));
  
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < N; j++) {
      int left = 0;
      if (i == 0) {
        if (j == 0) {
        	step[i][j] = 1;
        } else {
          step[i][j] step[i][j - 1] + 1;
        }
      } else {
        while (left < N - 1 && A[i - 1][left + 1] < A[i][j]) {
          left++;
        }
        if (A[i - 1][left] < A[i][j]) {
          if (j == 0) {
            step[i][j] = step[i - 1][left];
          } else {
            step[i][j] = step[i][j - 1] + step[i - 1][left];
          }
        }
      }
    }
  }
  
  cout << step[2][N - 1] << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector< vector<int> > A(3, vector<int>(N));
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:10:18: error: expected primary-expression before 'int'
   10 |   vector< vector<int> > A(3, vector<int>(N));
      |                  ^~~
a.cc:14:16: error: 'A' was not declared in this scope
   14 |         cin >> A[i][j];
      |                ^
a.cc:16:10: error: 'A' was not declared in this scope
   16 |     sort(A[i].begin(), A[i].end());
      |          ^
a.cc:19:18: error: expected primary-expression before 'int'
   19 |   vector< vector<int> > step(3, vector<int>(N));
      |                  ^~~
a.cc:26:17: error: 'step' was not declared in this scope
   26 |                 step[i][j] = 1;
      |                 ^~~~
a.cc:28:11: error: 'step' was not declared in this scope
   28 |           step[i][j] step[i][j - 1] + 1;
      |           ^~~~
a.cc:31:32: error: 'A' was not declared in this scope
   31 |         while (left < N - 1 && A[i - 1][left + 1] < A[i][j]) {
      |                                ^
a.cc:34:13: error: 'A' was not declared in this scope
   34 |         if (A[i - 1][left] < A[i][j]) {
      |             ^
a.cc:36:13: error: 'step' was not declared in this scope
   36 |             step[i][j] = step[i - 1][left];
      |             ^~~~
a.cc:38:13: error: 'step' was not declared in this scope
   38 |             step[i][j] = step[i][j - 1] + step[i - 1][left];
      |             ^~~~
a.cc:45:11: error: 'step' was not declared in this scope
   45 |   cout << step[2][N - 1] << endl;
      |           ^~~~
Language: C++

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

using namespace std;

#define ll long long

int N;
ll cnt_A[100005]={0}, cnt_C[100005]={0}, ans=0;
vector<int> A, B ,C;

void solve(){
    for(int i = 0; i < N; i++){
        auto itr = lower_bound(A.begin(), A.begin()+N, B[i]);
        cnt_A[i] = itr - A.begin(); 
        
        auto itr = upper_bound(C.begin(), C.begin()+N, B[i]);
        cnt_C[i] = N - (itr - C.begin());
        
        ans += cnt_A[i] * cnt_C[i];
    }

    cout << ans << endl;
}

int main(){
    cin >> N;

    int buff;
    for(int i = 1; i <= N; i++){
        cin >> buff;
        A.push_back(buff);
    } 
    for(int i = 1; i <= N; i++){
        cin >> buff;
        B.push_back(buff);
    }
    for(int i = 1; i <= N; i++){
        cin >> buff;
        C.push_back(buff);
    }
 
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    sort(C.begin(),C.end());
    
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:18:14: error: conflicting declaration 'auto itr'
   18 |         auto itr = upper_bound(C.begin(), C.begin()+N, B[i]);
      |              ^~~
a.cc:15:14: note: previous declaration as '__gnu_cxx::__normal_iterator<int*, std::vector<int> > itr'
   15 |         auto itr = lower_bound(A.begin(), A.begin()+N, B[i]);
      |              ^~~
Language: C++

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

using namespace std;

define ll long long

int N, cnt_A[100005]={0}, cnt_C[100005]={0};
ll ans=0;
vector<int> A, B ,C;

void solve(){
    for(int i = 0; i < N; i++){
        auto itr = lower_bound(A.begin(), A.begin()+N, B[i]);
        cnt_A[i] = itr - A.begin(); 
    }

    for(int i = 0; i < N; i++){
        auto itr = upper_bound(C.begin(), C.begin()+N, B[i]);
        cnt_C[i] = N - (itr - C.begin());
        ans += cnt_A[i] * cnt_C[i];
    }

    cout << ans << endl;
}

int main(){
    cin >> N;

    int buff;
    for(int i = 1; i <= N; i++){
        cin >> buff;
        A.push_back(buff);
    } 
    for(int i = 1; i <= N; i++){
        cin >> buff;
        B.push_back(buff);
    }
    for(int i = 1; i <= N; i++){
        cin >> buff;
        C.push_back(buff);
    }
 
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    sort(C.begin(),C.end());
    
    solve();
}


Compiler output:
a.cc:7:1: error: 'define' does not name a type
    7 | define ll long long
      | ^~~~~~
a.cc:9:25: error: expected unqualified-id before ',' token
    9 | int N, cnt_A[100005]={0}, cnt_C[100005]={0};
      |                         ^
a.cc:9:40: error: expected constructor, destructor, or type conversion before '=' token
    9 | int N, cnt_A[100005]={0}, cnt_C[100005]={0};
      |                                        ^
a.cc:10:1: error: 'll' does not name a type
   10 | ll ans=0;
      | ^~
a.cc: In function 'void solve()':
a.cc:14:24: error: 'N' was not declared in this scope
   14 |     for(int i = 0; i < N; i++){
      |                        ^
a.cc:16:9: error: 'cnt_A' was not declared in this scope
   16 |         cnt_A[i] = itr - A.begin();
      |         ^~~~~
a.cc:19:24: error: 'N' was not declared in this scope
   19 |     for(int i = 0; i < N; i++){
      |                        ^
a.cc:21:9: error: 'cnt_C' was not declared in this scope
   21 |         cnt_C[i] = N - (itr - C.begin());
      |         ^~~~~
a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |         ans += cnt_A[i] * cnt_C[i];
      |         ^~~
      |         abs
a.cc:22:16: error: 'cnt_A' was not declared in this scope
   22 |         ans += cnt_A[i] * cnt_C[i];
      |                ^~~~~
a.cc:25:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc: In function 'int main()':
a.cc:29:12: error: 'N' was not declared in this scope
   29 |     cin >> N;
      |            ^
Language: C

#include <iostream>
#include <algorithm>

using namespace std;

int n, aa[3][100001];
long long ans = 0;

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    cin >> n;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < n; j++) cin >> aa[i][j];
        sort(aa[i], aa[i] + n);
    }

    for (int i = 0; i < n; i++) {
        unsigned long j = lower_bound(aa[0], aa[0] + n, aa[1][i]) - aa[0];
        unsigned long k = upper_bound(aa[2], aa[2] + n, aa[1][i]) - aa[2];
        ans += (long long) (n - k) * j;
    }
    return 0;
}

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

#include <iostream>
#include <algorithm>

using namespace std;

int n, aa[3][100001];
long long ans = 0;

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    cin >> n;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < n; j++) cin >> aa[i][j];
        sort(aa[i], aa[i] + n);
    }

    for (int i = 0; i < n; i++) {
        unsigned long j = lower_bound(aa[0], aa[0] + n, aa[1][i]) - aa[0];
        unsigned long k = upper_bound(aa[2], aa[2] + n, aa[1][i]) - aa[2];
        ans += (long long) (n - k) * j;
    }
    cout << ans;
    return 0;
}



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

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>
using namespace std;

const int N = 1e5+10;;
int a[N], b[N], c[N];
int main ()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &b[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &c[i];
    }
   sort(a, a+n);
    sort(b, b+n);
    sort(c, c+n);
    long long ans = 0;
    for(int i = 0, j = 0, k = 0; i < n; i++)
    {
        while(b[i]>a[j] && j <= n-1)
        {
            j++;
        }
        while(b[i]>=c[k] && k <= n-1)
        {
            k++;
        }
        ans += (long long )j * (n-k);
    }
    printf("%lld\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: expected ')' before ';' token
   24 |         scanf("%d", &c[i];
      |              ~           ^
      |                          )
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>
using namespace std;

const int N = 1e5+10;;
int a[N], b[N], c[N];
int main ()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &b[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &c[i
    }
          sort(a, a+n);
    sort(b, b+n);
    sort(c, c+n);
    long long ans = 0;
    for(int i = 0, j = 0, k = 0; i < n; i++)
    {
        while(b[i]>a[j] && j <= n-1)
        {
            j++;
        }
        while(b[i]>=c[k] && k <= n-1)
        {
            k++;
        }
        ans += (long long )j * (n-k);
    }
    printf("%lld\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: expected ']' before '}' token
   24 |         scanf("%d", &c[i
      |                         ^
      |                         ]
   25 |     }
      |     ~                    
a.cc:24:25: error: expected ')' before '}' token
   24 |         scanf("%d", &c[i
      |              ~          ^
      |                         )
   25 |     }
      |     ~
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>
using namespace std;

const int N = 1e5+10;;
int a[N], b[N], c[N];
int main ()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &b[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &c[i
    }
          sort(a, a+n);
    sort(b, b+n);
    sort(c, c+n);
    long long ans = 0;
    for(int i = 0, j = 0, k = 0; i < n; i++)
    {
        while(b[i]>a[j] && j <= n-1)
        {
            j++;
        }
        while(b[i]>=c[k] && k <= n-1)
        {
            k++;
        }
        ans += (long long )j * (n-k);
    }
    printf("%lld\n", ans);
    return 0;
}

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

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    long long  n; cin>>n;
    int a[n],b[n],c[n];
    for(int i=1;i<=n;i++)
        printf("%d",&a[i]);
    for(int i=1;i<=n;i++)
        printf("%d",&b[i]);
    for(int i=1;i<=n;i++)
        printf("%d",&c[i]);
    sort(a+1,a+n+1);
    sort(b+1,b+n+1);
    sort(c+1,c+n+1);
    long long temp=0;
    long long  ja=0,jb=0,jc=0;
    for(int i=1;i<=n;i++)
    {
         while(a[ja+1]<b[i]&&ja<n)
            ja++;
         while(c[jc+1]<=b[i]&&jc<n)
            jc++;
         temp+=ja*(n-jc);
    }
    printf("%d",temp);
    return 0;
}

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

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

const int N = 100009;

int a[N], b[N], c[N];
LL f[N];


int main()
{
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) scanf("%d", &a[i]);
    for(int i = 0; i < n; i++) scanf("%d", &b[i]);
    for(int i = 0; i < n; i++) scanf("%d", &c[i]);
    sort(a, a+n);
    sort(b, b+n);
    sort(c, c+n);
    LL ans = 0;

    for(int i = 0; i < n; i++)
    {
        if(b[i] >= c[n-1]) break;
        f[i+1] = 1ll*n - (upper_bound(c, c+n, b[i]) - c);
    }
    f[0] = 0;
    for(int i = 1; i <= n; i++) f[i] += f[i-1];

    for(int i = 0; i < n; i++)
    {
        if(a[i] >= b[n-1]) break;
        int s = upper_bound(b, b+n, a[i]) - b;
        ans += f[n] - f[s];
    }

    printf("%lld\n", ans);
    return 0;



}




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

#include<algorithm>
#include<cstdio>
#include<iostream>
using namespace std;
long long  a[200000],b[200000],c[200000],d[200000];
int main()
{
    long long int i,n,m=0,j,k,l,x=0,y=0;
    while(~scanf("%lld",&n))
    {
        scanf("%d",&a[i]);
        for(i=1; i<=n; i++)
            scanf("%d",&b[i]);
        for(i=1; i<=n; i++)
            scanf("%d",&c[i]);
        sort(a+1,a+1+n);
        sort(b+1,b+1+n);
        sort(c+1,c+1+n);
        for(i=n; i>=1; i--)
        {
            k=upper_bound(c+1,c+1+n,b[i])-c;
            if(k<=n)
                d[i]=d[i+1]+n-k+1;
        }
        for(i=1; i<=n; i++)
        {
            k=upper_bound(b+1,b+1+n,a[i])-b;
            if(k>n)
                break;
            else
                m+=d[k];
        }
        printf("%lld",m);

        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:36:6: error: expected '}' at end of input
   36 |     }
      |      ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int num[3][100000];
int main()
{
    int n,i,j,o,k;
    scanf("%d",&n);
    for(i=0; i<3; i++)
        for(j=0; j<n; j++)
            scanf("%d",&num[i][j]);
    sort(num[0],num[0]+n);
    sort(num[1],num[1]+n);
    sort(num[2],num[2]+n);
    o=0;
    for(i=0; i<n; i++)
        for(j=0; j<n; j++)
        {
            if(num[0][i]<num[1][j])
                for(k=0; k<n; k++)
                {
                    if(num[1][j]<num[2][k])
                    {
                        o=o+((n-1)-(k-1));
                        break;
                    }
                }
        }
    printf("%d\n",o);
}


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

#include<cstdio>
#include<iostream>
#include<cstring>
#include <cstdlib>

using namespace std;

#define pi 100100

int main()
{
    int n;
    int a[pi],b[pi],c[pi];
    long long ans;
    while(~scanf("%d",&n))
    {
            ans=0;
            int i;
            for(i=0;i<n;i++)
                scanf("%d",&a[i]);
            for(i=0;i<n;i++)
                scanf("%d",&b[i]);
            for(i=0;i<n;i++)
                scanf("%d",&c[i]);
                int j,k;
            for(i=0;i<n;i++)
            {
//                printf("* ");
                for(j=0;j<n;j++)
                {
//                    printf("g ");
                    if(a[i]<b[j])
                    {
                        for(k=0;k<n;k++)
                        {
//                            printf("s ");
                            if(b[j]<c[k])
                            {
//                                printf("mm\n");
                                ans++;
                            }
                        }
                    }
                }
            }
            printf("%d\n",ans);
    }
}


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

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<cstring>
#include<math.h>
#include<map>
using namespace std;
long long a[100010];
long long b[100010];
long long c[100010];
long long aaa[100010];
long long bbb[100010];
long long ccc[100010];
int main()
{
    int n;
    cin>>n;

    for(int i=1; i<=n; i++)
        cin>>a[i];
    for(int i=1; i<=n; i++)
        cin>>b[i];
    for(int i=1; i<=n; i++)
        cin>>c[i];
    sort(a+1,a+1+n);
    sort(b+1,b+1+n);
    sort(c+1,c+1+n);
    for(int i=1; i<=n; i++)
    {
        int l=1;
        int r=n;
        while(l<=r)
        {
            long long mid=(l+r)/2;
            if(b[mid]>=c[i])
            {
                r=mid-1;
            }
            if(b[mid]<c[i])
            {
                l=mid+1;
            }
        }
        ccc[i]=l-1;
    }
    for(long long i=1; i<=n; i++)
    {
        long long l=1;
        long long r=n;
        while(l<=r)
        {
            long long mid=(l+r)/2;
            if(a[mid]>=b[i])
            {
                r=mid-1;
            }
            if(a[mid]<b[i])
            {
                l=mid+1;
            }
        }
        bbb[i]=l-1;

    }
    long long sum=0，sum1=0;
    for(long long i=1; i<=n; i++)
    {
        for(long long j=ccc[i-1]+1; j<=ccc[i]; j++)
        {
            sum1+=bbb[j];
        }
        sum+=sum1;
    }
    cout<<sum<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:19: error: unable to find numeric literal operator 'operator""\U0000ff0csum1'
   68 |     long long sum=0，sum1=0;
      |                   ^~~~~~~
a.cc:73:13: error: 'sum1' was not declared in this scope; did you mean 'sum'?
   73 |             sum1+=bbb[j];
      |             ^~~~
      |             sum
a.cc:75:14: error: 'sum1' was not declared in this scope; did you mean 'sum'?
   75 |         sum+=sum1;
      |              ^~~~
      |              sum
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  int N;
  cin >> N;
  
  int a[N], b[N], c[N];
  for(int i=0;i<N;i++){cin >> a[i];}
  for(int i=0;i<N;i++){cin >> b[i];}
  for(int i=0;i<N;i++){cin >> c[i];}
  
  sort(a,a+N);
  sort(c,c+N);
  
  for(int i=0;i<N;i++){
    int l=0;
    int u=0;
    int sum=0;
    
    for(int j=0;a[j]>=b[j];j++){l++;}
    for(int k=0;b[k]<=c[k];k++){u++;}
    
    sum += l * (N-u);
  }
  
  cout << sum << endl;
  
  return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'sum' was not declared in this scope
   28 |   cout << sum << endl;
      |           ^~~
Language: C++

#include <iostrem>
#include <algorithm>
using namespace std;

int main(){
  int N;
  cin >> N;
  
  int a[N], b[N], c[N];
  for(int i=0;i<N;i++){cin >> a[i];}
  for(int i=0;i<N;i++){cin >> b[i];}
  for(int i=0;i<N;i++){cin >> c[i];}
  
  sort(a,a+N);
  sort(c,c+N);
  
  for(int i=0;i<N;i++){
    int l=0;
    int u=0;
    int sum=0;
    
    for(int j=0;a[j]>=b[j];j++){l++;}
    for(int k=0;b[k]<=c[k];k++){u++;}
    
    sum += l * (N-u);
  }
  
  cout << sum << endl;
  
  return 0;
}
    

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

#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << (x) << endl;
typedef long long ll;
const int MAX = 999999999;

int main(){
    int n;
    cin >> n;

    vector<vector<ll>> nums(3, vector<ll>(n));
    rep(i, 3){
        rep(j, n){
            cin >> nums[i][j];
        }
        sort(all(nums[i]));
    }

    // [1] -> [0]
    vector<ll> up_low_nums(n);
    rep(i, n){
        up_low_nums[i] = lower_bound(all(nums[0]), nums[1][i]) - nums[0].begin();
    }

    // [1] -> [2]
    vector<ll> sum_num(n);
    rep(i, n){
        sum_num[i] = (nums[2].end() - upper_bound(all(nums[2]), nums[1][i])) * up_low_nums[i];
    }

    cout << accumulate(all(sum_num), 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'cin' was not declared in this scope
   21 |     cin >> n;
      |     ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include <set>
  +++ |+#include <iostream>
    9 | 
a.cc:43:5: error: 'cout' was not declared in this scope
   43 |     cout << accumulate(all(sum_num), 0) << endl;
      |     ^~~~
a.cc:43:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:44: error: 'endl' was not declared in this scope
   43 |     cout << accumulate(all(sum_num), 0) << endl;
      |                                            ^~~~
a.cc:9:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    8 | #include <set>
  +++ |+#include <ostream>
    9 |
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

long main(){
    long N;
    long A[100000], B[100000], C[100000];
    long sum[100000], bigger[100000];
    cin >> N;
    for(long i = 0; i < N; i++){
        cin >> A[i];
    }
    for(long i = 0; i < N; i++){
        cin >> B[i];
    }
    for(long i = 0; i < N; i++){
        cin >> C[i];
    }
    sort(A, A+N);
    sort(B, B+N);
    sort(C, C+N);
    long ans = 0;
    for(long i = 0; i < N; i++){
        long *c;
        c = upper_bound(C, C+N, B[i]);
        if(*c <= B[i]) bigger[i] = 0;
        else bigger[i] = C+N - c;
        //cout << bigger[i] << endl;
    }
    sum[N-1] = bigger[N-1];
    for(long i = N-2; i >= 0; i--){
        sum[i] = sum[i+1] + bigger[i];
    }
    for(long i = 0; i < N; i++){
        long *b, *c;
        b = upper_bound(B, B+N, A[i]);
        if(*b <= A[i]) break;
        ans += sum[b-B];
        //cout << ans << endl;
    }
    cout << ans << endl;
}

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

#include<iostream>
#include<algorithm>
#include<vector>
typedef long long lint;
using namespace std;

int main()
{
	int N;
	int A[100010]={},B[100010]={},C[100010]={};
	int a,c;
	lint ans=0;
	
	cin >> N;
	for(int i=0;i<N;i++)cin >> A[i];
	for(int i=0;i<N;i++)cin >> B[i];
	for(int i=0;i<N;i++)cin >> C[i];
	
	sort(A.begin(),A.end());
	sort(B.begin(),B.end());
	sort(C.begin(),C.end());
	
	for(int i=0;i<N;i++)
	{
		a=lower_bound(A,A+N,B[i])-A;
		c=C+N-upper_bound(C,C+N,B[i]);
		ans+=a*c;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: request for member 'begin' in 'A', which is of non-class type 'int [100010]'
   19 |         sort(A.begin(),A.end());
      |                ^~~~~
a.cc:19:26: error: request for member 'end' in 'A', which is of non-class type 'int [100010]'
   19 |         sort(A.begin(),A.end());
      |                          ^~~
a.cc:20:16: error: request for member 'begin' in 'B', which is of non-class type 'int [100010]'
   20 |         sort(B.begin(),B.end());
      |                ^~~~~
a.cc:20:26: error: request for member 'end' in 'B', which is of non-class type 'int [100010]'
   20 |         sort(B.begin(),B.end());
      |                          ^~~
a.cc:21:16: error: request for member 'begin' in 'C', which is of non-class type 'int [100010]'
   21 |         sort(C.begin(),C.end());
      |                ^~~~~
a.cc:21:26: error: request for member 'end' in 'C', which is of non-class type 'int [100010]'
   21 |         sort(C.begin(),C.end());
      |                          ^~~
Language: C++

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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef pair<int, int> p;

int main(){
  int n;
  cin >> n;
  vector<int> a(n, 0);
  vector<int> b(n, 0);
  vector<int> c(n, 0);

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  sort(all(a));
  sort(all(b));
  sort(all(c));

  print(a);
  print(b);
  print(c);

  int res = 0;

  for (int i = 0; i < n; i++)
  {
    auto au = lower_bound(a.begin(), a.end(), b[i]) - a.begin();
    if(b[i] == a[au-1]) au--;
    auto cu = n - (lower_bound(c.begin(), c.end(), b[i]) - c.begin());
    if(b[i] == c[n - cu]) cu++;
    cout << au << " " << cu << endl;
    res += au * cu;
  }

  cout << res << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   34 |   print(a);
      |   ^~~~~
      |   rint