hdu 5590 ZYB's Biology
After getting scores in NOIP ZYB(ZJ−) begins to work with biological questions.Now he give you a simple biological questions:
he gives you a DNA sequence and a RNA sequence,then he asks you whether the DNA sequence and the RNA sequence are
matched. The DNA 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.
In the first line there is the testcase T. For each teatcase: In the first line there is one number N. In the next line there is a string of length N,describe the DNA sequence. In the third line there is a string of length N,describe the RNA sequence. ≤T≤,≤N≤
For each testcase,print YES or NO,describe whether the two arrays are matched.
ACGT
UGCA ACGT
ACGU
YES
NO
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<queue>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<stdlib.h>
#include <stack>
using namespace std;
#define PI acos(-1.0)
#define max(a,b) (a) > (b) ? (a) : (b)
#define min(a,b) (a) < (b) ? (a) : (b)
#define ll long long
#define eps 1e-10
#define MOD 1000000007
#define N 106
#define inf 1e12
int n;
char s1[N];
char s2[N];
int main()
{
int t;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
scanf("%s",s1);
scanf("%s",s2);
int flag=;
for(int i=;i<n;i++){
if(s1[i]=='A'){
if(s2[i]!='U'){
flag=;
break;
}
}
else if(s1[i]=='T'){
if(s2[i]!='A'){
flag=;
break;
}
}
else if(s1[i]=='C'){
if(s2[i]!='G'){
flag=;
break;
}
}
else if(s1[i]=='G'){
if(s2[i]!='C'){
flag=;
break;
}
}
}
if(flag){
printf("YES\n");
}else{
printf("NO\n");
} }
return ;
}
hdu 5590 ZYB's Biology的更多相关文章
- HDU 5590 ZYB's Biology 水题
ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...
- BestCoder Round #65 (ZYB's Biology)
ZYB's Biology Accepts: 848 Submissions: 1199 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 13 ...
- hdu 5594 ZYB's Prime 最大流
ZYB's Prime Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5 ...
- hdu 5592 ZYB's Game 树状数组
ZYB's Game Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=55 ...
- hdu 5591 ZYB's Game 博弈论
ZYB's Game Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=55 ...
- hdu 5268 ZYB loves Score 水题
ZYB loves Score Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...
- HDU 6468 zyb的面试
http://acm.hdu.edu.cn/showproblem.php?pid=6468 题目 今天zyb参加一场面试,面试官听说zyb是ACMer之后立马抛出了一道算法题给zyb:有一个序列,是 ...
- Bestcoder round #65 && hdu 5593 ZYB's Tree 树形dp
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...
- Bestcoder round #65 && hdu 5592 ZYB's Premutation 线段树
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...
随机推荐
- SpringMVC之数据绑定(转)
到目前为止,请求已经能交给我们的处理器进行处理了,接下来的事情是要进行收集数据啦,接下来我们看看我们能从请求中收集到哪些数据, 1.@RequestParam绑定单个请求参数值: 2.@PathVar ...
- C++类对应的内存结构
提示1:对“内存结构”表示有疑问或不解的,先参考: http://blog.csdn.net/guogangj/archive/2007/05/25/1625199.aspx, 本文使用的表示方法和V ...
- javacript 面向对象
1.对象 使用Object创建对象 var p = new Object(); p.name = 'jason'; p.sayName = function(){ alert(this.name); ...
- mysql--存储过程(入门篇)
h2 { color: #fff; background-color: #7CCD7C; padding: 3px; margin: 10px 0px } h3 { color: #fff; back ...
- mysql中limit用法误区
之前一直用oracle,在分页的时候用rownumber,转换到mysql上之后,用limit做分页: 在做某个业务的时候,需要先将数据排序,再分页,在给limit上参数的时候沿用了oracle的ro ...
- Linux下如何进行FTP安装与设置
1. 先用rpm -qa| grep vsftpd命令检查是否已经安装,如果ftp没有安装,使用yum -y install vsftpd 安装,(ubuntu 下使用apt-get instal ...
- git创建分支
1.创建本地分支名称为dev的本地分支 git branch dev 2.将本地分支添加到远程分支 git push origin dev 3.查看创建的本地分支, 带有*符号的分支,代表当前所在分支 ...
- SqlHelper数据库访问类
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...
- meta 标签整理
<!-- 声明文档 --> <meta charset='utf-8'> <!-- 指示IE以目前可用的最高模式显示内容 --> <meta http-equ ...
- boost信号量 boost::interprocess::interprocess_semaphore的用法
使用方法首先给信号量初始化赋值,可以根据需要设定需要的值,之前在写项目的过程中用这个控制下载的线程个数. boost::interprocess::interprocess_semaphore m_s ...