Time Exceeded
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-11-11 02:48:22
- Judged By
- Score
- 20
- Total Time
- ≥1091ms
- Peak Memory
- ≥1.648 MiB