Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
using LL = long long;
  
  
 int main() {
  
     int N;
     cin >> N;
  
     vector<int> A(N), B(N), C(N);
     for (int i = 0; i < N; i++) cin >> A[i];
     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;
  
     for (int i = 0; i < N; i++) {
         LL pre = lower_bound(A.begin(), A.end(), B[i]) - A.begin();
         LL over = C.end() - upper_bound(C.begin(), C.end(), B[i]);
         ans += pre * over;
     }
  
  
     cout << ans;
  
     return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   18 |      cin >> N;
      |      ^~~
      |      std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:6: error: 'vector' was not declared in this scope
   20 |      vector<int> A(N), B(N), C(N);
      |      ^~~~~~
a.cc:20:6: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:20:13: error: expected primary-expression before 'int'
   20 |      vector<int> A(N), B(N), C(N);
      |             ^~~
a.cc:21:41: error: 'A' was not declared in this scope
   21 |      for (int i = 0; i < N; i++) cin >> A[i];
      |                                         ^
a.cc:22:41: error: 'B' was not declared in this scope
   22 |      for (int i = 0; i < N; i++) cin >> B[i];
      |                                         ^
a.cc:23:41: error: 'C' was not declared in this scope
   23 |      for (int i = 0; i < N; i++) cin >> C[i];
      |                                         ^
a.cc:24:11: error: 'A' was not declared in this scope
   24 |      sort(A.begin(), A.end());
      |           ^
a.cc:24:6: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   24 |      sort(A.begin(), A.end());
      |      ^~~~
      |      std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:25:11: error: 'B' was not declared in this scope
   25 |      sort(B.begin(), B.end());
      |           ^
a.cc:26:11: error: 'C' was not declared in this scope
   26 |      sort(C.begin(), C.end());
      |           ^
a.cc:31:19: error: 'lower_bound' was not declared in this scope; did you mean 'std::lower_bound'?
   31 |          LL pre = lower_bound(A.begin(), A.end(), B[i]) - A.begin();
      |                   ^~~~~~~~~~~
      |                   std::lower_bound
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:1963:5: note: 'std::lower_bound' declared here
 1963 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
a.cc:32:30: error: 'upper_bound' was not declared in this scope; did you mean 'std::upper_bound'?
   32 |          LL over = C.end() - upper_bound(C.begin(), C.end(), B[i]);
      |                              ^~~~~~~~~~~
      |                              std::upper_bound
/usr/include/c++/14/bits/stl_algo.h:2050:5: note: 'std::upper_bound' declared here
 2050 |     upper_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
a.cc:37:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |      cout << ans;
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~