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

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

#define rep(i, n) REP(i, 0, n)
#define REP(i, k, n) for(auto i = k; i != n; i++)
#define rrep(i, n) RREP(i, n, 0)
#define RREP(i, n, k) for(auto i = n; i != k; i--)
#define all(x, r) (x), (x)+(r)
#define ALL(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " " << x << endl
#define exst(x, data) (data).find(x) != (data).end()
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define np next_permutation
#define b32 bitset<32>

using ll = long long;
using Pii = pair<int,int>;
using Tiii = tuple<int, int, int>;
template<class T>using V = vector<T>;

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

    int N; cin >> N;
    V<int> A = V<int>(N+1); REP(i,1,N+1) cin >> A[i];
    V<int> B = V<int>(N+1); REP(i,1,N+1) cin >> B[i];
    V<int> C = V<int>(N+1); REP(i,1,N+1) cin >> C[i];
    sort(A.begin()+1,A.end());
    sort(B.begin()+1,B.end());
    sort(C.begin()+1,C.end());

    V<ll> B_num = V<int>(N+1, 0);
    REP(b,1,N+1) {
        int pos = lower_bound(A.begin()+1,A.end(),B[b]) - A.begin() -1;
        B_num[b] = pos;
        // REP(a,1,N+1) {
        //     if(A[a]>=B[b]) break;
        //     B_num[b]++;
        // }
    }

    V<ll> C_num = V<int>(N+1, 0);
    REP(i,2,N+1) B_num[i] += B_num[i-1];
    REP(c,1,N+1) {
        int pos = lower_bound(B.begin()+1,B.end(),C[c]) - B.begin() -1;
        C_num[c] = B_num[pos];
        // REP(b,1,N+1) {
        //     if(B[b]>=C[c]) break;
        //     C_num[c] += B_num[b];
        // }
    }

    cout << accumulate(C_num.begin()+1,C_num.end(), 0L) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:19: error: conversion from 'vector<int,allocator<int>>' to non-scalar type 'vector<long long int,allocator<long long int>>' requested
   36 |     V<ll> B_num = V<int>(N+1, 0);
      |                   ^~~~~~~~~~~~~~
a.cc:46:19: error: conversion from 'vector<int,allocator<int>>' to non-scalar type 'vector<long long int,allocator<long long int>>' requested
   46 |     V<ll> C_num = V<int>(N+1, 0);
      |                   ^~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

vector<int> a, b, c;
ll s = 0LL;
ll a2b[100100];
ll b2c[100100];
ll x[100100];

int main() {
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        int x; cin >> x;
        a.push_back(x);
    }
    for(int i = 0; i < N; i++){
        int x; cin >> x;
        b.push_back(x);
    }
    for(int i = 0; i < N; i++){
        int x; cin >> x;
        c.push_back(x);
    }

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

    for(int i = 0; i < N; i++){
        auto itr = upper_bound(b.begin(), b.end(), a[i]);
        ll index = itr - b.begin();
        a2b[i] = index;
    }
    for(int i = 0; i < N; i++){
        auto itr = upper_bound(c.begin(), c.end(), b[i]);
        ll index = itr - c.begin();
        b2c[i] = index;
    }

    for(int i = 0; i < N; i++){
        x[i] = 0;
    }
    for(int i = 0; i < N; i++){
        x[a2b[i]] += 1;
    }
    for(int i = 0; i < N-1; i++){
        x[i+1] += x[i];
    }

    for(int i = 0; i < N; i++){
        s += x[i] * (N - b2c[i]);
    }
    cout << s << endl;

    return 0;
}

Compiler output:
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<int> a, b, c;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:19:9: error: 'a' was not declared in this scope
   19 |         a.push_back(x);
      |         ^
a.cc:23:9: error: 'b' was not declared in this scope
   23 |         b.push_back(x);
      |         ^
a.cc:27:9: error: 'c' was not declared in this scope
   27 |         c.push_back(x);
      |         ^
a.cc:30:10: error: 'a' was not declared in this scope
   30 |     sort(a.begin(), a.end());
      |          ^
a.cc:31:10: error: 'b' was not declared in this scope
   31 |     sort(b.begin(), b.end());
      |          ^
a.cc:32:10: error: 'c' was not declared in this scope
   32 |     sort(c.begin(), c.end());
      |          ^
Language: C++

#include<cstdio>
#define MAX 100005
#define INF 1000000005
using namespace std;
 
int main(){
  int n, a[3][MAX], b[MAX], i, j, k, l, ans = 0;
  scanf("%d", &n);
  for(i = 0; i < 3; i++)
    for(j = 0; j < n; j++) scanf("%d", &a[i][j]);
  for(i = 0; i < 3; i++){
    sort(a[i], a[i]+n);
      a[i][n] = INF;
  }
  for(i = 0; i < 2; i++){
    j = 0; k = 0;
    for(l = 0; l < 2*n; l++){
      if(a[i][j] < a[i+1][k]){
        if(i) ans += b[j]*(n-k);
        j++;
      }else{
        if(!i) b[k] = j;
        k++;
      }
    }
  }
  printf("%d\n", ans);
}

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

#include <iostream>
#include <algorithm>

#define INF (1ll << 60ll)

using namespace std;

long long n;
vector<long long> a;
vector<long long> b;
vector<long long> c;

int main()
{
    long long ans = 0;
    long long tmp;
    
    cin >> n;
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        a.push_back(tmp);
    }
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        b.push_back(tmp);
    }
    for (long long i = 0; i < n; i++) {
        cin >> tmp;
        c.push_back(tmp);
    }

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

    for (long long i = 0; i < n; i++) {
        auto ap = lower_bound(a.begin(), a.end(), b[i]);
        auto cp = upper_bound(c.begin(), c.end(), b[i]);

        ans += (ap - a.begin()) * (c.end() - cp);
    }

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


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<long long> a;
      | ^~~~~~
a.cc:10:1: error: 'vector' does not name a type
   10 | vector<long long> b;
      | ^~~~~~
a.cc:11:1: error: 'vector' does not name a type
   11 | vector<long long> c;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:21:9: error: 'a' was not declared in this scope
   21 |         a.push_back(tmp);
      |         ^
a.cc:25:9: error: 'b' was not declared in this scope
   25 |         b.push_back(tmp);
      |         ^
a.cc:29:9: error: 'c' was not declared in this scope
   29 |         c.push_back(tmp);
      |         ^
a.cc:32:10: error: 'a' was not declared in this scope
   32 |     sort(a.begin(), a.end());
      |          ^
a.cc:33:10: error: 'b' was not declared in this scope
   33 |     sort(b.begin(), b.end());
      |          ^
a.cc:34:10: error: 'c' was not declared in this scope
   34 |     sort(c.begin(), c.end());
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
typedef long long int i64;
int main(){
    int N;cin>>N;
    int A[3][N];
    REP(i,3)REP(j,N) cin>>A[i][j];
  	REP(i,3) sort(A[i],A[i]+N);
    i64 sum=0;
    REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
    cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:92: error: expected ')' before '{' token
   12 |     REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
      |                                                                              ~             ^
      |                                                                                            )
a.cc:12:94: error: expected ')' before ']' token
   12 |     REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
      |                                                           ~                                  ^
      |                                                                                              )
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
typedef long long int i64;
int main(){
    int N;cin>>N;
    int A[3][N];
    REP(i,3)REP(j,N) cin>>A[i][j];
  	REP(i,3) sort(A[i],A[i]+N);
    i64 sum 0;
    REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
    cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected initializer before numeric constant
   11 |     i64 sum 0;
      |             ^
a.cc:12:14: error: 'sum' was not declared in this scope
   12 |     REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
      |              ^~~
a.cc:12:92: error: expected ')' before '{' token
   12 |     REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
      |                                                                              ~             ^
      |                                                                                            )
a.cc:12:94: error: expected ')' before ']' token
   12 |     REP(i,N) sum+=(lower_bound(A[0],A[0]+N,A[1][i])-A[0])*(A[2]+N-upper_bound(A[2],A[2]+N,A{2][i]));
      |                                                           ~                                  ^
      |                                                                                              )
a.cc:13:11: error: 'sum' was not declared in this scope
   13 |     cout<<sum<<endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
const int maxn = 1e5+10;
typedef long long ll;
int a[maxn], b[maxn], c[maxn];
int n;

int main(){
    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]);
    }
    for(int i = 0 ; i < n; i++){
        scanf("%d", &c[i]);
    }
    sort(c, c+n);
    ll ans = 0;
    ll pos1, pos2;
    for(int i = 0; i < n; i++){
        pos1 = lower_bound(a, a + n, b[i]) - a;
        if(pos1 == 0 && a[pos1] < b[i])
            pos1++;
        pos2 = lower_bound(c, c + n, b[i]) - c;
        if(c[pos2] == b[i]) pos--;
        pos2 = n - pos2;
        ans += pos1*pos2;
    }
    printf("%lld\n", ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:29: error: 'pos' was not declared in this scope; did you mean 'pos2'?
   29 |         if(c[pos2] == b[i]) pos--;
      |                             ^~~
      |                             pos2
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int n,a[maxn],b[maxn],c[maxn];
int p1[maxn],p2[maxn];
int main(){
    scanf("%d",&n);
    for (int i=1; i<=n; i++) scanf("%d",&a[i]);
    for (int i=1; i<=n; i++) scanf("%d",&b[i]);
    for (int i=1; i<=n; i++) scanf("%d",&c[i]);
    sort(a+1,a+1+n);
    sort(b+1,b+1+n);
    sort(c+1,c+1+n);
//    int sza=unique(a+1,a+1+n)-a-1;
//    int szb=unique(b+1,b+1+n)-b-1;
//    int szc=unique(c+1,c+1+n)-c-1;

    for (int now,i=1; i<=n; i++){
        now=upper_bound(a+1,a+1+sza,b[i])-a;
        p1[i]=now-1;
        now=upper_bound(c+1,c+1+szc,b[i])-c;
        p2[i]=n-(now-1);
//        printf("%d %d %d\n",i,p1[i],p2[i]);
    }


    long long  ans=0;
    for (int i=1; i<=n; i++)
        ans+=1ll*p1[i]*p2[i];
    printf("%lld\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'sza' was not declared in this scope
   19 |         now=upper_bound(a+1,a+1+sza,b[i])-a;
      |                                 ^~~
a.cc:21:33: error: 'szc' was not declared in this scope
   21 |         now=upper_bound(c+1,c+1+szc,b[i])-c;
      |                                 ^~~
Language: C++

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#define lp(n) for (int i = 0; i < n; i++)
#define lop(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define ll long long int
#define sp ' '
#define intmax 2147483647
#define intmin -2147483647
#define llmax 9223372036854775807
using namespace std;

int n;
int a[100001], b[100000], c[100000];
ll ans;


int main(){
	cin >> n;
	lp(n)
		cin >> a[i];
	lp(n)
		cin >> b[i];
	lp(n)
		cin >> c[i];
	
	a[n] = intmax;

	sort(a, a + n);
	sort(b, b + n);
	sort(c, c + n);

	int j, k;
	j = k = 0;

	ans = 0;
	bool flag = false;

	lp(n) {
		while (a[j] < b[i]) {
			if (j == n) {
				flag = true;
				break;
			}
			j++;
		}
		j--;
		while (b[i] >= c[k]) {
			if (k == n - 1) {
				flag = true;
				break;
			}
			k++;
		}
		ans += long long int(j + 1)*long long int(n - k);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:24: error: expected primary-expression before 'long'
   59 |                 ans += long long int(j + 1)*long long int(n - k);
      |                        ^~~~
Language: C++

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#define lp(n) for (int i = 0; i < n; i++)
#define lop(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define ll long long int
#define sp ' '
#define intmax 2147483647
#define intmin -2147483647
#define llmax 9223372036854775807
using namespace std;

int n;
int a[100001], b[100000], c[100000];
ll ans;


int main(){
	cin >> n;
	lp(n)
		cin >> a[i];
	lp(n)
		cin >> b[i];
	lp(n)
		cin >> c[i];
	
	a[n] = intmax;

	sort(a, a + n);
	sort(b, b + n);
	sort(c, c + n);

	int j, k;
	j = k = 0;

	ans = 0;
	bool flag = false;

	lp(n) {
		while (a[j] < b[i]) {
			if (j == n) {
				flag = true;
				break;
			}
			j++;
		}
		j--;
		while (b[i] >= c[k]) {
			if (k == n - 1) {
				flag = true;
				break;
			}
			k++;
		}
		ans += ll(j + 1)*ll(n - k);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before 'long'
   10 | #define ll long long int
      |            ^~~~
a.cc:59:24: note: in expansion of macro 'll'
   59 |                 ans += ll(j + 1)*ll(n - k);
      |                        ^~
Language: C++

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

using namespace std;

int main(){

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

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

			}
		}

	}

	coutn << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'coutn' was not declared in this scope; did you mean 'count'?
   37 |         coutn << count << endl;
      |         ^~~~~
      |         count
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  int A[100001],B[100001],C[100001];
  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;
  ll s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A,A+N,B[i]);
    t=upper_bound(C,C+N,B[i]);
    ans+=s*t;
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: invalid conversion from 'int*' to 'll' {aka 'long long int'} [-fpermissive]
   34 |     s=upper_bound(A,A+N,B[i]);
      |       ~~~~~~~~~~~^~~~~~~~~~~~
      |                  |
      |                  int*
a.cc:35:18: error: invalid conversion from 'int*' to 'll' {aka 'long long int'} [-fpermissive]
   35 |     t=upper_bound(C,C+N,B[i]);
      |       ~~~~~~~~~~~^~~~~~~~~~~~
      |                  |
      |                  int*
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  int A[100001],B[100001],C[100001];
  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;
  int s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A,A+N,B[i]);
    t=upper_bound(C,C+N,B[i]);
    ans+=s*t;
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   34 |     s=upper_bound(A,A+N,B[i]);
      |       ~~~~~~~~~~~^~~~~~~~~~~~
      |                  |
      |                  int*
a.cc:35:18: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   35 |     t=upper_bound(C,C+N,B[i]);
      |       ~~~~~~~~~~~^~~~~~~~~~~~
      |                  |
      |                  int*
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  int A[100001],B[100001],C[100001];
  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;
  int s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);
    ans+=s*t;
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'int [100001]'
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'int [100001]'
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'int [100001]'
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'int [100001]'
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

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);
  ll ans=0;
  int s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'int [N]'
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'int [N]'
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'int [N]'
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'int [N]'
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  int N;
  cin >> N;
  ll 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);
  ll ans=0;
  ll s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  ll 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());
  sort(C.begin(),C.end());
  ll ans=0;
  ll s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   28 |   sort(A.begin(),A.end());
      |          ^~~~~
a.cc:28:20: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   28 |   sort(A.begin(),A.end());
      |                    ^~~
a.cc:29:10: error: request for member 'begin' in 'B', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   29 |   sort(B.begin(),B.end());
      |          ^~~~~
a.cc:29:20: error: request for member 'end' in 'B', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   29 |   sort(B.begin(),B.end());
      |                    ^~~
a.cc:30:10: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   30 |   sort(C.begin(),C.end());
      |          ^~~~~
a.cc:30:20: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   30 |   sort(C.begin(),C.end());
      |                    ^~~
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = int;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  ll 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);
  ll ans=0;
  ll s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  ll N;
  cin >> N;
  ll 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);
  ll ans=0;
  ll s,t;
  for(ll i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

int main (){
  int N;
  cin >> N;
  ll 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);
  ll ans=0;
  ll s,t;
  for(int i=0; i<N;i++){
    s=upper_bound(A.begin(),A.end(),B[i]);
    t=upper_bound(C.begin(),C.end(),B[i]);    
    ans+=s*t;
  } 
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: request for member 'begin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                     ^~~~~
a.cc:34:31: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   34 |     s=upper_bound(A.begin(),A.end(),B[i]);
      |                               ^~~
a.cc:35:21: error: request for member 'begin' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                     ^~~~~
a.cc:35:31: error: request for member 'end' in 'C', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   35 |     t=upper_bound(C.begin(),C.end(),B[i]);
      |                               ^~~
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
  int i;
  int N;
  int A[100010], B[100010], C[100010];
  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]);
  }
  sort(A, A+N);
  sort(B, B+N);
  sort(C, C+N);
  int num_B[100010], num_A[100010];
  int ruiseki[100010];
  long long ans = 0;
  for (i = 0; i < N; i++) {
    long long* it_A = lower_bound(A, A+N, B[i]);
    long long* it_C = upper_bound(C, C+N, B[i]);
    ans += (int)(it_A - A) * (N - (int)(it_C - C));
    //printf("%d %d ", (int)(it_A - A), N - (int)(it_C - C));
  }
  printf("%lld", ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:34: error: cannot convert 'int*' to 'long long int*' in initialization
   27 |     long long* it_A = lower_bound(A, A+N, B[i]);
      |                       ~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                  |
      |                                  int*
a.cc:28:34: error: cannot convert 'int*' to 'long long int*' in initialization
   28 |     long long* it_C = upper_bound(C, C+N, B[i]);
      |                       ~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                  |
      |                                  int*
a.cc:29:23: error: invalid operands of types 'long long int*' and 'int [100010]' to binary 'operator-'
   29 |     ans += (int)(it_A - A) * (N - (int)(it_C - C));
      |                  ~~~~ ^ ~
      |                  |      |
      |                  |      int [100010]
      |                  long long int*
a.cc:29:46: error: invalid operands of types 'long long int*' and 'int [100010]' to binary 'operator-'
   29 |     ans += (int)(it_A - A) * (N - (int)(it_C - C));
      |                                         ~~~~ ^ ~
      |                                         |      |
      |                                         |      int [100010]
      |                                         long long int*
Language: C++

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

const int MAX_N = 100000;
int n;
vector<int> a, b, c;

int main(){
  cin >> n;
  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    a.push_back(x);
  }

  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    b.push_back(x);
  }
  
  for(int i=0; i<n; i++){
    int x;
    cin >> x;
    c.push_back(x);
  }

  // sort
  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 an = lower_bound(a.begin(), a.end(), b[i]) - a.begin();
    long long cn = c.end() - upper_bound(c.begin(), c.end(), b[i]);
    ans+=an*cn;
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
a.cc:37:30: error: 'upper_bound' was not declared in this scope
   37 |     long long cn = c.end() - upper_bound(c.begin(), c.end(), b[i]);
      |                              ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 2;
bool can[76][N];
int main() {
   int n;
   cin >> n;
   for(int c = 1; c <= 9; ++c)
      can[c][c % n] = 1;
for(int q = 0; q < 46; ++q)
   for(int s = 0; s <= 45; ++s) {
      for(int r = 0; r < n; ++r) {
         for(int ad = 0; ad + s <= 9; ++ ad) {
               can[s + ad][(r * 10 + ad) % n] |= can[s][r];}
         }
      }
   }

   for(int s = 1; s <= 45; ++s)
      if(can[s][0]) {
         cout << s;
         return 0;
      }

}


Compiler output:
a.cc:21:4: error: expected unqualified-id before 'for'
   21 |    for(int s = 1; s <= 45; ++s)
      |    ^~~
a.cc:21:19: error: 's' does not name a type
   21 |    for(int s = 1; s <= 45; ++s)
      |                   ^
a.cc:21:28: error: expected unqualified-id before '++' token
   21 |    for(int s = 1; s <= 45; ++s)
      |                            ^~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int INF = int(1e9);
const int MAX = 1000020;
LL N;
LL a[MAX],b[MAX],c[MAX];
 
void Cin(LL a[])
{
    for(int i = 1;i<=N;i++)
        scanf("%lld",&a[i]);
}
 
int main()
{
    cin>>N;
    Cin(a),Cin(b),Cin(c);
    sort(a+1,a+1+N),sort(b+1,b+1+N),sort(c+1,c+1+N);
    LL sum = 0;
    LL ai = 0,ci = 0;
    for(int i = 1;i<=N;i++){
        while(a[ai+1]<b[i]&&ai+1<=N)
            ai++;
        while(c[ci+1]<=b[i]&&ci+1<=N)
            ci++;
        sum += ai*(N-ci);
    cout<<sum<<endl;
    return 0;
}

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

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

const int N = 1e5+7;

int t[N], m[N], b[N];


int binarySearch1(int arr[], int n, int val) {
    int l = 0, r = n;
    while (l<r-1) {
        int md = (l+r)/2;
        if (val <= arr[md])
            r = md;
        else
            l = md;
    }
    if (arr[l] >= val)
    	return l;
    return r;
}

int binarySearch2(int arr[], int n, int val) {
	int l = 0, r = n;
    while (l<r-1) {
        int md = (l+r)/2;
        if (val < arr[md])
            r = md;
        else
            l = md;
    }
    if (arr[l] > val)
    	r = l;
	return n-r;
}

int t[

int main() {

   int n;
   cin >> n;

   for (int i=0; i<n; i++)
    cin >> t[i];
   for (int i=0; i<n; i++)
    cin >> m[i];
   for (int i=0; i<n; i++)
    cin >> b[i];

   sort(t, t+n);
   sort(m, m+n);
   sort(b, b+n);

   long long ans = 0;

   for (int i=0; i<n; i++) {
   		ans += binarySearch1(t,n,m[i])*binarySearch2(b,n,m[i]);
   }

   cout << ans << endl;


	// int n = 11;
	// int arr[] = {3,2,3,5,7,3,2,7,6,7,7};

	// sort(arr, arr+n);
	// for (auto it: arr)
	// 	cout << it << " ";
	// cout << endl;

	// cout << binarySearch2(arr, n, 11);

}


Compiler output:
a.cc:39:1: error: expected primary-expression before 'int'
   39 | int main() {
      | ^~~
a.cc:37:7: error: expected ']' before 'int'
   37 | int t[
      |       ^
      |       ]
   38 | 
   39 | int main() {
      | ~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

typedef long long int lli;

const int maxn = int(1e5)+5;

lli A[maxn], B[maxn], C[maxn], dp[maxn][3];

int main(void)
{
	lli n;
	scanf("%lld", &n);
	for(lli i = 0;i < n;i++) scanf("%lld", &A[i]);
	for(lli i = 0;i < n;i++) scanf("%lld", &B[i]);
	for(lli i = 0;i < n;i++) scanf("%lld", &C[i]);
	sort(A, A+n), sort(B, B+n), sort(C, C+n);

	for(lli i = 0;i < n;i++) dp[i][0] = i+1;

	for(lli i = 0;i < n;i++)
	{
		lli idx = lli(lower_bound(A, A+n, B[i])-A)-1;
		if(idx >= 0) dp[i][1] += dp[idx][0];
		if(i) dp[i][1] += dp[i-1][1];
	}

	for(lli i = 0;i < n;i++)
	{
		lli idx = lli(lower_bound(B, B+n, C[i])-B)-1;
		if(idx >= 0) dp[i][2] += dp[idx][1];
		if(i) dp[i][2] += dp[i-1][2];
	}
	printf("%lld\n", dp[n-1][2]);
}

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

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>
 
using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;
 
using lli = long long int;
using ulli = unsigned long long int;
 
#define INF 999999999;
 
//#define EVEL 1
 
#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

lli N;
vector<lli> parts[3];
lli in, ans=0;
lli A, B;

int main(){
	cin.tie(0);
	std::ios::sync_with_stdio(false);
	
	cin >> N;
	for(int i = 0; i < 3; i++){
		for(lli j = 0; j < N; j++){
			cin >> in;
			parts[i].push_back(in);
		}
		sort(parts[i].begin(), parts[i].end());
	}
	
	A = N; B = N;
	for(lli i = N-1; i >= 0; i--){
		
		
		while()
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		for(int j = B; j >= 0; j--){
			if( parts[2][i] > parts[1][j] ){
				B = j;
				break;
			}
		}
		
		ans += (B+1)*(A+1);
	}
	
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:23: error: expected primary-expression before ')' token
   66 |                 while()
      |                       ^
Language: Java

package RegularContest084;

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

/**
 * Created by Ryuta on 2017/11/07.
 */
public class SnukeFestival {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] altars = new int[3][n];
        int count = 0;

        // 読み込み
        for(int i = 0;i<3;i++){
            for (int j = 0; j < n; j++) {
                altars[i][j] = sc.nextInt();
            }
        }

        // ソート
        for(int[] alter:altars){
            Arrays.sort(alter);
           // System.out.println(alter[0]);
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if(altars[0][i] < altars[1][j] ){
                    for (int k = 0; k < n; k++) {
                        if(altars[1][j] < altars[2][k]){
                            count++;
                        }
                    }
                }
            }
        }

        System.out.println(count);

    }
}


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

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

long long int a[100005]={0}, b[100005]={0}, c[100005]={0};

int main(){
    int n;
    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);

    long long int ans = 0;
    int ai = 0, ci = 0;a
    for(int i=0;i<n;++i){
        while(ci < n && c[ci] <= b[i])ci++;
        do{
            ai++;
        }while(ai < n && a[ai] < b[i]);
        ai--;
        ans += (n - ci) * (ai + 1);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: expected ';' before 'for'
   18 |     int ai = 0, ci = 0;a
      |                         ^
      |                         ;
   19 |     for(int i=0;i<n;++i){
      |     ~~~                  
a.cc:19:17: error: 'i' was not declared in this scope; did you mean 'ci'?
   19 |     for(int i=0;i<n;++i){
      |                 ^
      |                 ci
Language: C++

import Control.Monad
main :: IO ()
main = do
    n <- readLn
    ss <- (map ((map read) . words)) <$> replicateM 3 getLine
    print $ solve n ss
solve :: Int -> [[Int]] -> Int
solve n (ax:bx:cx:d) = sum (liftM3 f ax bx cx) where
    f a b c = fromEnum ((a < b) && (b < c))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Monad
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
lg a[100005],b[100005],c[100005],d[100005];
int main(){
	int n;scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%lld",a+i);
	for(int i=1;i<=n;++i)scanf("%lld",b+i);
	for(int i=1;i<=n;++i)scanf("%lld",c+i);
	sort(a+1,a+n+1);sort(b+1,b+n+1);sort(c+1,c+n+1);
	for(int i=n,j=n;i;--i){while(j&&c[j]>b[i])--j;d[i]=n-j+d[i+1];}
	for(int i=n,j=n;i;--i){while(j&&b[j]>a[i])--j;c[i]=d[j+1]+c[i+1];}
	cout<<c[1];
	return 0;
}

Compiler output:
a.cc:3:1: error: 'lg' does not name a type
    3 | lg a[100005],b[100005],c[100005],d[100005];
      | ^~
a.cc: In function 'int main()':
a.cc:6:43: error: 'a' was not declared in this scope
    6 |         for(int i=1;i<=n;++i)scanf("%lld",a+i);
      |                                           ^
a.cc:7:43: error: 'b' was not declared in this scope
    7 |         for(int i=1;i<=n;++i)scanf("%lld",b+i);
      |                                           ^
a.cc:8:43: error: 'c' was not declared in this scope
    8 |         for(int i=1;i<=n;++i)scanf("%lld",c+i);
      |                                           ^
a.cc:9:14: error: 'a' was not declared in this scope
    9 |         sort(a+1,a+n+1);sort(b+1,b+n+1);sort(c+1,c+n+1);
      |              ^
a.cc:9:30: error: 'b' was not declared in this scope
    9 |         sort(a+1,a+n+1);sort(b+1,b+n+1);sort(c+1,c+n+1);
      |                              ^
a.cc:9:46: error: 'c' was not declared in this scope
    9 |         sort(a+1,a+n+1);sort(b+1,b+n+1);sort(c+1,c+n+1);
      |                                              ^
a.cc:10:55: error: 'd' was not declared in this scope
   10 |         for(int i=n,j=n;i;--i){while(j&&c[j]>b[i])--j;d[i]=n-j+d[i+1];}
      |                                                       ^
a.cc:11:60: error: 'd' was not declared in this scope
   11 |         for(int i=n,j=n;i;--i){while(j&&b[j]>a[i])--j;c[i]=d[j+1]+c[i+1];}
      |                                                            ^
Language: C

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

using namespace std;

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

  vector<int> a(n), b(n), c(n);
  for (auto& i : a) cin >> i;
  for (auto& i : b) cin >> i;
  for (auto& i : c) cin >> i;

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

  vector<int> bc(n);

  for (int i = 0; i < n; i++) {
    auto ci = upper_bound(c.begin(), c.end(), b[i]);
	int ii = distance(ci, c.end());
	for (int j = 0; j <= i; j++) {
	  bc[j] += ii;
	}
  }

  long long ans = 0;

  for (int i = 0; i < n; i++) {
    auto bi = upper_bound(b.begin(), b.end(), a[i]);
	int ii = distance(b.begin(), bi);
	if (ii < bc.size())
	  ans += bc[ii];
  }
  cout << ans << 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 <bits/stdc++.h>
#include <vector>

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define _P(...) (void)fprintf(stderr, __VA_ARGS__)

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

void dbg(){ cerr << "\n"; }  
template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
 
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI 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(b));
	sort(all(c));
	rep(i, n){
	
		int crb= b[i];
		
		auto it = lower_bound(all(a), crb);
		int asu = it - a.begin();
		
		auto it2 = upper_bound(all(c), crb);
		int csu = n -(it2 - c.begin()) ;
		ans += asu * csu;
			dbg("b=",crb,"a,c=",*it,asu,*it2,csu,ans);
	}
	
	cout << ans <<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   44 |                 ans += asu * csu;
      |                 ^~~
      |                 abs
a.cc:48:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |         cout << ans <<"\n";
      |                 ^~~
      |                 abs
Language: C++

#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;typedef pair<int,int> pii;
typedef pair<ll,ll> pll;typedef vector<string> vss;
typedef vector<int> vii;typedef vector<pii> vpi;
typedef vector<ll> vll;typedef vector<pll> vpl;
typedef unsigned long long ul;typedef queue<int> qii;typedef queue<pii> qpi;
int ans,res;
int get_num(int n){
	res=0;
	while(n>0){
	//	cout<<n<<'\n';
		res+=n%10;
		n/=10;
	}
	return res;
}
int main()
{
// 	freopen("","r",stdin);
// 	freopen("","w",stdout);
	int k;cin>>k;
//	cout<<k<<'\n';
//	cout<<t<<'\n';
	ans=get_num(k);
//	cout<<ans<<'\n';
	for(int i=2;i<==30000000;i++){
		ans=min(ans,get_num(k*i));
	//	cout<<ans<<'\n';
	}
	cout<<ans<<'\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:24: error: expected primary-expression before '=' token
   43 |         for(int i=2;i<==30000000;i++){
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define iinf 2000000000
#define linf 1000000000000000000
#define ulinf 10000000000000000000ull
#define MOD 1000000007
#define lson(v) ((v)<<1)
#define rson(v) (((v)<<1)^1)
#define mpr make_pair
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef unsigned short US;
typedef pair < int , int > pii;
clock_t __stt;
inline void TStart(){__stt=clock();}
inline void TReport(){printf("\nTaken Time : %.3lf sec\n",(double)(clock()-__stt)/CLOCKS_PER_SEC);}
template < typename T > T MIN(T a,T b){return a<b?a:b;}
template < typename T > T MAX(T a,T b){return a>b?a:b;}
template < typename T > T ABS(T a){return a>0?a:(-a);}
template < typename T > void UMIN(T &a,T b){if(b<a) a=b;}
template < typename T > void UMAX(T &a,T b){if(b>a) a=b;}
int n,dp[2][100005],mul[5005],res=1e9;
int main(){
    // inputing start
    scanf("%d",&n);
	while((n%10)==0) n/=10;
	clock
	TStart();
    // calculation start
    int xb,x2,x3;
	mul[0]=1;
	for(xb=1;xb<5005;++xb){
		mul[xb]=mul[xb-1]*10;
		mul[xb]%=n;
	}
	fill(dp[0],dp[0]+100005,iinf);
	for(xb=0;xb<10;++xb) dp[0][xb]=xb;
	for(xb=1;;++xb){
		int cv=(xb&1),lv=1-xb;
		for(x2=0;x2<n;++x2){
			dp[cv][x2]=iinf;
			for(x3=0;x3<10;++x3){
				int av=(x3*mul[xb])%n;
				UMIN(dp[cv][x2],dp[lv][(x2+n-av)%n]+x3);
				if(x3 && !x2) {
					UMIN(res,dp[lv][(x2+n-av)%n]+x3);
				}
			}
		}
		if(xb%10==0){
			if((clock()-__stt)*10>=CLOCKS_PER_SEC*18) break;
		}
	}
	printf("%d\n",res);
    #ifdef LOCAL
        TReport();
    #endif
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: expected ';' before 'TStart'
   28 |         clock
      |              ^
      |              ;
   29 |         TStart();
      |         ~~~~~~