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

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	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];
	}
	std::sort(A.begin(), A.end());
	std::sort(B.begin(), B.end());
	std::sort(C.begin(), C.end());
	//cout << A[0] << A[1] << B[0] << B[1] << C[0] << C[1] << endl;
	vector<int> Anum(n,0);
	vector<int> Bnum(n,0);
	for (int j = 0; j < n; j++) {
		Anum[0] = j;
		if (A[0] < B[j]) {
			break;
		}
		else if (j == n - 1) {
			Anum[0] = n;
			break;
		}
	}
	for (int i = 1; i < n; i++) {
		for (int j = Anum[i - 1]; j < n; j++) {
			Anum[i] = j;
			if (A[i] < B[j]) {
				break;
			}
			else if (j == n - 1) {
				Anum[i] = n;
				break;
			}
		}
	}
	for (int j = 0; j < n; j++) {
		Bnum[0] = j;
		if (B[0] < C[j]) {
			break;
		}
		else if (j == n - 1) {
			Bnum[0] = n;
			break;
		}
	}
	for (int i = 1; i < n; i++) {
		for (int j = Bnum[i - 1]; j < n; j++) {
			Bnum[i] = j;
			if (B[i] < C[j]) {
				break;
			}
			else if (j == n - 1) {
				Bnum[i] = n;
				break;
			}
		}
	}
	long long res = 0;
	int jj = n - 1;
	for (int i = n - 1; i >= 0; i--) {
		while (jj >= Anum[i]) {
			res += (n - Bnum[jj])*(i + 1);
			jj--;
		}
	}
	cout << res << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   22 |         std::sort(A.begin(), A.end());
      |              ^~~~
      |              qsort
a.cc:23:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   23 |         std::sort(B.begin(), B.end());
      |              ^~~~
      |              qsort
a.cc:24:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   24 |         std::sort(C.begin(), C.end());
      |              ^~~~
      |              qsort
Language: C

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

int main(){
    int n, i, j, k;
    cin >> n;

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

    int count = 0;

    for (i = 0; i < n; i++){
        for (j = 0; j < n; j++){
            for (k = 0; k < n; k++){
                if(a[i]<b[j] && b[j]<c[k]){
                    count++;
                }
            }
        }
    }

    cout << count << endl;

    return 0;
}

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

#include<iostream>
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(b,b+n);
  sort(c,c+n);
  long long int J = 0;
  long long int K = 0;
  long long int ans = 0;
  long long int tmp = 0;
  for(int i = 0; i < n; i++) {
    bool pre = true;
    ans += tmp;
    for(int j = J; j < n; j++) {
      if(b[j] >= c[i]) {
        break;
      }
      pre = false;
      J = j + 1;
      for(int k = K; k < n; k++) {
        if(a[k] >= b[j]) break;
        K = k+1;
      }
      tmp += K;
      ans += K;
    }
  }
  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(a,a+n);
      |   ^~~~
      |   short
Language: C++

#include<iostream>
//#include<algorithm>
//#include<functional>
#include<vector>
//#include<cmath>
using namespace std;

//スキャン
void myscan(vector<int> &x, int n){
  for (int i=0; i<n; i++){
    cin >> x[i];
  }
//  sort(x, x+n, greater<int>());
  sort(x.begin(), x.end());
}

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

  myscan(a,n);
  myscan(b,n);
  myscan(c,n);

  int ans = 0;

  for(int i=0; i<n; i++){
    int p = b[i];
    ans += distance(a.begin(), lower_bound(a.begin(), a.end(), p))
      * (n - distance(c.begin(), upper_bound(c.begin(), c.end(), p)));
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'void myscan(std::vector<int>&, int)':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(x.begin(), x.end());
      |   ^~~~
      |   short
a.cc: In function 'int main()':
a.cc:31:34: error: 'upper_bound' was not declared in this scope
   31 |       * (n - distance(c.begin(), upper_bound(c.begin(), c.end(), p)));
      |                                  ^~~~~~~~~~~
Language: Java

package atcoder;

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

public class N84 {
	public int[] ue, naka, sita;
	public static void main(String[] args){
		N84 meu = new N84();
	}
	
	public N84(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ue = new int[n];
		naka = new int[n];
		sita = new int[n];
		int i, meu, rinrin, ibubu, c=0;
		for(i = 0; i < n;++i){
			ue[i] = sc.nextInt();
		}
		for(i = 0; i < n;++i){
			naka[i] = sc.nextInt();
		}
		for(i = 0; i < n;++i){
			sita[i] = sc.nextInt();
		}
		Arrays.sort(ue);Arrays.sort(naka);Arrays.sort(sita);
		for(i = 0; i < n;++i){
			meu = naka[i];
			rinrin = Arrays.binarySearch(ue, meu);
			ibubu = Arrays.binarySearch(sita, meu);
			if(rinrin < 0){
				rinrin = (rinrin+1)*-1;
			}
			if(ibubu < 0){
				ibubu = (n-((ibubu+1)*-1));
			}else{
				ibubu = n-1-ibubu;
			}
			c += rinrin*ibubu;
		}
		System.out.println(c);
	}
}


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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<vector>
#define ll long long
using namespace std;
long long sum;
int main() {
    int n;
    cin >> n;
    vector<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.begin(),a.end());
    sort(c.begin(),c.end()); 
    ll cnt = 0;
    for (int i = 0; i < n; i++) {
        ll A = lower_bound(a.begin(), a.end(), b[i]) - a.begin();
        ll B = c.end() - upper_bound(c.begin(), c.end(), b[i]);
        cnt += A * B;
    }
 
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc:18:29: error: extended character   is not valid in an identifier
   18 |     sort(c.begin(),c.end()); 
      |                             ^
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |  
      | ^
a.cc: In function 'int main()':
a.cc:18:29: error: '\U000000a0' was not declared in this scope
   18 |     sort(c.begin(),c.end()); 
      |                             ^
a.cc:23:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |         cnt += A * B;
      |         ^~~
      |         int
a.cc:25:2: error: expected ';' before 'cout'
   25 |  
      |  ^
      |  ;
   26 |     cout << cnt << endl;
      |     ~~~~
Language: C++

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


Compiler output:
a.cc:2:21: error: extended character   is not valid in an identifier
    2 | using namespace std; 
      |                     ^
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |  
      | ^
a.cc:19:1: error: extended character   is not valid in an identifier
   19 |  
      | ^
a.cc:21:1: error: extended character   is not valid in an identifier
   21 |  
      | ^
a.cc:2:21: error: '\U000000a0' does not name a type
    2 | using namespace std; 
      |                     ^
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#define M 100005
using namespace std;
int N,A[M],B[M],C[M];
int cnt=0;
int a,c;
int TANSAKU_AB(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(A[mid]<B[i]) right=mid;
    else left=mid+1;
  }
  return left;
}
int TANSAKU_BC(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(B[i]<C[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int main(){
  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);
  for(int i=0;i<N;i++){
    a=TANSAKU_AB(i);
    c=TANSAKU_BC(i);
    ans+=a*c;
  }
  printf("%d\n",ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |     ans+=a*c;
      |     ^~~
      |     abs
a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |   printf("%d\n",ans);
      |                 ^~~
      |                 abs
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#define M 100005
using namespace std;
int N,A[M],B[M],C[M];
int cnt=0;
int a,c;
int TANSAKU_AB(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(A[mid]<B[i]) right=mid;
    else left=mid+1;
  }
  return left;
}
int TANSAKU_BC(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(B[i]<C[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int main(){
  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);
  for(int i=0;i<N;i++){
    a=TANSAKU_AB(i);
    c=TANSAKU_BC(i);
  }
  ans=a*c;
  printf("%d\n",cnt);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |   ans=a*c;
      |   ^~~
      |   abs
Language: C++

#include <iostream>

using namespace std;

int main()
{
	int n; cin >> n;
	int a[n];
	int b[n];
	int c[n];
	int ans = 0;
	for (int j = 0; j < n; j++) cin >> a[j];
	for (int j = 0; j < n; j++) cin >> b[j];
	for (int j = 0; j < n; j++) cin >> c[j];
	sort(a, a + n);
	sort(b, b + n);
	sort(c, c + n);
	for (int x = 0; x < n; x++)
	{
		for (int y = 0; y < n; y++)
		{
			if (a[x] >= b[y]) break;
			for (int z = 0; z < n; z++)
			{
				if (a[x] < b[y] && b[y] < c[z]) ans++;
				else
				{
					break;
				}
			}
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |         sort(a, a + n);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    int n, cnt = 0;
    cin >> n;
    vector<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];
    }
    a.sort();
    b.sort();
    c.sort();
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(b[j] >= c[i]) break;
            for(int k = 0; k < n; k++){
                if(a[k] < b[j]){
                    cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'class std::vector<int>' has no member named 'sort'
   19 |     a.sort();
      |       ^~~~
a.cc:20:7: error: 'class std::vector<int>' has no member named 'sort'
   20 |     b.sort();
      |       ^~~~
a.cc:21:7: error: 'class std::vector<int>' has no member named 'sort'
   21 |     c.sort();
      |       ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#define M 100000
using namespace std;
typedef long long llong
int N,A[M],B[M],C[M];
llong cnt=0;
int TANSAKU_AB(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(A[i]<B[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int TANSAKU_BC(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(B[i]<C[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int main(){
  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);
  for(int i=0;i<N;i++){
    for(int j=TANSAKU_AB(i);j<N;j++){
      for(int k=TANSAKU_BC(j);k<N;k++){
        cnt++;
      }
    }
  }
  printf("%lld\n",cnt);
  return 0;
}


Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int N,A[M],B[M],C[M];
      | ^~~
a.cc:8:1: error: 'llong' does not name a type; did you mean 'ulong'?
    8 | llong cnt=0;
      | ^~~~~
      | ulong
a.cc: In function 'int TANSAKU_AB(int)':
a.cc:10:24: error: 'N' was not declared in this scope
   10 |   int left=0,mid,right=N;
      |                        ^
a.cc:13:8: error: 'A' was not declared in this scope
   13 |     if(A[i]<B[mid]) right=mid;
      |        ^
a.cc:13:13: error: 'B' was not declared in this scope
   13 |     if(A[i]<B[mid]) right=mid;
      |             ^
a.cc: In function 'int TANSAKU_BC(int)':
a.cc:19:24: error: 'N' was not declared in this scope
   19 |   int left=0,mid,right=N;
      |                        ^
a.cc:22:8: error: 'B' was not declared in this scope
   22 |     if(B[i]<C[mid]) right=mid;
      |        ^
a.cc:22:13: error: 'C' was not declared in this scope
   22 |     if(B[i]<C[mid]) right=mid;
      |             ^
a.cc: In function 'int main()':
a.cc:28:15: error: 'N' was not declared in this scope
   28 |   scanf("%d",&N);
      |               ^
a.cc:29:35: error: 'A' was not declared in this scope
   29 |   for(int i=0;i<N;i++)scanf("%d",&A[i]);
      |                                   ^
a.cc:30:35: error: 'B' was not declared in this scope
   30 |   for(int i=0;i<N;i++)scanf("%d",&B[i]);
      |                                   ^
a.cc:31:35: error: 'C' was not declared in this scope
   31 |   for(int i=0;i<N;i++)scanf("%d",&C[i]);
      |                                   ^
a.cc:32:8: error: 'A' was not declared in this scope
   32 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |        ^
a.cc:32:20: error: 'B' was not declared in this scope
   32 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |                    ^
a.cc:32:32: error: 'C' was not declared in this scope
   32 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |                                ^
a.cc:36:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |         cnt++;
      |         ^~~
      |         int
a.cc:40:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
   40 |   printf("%lld\n",cnt);
      |                   ^~~
      |                   int
Language: C++

#include <cstdio>
#include <algorithm>
#define M 100000
using namespace std;
typedef long long llong
int N,A[M],B[M],C[M];
llong cnt=0;
int TANSAKU_AB(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(A[i]<B[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int TANSAKU_BC(int i){
  int left=0,mid,right=N;
  while(left<right){
    mid=(left+right)/2;
    if(B[i]<C[mid]) right=mid;
    else left=mid+1;
  }
  return left;
}
int main(){
  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);
  for(int i=0;i<N;i++){
    for(int j=TANSAKU_AB(i);j<N;j++){
      for(int k=TANSAKU_BC(j);k<N;k++){
        cnt++;
      }
    }
  }
  printf("%lld\n",cnt);
  return 0;
}


Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int N,A[M],B[M],C[M];
      | ^~~
a.cc:7:1: error: 'llong' does not name a type; did you mean 'ulong'?
    7 | llong cnt=0;
      | ^~~~~
      | ulong
a.cc: In function 'int TANSAKU_AB(int)':
a.cc:9:24: error: 'N' was not declared in this scope
    9 |   int left=0,mid,right=N;
      |                        ^
a.cc:12:8: error: 'A' was not declared in this scope
   12 |     if(A[i]<B[mid]) right=mid;
      |        ^
a.cc:12:13: error: 'B' was not declared in this scope
   12 |     if(A[i]<B[mid]) right=mid;
      |             ^
a.cc: In function 'int TANSAKU_BC(int)':
a.cc:18:24: error: 'N' was not declared in this scope
   18 |   int left=0,mid,right=N;
      |                        ^
a.cc:21:8: error: 'B' was not declared in this scope
   21 |     if(B[i]<C[mid]) right=mid;
      |        ^
a.cc:21:13: error: 'C' was not declared in this scope
   21 |     if(B[i]<C[mid]) right=mid;
      |             ^
a.cc: In function 'int main()':
a.cc:27:15: error: 'N' was not declared in this scope
   27 |   scanf("%d",&N);
      |               ^
a.cc:28:35: error: 'A' was not declared in this scope
   28 |   for(int i=0;i<N;i++)scanf("%d",&A[i]);
      |                                   ^
a.cc:29:35: error: 'B' was not declared in this scope
   29 |   for(int i=0;i<N;i++)scanf("%d",&B[i]);
      |                                   ^
a.cc:30:35: error: 'C' was not declared in this scope
   30 |   for(int i=0;i<N;i++)scanf("%d",&C[i]);
      |                                   ^
a.cc:31:8: error: 'A' was not declared in this scope
   31 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |        ^
a.cc:31:20: error: 'B' was not declared in this scope
   31 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |                    ^
a.cc:31:32: error: 'C' was not declared in this scope
   31 |   sort(A,A+N);sort(B,B+N);sort(C,C+N);
      |                                ^
a.cc:35:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   35 |         cnt++;
      |         ^~~
      |         int
a.cc:39:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
   39 |   printf("%lld\n",cnt);
      |                   ^~~
      |                   int
Language: C++

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

#define DEBUG(x) cerr << #x << ": " << x << endl;
#define 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];
    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());

    int cnt = 0;
    for (int ai = 0; ai < n; ai++) {
        for (int bi = 0; bi < n; bi++) {
            for (int ci = 0; ci < n; ci++) {
                if (a[ai] < b[bi] && b[bi] c[ci]) {
                    cnt++;
                }
            }
        }
    }

    cout << cnt << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:43: error: expected ')' before 'c'
   22 |                 if (a[ai] < b[bi] && b[bi] c[ci]) {
      |                    ~                      ^~
      |                                           )
Language: C++

#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N,sum=0;
	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);
	for(int i=0;i<N;i++)
	{
		m=lower_bound(a,a+N,b[i])-a;
		n=upper_bound(c,c+N,c[i])-c;
		sum+=m*(N-n);
	}
	printf("%d",sum);
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'm' was not declared in this scope
   24 |                 m=lower_bound(a,a+N,b[i])-a;
      |                 ^
a.cc:25:17: error: 'n' was not declared in this scope
   25 |                 n=upper_bound(c,c+N,c[i])-c;
      |                 ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const long long Maxn=100000;
long long n,sum=0;
long long a[Maxn],b[Maxn],c[Maxn];
int main()
{
	long long ans,ant;
	cin>>n;
	for(int j=0;j<n;j++)
	cin>>a[j];
	for(int j=0;j<n;j++)
		cin>>b[j];
	for(int j=0;j<n;j++)
		cin>>c[i];
    sort(a,a+n);
	sort(b,b+n);
	sort(c,c+n);
	for(int i=0;i<n;i++)
	{
		ans=lower_bound(a,a+n,b[i])-a;
		ant=upper_bound(c,c+n,b[i])-c;
		sum+=ans*(n-ant);
	}
	printf("%lld\n",sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
   13 |         cin>>n;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<algorithm>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:19:24: error: 'i' was not declared in this scope
   19 |                 cin>>c[i];
      |                        ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
	static int n;
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[n];
		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();
		}
		long ans = 0;
		Arrays.sort(a);
		Arrays.sort(c);
		for(int i  = 0 ; i < n ; i++) {
			ans += 0L + binary_search(a, b[i]) *(n -  binary_search2(c, b[i] + 1));
		}
		System.out.println(ans);
	}
 
	public static int binary_search(int[] a, int x) {
		int l = 0;
		int r = n;
		while(r - l >= 1) {
			int i = (l + r) / 2;
			if(x <= a[i]) r = i;
			else l = i + 1;
		}
		return l;
	}
 
}

Compiler output:
Main.java:27: error: cannot find symbol
			ans += 0L + binary_search(a, b[i]) *(n -  binary_search2(c, b[i] + 1));
			                                          ^
  symbol:   method binary_search2(int[],int)
  location: class Main
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
 
	static long n;
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[n];
		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();
		}
		long ans = 0;
		Arrays.sort(a);
		Arrays.sort(c);
		for(int i = 0 ; i < n ; i++) {
			ans += binary_search(a, b[i]) * (n - binary_search(c, b[i]+1));
		}
		System.out.println(ans);
	}
 
	public static long binary_search(int[] a, int x) {
		int l = 0;
		int r = n - 1;
		while(r - l > 1) {
			int i = (l + r) / 2;
			if(x <= a[i]) r = i;
			else l = i;
		}
		return r;
	}
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from long to int
		int[] a = new int[n];
		                  ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
		int[] b = new int[n];
		                  ^
Main.java:13: error: incompatible types: possible lossy conversion from long to int
		int[] c = new int[n];
		                  ^
Main.java:34: error: incompatible types: possible lossy conversion from long to int
		int r = n - 1;
		          ^
4 errors
Language: Java

import java.util.*;

public class SnukeFes {
    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];
        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);

        long[] up = new long[N];
        long[] dn = new long[N];

        int j = N - 1;
        for (int i = N - 1; i >= 0; i--) {
            for (; j >= 0; j--) {
                if (A[j] < B[i]) {
                    up[i] = (long)(j + 1); // record how many a is less at B[i];
                    break;
                }
            }

            if (j < 0) break;
        }

        j = 0;
        for (int i = 0; i < N; i++) {
            for (; j < N; j++) {
                if (C[j] > B[i]) {
                    dn[i] = (long) N - j;
                    break;
                }
            }

            if (j > N) break;
        }

        long res = 0;

        for (int i = 0; i < N; i++) {
                res += up[i] * dn[i];
        }

        System.out.println(res);
    }




}


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

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

int main(void){
    int n; cin >> n;
    vector<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];
    }

    int dp[2][100010] = {};

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());

    int j = 0;
    for(int i = 0; i < n; i++){
        while(1){
            if(a[i] < b[j]){
                dp[0][i] = n - j;
                break;
            }
            if(j == n-1){
                cout << "ok" << endl;
                i = n-1;
                break;
            }
            j++;
        }
    }

    j = 0;
    for(int i = 0; i < n; i++){
        while(1){
            if(b[i] < c[j]){
                dp[1][i] = n - j;
                break;
            }
            if(j == n-1){
                cout << "ok" << endl;
                i = n-1;
                break;
            }
            j++;
        }
        
    }

    long long temp;
    int w;
    long long D[100010] = {};
    long long = 0;
    for(int i = 0; i < n; i++){
        if(D[ dp[0][i] ] != 0){
            ans += D[ dp[0][i] ];
        }else{
            temp = 0;
            for(int j = n - dp[0][i]; j < n; j++){

                temp += dp[1][j];
            }
            ans += temp;
            D[ dp[0][i] ] = temp;
        }
    }

    /*for(int i = 0; i < n; i++) cout << dp[0][i] << " ";
    cout << endl;
    for(int i = 0; i < n; i++) cout << dp[1][i] << " ";
    cout << endl;
    for(int i = 0; i <= n; i++) cout << D[i] << " ";
    cout << endl;
    */
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:15: error: expected unqualified-id before '=' token
   59 |     long long = 0;
      |               ^
a.cc:62:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   62 |             ans += D[ dp[0][i] ];
      |             ^~~
      |             abs
a.cc:69:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   69 |             ans += temp;
      |             ^~~
      |             abs
a.cc:81:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   81 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define DEBUG(vec) for (auto v : vec) { cout << v << " "; } cout << endl;

using namespace std;

ll A[100010] = {};
ll B[100010] = {};
ll C[100010] = {};

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

  int N;
  cin >> N;
  REP(i, N) {
    cin >> A[i];
  }
  REP(i, N) {
    cin >> B[i];
  }
  REP(i, N) {
    cin >> C[i];
  }
  sort(A, A + N);
  sort(B, B + N);
  sort(C, C + N);

  ll total = 0;
  REP(i, N) {
    ll ai = lower_bound(A, A + N, B[i]) - A;
    llci = upper_bound(C, C + N, B[i]) - C;
    total += ai * (N - ci);
  }

  cout << total << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:5: error: 'llci' was not declared in this scope
   55 |     llci = upper_bound(C, C + N, B[i]) - C;
      |     ^~~~
a.cc:56:24: error: 'ci' was not declared in this scope; did you mean 'ai'?
   56 |     total += ai * (N - ci);
      |                        ^~
      |                        ai
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
	int N;
	int A[100000], B[100000], C[100000];
	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, A + N); sort(B, B + N); sort(C, C + N);
	ll ans = 0;
	for(int i = 0; i < N; i++){
		int* mid = lower_bound(A, A + N, B[i]);
		ll = distance(A, mid);
		int* mid_ = upper_bound(C, C + N, B[i]);
		ll idx_ = distance(C, mid_);
		ans += idx * (N - idx_);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: expected unqualified-id before '=' token
   21 |                 ll = distance(A, mid);
      |                    ^
a.cc:24:24: error: 'idx' was not declared in this scope; did you mean 'idx_'?
   24 |                 ans += idx * (N - idx_);
      |                        ^~~
      |                        idx_
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int a[100005],b[100005],c[100005],n,nowa,nowc;
    long long ans=0,nowa=0,nowb=0;
    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);

    for (int i=0;i<n;i++)
        {
            while ((a[nowa]<b[i])&&(nowa<n)) nowa++;
            while ((c[nowc]<=b[i])&&(nowc<n)) nowc++;
            ans=ans+nowa*(n-nowc);
        }
    printf("%lld\n",ans);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: conflicting declaration 'long long int nowa'
    9 |     long long ans=0,nowa=0,nowb=0;
      |                     ^~~~
a.cc:8:41: note: previous declaration as 'int nowa'
    8 |     int a[100005],b[100005],c[100005],n,nowa,nowc;
      |                                         ^~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

long n;
long a[100005];
long b[100005];
long c[100005];
long long res;

int main()
{
	long long i, k;

	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);

	i = k = 0;
	for (long j = 0; j < n; ++j)
	{
		while (a[i] < b[j] && i < n) ++i;
		while (c[k] <= b[j] && k < n) ++k
		if (b[j] > c[n-1]) break;
		res += i * (n - k);
	}

	cout << res << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:50: error: expected ';' before 'if'
   35 |                 while (c[k] <= b[j] && k < n) ++k
      |                                                  ^
      |                                                  ;
   36 |                 if (b[j] > c[n-1]) break;
      |                 ~~
Language: C++

#include<iostream>
using namespace std;
 
 
int main(){
  int A[10003];
  int B[10003];
  int C[10003];
  int K[10003];
  int N;
  cin>>N;
  for(int i=0;i<N;i++) cin>>A[i]>>B[i]>>C[i];
  for(int i=0;i<N;i++){
    int a=0;
    for(int j=0;j<N;j++){
    if(A[j]<B[i])a++;
    }
  K[i]=a;
  }
  long ans=0
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
    if(B[i]<C[j])ans+=K[i];
   }
  }
  cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: expected ',' or ';' before 'for'
   21 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:21:15: error: 'i' was not declared in this scope
   21 |   for(int i=0;i<N;i++){
      |               ^
Language: C++

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

typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N],b[N],c[N];

int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        for(int i=0; i<n; i++)
            scanf("%d",&a[i]);
        sort(a,a+n);
        for(int i=0; i<n; i++)
            scanf("%d",&b[i]);
        sort(b,b+n);
        for(int i=0; i<n; i++)
            scanf("%d",&c[i]);
        sort(c,c+n);
        ll ans=0;
        for(int i=0;i<n;i++)
        {
            auto pos1=lower_bound(a,a+n,b[i]);
            ll cnt_a=it_a-a;
            auto pos2=upper_bound(c,c+n,c[i]);
            ll cnt_c=(c+n)-it_c;
            ans+=(cnt_a*cnt_c);
        }
        printf("%lld\n",ans);
    }
    return 0;
}
/**
2
1 5
2 4
3 6
3
1 1 1
2 2 2
3 3 3
6
3 14 159 2 6 53
58 9 79 323 84 6
2643 383 2 79 50 288
**/


Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'it_a' was not declared in this scope
   27 |             ll cnt_a=it_a-a;
      |                      ^~~~
a.cc:29:28: error: 'it_c' was not declared in this scope
   29 |             ll cnt_c=(c+n)-it_c;
      |                            ^~~~
Language: C++

#include<iostream>
using namespace std;
 
 
int main(){
  int A[10003];
  int B[10003];
  int C[10003];
  int K[10003];
  int N;
  cin>>N;
  for(int i=0;i<N;i++)cin>>A[i]>>B[i]>>c[i];
  for(int i=0;i<N;i++){
    int a=0;
    for(int j=0;j<N;j++){
    if(A[j]<B[i])a++;
    }
  K[i]=a;
  }
  long ans=0
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
    if(B[i]<C[j])ans+=K[i];
   }
  }
  cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:40: error: 'c' was not declared in this scope
   12 |   for(int i=0;i<N;i++)cin>>A[i]>>B[i]>>c[i];
      |                                        ^
a.cc:21:3: error: expected ',' or ';' before 'for'
   21 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:21:15: error: 'i' was not declared in this scope
   21 |   for(int i=0;i<N;i++){
      |               ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int mod=1e9+7;
const int N=1e5+5;
int a[N],b[N],c[N];

int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        for(int i=0; i<n; i++)
            scanf("%d",&a[i]);
        sort(a,a+n);
        for(int i=0; i<n; i++)
            scanf("%d",&b[i]);
        sort(b,b+n);
        for(int i=0; i<n; i++)
            scanf("%d",&c[i]);
        sort(c,c+n);
        ll ans=0;
        for(int i=0;i<n;i++)
        {
            auto pos1=lower_bound(a,a+n,b[i]);
            ll cnt_a=it_a-a;
            auto pos2=upper_bound(c,c+n,c[i]);
            ll cnt_c=(c+n)-it_c;
            ans+=(cnt_a*cnt_c);
        }
        printf("%lld\n",ans);
    }
    return 0;
}
/**
2
1 5
2 4
3 6
3
1 1 1
2 2 2
3 3 3
6
3 14 159 2 6 53
58 9 79 323 84 6
2643 383 2 79 50 288
**/


Compiler output:
a.cc: In function 'int main()':
a.cc:32:22: error: 'it_a' was not declared in this scope
   32 |             ll cnt_a=it_a-a;
      |                      ^~~~
a.cc:34:28: error: 'it_c' was not declared in this scope
   34 |             ll cnt_c=(c+n)-it_c;
      |                            ^~~~
Language: C++

#include "stdafx.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
	int N;
	int A[10000], B[10000], C[10000], K1, K2, K3;
	int i, j, q, count;
	scanf("%d", &N);
	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]);
	}
	for (i = 0; i < N; i++)
	{
		K1 = A[i];
		for (j = 0; j < N; j++)
		{
			K2 = B[j];
			if(K2>K1)
				for (q = 0; q < N; q++)
				{
					if (K3 > K2)
						count++;
					if (q == (N - 1))
						break;
				}
			if (j == N-1)
				break;
		}
		if (i == N - 1)
			break;
	}
	printf("%d\n", count);
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>


long a[2][10000];

void sort(int n){
	int k = 0;//a[k]より前はソート済み
	while(k < n-1){
		int j;
		int last = n-1;//最後に交換した位置
		for(j=n-1;j>k;j--){
			if(a[j-1] > a[j]){
				swap(int, a[j-1], a[j]);
				last = j;
			}
		}
		k = last;
	}
}

int main(void)
{
	long  i,j,k;
	long  cnt, n;
	scanf("%ld", &n);
	for(i=0;i<3;i++){
		for(j=0;j<n;j++){
			scanf("%ld",&a[i][j]);
		}
	}

	sort(n);
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			for(k=0;k<n;k++){
				if(a[0][i] < a[1][j] && a[1][j] < a[2][k]){
					cnt++;
				}else{
					continue;
				}
			}
		}
	}

	printf("%ld\n",cnt);
	return 0;
}


Compiler output:
main.c: In function 'sort':
main.c:13:33: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   13 |                                 swap(int, a[j-1], a[j]);
      |                                 ^~~~
main.c:13:38: error: expected expression before 'int'
   13 |                                 swap(int, a[j-1], a[j]);
      |                                      ^~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class ABC077_C {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[][] parts = new int[3][n];
		for (int i = 0; i < 3; i++) {
			String[] input = br.readLine().split(" ");
			for (int j = 0; j < n; j++) {
				parts[i][j] = Integer.parseInt(input[j]);
			}
			Arrays.sort(parts[i]);

		}
		int[][] pn = new int[3][n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i >= n)
					break;
				if (parts[0][j] >= parts[1][i]) {
					pn[0][i] = j;
					i++;
					j--;
					continue;
				}

			}
			if (i >= n)
				break;
			pn[0][i] = n;
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i >= n)
					break;
				if (parts[1][j] >= parts[2][i]) {
					pn[1][i] = j;
					i++;
					continue;
				}

			}
			if (i >= n)
				break;
			pn[1][i] = n;
		}
		pn[2][0] = pn[0][0];
		for (int i = 1; i < n; i++) {
			pn[2][i] = pn[0][i] + pn[2][i - 1];
		}
		int total = 0;
		for (int i = 0; i < n; i++) {
			if (pn[1][i] == 0)
				continue;
			total += pn[2][pn[1][i] - 1];
		}
		System.out.println(total);
	}
}


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

#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <functional>

#define REP(i,n) for(int i = 0; i < int(n); i++)

using namespace std;
using ll = long long;


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());

	int c = 0;	
	REP(i, N) {
		REP(j, N) {
			if (C[i] > B[j])
				REP(k, N) {
				if (B[j] > A[k]) {
					c += (N - k);
					cout << c << endl;
					break;
				}
				if (B[j] <= A[k]) {
					break;
			}
			if (C[i] <= B[j])
			break;
		}
	}
	cout << c << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C

#include <stdio.h>
int main() {
	int n;
	scanf("%d",&n);
	int a[n],b[n],c[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]);
	int sort(int,int *);
	int *count(int,int *,int *);
	int sum(int,int *,int *);
	sort(n,a);
	sort(n,b);
	sort(n,c);
	int bcount[n] = count(n,b,c),acount[n] = count(n,a,b);
	printf("%d",sum(n,bcount,acount));
	return 0;
}

int sort(int n,int *array) {
	int tmp;
	for(int i = n - 2;i >= 1;i--) {
		for(int j = 0;j <= i;j++) {
			if(array[j] > array[j+1]) {
				tmp = array[j];
				array[j] = array[j+1];
				array[j+1] = tmp;
			}
		}
	}
	return 0;
}

int *count(int n,int *farray,int *barray) {
	int counter[n];
	for(int i = 0;i < n;i++) {
		if(i == 0) {
			for(int j = 0;j < n;j++) {
				if(farray[i] < barray[j]) {
					counter[i] = n - j;
					break;
				}
			}
		}
		else {
			for(int j = n - counter[n-1];j < n;j++) {
				if(farray[i] < barray[j]) {
					counter[i] = n - j;
					break;
				}
			}
		}
	}
	return counter;	
}

int sum(int n,int *bcount,int *acount) {
	int sumsum = 0;
	for(int i = 0;i < n;i++) {
		for(int j = n - acount[i];j < n;j++) {
			sumsum += bcount[j];
	}
	return sumsum;
}

Compiler output:
main.c: In function 'main':
main.c:15:25: error: variable-sized object may not be initialized except with an empty initializer
   15 |         int bcount[n] = count(n,b,c),acount[n] = count(n,a,b);
      |                         ^~~~~
main.c:15:50: error: variable-sized object may not be initialized except with an empty initializer
   15 |         int bcount[n] = count(n,b,c),acount[n] = count(n,a,b);
      |                                                  ^~~~~
main.c: In function 'count':
main.c:54:16: warning: function returns address of local variable [-Wreturn-local-addr]
   54 |         return counter;
      |                ^~~~~~~
main.c: In function 'sum':
main.c:64:1: error: expected declaration or statement at end of input
   64 | }
      | ^
Language: C++

#include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ちゃんとユニークな配列にする。連続した値を除去して切り出す。
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

int main() {
  int N;
  int size;
  cin >> N;
  vector<int> A;
  rep(i, N) {
    cin >> size;
    A.pb(size);
  }
  sort(all(A));

  vector<int> B;
    rep(i, N) {
    cin >> size;
    B.pb(size);
  }
  sort(all(B));

  vector<int> C;
  rep(i, N) {
    cin >> size;
    C.pb(size);
  }
  sort(all(C));

  int result = 0;
  int biggerCIndex = 0;
  int biggerBIndex = 0;
  rep(i, N) {
    int c = C[i];
    for (int j = biggerCIndex; j < N; j++){
      if(c > B[j]) {
        biggerCIndex = j;
        break;
      }
    }
    for (int j = biggerCIndex; j < N ; j++) {
      int b = B[j];
      for (int k = biggerBIndex; k < N; k++) {
        if(B > c[k]) {
          biggerBIndex = k;
          break;
        }
      }
      result += (N - biggerBIndex)
    }
  }

  cout << result << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: invalid types 'int[int]' for array subscript
   57 |         if(B > c[k]) {
      |                 ^
a.cc:62:35: error: expected ';' before '}' token
   62 |       result += (N - biggerBIndex)
      |                                   ^
      |                                   ;
   63 |     }
      |     ~
Language: C++

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	vector<int> x(n);
	vector<int> y(n);
	vector<int> z(n);
	
	for(int i = 0; i < n; i++)
	{
		cin >> x[i];
	}
	
	for(int i = 0; i < n; i++)
	{
		cin >> y[i];
	}
	
	for(int i = 0; i < n; i++)
	{
		cin >> z[i];
	}
	
	sort(x.begin(),x.end());
	sort(y.begin(),y.end());
	sort(z.begin(),z.end());
	
	
	int ans = 0;
	for(int i = 0; i < n; i++)
	{
		for(int j = dy; j < n; j++)
		{
			if(x[i] >= y[j])
			{
				dy = j;
				continue;
			}
			
			for(int k = dz; k < n; k++)
			{
				if(y[j] < z[k])
				{
					ans++;
				}
			}
		}
	}
	
	cout << ans << endl;
				
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:29: error: 'dy' was not declared in this scope; did you mean 'y'?
   39 |                 for(int j = dy; j < n; j++)
      |                             ^~
      |                             y
a.cc:47:37: error: 'dz' was not declared in this scope; did you mean 'z'?
   47 |                         for(int k = dz; k < n; k++)
      |                                     ^~
      |                                     z
Language: C++

int main()
{
	int n;
	cin >> n;
	int a[114514], b[114514], c[114514];
	long long d[114514];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++)
		cin >> b[i];
	sort(b, b + n);
	for (int i = 0; i < n; i++)
		cin >> c[i];
	sort(c, c + n);
	d[0] = 0;
	long long x = 0;
	for (int i = 0, j = 0; j < n;) {
		if (i == n || a[i] >= b[j])
			d[j + 1] = x + d[j], j++;
		else
			i++, x++;
	}
	x = 0;
	for (int i = 0, j = 0; j < n;) {
		if (i == n || b[i] >= c[j])
			x += d[i], j++;
		else
			i++;
	}
	cout << x << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |         sort(a, a + n);
      |         ^~~~
      |         short
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << x << endl;
      |         ^~~~
a.cc:31:22: error: 'endl' was not declared in this scope
   31 |         cout << x << endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n;
int a[4][1000000009];
int memo[4][1000000009];

int dfs(int cnt,int last){
  int rec=0;
  if(memo[cnt][last]!=-1)return memo[cnt][last];
  if(cnt==3)return 1;
  for(int i=0;i<n;i++){
    if(last<a[cnt][i])rec+=dfs(cnt+1,a[cnt][i]);
  }
  return memo[cnt][last]=rec;
}

int main(){
  memset(memo,-1,sizeof(memo));
  cin>>n;
  for(int i=0;i<3;i++){
    for(int j=0;j<n;j++){
      cin>>a[i][j];
    }
  }
  cout<<dfs(0,0)<<endl;
  return(0);
}

Compiler output:
/tmp/cc3QZmVO.o: in function `dfs(int, int)':
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/cc3QZmVO.o
a.cc:(.text+0x61): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/cc3QZmVO.o
a.cc:(.text+0x11a): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/cc3QZmVO.o
a.cc:(.text+0x144): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/cc3QZmVO.o
/tmp/cc3QZmVO.o: in function `main':
a.cc:(.text+0x16a): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/cc3QZmVO.o
collect2: error: ld returned 1 exit status
Language: C++

using namespace std;

int main(){

    int K;

    cin>>K;

    int arr[K][K];
    for(int i=0;i<K;i++){
        for(int j=0;j<K;j++){
            cin>>arr[i][j];
        }
    } //入力

    for(int i=0;i<K;i++){
        for(int j=0;j<K;j++){
            if(){
                
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>K;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:18:16: error: expected primary-expression before ')' token
   18 |             if(){
      |                ^