Advertisement
Guest User

For Olya

a guest
Oct 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. n = int(input())
  2. inp = list(map(int,input().split()))
  3.  
  4. xor_inp = 0
  5. xor_out = 0
  6. my_arr = []
  7.  
  8. for i in range(n):
  9. xor_inp = xor_inp ^ inp[i]
  10.  
  11. flag = 0
  12. teta = 1
  13. while flag != 1:
  14. if len(my_arr) == (n-1):
  15. flag = 1
  16.  
  17. if inp.count(teta) != 0:
  18. teta += 1
  19. else:
  20. my_arr.append(teta)
  21. xor_out = xor_out ^ teta
  22.  
  23. my_arr.append(xor_inp ^ xor_out)
  24. print(' '.join(map(str, my_arr)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement