博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
uva 620 - Cellular Structure
阅读量:4035 次
发布时间:2019-05-24

本文共 2138 字,大约阅读时间需要 7 分钟。

1、

2、题目好难懂。。。

给定一个细胞链,只有AB两种字母组成,有三种方式,一种是OA,一种是OAB,一种是BOA,O代表是正常的细胞链,最后看一下这个细胞链是否是由这些组合构成的,如果有多种方式构成,输出排在前边的方式。如果不是这三种方式中的一种,那么该细胞链已变异,作为第四种输出

3、题目:

 

A chain of connected cells of two types A and B composes a  cellular structure of some microorganisms of species APUDOTDLS.

If no mutation had happened during growth of an organism,  its cellular chain would take one of the following forms:

simple stage 		 O = A  fully-grown stage 		 O = OAB mutagenic stage 		 O = BOA

Sample notation O = OA means that if we added to chain of a healthy  organism a cell A from the right hand side, we would end up also with  a chain of a healthy organism. It would grow by one cell A.

A laboratory researches a cluster of these organisms.  Your task is to write a program which could find out a current stage  of growth and health of an organism, given its cellular chain sequence.

A integer n being a number of cellular chains to test, and thenn consecutive lines containing chains of tested organisms.

For each tested chain give (in separate lines) proper answers:

SIMPLE 		 for simple stage		 FULLY-GROWN 		 for fully-grown stage		 MUTAGENIC 		 for mutagenic stage		 MUTANT 		 any other (in case of mutated organisms)

If an organism were in two stages of growth at the same time the  first option from the list above should be given as an answer.

4AAABBAABBAABA

SIMPLEFULLY-GROWNMUTANTMUTAGENIC

 

4、AC代码:

#include
#include
char str[100];int ans;int DP(int start,int end){ if(start==end && str[start]=='A') return 1; else if(end-start>=1 && str[end]=='A' && DP(start,end-1)) return 1; else if(end-start>=2 && str[end]=='B' && str[end-1]=='A' && DP(start,end-2)) return 2; else if(end-start>=2 && str[end]=='A' && str[start]=='B' && DP(start+1,end-1)) return 3; return 0;}int main(){ int n; scanf("%d",&n); while(n--) { scanf("%s",str); int l=strlen(str); int ans=DP(0,l-1); if(ans==1) printf("SIMPLE\n"); else if(ans==2) printf("FULLY-GROWN\n"); else if(ans==3) printf("MUTAGENIC\n"); else printf("MUTANT\n"); } return 0;}

 

转载地址:http://whddi.baihongyu.com/

你可能感兴趣的文章
QT中json的生成和解析
查看>>
std::function 和 std::bind 的简单例子
查看>>
CFormView简介
查看>>
Visual Studio 2010 与 VC++ 6.0 的操作差异(一)之对话框中添加OnInitDialog()函数
查看>>
VC的MFC里面控件的ID使用ID_XXXXX和IDR_XXXXX的区别
查看>>
VC++ 获取ListControl选中行
查看>>
用VC++实现应用程序窗口的任意分割(2)
查看>>
“class”类型重定义,include(头文件)重复加载 QT /c++
查看>>
MFC框架类、文档类、视图类相互访问的方法
查看>>
<转>文档视图指针互获
查看>>
C++中头文件相互包含的几点问题
查看>>
内存设备描述表
查看>>
Latex插入eps图片的方法
查看>>
Matlab subplot 图像间距调整
查看>>
Hibernate使用count(*)取得表中记录总数
查看>>
distinct使SQL查询除去重复的字段
查看>>
从mysql中 导出/导入表及数据
查看>>
HQL语句大全(转)
查看>>
几个常用的Javascript字符串处理函数 spilt(),join(),substring()和indexof()
查看>>
javascript传参字符串 与引号的嵌套调用
查看>>