/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 324.0 KiB
#2 Wrong Answer 1ms 532.0 KiB

Code

#include<iostream>
using namespace std;
int main()
{
    int t;
    cin>>t;

    while(t--){
        int n;
        cin>>n;
        int a[n],pre[n],rst=0,precount[]={0};

        for(int i=0; i<n; i++)
        {
            cin>>a[i];
        }
         for(int i=0; i<n; i++)
        {
            pre[i] = pre[i-1]^a[i-1];
        }

         for(int j=1; j<=n; j++)
        {
            rst+= precount[pre[j-1]];

            precount[pre[j]]++;
        }
        cout<<rst<<endl;
    }
}

Information

Submit By
Type
Submission
Problem
P1096 Mr. Heart and the XOR Puzzle
Contest
Brain Booster #6
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 17:40:51
Judged At
2024-11-11 02:45:46
Judged By
Score
0
Total Time
1ms
Peak Memory
532.0 KiB