hdoj ZYB's Biology 5590 (字符串) 水
来源:互联网 发布:淘宝详情页模板套用 编辑:程序博客网 时间:2024/05/18 02:21
ZYB's Biology
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 85 Accepted Submission(s): 69
Problem Description
After getting 600 scores in NOIP ZYB(ZJ−267) begins to work with biological questions.Now he give you a simple biological questions:
he gives you aDNA sequence and a RNA sequence,then he asks you whether the DNA sequence and the RNA sequence are
matched.
TheDNA sequence is a string consisted of A,C,G,T ;TheRNA sequence is a string consisted of A,C,G,U .
DNA sequence and RNA sequence are matched if and only if A matches U ,T matches A ,C matches G ,G matches C on each position.
he gives you a
matched.
The
Input
In the first line there is the testcase T .
For each teatcase:
In the first line there is one numberN .
In the next line there is a string of lengthN ,describe the DNA sequence.
In the third line there is a string of lengthN ,describe the RNA sequence.
1≤T≤10 ,1≤N≤100
For each teatcase:
In the first line there is one number
In the next line there is a string of length
In the third line there is a string of length
Output
For each testcase,print YES or NO ,describe whether the two arrays are matched.
Sample Input
24ACGTUGCA4ACGTACGU
Sample Output
YESNO#include<stdio.h>#include<string.h>#include<algorithm>#define N 110using namespace std;char a[N];char b[N];int main(){int t,n;int i,j;scanf("%d",&t);while(t--){scanf("%d",&n);scanf("%s%s",a,b);for(i=0;i<n;i++){if(a[i]=='A') a[i]='U';else if(a[i]=='T')a[i]='A';else if(a[i]=='C')a[i]='G';else if(a[i]=='G')a[i]='C';}if(strcmp(a,b)==0)printf("YES\n");elseprintf("NO\n");}return 0;}
0 0
- hdoj ZYB's Biology 5590 (字符串) 水
- hdoj 5592 ZYB's Biology 【线段树】 hdoj 5590 ZYB's Biology 【字符串水题】
- 【水】HDOJ ZYB's Biology 5590
- HDOJ 5590 ZYB's Biology
- HDOJ 5590 ZYB's Biology
- hdoj-5590-ZYB's Biology
- hdu 5590 ZYB's Biology(水)
- hdoj 5590 ZYB's Biology 【水题】
- HDU 5590 ZYB's Biology
- HDU 5590 ZYB's Biology
- 杭电5590 ZYB's Biology
- ZYB's Biology
- ZYB's Biology解题报告
- BestCoder Round #65 ZYB's Biology
- BestCoder Round #65 1001 ZYB's Biology HDU5590
- HDOJ 5591 ZYB's Game
- hdoj-5591-ZYB's Game
- hdoj ZYB's Game 5901 (数学规律题)
- 解决问题 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 蓝桥杯 字母图形(循环+字符串)
- Java Nio 一、Java NIO教程
- LeetCode306——Additive Number且看我是如何解决的
- 设计模式系列之三:工厂模式(Factory Pattern)
- hdoj ZYB's Biology 5590 (字符串) 水
- 每天一点统计学——————————————序
- HDOJ 1086 You can Solve a Geometry Problem too (判断直线交点个数)
- 背包详解
- lightoj--1008--Fibsieve`s Fantabulous Birthday(水题)
- hdoj ZYB's Game 5901 (数学规律题)
- 希尔密码的”哑元“
- HTTP协议详解
- tomcat安装配置