Submission #158904


Source Code Expand

Copy
#include <iostream>
using namespace std;
int main( void )
{
  int L, B[100000],A[100000];
  cin >> L;
  for( int i=0; i<L; i++ ) cin >> B[i];
  A[0] = 0;
  for( int i=0; i<L-1; i++ ) A[i+1] = A[i] ^ B[i];
  if( B[L-1] != A[L-1] ){
    cout << -1 << endl; return 0;
  }
  for( int i=0; i<L; i++ ) cout << A[i] << endl;
  return 0;
}

Submission Info

Submission Time
Task B - Your Numbers are XORed...
User capythm
Language C++ (G++ 4.6.4)
Score 100
Code Size 345 Byte
Status
Exec Time 479 ms
Memory 2600 KB

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 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 21 ms 928 KB
subtask0_sample-02.txt 21 ms 920 KB
subtask0_sample-03.txt 20 ms 748 KB
subtask1_01.txt 21 ms 800 KB
subtask1_02.txt 21 ms 932 KB
subtask1_03.txt 21 ms 924 KB
subtask1_04.txt 21 ms 932 KB
subtask1_05.txt 21 ms 924 KB
subtask1_06.txt 21 ms 932 KB
subtask1_07.txt 21 ms 804 KB
subtask1_08.txt 21 ms 928 KB
subtask1_09.txt 43 ms 932 KB
subtask1_10.txt 112 ms 1056 KB
subtask1_11.txt 249 ms 1700 KB
subtask1_12.txt 59 ms 1196 KB
subtask1_13.txt 330 ms 1448 KB
subtask1_14.txt 385 ms 2216 KB
subtask1_15.txt 92 ms 1572 KB
subtask1_16.txt 475 ms 2144 KB
subtask1_17.txt 479 ms 2600 KB
subtask1_18.txt 126 ms 1532 KB
subtask1_19.txt 478 ms 2524 KB
subtask1_20.txt 478 ms 2600 KB