Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <cstdio>
- #include <vector>
- #include <iostream>
- #include <algorithm>
- #include <unordered_map>
- using namespace std;
- int main() {
- unordered_map<long long, int> counter;
- int n;
- long long num;
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> num;
- counter[num]++;
- }
- int sum = 0;
- for(auto i : counter){
- if(i.second % 2 == 1)
- sum += (i.second * i.first);
- }
- cout << sum;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment