Language: C++

#include<bits/stdc++.h>
using namespace std;
string st;
int s1[30],x,x1;
int main()
{
    cin>>st;
    for (int i=0;i<=st.size()-1;i++)
        s1[st[i]-64]++;
    if (s1['B'-64]==1&&s1['K'-64]==1&&s1['I'-64]==1&&s1['H'-64]==1&&s1['R'-64]==1) 
    {
            x=st.find('K');
            if (st[x+1]!='I') {cout<<"NO"<<endl;return 0;} else
            {
            	x=st.find('I');
                if (st[x+1]!='H') {cout<<"NO"<<endl;return 0;} else
                {
                	x1=st.find('B');
                	x=st.find('H');
                	if (x1-x<=2&&x1-x!=0) 
                	{
                		x=st.find('B');
                		x1=st.find('R');
                		if (x1-x<=2&&x1-x!=0) 
						{
			                x=st.find('R');
			                if (st.size()-1-x>1) {cout<<"NO"<<endl;return 0;} else
			                {
			                	x=st.find('B');
			                	if (x+1>1) {cout<<"NO"<<endl;return 0;} else
			                	    cout<<"YES"<<endl;
			                }
						} else {cout<<"NO"<<endl;return 0;}
                	} else
                	{cout<<"NO"<<endl;return 0;}
            	   	
            	}
            }
    } else cout<<"NO"<<endl;
    return 0;
}#include<bits/stdc++.h>
using namespace std;
string st;
int s1[30],x,x1;
int main()
{
    cin>>st;
    for (int i=0;i<=st.size()-1;i++)
        s1[st[i]-64]++;
    if (s1['B'-64]==1&&s1['K'-64]==1&&s1['I'-64]==1&&s1['H'-64]==1&&s1['R'-64]==1) 
    {
            x=st.find('K');
            if (st[x+1]!='I') {cout<<"NO"<<endl;return 0;} else
            {
            	x=st.find('I');
                if (st[x+1]!='H') {cout<<"NO"<<endl;return 0;} else
                {
                	x1=st.find('B');
                	x=st.find('H');
                	if (x1-x<=2) 
                	{
                		x=st.find('B');
                		x1=st.find('R');
                		if (x1-x<=2) 
						{
			                x=st.find('R');
			                if (st.size()-1-x>1) {cout<<"NO"<<endl;return 0;} else
			                {
			                	x=st.find('K');
			                	if (x+1>1) {cout<<"NO"<<endl;return 0;} else
			                	    cout<<"YES"<<endl;
			                }
						} else {cout<<"NO"<<endl;return 0;}
                	} else
                	{cout<<"NO"<<endl;return 0;}
            	   	
            	}
            }
    } else cout<<"NO"<<endl;
    return 0;
}

Compiler output:
a.cc:41:2: error: stray '#' in program
   41 | }#include<bits/stdc++.h>
      |  ^
a.cc:41:3: error: 'include' does not name a type
   41 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:43:8: error: redefinition of 'std::string st'
   43 | string st;
      |        ^~
a.cc:3:8: note: 'std::string st' previously declared here
    3 | string st;
      |        ^~
a.cc:44:5: error: redefinition of 'int s1 [30]'
   44 | int s1[30],x,x1;
      |     ^~
a.cc:4:5: note: 'int s1 [30]' previously declared here
    4 | int s1[30],x,x1;
      |     ^~
a.cc:44:12: error: redefinition of 'int x'
   44 | int s1[30],x,x1;
      |            ^
a.cc:4:12: note: 'int x' previously declared here
    4 | int s1[30],x,x1;
      |            ^
a.cc:44:14: error: redefinition of 'int x1'
   44 | int s1[30],x,x1;
      |              ^~
a.cc:4:14: note: 'int x1' previously declared here
    4 | int s1[30],x,x1;
      |              ^~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~