Advertisement
STANAANDREY

11/65

Nov 18th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. typedef struct
  6. {
  7.     int x, y;
  8. } PUNCT;
  9.  
  10. int main()
  11. {
  12.     PUNCT p[100];
  13.     int fr[100] = {};//il fac pe fr 0
  14.     int n;
  15.     cin >> n;
  16.     for (int i = 0; i < n; i++)
  17.         cin >> p[i].x >> p[i].y;
  18.  
  19.     int maxi = 0;
  20.     for (int i = 0; i < n; i++)
  21.     {
  22.         fr[p[i].y]++;
  23.         if (maxi < p[i].y)
  24.             maxi = p[i].y;
  25.     }
  26.  
  27.     int maxifr = 0;
  28.     for (int i = 0; i < maxi; i++)
  29.         if (maxifr < fr[i])
  30.             maxifr = fr[i];
  31.  
  32.     cout << maxifr;
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement