这个题居然被刘汝佳归类到动态规划的章节中,最后才发现水题一道
题目就是说
代码:
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
char str[1001];
int ans;
void Cal(int l,int r)
{
if(r&1)
return;
if(r==0&&str[r]=='A')
{
ans=1;
return;
}
if(str[r]=='B'&&str[r-1]=='A')
{
ans=2;
return;
}
if(str[l]=='B'&&str[r]=='A')
{
ans=3;
return;
}
}
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
ans=0;
scanf("%s",str);
Cal(0,strlen(str)-1);
if(!ans)
printf("MUTANT\n");
else if(ans==1)
printf("SIMPLE\n");
else if(ans==2)
printf("FULLY-GROWN\n");
else
printf("MUTAGENIC\n");
}
return 0;
}