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. 【20151105noip膜你赛】bzoj3652 bzoj3653

    题目仿佛在讽刺我... 第一题: 题解: 考虑枚举区间右端点,维护所以左到当前的 and 和 or .注意 and 每次变化至少有一个二进制位从1变 0,or 每次至少有一个位从0变 1,所以最多有l ...

  2. 【Codeforces542E】Playing on Graph [Bfs][Dfs]

    Playing on Graph Time Limit: 20 Sec  Memory Limit: 512 MB Description Input Output Sample Input 5 4 ...

  3. 【Luogu】P3930 SAC E#1 - 一道大水题 Knight

    [题目]洛谷10月月赛R1 提高组 [题意]给定n*n棋盘和<=16个棋子,给几个棋子种类和攻击范围,现我方只有一马,求能否吃王. [算法]状压+BFS [题解]16种棋子中,马不能吃马,直接处 ...

  4. 每个 Java 开发者都应该知道的 5 个注解

    自 JDK5 推出以来,注解已成为Java生态系统不可缺少的一部分.虽然开发者为Java框架(例如Spring的@Autowired)开发了无数的自定义注解,但编译器认可的一些注解非常重要. 在本文中 ...

  5. vue清空input file

    input file是只读的,给form一个id,用form.reset()干掉里面input的值 document.getElementById("uploadForm")&am ...

  6. 【Windows使用笔记】使Onedrive同步任意文件夹

    因为度盘实在是有点垃圾,经常看的剧之类的或者其他软件资源啥的动不动就被封. 所以跑去某宝买了一个5T的企业子账号,安全性不清楚,重要的隐私数据反正都用移动硬盘备份了.主要就是存一些资源性的文件吧.而且 ...

  7. Exploring Qualcomm's TrustZone Implementation

    转自  http://bits-please.blogspot.com/2015/08   (需要FQ, 狗日的墙) In this blog post, we'll be exploring Qua ...

  8. (二十一)Makefile例子

    ROOT_PROJECT = .DIR_INC = -I$(ROOT_PROJECT)/include -I$(ROOT_PROJECT)/include/NE10 DIR_BIN = $(ROOT_ ...

  9. python 判断文件的创建时间和当前时间的比较

    import os import time import datetime filePath=r"C:\pyweibo\cookies5673210223" ctime=os.pa ...

  10. spark 环境搭建坑

    spark的新人会有什么坑 spark是一个以java为基础的,以Scala实现的,所以在你在安装指定版本的spark,需要检查你用的是对应spark使用什么版本的scala,可以通过spark-sh ...