Submission #19493305


Source Code Expand

Copy
//
// Created by zeronosu77108 on Jan 17, 2021.
//
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

using namespace std;

int main() {
    int l;
    cin >> l;

    vector b(l, 0);
    for (int i=0; i<l; i++) cin >> b[i];

    if (reduce(b.begin(), b.end(), 0, bit_xor{})) {
        cout << -1 << endl;
        return 0;
    }

    vector ans(l, 0);
    for (int i=1; i<l; i++) {
        ans[i] = ans[i-1] xor b[i-1];
    }

    for (const auto& i : ans) {
        cout << i << endl;
    }
}

Submission Info

Submission Time
Task B - Your Numbers are XORed...
User zeronosu77108
Language C++ (Clang 10.0.0)
Score 100
Code Size 551 Byte
Status AC
Exec Time 240 ms
Memory 3556 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 23
Set Name Test Cases
All subtask0_sample-01.txt, subtask0_sample-02.txt, subtask0_sample-03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Case Name Status Exec Time Memory
subtask0_sample-01.txt AC 15 ms 3020 KB
subtask0_sample-02.txt AC 2 ms 3188 KB
subtask0_sample-03.txt AC 2 ms 3152 KB
subtask1_01.txt AC 2 ms 3160 KB
subtask1_02.txt AC 2 ms 2996 KB
subtask1_03.txt AC 2 ms 3008 KB
subtask1_04.txt AC 2 ms 3024 KB
subtask1_05.txt AC 3 ms 3088 KB
subtask1_06.txt AC 2 ms 3044 KB
subtask1_07.txt AC 2 ms 3020 KB
subtask1_08.txt AC 3 ms 3172 KB
subtask1_09.txt AC 25 ms 3160 KB
subtask1_10.txt AC 61 ms 3160 KB
subtask1_11.txt AC 126 ms 3124 KB
subtask1_12.txt AC 49 ms 3040 KB
subtask1_13.txt AC 163 ms 3192 KB
subtask1_14.txt AC 196 ms 3348 KB
subtask1_15.txt AC 88 ms 3192 KB
subtask1_16.txt AC 233 ms 3516 KB
subtask1_17.txt AC 240 ms 3556 KB
subtask1_18.txt AC 91 ms 3196 KB
subtask1_19.txt AC 237 ms 3488 KB
subtask1_20.txt AC 240 ms 3536 KB