/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Wrong Answer 17ms 320.0 KiB
#4 Wrong Answer 18ms 2.07 MiB

Code

#include<bits/stdc++.h>

using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
#define ordered_set tree < int, null_type, less < int > , rb_tree_tag, tree_order_statistics_node_update >

#define ll long long int
#define lld long double
#define srt(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())
#define rep(i, n) for (int i = 0; i < n; i++)
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define nn cout << "\n";
const int N = 2e5 + 5;
const int MOD = 1000000007;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t = 1;
    cin >> t;
    while (t--) {
        ll n;
        cin>>n;
        ll a,ans=0,p[n];
        cin>>p[0];
        for(int i=1;i<n;i++){
            cin>>a;
            p[i]=a^p[i-1];
            if(p[i]==0)ans+=i;
        }
        cout<<ans<<"\n";

    }
    return 0;
}
// BS,PS,BM,P2,P,BA,FO

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:56:26
Judged At
2024-11-11 02:47:15
Judged By
Score
20
Total Time
18ms
Peak Memory
2.07 MiB