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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n;
    cin>>n;
    vector<vector<int>> grid(3,vector<int>(n));
    REP(i,3){REP(j,n){
            cin >> grid[i][j];
        }
        sort(grid[i].begin(), grid[i].end());
    }

    int result = 0;

    REP(i,n){
        result += (distance(grid[0].begin(),lower_bound(grid[0].begin(), grid[0].end(), grid[1][i])) * (distance(upper_bound(grid[2].begin(),grid[2].end(),grid[1][i]),grid[2].end())));
    }
    cout << result << endl;
    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<vector>
#include<algorithm>
using namespace std;

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

    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a.at(i);
    }
    vector<int> b(n);
    for(int i = 0; i < n; i++){
        cin >> b.at(i);
    }
    vector<int> c(n);
    for(int i = 0; i < n; i++){
        cin >> c.at(i);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    sort(c.begin(),c.end());

    long long ans = 0;

    for(int i = 0; i < n; i++){
        long long numA = lower_bound(a.begin(),a.end(),b.at(i)) - a.begin();
        long long numC = c.end() - upper_bound(c.begin(),c.end(),b.at(i));
        ans += numA * numC
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: expected ';' before '}' token
   31 |         ans += numA * numC
      |                           ^
      |                           ;
   32 |     }
      |     ~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

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

    vector<ll> a(n), b(n), c(n);
    rep(i, n) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    rep(i, n) {
        cin >> b[i];
    }
    sort(b.begin(), b.end());
    rep(i, n) {
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    
    auto pos1, pos2;
    ll ans = 0;
    rep(i, n) {
        pos1 = lower_bound(a.begin(), a.end(), b[i]);
        ll x = pos1 - a.begin();
        pos2 = upper_bound(c.begin(), c.end(), b[i]);
        ll y = pos2 - c.begin();
        ans += x*y;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: declaration of 'auto pos1' has no initializer
   29 |     auto pos1, pos2;
      |     ^~~~
a.cc:29:5: error: declaration of 'auto pos2' has no initializer
Language: C++

#include <algoriVGVG
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, sta, n) for (int i = sta; i < n; ++i)

using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> c[i];
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());

    ll ans = 0;
    rep(i, n) {
        int bi = b[i];
        auto it_aub = upper_bound(a.begin(), a.end(), bi-1);
        size_t aub_pos = distance(a.begin(), it_aub);
        int asize = (int)aub_pos;

        auto it_clb = lower_bound(c.begin(), c.end(), bi+1);
        size_t clb_pos = distance(it_clb, c.end());
        int csize = (int)clb_pos;
        ans += (asize*csize);
    }

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


Compiler output:
a.cc:1:21: error: missing terminating > character
    1 | #include <algoriVGVG
      |                     ^
a.cc:1:10: fatal error: algoriVGVG: No such file or directory
    1 | #include <algoriVGVG
      |          ^
compilation terminated.
Language: C++

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

int main(){
  ll N, ans=0; cin>>N;
  vector<ll> A(N), B(N), C(N);
  
  rep(i, N) cin>>A[i];
  rep(i, N) cin>>B[i];
  rep(i, N )cin>>C[i];
  
  sort(ALL(A));
  sort(ALL(C));
  
  rep(i, N){
    ll cnt = upper_bound(ALL(A), B[i]-1) - A.begin(), cnt2 = C.end() - lower_bound(ALL(C), b+1);
    ans += cnt * cnt2;
  }
  
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:92: error: 'b' was not declared in this scope
   19 |     ll cnt = upper_bound(ALL(A), B[i]-1) - A.begin(), cnt2 = C.end() - lower_bound(ALL(C), b+1);
      |                                                                                            ^
Language: Java

import java.util.*;
public class Mainq {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long ans = 0;
		double[] A = new double[N];
		for(int i = 0; i < N; i++)
			A[i] = sc.nextInt();
		Arrays.sort(A);
		int[] B = new int[N];
		for(int i = 0; i < N; i++)
			B[i] = sc.nextInt();
		Arrays.sort(B);
		double[] C = new double[N];
		for(int i = 0; i < N; i++)
			C[i] = sc.nextInt();
		Arrays.sort(C);
		for(int i = 0; i < N; i++) {
			long AB = 0, BC = 0;
			AB = - 1 - Arrays.binarySearch(A, B[i]-0.1);
			BC = N + 1 + Arrays.binarySearch(C, B[i]+0.1);
			ans += AB * BC;
		}
		System.out.println(ans);
	}

}


Compiler output:
Main.java:2: error: class Mainq is public, should be declared in a file named Mainq.java
public class Mainq {
       ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
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(c);
		long ans=0;
		for(int i=0; i<n; i++){
			long idxa=Arrays.binarySearch(a,b[i]);
			long idxc=Arrays.binarySearch(c,b[i]);
			if(idxa<0){
				idxa=-idxa-1;
			}
			if(idxc<0){
				idxc=n+idxc+1);
			}else{
				idxc=n-idxc-1;
			}
			ans+=idxa*idxc;
		}
		System.out.println(ans);
	}
}


Compiler output:
Main.java:29: error: ';' expected
				idxc=n+idxc+1);
				             ^
1 error
Language: C++

#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
#define all(v) (v).begin(),(v).end()
typedef pair<ll,ll> P;
#define fi first
#define se second
set<string> c;
map<ll,ll> mp;
const ll inf=100000000000000000;
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}

int main(){
int n;
cin>>n;
vector<int> a(n),b(n),c(n);
//multiset<int> b,c;
for(int i=0;i<n;i++)cin>>a.at(i);
for(int i=0;i<n;i++)cin>>b.at(i);
for(int i=0;i<n;i++)cin>>c.at(i);
sort(all(a));
sort(all(b));
sort(all(c));
ll ans=0;
for(int i=0;i<n;i++){
  llitb=lower_bound(all(a),b.at(i))-a.begin();
  ll itc=c.end()-upper_bound(all(c),b.at(i));
  //cout<<itb<<" "<<itc<<endl;
  //if(itc==0)continue;
ans+=(itb*itc);
}
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:3: error: 'llitb' was not declared in this scope
   29 |   llitb=lower_bound(all(a),b.at(i))-a.begin();
      |   ^~~~~
a.cc:33:7: error: 'itb' was not declared in this scope; did you mean 'itc'?
   33 | ans+=(itb*itc);
      |       ^~~
      |       itc
Language: C++

#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
#define all(v) (v).begin(),(v).end()
typedef pair<ll,ll> P;
#define fi first
#define se second
set<string> c;
map<ll,ll> mp;
const ll inf=100000000000000000;
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}

int main(){
int n;
cin>>n;
vector<int> a(n),b(n),c(n);
//multiset<int> b,c;
for(int i=0;i<n;i++)cin>>a.at(i);
for(int i=0;i<n;i++)cin>>b.at(i);
for(int i=0;i<n;i++)cin>>c.at(i);
sort(all(a));
sort(all(b));
sort(all(c));
ll ans=0;
for(int i=0;i<n;i++){
  llitb=lower_bound(all(a),b.at(i))-a.begin();
  ll itc=c.end()-upper_bound(all(c),b.at(i));
  cout<<itb<<" "<<itc<<endl;
  //if(itc==0)continue;
ans+=(itb*itc);
}
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:3: error: 'llitb' was not declared in this scope
   29 |   llitb=lower_bound(all(a),b.at(i))-a.begin();
      |   ^~~~~
a.cc:31:9: error: 'itb' was not declared in this scope; did you mean 'itc'?
   31 |   cout<<itb<<" "<<itc<<endl;
      |         ^~~
      |         itc
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n, a, b;
    cin >> n;
    int ans=0;
    vector<int> A(n);
    vector<int> B(n);
    vector<int> 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.begin(), A.end());
    sort(C.begin(), C.end());
    for(int i=0;i<n;i++) {
        a = lower_bound(A.begin(), A.end(), B[i]) - A.begin();
        b = C.end() - upper_bound(C.begin(), C.end(), B[i]);
        ans += a*b;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(A.begin(), A.end());
      |     ^~~~
      |     short
a.cc:18:23: error: 'upper_bound' was not declared in this scope
   18 |         b = C.end() - upper_bound(C.begin(), C.end(), B[i]);
      |                       ^~~~~~~~~~~
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

ll main() {
    ll n = 0;
    cin >> n;
    vector<ll> a(n);
    for (ll i=0; i<n; i++) {
        cin >> a.at(i);
    }
    vector<ll> b(n);
    for (ll i=0; i<n; i++) {
        cin >> b.at(i);
    }
    vector<ll> c(n);
    for (ll i=0; i<n; i++) {
        cin >> c.at(i);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    vector<ll> cnt_b(n);
    ll now_a = 0, now_b = 0, now_c = 0;
    while (now_b < n) {
        while (now_c < n && c.at(now_c) <= b.at(now_b)) {
            now_c++;
        }
        if (now_c == n) {
            break;
        }
        cnt_b.at(now_b) = n - now_c;
        now_b++;
    }
    for (ll i=n-2; i>=0; i--) {
        cnt_b.at(i) += cnt_b.at(i+1);
    }
    now_b = 0;
    ll ans = 0;
    while (now_a < n) {
        while (now_b < n && b.at(now_b) <= a.at(now_a)) {
            now_b++;
        }
        if (now_b == n) {
            break;
        }
        ans += cnt_b.at(now_b);
        now_a++;
    }
    cout << ans << endl;
    return 0;
}


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

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] a = new double[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		}
		double[] c = new double[n];
		for (int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
		}
		sc.close();
 
		Arrays.parallelSort(a);
		Arrays.parallelSort(c);
 
		long ans = 0L;
		for (int j = 0; j < n; j++) {
			long idxA = Arrays.binarySearch(a, b[j] - 0.1);
			idxA = ~idxA;
			long idxC = Arrays.binarySearch(c, b[j] + 0.1);
			idxC = ~idxC;
			ans += idxA * (n - idxC);
		}
		System.out.println(ans);
	}
}
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] a = new double[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		}
		double[] c = new double[n];
		for (int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
		}
		sc.close();

		Arrays.parallelSort(a);
		Arrays.parallelSort(c);

		long ans = 0L;
		for (int j = 0; j < n; j++) {
			long idxA = Arrays.binarySearch(a, b[j] - 0.1);
			idxA = ~idxA;
			long idxC = Arrays.binarySearch(c, b[j] + 0.1);
			idxC = ~idxC;
			ans += idxA * (n - idxC);
		}
		System.out.println(ans);
	}
}
提出情報


Compiler output:
Main.java:36: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:37: error: class, interface, enum, or record expected
import java.util.Scanner;
^
Main.java:71: error: reached end of file while parsing
????
^
3 errors
Language: Java

import java.util.Scanner;

import java.util.*;	
public class Main {
	public static int lower(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid;
			}else {
				return mid;
			}
			
		}
		return left+1 ;
		
	}
	public static int upper(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid ;
			}else {
				return mid+1;
			}
			
		}
		return right;
	}

	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double[] A = new double[N];
		double[] B = new double[N];
		double[] C = new double[N];
		long count = 0;
		long  foundA=0;
		long  foundB=0;
	    for(int i=0; i<N; i++) {		
	    		A[i]=sc.nextInt();
	    	}
	    for(int i=0; i<N; i++) {		
    		B[i]=sc.nextInt();
    	}
	    for(int i=0; i<N; i++) {		
    		C[i]=sc.nextInt();
    	}
	    Arrays.sort(A);
	    Arrays.sort(B);
	    Arrays.sort(C);
	    
	    for(int i = 0; i<N; i++) {
	    	  foundA = lower(A,B[i]);
	    	  foundB = upper(C,B[i]);	    	  
	    	  count+=(long)((foundA)*(N-foundB));
	    		
	     }
	    System.out.println(count);
	}
}

Compiler output:
Main.java:67: error: incompatible types: double[] cannot be converted to int[]
	    	  foundA = lower(A,B[i]);
	    	                 ^
Main.java:68: error: incompatible types: double[] cannot be converted to int[]
	    	  foundB = upper(C,B[i]);	    	  
	    	                 ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.Scanner;

import java.util.*;	
public class Main1 {
	public static int lower(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid;
			}else {
				return mid;
			}
			
		}
		return left+1 ;
		
	}
	public static int upper(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid ;
			}else {
				return mid+1;
			}
			
		}
		return right;
	}

	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[] B = new int[N];
		int[] C = new int[N];
		long count = 0;
		long  foundA=0;
		long  foundB=0;
	    for(int i=0; i<N; i++) {		
	    		A[i]=sc.nextInt();
	    	}
	    for(int i=0; i<N; i++) {		
    		B[i]=sc.nextInt();
    	}
	    for(int i=0; i<N; i++) {		
    		C[i]=sc.nextInt();
    	}
	    Arrays.sort(A);
	    Arrays.sort(B);
	    Arrays.sort(C);
	    
	    for(int i = 0; i<N; i++) {
	    	  foundA = lower(A,B[i]);
	    	  foundB = upper(C,B[i]);	    	  
	    	  count+=(long)((foundA)*(N-foundB));
	    		
	     }
	    System.out.println(count);
	}
}


Compiler output:
Main.java:4: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Scanner;

import java.util.*;	
public class Main1 {
	public static int lower(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid;
			}else {
				return mid;
			}
			
		}
		return left+1 ;
		
	}
	public static int upper(int A[],int key) {
		int left=-1;
		int right = A.length;
		int mid=0;
		while(right-left>1) {
			mid = (right + left)/2;
			 if(A[mid]>key){
				right = mid;
				
			}else if(A[mid]<key){
				left = mid ;
			}else {
				return mid+1;
			}
			
		}
		return right;
	}

	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] parts = new int[3][N];
		long count = 0;
		long  foundA=0;
		long  foundB=0;
	    for(int i=0; i<3; i++) {
			for(int j = 0;j<N;j++){
	    		parts[i][j]=sc.nextInt();
	    	}
			 Arrays.sort(parts[i]);
	    }
	    for(int i = 0; i<N; i++) { 	  
	    	  count+=(long)((foundA)*(N-foundB));
	    		
	     }
	    System.out.println(count);
	}
}


Compiler output:
Main.java:4: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Scanner;

import java.util.*;	
public class Main1 {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] parts = new int[3][N];
		long count = 0;
		long foundA=0;
		long foundB=0;
	    for(int i=0; i<3; i++) {
			for(int j = 0;j<N;j++){
	    		parts[i][j]=sc.nextInt();
	    	}
			 Arrays.sort(parts[i]);
	    }
	    for(int i = 0; i<N; i++) {
	    	  foundA = Arrays.binarySearch(parts[0], parts[1][i]);
	    	  foundB = Arrays.binarySearch(parts[2],parts[1][i]);
			
	    	  if(foundA>=0) {	 
	    			  if(foundB>=0) {
	    				  count+=(long)(foundA*(N-foundB-1));
	    			
	    			  }else if(foundB<0) {
	    				  count+=(long)(foundA*(N-(-(foundB+1))));

	    			  }	  
	    		  
	    	  }else if(foundA<0) {
	 			 
	    			  if(foundB>=0) {
	    				  count+=(long)((-(foundA+1))*(N-foundB-1));  
	    				 
	    			  }else if(foundB<0) {
	    		
	    				  count+=(long)((-(foundA+1))*(N-(-(foundB+1)))); 
	    				  
	    		     }
	    	      
	          }
	     }
	    System.out.println(count);
	}
}


Compiler output:
Main.java:4: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Scanner;

import java.util.*;	
public class Main1 {
	/**
	 * @param args
	 */
	/**
	 * @param args
	 */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] parts = new int[3][N];
		int count = 0;
		int foundA=0;
		int foundB=0;
	    for(int i=0; i<3; i++) {
			for(int j = 0;j<N;j++){
	    		parts[i][j]=sc.nextInt();
	    	}
			 Arrays.sort(parts[i]);
	    }
	    for(int i = 0; i<N; i++) {
	    	  foundA = Arrays.binarySearch(parts[0], parts[1][i]);
	    	  foundB = Arrays.binarySearch(parts[2],parts[1][i]);
			
	    	  if(foundA>=0) {	 
	    			  if(foundB>=0) {
	    				  count+=foundA*(N-foundB-1);
	    			
	    			  }else if(foundB<0) {
	    				  count+=foundA*(N-(-(foundB+1)));

	    			  }	  
	    		  
	    	  }else if(foundA<0) {
	 			 
	    			  if(foundB>=0) {
	    				  count+=(-(foundA+1))*(N-foundB-1);  
	    				 
	    			  }else if(foundB<0) {
	    		
	    				  count+=(-(foundA+1))*(N-(-(foundB+1))); 
	    				  
	    		     }
	    	      
	          }
	     }
	    System.out.println(count);
	}
}


Compiler output:
Main.java:4: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
       ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;

import java.util.*;	
public class Main1 {
	/**
	 * @param args
	 */
	/**
	 * @param args
	 */
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] parts = new int[3][N];
		int count = 0;
		int foundA=0;
		int foundB=0;
	    for(int i=0; i<3; i++) {
			for(int j = 0;j<N;j++){
	    		parts[i][j]=sc.nextInt();
	    	}
			 Arrays.sort(parts[i]);
	    }
	    for(int i = 0; i<N; i++) {
	    	  foundA = Arrays.binarySearch(parts[0], parts[1][i]);
	    	  foundB = Arrays.binarySearch(parts[2],parts[1][i]);
			
	    	  if(foundA>=0) {	 
	    			  if(foundB>=0) {
	    				  count+=foundA*(N-foundB);
	    			
	    			  }else if(foundB<0) {
	    				  count+=foundA*(N-(-(foundB+1)));

	    			  }	  
	    		  
	    	  }else if(foundA<0) {
	 			 
	    			  if(foundB>=0) {
	    				  count+=(-(foundA+1))*(N-foundB);  
	    				 
	    			  }else if(foundB<0) {
	    		
	    				  count+=(-(foundA+1))*(N-(-(foundB+1))); 
	    				  
	    		     }
	    	      
	          }
	     }
	    System.out.println(count);
	}
}


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

#include <iostream>
#include <vector>
#include <algoritm>

using namespace std;
  //in search of upper bound
  int ub(int s, int e, long long int t, vector<long long int> &V){
    if(e < s){
      return -1;
    }else if(t < V[0]){
      return 0;
    }
    int a = s + (e - s) / 2; //knuth
    
    if(V[a] > t){
      if(e != s){
        return ub(s, a-1, t, V);
      }else{
        return a;
      }
    }else if(V[a] < t){
      if(e != s){
        return ub(a+1, e, t, V);
      }else{
        if(a < V.size() - 1){
          return a + 1;
        }else{
          return -1;
        }
      }
    }else{ //V[a] == t;
      if(a < V.size() - 1){
        return a + 1;
      }else{
        return -1;
      }
    }
  }
   //in search of lower bound
  int lb(int s, int e, long long int t, vector<long long int> &V){
    if(e < s){
      return -1;
    }else if(t > V[V.size()-1]){
      return V.size()-1;
    }
    int a = s + (e - s) / 2; //knuth
    
    if(V[a] > t){
      if(e != s){
        return ub(s, a-1, t, V);
      }else{
        if(a > 0){
          return a - 1;
        }else{
          return -1;
        }
      }
    }else if(V[a] < t){
      if(e != s){
        return ub(a+1, e, t, V);
      }else{
        return a;
      }
    }else{ //V[a] == t;
      if(a > 0){
        return a - 1;
      }else{
        return -1;
      }
    }
  }
int N;

int main(){
  cin >> N;
  
  vector<long long int> A(N);
  vector<long long int> B(N);
  vector<long long int> 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.begin(), A.end());
  sort(C.begin(), C.end());
  
  long long int ans = 0LL;
  
  for(int i = 0; i < N; i++){
    int u = ub(0, N-1, B[i], C);
    int l = lb(0, N-1, B[i], A);
    
    if(u == -1 || l == -1) continue;
    
    u = N - u;
    l++;
    ans += l * u;
    
  }
  cout << ans;
}


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

#include <iostream>
#include <vector>

using namespace std;

int ub(int s, int e, vector <long long int> &V, long long int t){
  if(t < V[0]) return 0;
  
  if(e < s) return - 1;
  
  int a = s + (e - s)/2;
  if(V[a] > t){
    if(a == s){
      return a;
    }else{
    return ub(s, a-1, V, t);
    }
  }else if(V[a] < t){
    if(a == e){
      return a + 1;
    }else{
    return ub(a+1, e, V, t);
    }
  }else{
    return a + 1;
  }
}


int lb(int s, int e, vector <long long int> &V, long long int t){
  if(t > V[V.size()-1]) return V.size() - 1;
  
  if(e < s) return - 1;
  
  int a = s + (e - s)/2;
  if(V[a] > t){
    if(a == s){
      return a - 1;
    }else{
    return lt(s, a-1, V, t);
    }
  }else if(V[a] < t){
    if(a == e){
      return a;
    }else{
    return lt(a+1, e, V, t);
    }
  }else{
    return a - 1;
  }
}

int main(){
  int N;
  cin >> N;
  
  vector <long long int> A(N);
  vector <long long int> B(N);
  vector <long long int> 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];
  
  int ans = 0;
  
  for(int i = 0; i < N; i++){
    int la,uc;
    la = lb(0, N-1, A, B[i]);
    uc = ub(0, N-1, C, B[i]);
    la = N - la - 1;
    ans += la * uc;
  }
  cout << ans;
}



Compiler output:
a.cc: In function 'int lb(int, int, std::vector<long long int>&, long long int)':
a.cc:40:12: error: 'lt' was not declared in this scope; did you mean 't'?
   40 |     return lt(s, a-1, V, t);
      |            ^~
      |            t
a.cc:46:12: error: 'lt' was not declared in this scope; did you mean 't'?
   46 |     return lt(a+1, e, V, t);
      |            ^~
      |            t
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int lt(int s, int e, vector <long long int> &V, long long int t){
  if(t > V[V.size()-1]) return V.size() - 1;
  
  if(e < s) return - 1;
  
  int a = s + (e - s)/2;
  if(V[a] > t){
    if(a == s){
      return a - 1;
    }else{
    return lt(s, a-1, V, t);
    }
  }else if(V[a] < t){
    if(a == s){
      return a;
    }else{
    return lt(a+1, e, V, t);
    }
  }else{
    return a - 1;
  }
}

int main(){
  int N;
  cin >> N;
  
  vector <long long int> A(N);
  vector <long long int> B(N);
  vector <long long int> 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];
  
  int ans = 0;
  
  for(int i = 0; i < N; i++){
    int bmax = lt(C[i], 0, N-1, B);
    int amax = lt(B[bmax], 0, N-1 ,A);
    ans += (amax + 1) * (bmax + 1);
  }
  cout << ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:44:29: error: invalid initialization of non-const reference of type 'std::vector<long long int>&' from an rvalue of type 'int'
   44 |     int bmax = lt(C[i], 0, N-1, B);
      |                            ~^~
a.cc:6:46: note: in passing argument 3 of 'int lt(int, int, std::vector<long long int>&, long long int)'
    6 | int lt(int s, int e, vector <long long int> &V, long long int t){
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc:45:32: error: invalid initialization of non-const reference of type 'std::vector<long long int>&' from an rvalue of type 'int'
   45 |     int amax = lt(B[bmax], 0, N-1 ,A);
      |                               ~^~
a.cc:6:46: note: in passing argument 3 of 'int lt(int, int, std::vector<long long int>&, long long int)'
    6 | int lt(int s, int e, vector <long long int> &V, long long int t){
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int lt(long long int t, int s, int e, vector <long long int> &V){
  if(t < V[0]) return -1;
  else if(t > V[V.size()-1]) return V[V.size()-1];
  
  int a = (s + e) / 2;
  
  if(e - s <= 1) return s;
  
  if(V[a] == t && a > 0) return a - 1
  else if(V[a] > t) return lt(t, s, a, V);
  else if(V[a] < t) return lt(t, a, e, V);
  else return -1;
}

int main(){
  int N;
  cin >> N;
  
  vector <long long int> A(N);
  vector <long long int> B(N);
  vector <long long int> 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];
  
  int ans = 0;
  
  for(int i = 0; i < N; i++){
    int bmax = lt(C[i], 0, N-1, B);
    int amax = lt(B[bmax], 0, N-1 ,A);
    ans += (amax + 1) * (bmax + 1);
  }
  cout << ans;
}



Compiler output:
a.cc: In function 'int lt(long long int, int, int, std::vector<long long int>&)':
a.cc:14:38: error: expected ';' before 'else'
   14 |   if(V[a] == t && a > 0) return a - 1
      |                                      ^
      |                                      ;
   15 |   else if(V[a] > t) return lt(t, s, a, V);
      |   ~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int N;
  cin >> N;
  
  vector<long long int> A(N,0LL);
  vector<long long int> B(N,0LL);
  vector<long long int> C(N,0LL);
  
  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];
  
  vector<int> A_lt_B(N);
  vector<int> B_lt_C(N);
  
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(A[j] < B[i]) A_lt_B[i];
    }
  }
  
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(B[j] < C[i]) B_lt_C[i];
    }
  }
  int ans = 0;
  for(int i = 0; i < N; i++){
    int tmp = B_lt_C;
    for(int j = 0; j < tmp; j++){
      ans += A_lt_B[j] * B_lt_C[i];
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:31: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   23 |       if(A[j] < B[i]) A_lt_B[i];
      |                               ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:29:31: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   29 |       if(B[j] < C[i]) B_lt_C[i];
      |                               ^
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:34:15: error: cannot convert 'std::vector<int>' to 'int' in initialization
   34 |     int tmp = B_lt_C;
      |               ^~~~~~
      |               |
      |               std::vector<int>
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  vector<int> C(N);
  for(int i = 0; i < N; i+){
    cin >> A.at(i);
  }
  for(int i = 0; i < N; i++){
    cin >> B.at(i);
  }
  for(int i = 0; i < N; i++){
    cin >> C.at(i);
  }
  
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  
  int count = 0;
//  bool judge = false
  
  for(int i = 0; i < N; i++){//A's Loop
    for(int j = 0; j < N; j++){//B's Loop
      if(A.at(i) < B.at(j)){//A < B => C judge
        for(int k = 0; k < N; k++){//C's Loop
          if(B.at(j) < C.at(k)){//A < B < C judge
            count++;
          } else {
//            judge = true;
            break;
          }
        }//C's Loop escape
      } else {
        break;
      }
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected primary-expression before ')' token
   10 |   for(int i = 0; i < N; i+){
      |                           ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

using ll =  long long;

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n);
    for(int i=0;i<n;++i){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for(int i=0;i<n;++i){
        cin >> b[i];
    }
    sort(b.begin(), b.end());
    for(int i=0;i<n;++i){
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    

    vector<int> ab(n), bc(n), bc_count(n, 0);
    for(int i=0;i<n;++i) {
        ab[i] = upper_bound(b.begin(), b.end(), a[i]) - b.begin();
        ++bc_count[ab[i]];
    }
    for(int i=1;i<n;++i) bc_count[i] += bc_count[i-1];
    for(int i=0;i<n;++i) {
        bc[i] = upper_bound(c.begin(), c.end(), b[i]) - c.begin();
    }

    ll ans = 0LL;
    for(int i=0;i<n;++i) {
        ans += bc_count[i] * (n-bc[i]);
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(a.begin(), a.end());
      |     ^~~~
      |     short
a.cc:28:17: error: 'upper_bound' was not declared in this scope
   28 |         ab[i] = upper_bound(b.begin(), b.end(), a[i]) - b.begin();
      |                 ^~~~~~~~~~~
a.cc:33:17: error: 'upper_bound' was not declared in this scope
   33 |         bc[i] = upper_bound(c.begin(), c.end(), b[i]) - c.begin();
      |                 ^~~~~~~~~~~
Language: C++

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

int main() {
  int n;cin >> n;
  vector<ll> va(n),vb(n),vc(n);
  ll t;
  for (int i=0;i<n;++i)cin>>va[i];
  for (int i=0;i<n;++i)cin>>vb[i];
  for (int i=0;i<n;++i)cin>>vc[i];

  sort(va.begin(),va.end());
  sort(vb.begin(),vb.end());
  sort(vc.begin(),vc.end());
  int cnt =0;
  for(int i=0;i<vb.size();++i) {
    int a = lower_bound(all(va),vb[i])-va.begin();
    int c = upper_bound(all(vc),vb[i])-vc.begin();
    cnt += itr_a*(n-c);
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'itr_a' was not declared in this scope
   22 |     cnt += itr_a*(n-c);
      |            ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    
    //入力を受けとる
    int n;
    std::cin >> n;
    std::vector<int> a(n),b(n),c(n);
    long long sum=0;//答えの出力用
    
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        std::cin >> b[i];
    }for (int i = 0; i < n; i++) {
        std::cin >> c[i];
    }
    //sort
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    sort(c.begin(),c.end());

    //bを走査
    for (int i = 0; i < n; i++) {
    //二分探索でa,cを探索
    //aはb以下の個数を、cはb以上の個数を求める
    //それをかけて、sumに足す
        auto it1=lower_bound(a.begin(),a.end(),b[i]);
        auto it2=upper_bound(c.begin(),c.end(),b[i]);
        sum+=(it1-a.begin()))*(c.end()-it2);
    }
    //sumを出力
    std::cout << sum << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:29: error: expected ';' before ')' token
   31 |         sum+=(it1-a.begin()))*(c.end()-it2);
      |                             ^
      |                             ;
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        int cnt = 0;
        int tmp = n-1;
        int temp = n-1;
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);
        
        for(int i=0; i<n; i++){
            b[i] = sc.nextInt();
        }
        Arrays.sort(b);
        
        for(int i=0; i<n; i++){
            c[i] = sc.nextInt();
        }
        Arrays.sort(c);
        
        
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(a[i]>=b[j]){
                    temp = j;
                    break;
                }
                for(int k=0; k<n; k++){
                    if(b[j]>=c[k]){
                        tmp = k;
                        break;
                    }
                    if(a[i]<b[j] && b[j]<c[k]){
                        
                        cnt++;
                    }
                }
                if(b[j]>=c[k]) break;
            }
            if(b[j]>=c[tmp]) break;
            if(a[i]>=b[temp]) break;
            
        }
        System.out.println(cnt);
	}
}

Compiler output:
Main.java:44: error: cannot find symbol
                if(b[j]>=c[k]) break;
                           ^
  symbol:   variable k
  location: class Main
Main.java:46: error: cannot find symbol
            if(b[j]>=c[tmp]) break;
                 ^
  symbol:   variable j
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        int cnt = 0;
        int tmp = n-1;
        int temp = n-1;
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);
        
        for(int i=0; i<n; i++){
            b[i] = sc.nextInt();
        }
        Arrays.sort(b);
        
        for(int i=0; i<n; i++){
            c[i] = sc.nextInt();
        }
        Arrays.sort(c);
        
        
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(a[i]>=b[j]){
                    temp = j
                    break;
                }
                for(int k=0; k<n; k++){
                    if(b[j]>=c[k]){
                        tmp = k;
                        break;
                    }
                    if(a[i]<b[j] && b[j]<c[k]){
                        
                        cnt++;
                    }
                }
                if(b[j]>=c[k]) break;
            }
            if(b[j]>=c[tmp]) break;
            if(a[i]>=b[temp]) break;
            
        }
        System.out.println(cnt);
	}
}

Compiler output:
Main.java:31: error: ';' expected
                    temp = j
                            ^
1 error
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        int cnt = 0;
        int tmp = n-1;
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);
        
        for(int i=0; i<n; i++){
            b[i] = sc.nextInt();
        }
        Arrays.sort(b);
        
        for(int i=0; i<n; i++){
            c[i] = sc.nextInt();
        }
        Arrays.sort(c);
        
        
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(a[i]>=b[j]) break;
                for(int k=0; k<n; k++){
                    if(b[j]>=c[k]){
                        break;
                    }
                    if(a[i]<b[j] && b[j]<c[k]){
                        tmp = k;
                        cnt++;
                    }
                }
                if(b[j]>=c[k]) break;
            }
            if(b[j]>=c[tmp]) break;
            if(a[i]>=b[j]) break;
            
        }
        System.out.println(cnt);
	}
}

Compiler output:
Main.java:39: error: cannot find symbol
                if(b[j]>=c[k]) break;
                           ^
  symbol:   variable k
  location: class Main
Main.java:41: error: cannot find symbol
            if(b[j]>=c[tmp]) break;
                 ^
  symbol:   variable j
  location: class Main
Main.java:42: error: cannot find symbol
            if(a[i]>=b[j]) break;
                       ^
  symbol:   variable j
  location: class Main
3 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        int cnt = 0;
        int tmp = n-1;
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        Arrays.sort(a);
        
        for(int i=0; i<n; i++){
            b[i] = sc.nextInt();
        }
        Arrays.sort(b);
        
        for(int i=0; i<n; i++){
            c[i] = sc.nextInt();
        }
        Arrays.sort(c);
        
        
        for(int i=0; i<n; i++){
            for(int j=0; j<n; j++){
                if(a[i]>=b[j]) break;
                for(int k=0; k<n; k++){
                    if(b[j]>=c[k]){
                        break;
                    }
                    if(a[i]<b[j] && b[j]<c[k]){
                        cnt++;
                    }
                }
                if(b[j]>=c[k]) break;
            }
            if(b[j]>=c[k]) break;
            if(a[i]>=b[j]) break;
            
        }
        System.out.println(cnt);
	}
}

Compiler output:
Main.java:38: error: cannot find symbol
                if(b[j]>=c[k]) break;
                           ^
  symbol:   variable k
  location: class Main
Main.java:40: error: cannot find symbol
            if(b[j]>=c[k]) break;
                 ^
  symbol:   variable j
  location: class Main
Main.java:40: error: cannot find symbol
            if(b[j]>=c[k]) break;
                       ^
  symbol:   variable k
  location: class Main
Main.java:41: error: cannot find symbol
            if(a[i]>=b[j]) break;
                       ^
  symbol:   variable j
  location: class Main
4 errors
Language: Java

import java.util.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] aArr = new int[n];
        int[] bArr = new int[n];
        int[] cArr = new int[n];

        for (int i = 0; i < n; i++) {
            aArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            cArr[i] = sc.nextInt();
        }

        Arrays.sort(aArr);
        Arrays.sort(bArr);
        Arrays.sort(cArr);

        long ans = 0;
        for (int i = 0; i < n; i++) {
            int target = bArr[i];
            long aCount = BinarySearch.lowerBound(aArr, target);
            long cCount = n - BinarySearch.upperBound(cArr, target);
            ans += aCount * cCount;
        }

        System.out.println(ans);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Compiler output:
Main.java:32: error: cannot find symbol
            long aCount = BinarySearch.lowerBound(aArr, target);
                          ^
  symbol:   variable BinarySearch
  location: class Main
Main.java:33: error: cannot find symbol
            long cCount = n - BinarySearch.upperBound(cArr, target);
                              ^
  symbol:   variable BinarySearch
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] aArr = new int[n];
        int[] bArr = new int[n];
        int[] cArr = new int[n];

        for (int i = 0; i < n; i++) {
            aArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            bArr[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            cArr[i] = sc.nextInt();
        }

        Arrays.sort(aArr);
        Arrays.sort(bArr);
        Arrays.sort(cArr);

        long ans = 0;
        for (int i = 0; i < n; i++) {
            int target = bArr[i];
            long aCount = BinarySearch.lowerBound(aArr, target);
            long cCount = n - BinarySearch.upperBound(cArr, target);
            ans += aCount * cCount;
        }

        System.out.println(ans);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Template().run();
    }
}


Compiler output:
Main.java:32: error: cannot find symbol
            long aCount = BinarySearch.lowerBound(aArr, target);
                          ^
  symbol:   variable BinarySearch
  location: class Main
Main.java:33: error: cannot find symbol
            long cCount = n - BinarySearch.upperBound(cArr, target);
                              ^
  symbol:   variable BinarySearch
  location: class Main
Main.java:45: error: cannot find symbol
        new Template().run();
            ^
  symbol:   class Template
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  	int n;
  	cin>>n;
  	vector<int> a(n+1);
  	vector<int> b(n+1);
  	vector<int> c(n+1);
  	for(i=1;i<=n;i++) cin>>a[i];
  	for(i=1;i<=n;i++) cin>>b[i];
  	for(i=1;i<=n;i++) cin>>c[i];
  	sort(a.begin(), a.end());
  	sort(c.begin(), c.end());
  	long long ans = 0;
  	for (int i=1;i<=n;i++){
    long long j=lower_bound(a.begin(),a.end(),b[i])-a.begin();
    long long k=upper_bound(c.begin(),c.end(),b[i])-c.begin();
    ans+=j*(c.size()-k);
  }
  	cout<<ans<<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
    9 |         for(i=1;i<=n;i++) cin>>a[i];
      |             ^
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         for(i=1;i<=n;i++) cin>>b[i];
      |             ^
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         for(i=1;i<=n;i++) cin>>c[i];
      |             ^
Language: C++

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

int main(){
	int N, ans=0;
	cin >> N;
	vector<longlong> 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.begin(),A.end());
	sort(C.begin(),C.end());
	for(int i=0;i<N;i++){
		longlong Aans = lower_bound(A.begin(),A.end(),B[i]) - A.begin();
		longlong Cans = upper_bound(C.begin(),C.end(),B[i]) - C.begin();
		cout << Aans << Cans <<endl;
		ans += (N - Cans) * Aans;
	}	
	cout << ans <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'longlong' was not declared in this scope
    8 |         vector<longlong> A(N) ,B(N), C(N);
      |                ^~~~~~~~
a.cc:8:24: error: template argument 1 is invalid
    8 |         vector<longlong> A(N) ,B(N), C(N);
      |                        ^
a.cc:8:24: error: template argument 2 is invalid
a.cc:9:38: error: invalid types 'int[int]' for array subscript
    9 |         for(int i=0;i<N;i++) cin >> A[i];
      |                                      ^
a.cc:10:38: error: invalid types 'int[int]' for array subscript
   10 |         for(int i=0;i<N;i++) cin >> B[i];
      |                                      ^
a.cc:11:38: error: invalid types 'int[int]' for array subscript
   11 |         for(int i=0;i<N;i++) cin >> C[i];
      |                                      ^
a.cc:13:16: error: request for member 'begin' in 'A', which is of non-class type 'int'
   13 |         sort(A.begin(),A.end());
      |                ^~~~~
a.cc:13:26: error: request for member 'end' in 'A', which is of non-class type 'int'
   13 |         sort(A.begin(),A.end());
      |                          ^~~
a.cc:14:16: error: request for member 'begin' in 'C', which is of non-class type 'int'
   14 |         sort(C.begin(),C.end());
      |                ^~~~~
a.cc:14:26: error: request for member 'end' in 'C', which is of non-class type 'int'
   14 |         sort(C.begin(),C.end());
      |                          ^~~
a.cc:16:25: error: expected ';' before 'Aans'
   16 |                 longlong Aans = lower_bound(A.begin(),A.end(),B[i]) - A.begin();
      |                         ^~~~~
      |                         ;
a.cc:17:25: error: expected ';' before 'Cans'
   17 |                 longlong Cans = upper_bound(C.begin(),C.end(),B[i]) - C.begin();
      |                         ^~~~~
      |                         ;
a.cc:18:25: error: 'Aans' was not declared in this scope; did you mean 'ans'?
   18 |                 cout << Aans << Cans <<endl;
      |                         ^~~~
      |                         ans
a.cc:18:33: error: 'Cans' was not declared in this scope; did you mean 'ans'?
   18 |                 cout << Aans << Cans <<endl;
      |                                 ^~~~
      |                                 ans