Saleh127

CF 1287A.cpp

Jul 22nd, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 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 fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9. test
  10. {
  11. string a;
  12. ll c,d,e=-100,f,i,j,k=0,l;
  13. cin>>c>>a;
  14. if(c==1)
  15. {
  16. cout<<0<<endl;
  17. continue;
  18. }
  19. for(i=0;i<c;i++)
  20. {
  21. if(a[i]=='A') e=0;
  22. else e++;
  23. if(e>k) k=e;
  24. }
  25. cout<<k<<endl;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment