Submission #19517734


Source Code Expand

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

int n;
vector<int> a, b;

bool solve();

int main() {
  cin >> n;
  b.resize(n);
  for (auto &p : b) cin >> p;
  if (solve())
    for (auto p : a) cout << p << endl;
  else
    cout << -1 << endl;
  return 0;
}

bool solve() {
  a.assign(n, 0);
  for (int i = 1; i < n; ++i) a[i] = a[i - 1] ^ b[i - 1];
  return b.back() == a.back();
}

Submission Info

Submission Time
Task B - Your Numbers are XORed...
User m_tsubasa
Language C++ (GCC 9.2.1)
Score 100
Code Size 405 Byte
Status AC
Exec Time 175 ms
Memory 3968 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 8 ms 3384 KB
subtask0_sample-02.txt AC 2 ms 3564 KB
subtask0_sample-03.txt AC 2 ms 3604 KB
subtask1_01.txt AC 2 ms 3516 KB
subtask1_02.txt AC 6 ms 3404 KB
subtask1_03.txt AC 2 ms 3516 KB
subtask1_04.txt AC 2 ms 3580 KB
subtask1_05.txt AC 2 ms 3572 KB
subtask1_06.txt AC 2 ms 3600 KB
subtask1_07.txt AC 2 ms 3384 KB
subtask1_08.txt AC 2 ms 3560 KB
subtask1_09.txt AC 19 ms 3452 KB
subtask1_10.txt AC 46 ms 3732 KB
subtask1_11.txt AC 96 ms 3620 KB
subtask1_12.txt AC 25 ms 3652 KB
subtask1_13.txt AC 123 ms 3616 KB
subtask1_14.txt AC 142 ms 3580 KB
subtask1_15.txt AC 43 ms 3964 KB
subtask1_16.txt AC 173 ms 3956 KB
subtask1_17.txt AC 172 ms 3848 KB
subtask1_18.txt AC 44 ms 3964 KB
subtask1_19.txt AC 175 ms 3956 KB
subtask1_20.txt AC 173 ms 3968 KB