fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int i,z=0,o=0;
  7. string s;
  8.  
  9. cin>>s;
  10. for(i=0;i<s.length();i++)
  11. {
  12. if(s[i]=='z')
  13. z++;
  14. else
  15. o++;
  16. }
  17. if(o/z==2)
  18. cout<<"YES";
  19. else
  20. cout<<"NO";
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 4564KB
stdin
zzzoooooo
stdout
YES