Advertisement
Spocoman

08. Even Times

Jan 21st, 2024
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n, number;
  9.     cin >> n;
  10.  
  11.     map<int, int> numbers;
  12.  
  13.     for (int i = 0; i < n; i++) {
  14.         cin >> number;
  15.         numbers[number]++;
  16.     }
  17.  
  18.     for(auto& n:numbers) {
  19.         if (n.second % 2 == 0) {
  20.             cout << n.first << endl;
  21.             break;
  22.         }
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement