pre=(pre+a[i])%m;
sum[i]=pre;
}
map
mmap.clear();
LL ans=0;
mmap[0]++;
for(int i=0;i
if(mmap.count(t))
ans+=mmap[t];
mmap[sum[i]]++;
}
LL ret=0;
int j=1;
while(i+j
i+=j;
}
}
if(b==0) ans=ret;
else if(b==k-1) ans-=ret;
printf("%I64d\n",ans);
}
return 0;
} 作者:ACM_cxlove