fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios_base::sync_with_stdio(false);
  6. cin.tie(NULL);
  7.  
  8. int n;
  9. cin >> n;
  10.  
  11. vector<long long> a(n);
  12. for (int i = 0; i < n; i++) {
  13. cin >> a[i];
  14. }
  15.  
  16. for (int i = 1; i <= n - 1; i++) {
  17. for (int j = 0; j < n - i; j++) {
  18. a[j] = a[j] ^ a[j + 1];
  19. }
  20. }
  21.  
  22. cout << a[0];
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
Standard output is empty