Saleh127

toph

Jun 5th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. int main()
  8. {
  9.  
  10.  
  11. int x,f;
  12. cin>>x;
  13. for(f=1;f<=x;f++)
  14. {
  15. int a[200000],c,d=0,e=1,i,j,k=1,l,y;
  16. cin>>c;
  17. for(i=0;i<c;i++)
  18. {
  19. cin>>a[i];
  20. }
  21. for(i=0;i<c;i++)
  22. {
  23. d=1;
  24. l=a[i];
  25. for(j=i;j<c;j++)
  26. {
  27. if(a[j]-l==1)
  28. {
  29. d++;
  30. l=a[j];
  31. }
  32. }
  33. k=max(k,d);
  34. }
  35. printf("Case #%d: %d\n",f,k);
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment