fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int num;
  7. cin >> num;
  8. long long res = 0;
  9. for (int id = 0; id < 2 * num - 1; ++id) {
  10. long long new_num;
  11. cin >> new_num;
  12. res ^= new_num;
  13. }
  14. cout << res;
  15. }
Success #stdin #stdout 0s 5320KB
stdin
3
1 2 2 3 1
stdout
3