ZYB's Biology

Accepts: 848
Submissions: 1199
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 131072/131072 K (Java/Others)
Problem Description

After getting 600600600 scores in NOIPNOIPNOIP ZYB(ZJ−267)ZYB(ZJ-267)ZYB(ZJ−267) begins to work with biological questions.Now he give you a simple biological questions: he gives you a DNADNADNA sequence and a RNARNARNA sequence,then he asks you whether the DNADNADNA sequence and the RNARNARNA sequence are matched.

The DNADNADNA sequence is a string consisted of A,C,G,TA,C,G,TA,C,G,T;The RNARNARNA sequence is a string consisted of A,C,G,UA,C,G,UA,C,G,U.

DNADNADNA sequence and RNARNARNA sequence are matched if and only if AAA matches UUU,TTT matches AAA,CCC matches GGG,GGG matches CCC on each position.

Input

In the first line there is the testcase TTT.

For each teatcase:

In the first line there is one number NNN.

In the next line there is a string of length NNN,describe the DNADNADNA sequence.

In the third line there is a string of length NNN,describe the RNARNARNA sequence.

1≤T≤101 \leq T \leq 101≤T≤10,1≤N≤1001 \leq N \leq 1001≤N≤100

Output

For each testcase,print YESYESYES or NONONO,describe whether the two arrays are matched.

Sample Input
2
4
ACGT
UGCA
4
ACGT
ACGU
Sample Output
YES
NO 巨水的题目:但是却WA了两次!!!!!靠;就是那行freopen;忘了打杠了!!!!!
#include <iostream>
#include <cstdio>
#include<cstring>
using namespace std;
int t,n,x;
char d[],r[];
int main(){
//freopen("in.txt","r",stdin);
cin>>t;
for(int i=;i<t;i++){
cin>>n;
scanf("%s",d);
scanf("%s",r);
x=;
for(int j=;j<n;j++){
if((d[j]=='A'&&r[j]=='U')||(d[j]=='T'&&r[j]=='A')||(d[j]=='C'&&r[j]=='G')||(d[j]=='G'&&r[j]=='C'))
x++;
}
if(x!=n)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;
}
return ;
}

BestCoder Round #65 (ZYB's Biology)的更多相关文章

  1. BestCoder Round #65 (ZYB's Game)

    ZYB's Game Accepts: 672 Submissions: 1207 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536 ...

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

    ZYB's Premutation Accepts: 220 Submissions: 983 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: ...

  3. hdu 5592 BestCoder Round #65(树状数组)

    题意: ZYB有一个排列PP,但他只记得PP中每个前缀区间的逆序对数,现在他要求你还原这个排列. (i,j)(i < j)(i,j)(i<j)被称为一对逆序对当且仅当A_i>A_jA ...

  4. hdu 5591 BestCoder Round #65(博弈)

    题意: 问题描述 ZYBZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告 ...

  5. BestCoder Round #85(ZOJ1569尚未验证)

    A题 子序列和啊,就要想到前缀和的差.这个转换一定要!记着!那么i到j的一段子序列和Sij%m ==  0就等价于(Sj-Si-1)%m == 0 了,那么什么意思呢?就是如果有两段前缀和%m的模是一 ...

  6. BestCoder Round #65 HDOJ5592 ZYB&#39;s Premutation(树状数组+二分)

    ZYB's Premutation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Othe ...

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

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

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

  9. hdu 4956 Poor Hanamichi BestCoder Round #5(数学题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4956 Poor Hanamichi Time Limit: 2000/1000 MS (Java/Ot ...

随机推荐

  1. redhat 7 安装oracle12.1

    https://oracle-base.com/articles/12c/oracle-db-12cr1-installation-on-oracle-linux-7   一定要配置yum本地源   ...

  2. 回顾一下MyBatis逆向工程——自动生成代码

    前言 最近做的项目(SSM+Shiro)的数据库表已经创建完成,一共有15张表,如果我们一个个去写pojo/bean的代码以及各种sql语句的话未免太过麻烦而且很容易出错,这个时候我们就需要MyBat ...

  3. 4、什么是事务?MySQL如何支持事务?

    什么是事务? 事务是由一步或几步数据库操作序列组成逻辑执行单元,这系列操作要么全部执行,要么全部放弃执行.程序和事务是两个不同的概念.一般而言:一段程序中可能包含多个事务.(说白了就是几步的数据库操作 ...

  4. 【HNOI】d 最小割

    [题目大意]给定一个n*m的土地,每块可以种a或b作物,每种作物在不同的位置有不同的收成,同时,有q个子矩阵中,全部种指定的作物(a或b)会有一定的加成收成,求最大收成. [数据范围] 50% n,m ...

  5. HashMap根据value获取key值

    public static String getCityId(HashMap<String,String> citys, String city){ Set set = citys.ent ...

  6. deepin 快捷键

    从此脱离鼠标

  7. SUSE 11.3 linux ISO下载地址

    http://linux.iingen.unam.mx/pub/Linux/Suse/isos/SLES11/ SLE-11-SP3-SDK-DVD-i586-GM-DVD1.iso 6deaa960 ...

  8. python基础===requests学习笔记

    这里有一个新的学习requests网站:http://docs.python-requests.org/zh_CN/latest/user/quickstart.html2017/11/30 Requ ...

  9. 转 白话解析:一致性哈希算法 consistent hashing

    摘要: 本文首先以一个经典的分布式缓存的应用场景为铺垫,在了解了这个应用场景之后,生动而又不失风趣地介绍了一致性哈希算法,同时也明确给出了一致性哈希算法的优点.存在的问题及其解决办法. 声明与致谢: ...

  10. 算法题之Median of Two Sorted Arrays

    这道题是LeetCode上的题目,难度级别为5,刚开始做没有找到好的思路,以为是自己智商比较低,后来发现确实也比较低... 题目: There are two sorted arrays nums1  ...