#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5+10;
ll n,k,x;
ll sum[N];
ll cnt[N];
ll res;
int main(){
cin>>n>>k;
for(int i=1; i<=n; i++){
cin>>x;
sum[i]=sum[i-1]+x;
}
cnt[0] = 1;
for(int i=1; i<=n; i++){
res+=cnt[sum[i]%k];
cnt[sum[i]%k]++;
}
cout<<res<<endl;
return 0;
}
0 回复
0 转发
0 喜欢
1 阅读



