CodeForces - 1109A

#include<cstdio>
#include<map>
#include<iostream>
#include<algorithm>
using namespace std;

int n;
long long ans,pre;
map<pair<int,int>,int> M;
main()
{
    scanf("%d",&n);
    cin>>pre;
    M[{1,pre}]++;
    for(int i=2,x;i<=n;i++){
        scanf("%d",&x);
        pre^=x;
        ans+=M[{i&1,pre}];
        if(pre==0&&i%2==0) ans++;
        M[{i&1,pre}]++;
    }
    cout<<ans<<endl;
}

 

posted on 2019-02-27 16:37  欣崽  阅读(207)  评论(0编辑  收藏  举报

导航