Advertisement
Saleh127

at 72C

Oct 12th, 2020
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. map<ll,ll>a;
  11. map<ll,ll>::iterator it;
  12. ll c,d,e,f,i,j=0,k,l;
  13.  
  14. cin>>c;
  15. for(i=0;i<c;i++)
  16. {
  17. cin>>d;
  18. a[d]++;
  19. a[d-1]++;
  20. a[d+1]++;
  21. }
  22. for(it=a.begin();it!=a.end();it++)
  23. {
  24. j=max(j,it->second);
  25. }
  26. cout<<j<<endl;
  27. return 0;
  28. }
  29.  
Advertisement
RAW Paste Data Copied
Advertisement