fork download
  1. #include <iostream>
  2. #include<vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int n, l;
  10. int h[1001];
  11. for (int i =0; i<1001; i++) h[i] = 0;
  12. cin >> n;
  13. int count =0;
  14. for (int i =0; i<n; i++)
  15. {
  16. cin >> l;
  17. h[l]++;
  18. if (h[l] == 1) count++;
  19. }
  20. sort(h+1, h+1001);
  21. cout << h[1000] << " " << count << endl;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 15240KB
stdin
4
6 5 6 7
stdout
2 3