Language: C++

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

int main(){
  ll N;
  cin>>N;
  vector<ll> A(N);
  vector<ll> B(N);
  vector<ll> C(N);
  for(ll i=0;i<N;i++)cin>>A.at(i);
  for(ll i=0;i<N;i++)cin>>B.at(i);
  for(ll i=0;i<N;i++)cin>>C.at(i);
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  sort(C.begin(),C.end());  
  ll left=-1;
  ll lefta=-1;
  ll right=N;
  ll righta=N;
  ll ans=0;
  for(ll i=0;i<N;i++){
    left=-1;
    right=N;
    lefta=-1;
    righta=N;
    while(right-left>1){
      ll mid=(right+left)/2;
      if(A.at(mid)<B.at(i))left=mid;
      else right=mid;
    }
    while(righta-lefta>1){
      ll mid=(righta+lefta)/2;
      if(C.at(mid)>B.at(i))righta=mid;
      else lefta=mid;
    }
    ans=ans+righta*left;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:3:9: error: 'll' does not name a type
    3 | typedef ll int64_t;
      |         ^~
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll N;
      |   ^~
a.cc:7:8: error: 'N' was not declared in this scope
    7 |   cin>>N;
      |        ^
a.cc:8:12: error: template argument 2 is invalid
    8 |   vector<ll> A(N);
      |            ^
a.cc:9:12: error: template argument 2 is invalid
    9 |   vector<ll> B(N);
      |            ^
a.cc:10:12: error: template argument 2 is invalid
   10 |   vector<ll> C(N);
      |            ^
a.cc:11:9: error: expected ';' before 'i'
   11 |   for(ll i=0;i<N;i++)cin>>A.at(i);
      |         ^~
      |         ;
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(ll i=0;i<N;i++)cin>>A.at(i);
      |              ^
a.cc:11:29: error: request for member 'at' in 'A', which is of non-class type 'int'
   11 |   for(ll i=0;i<N;i++)cin>>A.at(i);
      |                             ^~
a.cc:12:9: error: expected ';' before 'i'
   12 |   for(ll i=0;i<N;i++)cin>>B.at(i);
      |         ^~
      |         ;
a.cc:12:14: error: 'i' was not declared in this scope
   12 |   for(ll i=0;i<N;i++)cin>>B.at(i);
      |              ^
a.cc:12:29: error: request for member 'at' in 'B', which is of non-class type 'int'
   12 |   for(ll i=0;i<N;i++)cin>>B.at(i);
      |                             ^~
a.cc:13:9: error: expected ';' before 'i'
   13 |   for(ll i=0;i<N;i++)cin>>C.at(i);
      |         ^~
      |         ;
a.cc:13:14: error: 'i' was not declared in this scope
   13 |   for(ll i=0;i<N;i++)cin>>C.at(i);
      |              ^
a.cc:13:29: error: request for member 'at' in 'C', which is of non-class type 'int'
   13 |   for(ll i=0;i<N;i++)cin>>C.at(i);
      |                             ^~
a.cc:14:10: error: request for member 'begin' in 'A', which is of non-class type 'int'
   14 |   sort(A.begin(),A.end());
      |          ^~~~~
a.cc:14:20: error: request for member 'end' in 'A', which is of non-class type 'int'
   14 |   sort(A.begin(),A.end());
      |                    ^~~
a.cc:15:10: error: request for member 'begin' in 'B', which is of non-class type 'int'
   15 |   sort(B.begin(),B.end());
      |          ^~~~~
a.cc:15:20: error: request for member 'end' in 'B', which is of non-class type 'int'
   15 |   sort(B.begin(),B.end());
      |                    ^~~
a.cc:16:10: error: request for member 'begin' in 'C', which is of non-class type 'int'
   16 |   sort(C.begin(),C.end());
      |          ^~~~~
a.cc:16:20: error: request for member 'end' in 'C', which is of non-class type 'int'
   16 |   sort(C.begin(),C.end());
      |                    ^~~
a.cc:17:5: error: expected ';' before 'left'
   17 |   ll left=-1;
      |     ^~~~~
      |     ;
a.cc:18:5: error: expected ';' before 'lefta'
   18 |   ll lefta=-1;
      |     ^~~~~~
      |     ;
a.cc:19:5: error: expected ';' before 'right'
   19 |   ll right=N;
      |     ^~~~~~
      |     ;
a.cc:20:5: error: expected ';' before 'righta'
   20 |   ll righta=N;
      |     ^~~~~~~
      |     ;
a.cc:21:5: error: expected ';' before 'ans'
   21 |   ll ans=0;
      |     ^~~~
      |     ;
a.cc:22:9: error: expected ';' before 'i'
   22 |   for(ll i=0;i<N;i++){
      |         ^~
      |         ;
a.cc:22:14: error: 'i' was not declared in this scope
   22 |   for(ll i=0;i<N;i++){
      |              ^
a.cc:23:9: error: assignment of function 'std::ios_base& std::left(ios_base&)'
   23 |     left=-1;
      |     ~~~~^~~
a.cc:25:5: error: 'lefta' was not declared in this scope
   25 |     lefta=-1;
      |     ^~~~~
a.cc:26:5: error: 'righta' was not declared in this scope
   26 |     righta=N;
      |     ^~~~~~
a.cc:27:16: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
   27 |     while(right-left>1){
      |           ~~~~~^~~~~
a.cc:28:9: error: expected ';' before 'mid'
   28 |       ll mid=(right+left)/2;
      |         ^~~~
      |         ;
a.cc:29:12: error: request for member 'at' in 'A', which is of non-class type 'int'
   29 |       if(A.at(mid)<B.at(i))left=mid;
      |            ^~
a.cc:29:15: error: 'mid' was not declared in this scope
   29 |       if(A.at(mid)<B.at(i))left=mid;
      |               ^~~
a.cc:29:22: error: request for member 'at' in 'B', which is of non-class type 'int'
   29 |       if(A.at(mid)<B.at(i))left=mid;
      |                      ^~
a.cc:33:9: error: expected ';' before 'mid'
   33 |       ll mid=(righta+lefta)/2;
      |         ^~~~
      |         ;
a.cc:34:12: error: request for member 'at' in 'C', which is of non-class type 'int'
   34 |       if(C.at(mid)>B.at(i))righta=mid;
      |            ^~
a.cc:34:15: error: 'mid' was not declared in this scope
   34 |       if(C.at(mid)>B.at(i))righta=mid;
      |               ^~~
a.cc:34:22: error: request for member 'at' in 'B', which is of non-class type 'int'
   34 |       if(C.at(mid)>B.at(i))righta=mid;
      |                      ^~
a.cc:37:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |     ans=ans+righta*left;
      |     ^~~
      |     abs
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs