/// Point-Update--Range-Query #include using namespace std; #define ll long long #define mod 1000000007 class BIT{ int sx,i,j,k; int res; int *bit; public: BIT() { sx=0; } BIT(int x, int *first) { sx=x; bit=first; } void build(int x, int *first) { sx=x; bit=first; } void update(int x, int val){ for(i=x;i<=sx;i+=(i&-i)) *(bit+i)+=val; } int preSum(int x){ for(res=0,i=x;i;i-=(i&-i)) res+=*(bit+i); return res; } int query(int x1, int x2){ return preSum(x2)-preSum(x1); } void show(){ for(i=1;i<=sx;i++) cout<<*(bit+i)<<" "; cout<>=1; } return ans; } ll comp(int f[]){ ll ans=0,val; int i,j,grt=0; for(i=0;i<26;i++){ if(f[i]>1)grt=1; if(f[i]<1) continue; val=(g[f[i]]); //cout<<(char)(i+'a')<<" :: "<> n >> q >> str; ll tmp; BIT tree[26]; for(i=0;i<26;i++) tree[i].build(n+10,&bits[i][0]); for(i=0;i='z') str[x]-=26; tree[str[x]-'a'].update(x+1,1); } } else{ // cout<