【水】HDOJ ZYB's Biology 5590
来源:互联网 发布:进出口银行 知乎 编辑:程序博客网 时间:2024/05/16 00:58
ZYB's Biology
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 323 Accepted Submission(s): 269
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 ;The RNA 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
Source
BestCoder Round #65
AC代码:
#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;int main(){ int t; scanf("%d",&t); while(t--){ char D[110],R[110]; int N; scanf("%d",&N); scanf("%s%s",D,R); int LD=strlen(D); int LR=strlen(R); if(LD!=LR){ printf("NO\n"); continue; } int flag=1; for(int i=0;i<N;i++){ if(D[i]=='A'&&R[i]=='U')continue; else if(D[i]=='T'&&R[i]=='A')continue; else if(D[i]=='C'&&R[i]=='G')continue; else if(D[i]=='G'&&R[i]=='C')continue; flag=0; } if(flag)printf("YES\n"); else printf("NO\n"); } return 0;}
0 0
- 【水】HDOJ ZYB's Biology 5590
- HDOJ 5590 ZYB's Biology
- HDOJ 5590 ZYB's Biology
- hdoj-5590-ZYB's Biology
- hdoj 5592 ZYB's Biology 【线段树】 hdoj 5590 ZYB's Biology 【字符串水题】
- hdoj ZYB's Biology 5590 (字符串) 水
- hdoj 5590 ZYB's Biology 【水题】
- hdu 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 5591 ZYB's Game 【水题】
- 延展@interface
- android_获取缓存大小和清除缓存功能
- 7个杀手级的开源监测工具
- 将所有文件的tab换成4个空格
- eclipse运行ant 控制台空白问题
- 【水】HDOJ ZYB's Biology 5590
- RealSense SDK 开发笔记(一)环境配置
- NSFileManager文件管理器
- JQuery弹框,自定义弹窗
- Java:接口和抽象类的区别
- 闭目养神
- 机器视觉的概念-20151201
- 【博弈】HDOJ ZYB's Game 5591
- 各jar下载