就很无脑,整了四次不过,B题口胡一次切
#include<iostream>
#include<string>
#include<map>
using namespace std;
bool judge(char a)
{
if(a=='T'||a=='u'||a=='i'||a=='m'||a=='r')
return 1;
return 0;
}
int main()
{
map<char,int>m;
m['T']=1;
m['u']=1;
m['i']=1;
m['r']=1;
m['m']=1;
int t,n,i,j;
bool flag=0;
char s[10];
cin>>t;
for(i=0;i<t;i++)
{
cin>>n;
cin>>s;
if(n!=5)
{
cout<<"NO"<<endl;
continue;
}
for(j=0;j<5;j++)
{
if(judge(s[j])&&(m[s[j]]==1))
{
// cout<<s[j]<<' ';
m[s[j]]=0;
}
else
{
flag=1;
break;
}
}
// cout<<endl;
// cout<<flag<<endl;
if(flag==1)
{
cout<<"NO"<<endl;
}
else
{
cout<<"YES"<<endl;
}
flag=0;
}
return 0;
}