Language: C++

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

using namespace std;

struct BIT {
  int N;
  vector<int> data;
  explicit BIT(int n) : N(n + 1), data(n + 1) {}
  void add(int i, int v) {
    for(int x = i; x < N; x += x & -x) {
    	data[x] += v;
    }
  }
  int get(int i) {
    int ret = 0;
    for(int x = i; x > 0; x -= x & -x) {
    	ret += data[x];
    }
    return ret;
  }
};

int main() {
  int N, K;
  cin >> N >> K;
  vector<ll> A(N);
  for(int i = 0; i < N; i++) {
    cin >> A[i];
    A[i] -= K;
  }
  vector<ll> acc(N + 1);
  for(int i = 0; i < N; i++) {
    acc[i + 1] = acc[i] + A[i];
  }
  vector<ll> acc_ = acc;
  sort(acc_.begin(), acc_.end());
  
  BIT bit(N + 1);
  ll ans = 0;
  for(int i = 0; i < N + 1; i++) {
    int k = lower_bound(acc_.begin(), acc_.end(), acc[i]) - acc.begin() + 1;
  	ans += bit.get(k);
    bit.add(k, 1);
  }
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: 'll' was not declared in this scope
   28 |   vector<ll> A(N);
      |          ^~
a.cc:28:12: error: template argument 1 is invalid
   28 |   vector<ll> A(N);
      |            ^
a.cc:28:12: error: template argument 2 is invalid
a.cc:30:13: error: invalid types 'int[int]' for array subscript
   30 |     cin >> A[i];
      |             ^
a.cc:31:6: error: invalid types 'int[int]' for array subscript
   31 |     A[i] -= K;
      |      ^
a.cc:33:12: error: template argument 2 is invalid
   33 |   vector<ll> acc(N + 1);
      |            ^
a.cc:35:8: error: invalid types 'int[int]' for array subscript
   35 |     acc[i + 1] = acc[i] + A[i];
      |        ^
a.cc:35:21: error: invalid types 'int[int]' for array subscript
   35 |     acc[i + 1] = acc[i] + A[i];
      |                     ^
a.cc:35:28: error: invalid types 'int[int]' for array subscript
   35 |     acc[i + 1] = acc[i] + A[i];
      |                            ^
a.cc:37:12: error: template argument 2 is invalid
   37 |   vector<ll> acc_ = acc;
      |            ^
a.cc:38:13: error: request for member 'begin' in 'acc_', which is of non-class type 'int'
   38 |   sort(acc_.begin(), acc_.end());
      |             ^~~~~
a.cc:38:27: error: request for member 'end' in 'acc_', which is of non-class type 'int'
   38 |   sort(acc_.begin(), acc_.end());
      |                           ^~~
a.cc:41:5: error: expected ';' before 'ans'
   41 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:43:30: error: request for member 'begin' in 'acc_', which is of non-class type 'int'
   43 |     int k = lower_bound(acc_.begin(), acc_.end(), acc[i]) - acc.begin() + 1;
      |                              ^~~~~
a.cc:43:44: error: request for member 'end' in 'acc_', which is of non-class type 'int'
   43 |     int k = lower_bound(acc_.begin(), acc_.end(), acc[i]) - acc.begin() + 1;
      |                                            ^~~
a.cc:43:54: error: invalid types 'int[int]' for array subscript
   43 |     int k = lower_bound(acc_.begin(), acc_.end(), acc[i]) - acc.begin() + 1;
      |                                                      ^
a.cc:43:65: error: request for member 'begin' in 'acc', which is of non-class type 'int'
   43 |     int k = lower_bound(acc_.begin(), acc_.end(), acc[i]) - acc.begin() + 1;
      |                                                                 ^~~~~
a.cc:44:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   44 |         ans += bit.get(k);
      |         ^~~
      |         abs
a.cc:47:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |   cout << ans << endl;
      |           ^~~
      |           abs