/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 328.0 KiB
#3 Wrong Answer 136ms 320.0 KiB
#4 Time Exceeded ≥1091ms ≥1.598 MiB

Code

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<int> v;
        for(int i=0;i<n;i++){
            int x;
            cin>>x;
            v.push_back(x);
        }
        int left=0;
        int count=0;
        for(int i=0;i<n-1;i++){
            left^=v[i];
            int right=0;
            for(int j=i+1;j<n;j++){
                right^=v[j];
            }
            if(left==right){
                count++; 
            }
        }
        cout << count << 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 16:26:51
Judged At
2024-12-17 11:34:43
Judged By
Score
20
Total Time
≥1091ms
Peak Memory
≥1.598 MiB