fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. typedef long long ll;
  5. int main()
  6. {
  7. ll n,cntr=0;
  8. cin >> n;
  9. char arr[n+1];
  10. string s;
  11. for(int i = 1; i <= n ;i++)
  12. {
  13. cntr=0;
  14. cin >> s;
  15. for(int j = 0 ; j < s.size() ;j++)
  16. {
  17. if(s[j]=='B')
  18. cntr++;
  19.  
  20. }
  21. if(2*cntr >= s.size()-1 && cntr!=s.size()-1 )
  22. arr[i]='Y';
  23. else
  24. arr[i]='N';
  25. }
  26. for(int i =1 ; i<=n;i++)
  27. {
  28. cout << "Case #" << i << ": " << arr[i] << "\n";
  29. }
  30. return 0;
  31. }
Runtime error #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty