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;
- unordered_map<int, int> orders;
- int sumProducts(){
- int sum = 0;
- for(auto i : orders)
- sum += i.second;
- return sum;
- }
- int main() {
- int n, id;
- cin >> n;
- for(int i = 0; i < n; i++) {
- cin >> id;
- orders[id]++;
- if(orders[id] == 10)
- orders.erase(id);
- }
- cout << orders.size() << " " << sumProducts();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment