fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. vector <int> entry={3,2,3,4,3};
  9. vector <int> hash={0,0,0,0,0};
  10.  
  11. for(int i=0;i<entry.size();i++){
  12. hash[entry[i]]=hash[entry[i]]+1;
  13. }
  14. sort(hash.begin(),hash.end());
  15. int min=hash[0];
  16. int max=hash[hash.size()-1];
  17.  
  18.  
  19.  
  20. cout<<min<<max;
  21.  
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
03