fork download
  1.  
  2.  
  3.  
  4. //#include "stdafx.h"
  5. #include<iostream>
  6. #include<fstream>
  7. #include<vector>
  8. #include<algorithm>
  9. //#define cin in
  10. //#define cout out
  11. using namespace std;
  12. bool xyu(int a, int b) {
  13. return a < b;
  14. }
  15. int main()
  16. {
  17. vector<int> gde(41);
  18. int n = 1;
  19. // generate(v.begin(), v.end(), rand); // Используем C-функцию rand()
  20. for (int i = 0; i < 41; i++){ cin >> gde[i]; cout << gde[i]<<" ";}
  21.  
  22. sort(gde.begin(), gde.end());
  23. for (int p = 0; p < gde.size();p++) {
  24. cout << gde[p] <<" ";
  25. }
  26. cout <<endl;
  27. int max=1,maxnow=1;
  28. for (int p = 0; p < gde.size()-1;p++) {
  29. if (gde[p] == gde[p + 1])
  30. maxnow++;
  31. else {
  32. if (maxnow > max)
  33. max = maxnow;
  34. maxnow = 1;
  35. }
  36. }
  37. cout << max;
  38. //cin.close();
  39. //cout.close();
  40. }
Success #stdin #stdout 0s 15232KB
stdin
1 7 8 234 2 4 6 7 89 7 8 2 4 4 1  3 5 6 7 8 9 1 2  4 4 3 21 24 324 32  5 45 345 35  5 543  435345 345 345 5 -1
stdout
1