Problem Description
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.
 
Input
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≤
 
Output
For each testcase,print YES or NO,describe whether the two arrays are matched.
 
Sample Input

ACGT
UGCA ACGT
ACGU
 
Sample Output
YES
NO
 
Source
 #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的更多相关文章

  1. HDU 5590 ZYB's Biology 水题

    ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

  2. BestCoder Round #65 (ZYB's Biology)

    ZYB's Biology Accepts: 848 Submissions: 1199 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 13 ...

  3. 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 ...

  4. 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 ...

  5. 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 ...

  6. hdu 5268 ZYB loves Score 水题

    ZYB loves Score Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...

  7. HDU 6468 zyb的面试

    http://acm.hdu.edu.cn/showproblem.php?pid=6468 题目 今天zyb参加一场面试,面试官听说zyb是ACMer之后立马抛出了一道算法题给zyb:有一个序列,是 ...

  8. 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 ...

  9. Bestcoder round #65 && hdu 5592 ZYB's Premutation 线段树

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submissio ...

随机推荐

  1. Easyui tabs学习

    前端时间花了一些时间学习easy ui,这个东西非常好用,界面也很美观,你都不需要在界面上花太多的工夫,例子程序也比较完善,基本上看下例子就能很好的使用easyui了,很方便. 特地分享一些使用时候遇 ...

  2. chrome console 调试xpath

    chrome console F12->$x(“//title”) [<title>Online Tools for Software Developers (Free)</t ...

  3. #include <boost/asio.hpp>

    TCP服务端和客户端 TCP服务端 #include <iostream> #include <stdlib.h> #include <boost/asio.hpp> ...

  4. Windows下安装Python3.4.2

    一.Windows下安装Python3.4.2 1.下载Windows下的Python3.4.2.exe 2.指定一个目录安装,然后下一步 3.配置环境变量包括Python.exe的文件.目录如下图所 ...

  5. Sending HTML Form Data

    public Task<HttpResponseMessage> PostFormData(){ // Check if the request contains multipart/fo ...

  6. Time.deltaTime和Time.realtimeSinceStartup

    private float f = 0f;void Update () {      f += Time.deltaTime;      Debug.LogError ("Time.delt ...

  7. java中的302和sendRedirect的区别

    java中有一个sendRedirect函数这个用于跳转到另外一个页面,这个实际上是一个302跳转,但是不完全等同于302跳转 点击(此处)折叠或打开 response.sendRedirect(&q ...

  8. C#整理5——break与continue.及数组

    一.break与continue.这两个关键字一般放在循环的花括号里面使用.break——结束整个循环.continue——结束本次循环,进入下次循环. break的案例: using System; ...

  9. WorkFlow WF如何为一个集合赋值

    今天刚刚开始学习WorkFlow.无奈WF网络上的学习资料实在太少. 刚刚学到Foreach控制流的使用,需要一个集合参数.经研究,静态赋值可以搞定.动态赋值还没. 首先添加一个List<int ...

  10. 查看当前支持的MySQL字符集的命令

    查看不同的MySQL字符集有不同的方法,下面介绍的命令用于查看当前支持的MySQL字符集,希望对您学习MySQL字符集能有所帮助. mysql> show char set; +-------- ...