Saleh127

codeforces 1141B.cpp

May 28th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 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 pi acos(-1)
  6. int main()
  7. {
  8. int a[200005],c,d=0,e=-1000,f,i,j,k,l;
  9. cin>>c;
  10. for(i=0; i<c; i++)
  11. {
  12. cin>>a[i];
  13. }
  14. for(j=0; j<2*c; j++)
  15. {
  16. if(a[j%c]==1) d++;
  17. else
  18. {
  19. e=max(e,d);
  20. d=0;
  21. }
  22. }
  23. cout<<e<<endl;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment