fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define IO ios_base::sync_with_stdio(0), cin.tie(0),cout.tie(0)
  4. typedef long long ll;
  5. const int N = 1e5 + 4 , MOD = 1e9 + 7 ;
  6. string s ;
  7. bool ok ;
  8. bool solve(int idx)
  9. {
  10. if(idx == s.size()+1)
  11. return (ok == 1) ;
  12. if(idx % 2 == 0 && islower(s[idx]) || idx % 2 == 1 && isupper(s[idx]))
  13. ok = 0 ;
  14. solve(idx + 1) ;
  15. return (ok == 1 ) ;
  16. }
  17. int main() {
  18. IO ;
  19. cin>>s ;
  20. ok = 1 ;
  21. s = '*' + s ;
  22. if(solve(1) == 1)
  23. cout<<"Yes" ;
  24. else
  25. cout<<"No" ;
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5528KB
stdin
Standard input is empty
stdout
Yes