fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. ios::sync_with_stdio(false);
  8. cin.tie(NULL);
  9.  
  10. string s;
  11. bool res=true;
  12. int ab=0;
  13. cin>>s;
  14.  
  15. for(int i=0; i<s.size(); ++i){
  16. if(s[i]=='A'){
  17. ab++;
  18. if(ab>1){
  19. res=false;
  20. break;
  21. }
  22. }
  23. else if(s[i]=='L' && s[i+1]=='L' && s[i+2]=='L'){
  24. res=false;
  25. break;
  26. }
  27. }
  28. cout<<(res?"TRUE":"FALSE");
  29.  
  30. return 0;
  31. }
  32.  
  33.  
Success #stdin #stdout 0s 5316KB
stdin
ALLAPPL
stdout
FALSE