/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 324.0 KiB
#3 Wrong Answer 16ms 532.0 KiB
#4 Wrong Answer 42ms 3.516 MiB
#5 Wrong Answer 18ms 3.52 MiB
#6 Wrong Answer 15ms 532.0 KiB
#7 Wrong Answer 15ms 532.0 KiB
#8 Wrong Answer 15ms 532.0 KiB
#9 Wrong Answer 22ms 3.52 MiB
#10 Wrong Answer 45ms 3.52 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pe(c) for (auto &e : c) cout << e << ' '; cout << '\n'
#define ps(b) cout << (b ? "YES" : "NO") << '\n'
#ifdef LOCAL
#include "def.h"
#else
#define ck(...)
#endif
const ll M = 1e9 + 7, N = 2e5 + 5;
// long long xr(int l, int r) { return pxr[r] ^ pxr[l - 1]; }
void test(int tc) {
    ll n = 0, m = 0, a = 0, b = 0, c = 0, d = 0, i = 0, j = 0, k = 0, q = 0;
    cin >> n;
    long long pxr[n+1], ar[n]; pxr[0] = 0;
    for (i = 0; i < n; ++i) { cin >> ar[i]; pxr[i + 1] = pxr[i] ^ ar[i]; }
    for(i=1;i<n;++i) {
        c += (pxr[i] == (pxr[n] ^ pxr[i]));
    }
    cout << c;
    cout << '\n';
}

signed main() {
    cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit | cin.badbit);
    int tc = 0, t = 1;
    cin >> t;
    while (tc < t) test(++tc);
    return 0;
}

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:10:02
Judged At
2024-10-03 17:10:02
Judged By
Score
20
Total Time
45ms
Peak Memory
3.52 MiB