Language: C++

#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
struct poi{ll sum,pos;}a[200010];
ll n,k,ans,cnt,tree[200010],lisan[200010];
void read(ll &k)
{
    k=0;int f=1;char c=getchar();
    while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
    while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
    k*=f;
}
bool cmp(poi a,poi b){return a.sum<b.sum;}
int lowbit(int x){return x&-x;}
void add(int x,int delta)
{
    for(int i=x;i<=cnt;i+=lowbit(i))
    tree[i]+=delta;
}
int sum(int x)
{
    int s=0;
    for(int i=x;i>=1;i-=lowbit(i))
    s+=tree[i];
    return s;
}
int main()
{
    read(n);read(k);
    for(int i=1;i<=n;i++)read(a[i].sum),a[i].sum-=k;
    for(int i=1;i<=n;i++)a[i].sum+=a[i-1].sum,a[i].pos=i;
    sort(a,a+1+n,cmp);
    for(int i=0;i<=n;i++)
    {
        if(a[i].sum!=a[i-1].sum||i==0)cnt++;
        lisan[a[i].pos]=cnt;
    }
    for(int i=n;i>=0;i--)
    {
        ans+=sum(cnt)-sum(lisan[i]-1);
        add(lisan[i],1);
    }
    printf("%lld\n",ans);
}

Compiler output:
a.cc:13:13: error: extended character ‘ is not valid in an identifier
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |             ^
a.cc:13:13: error: extended character ‘ is not valid in an identifier
a.cc:13:20: error: extended character ‘ is not valid in an identifier
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |                    ^
a.cc:13:20: error: extended character ‘ is not valid in an identifier
a.cc:13:27: error: extended character ‘ is not valid in an identifier
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |                           ^
a.cc:13:29: error: extended character ‘ is not valid in an identifier
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |                             ^
a.cc:14:14: error: extended character ‘ is not valid in an identifier
   14 |     while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
      |              ^
a.cc:14:14: error: extended character ‘ is not valid in an identifier
a.cc:14:22: error: extended character ‘ is not valid in an identifier
   14 |     while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
      |                      ^
a.cc:14:22: error: extended character ‘ is not valid in an identifier
a.cc:14:35: error: extended character ‘ is not valid in an identifier
   14 |     while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
      |                                   ^
a.cc:14:35: error: extended character ‘ is not valid in an identifier
a.cc: In function 'void read(long long int&)':
a.cc:13:13: error: '\U000020180\U00002018' was not declared in this scope
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |             ^~~
a.cc:13:20: error: '\U000020189\U00002018' was not declared in this scope
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |                    ^~~
a.cc:13:27: error: '\U00002018' was not declared in this scope
   13 |     while(c<‘0‘||c>‘9‘)c==‘-‘&&(f=-1),c=getchar();
      |                           ^
a.cc:14:14: error: '\U000020189\U00002018' was not declared in this scope
   14 |     while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
      |              ^~~
a.cc:14:22: error: '\U000020180\U00002018' was not declared in this scope
   14 |     while(c<=‘9‘&&c>=‘0‘)k=k*10+c-‘0‘,c=getchar();
      |                      ^~~