Advertisement
ShafiulAzim

codeforces 867A

Feb 22nd, 2020
116
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. int main(){
  4.  
  5. int n,f=0,s=0,i;
  6. string str;
  7. cin>>n;
  8. cin.ignore(numeric_limits<streamsize>::max(),'\n');
  9. cin>>str;
  10. for(i=0;i<n;i++){
  11. if(str[i]=='F' && str[i+1]=='S')
  12. f++;
  13.  
  14. else if(str[i]=='S' && str[i+1]=='F')
  15. s++;
  16. }
  17. if(s>f)
  18. cout<<"YES"<<endl;
  19. else
  20. cout<<"NO"<<endl;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement