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 ...
随机推荐
- 21副GIF动图让你了解各种数学概念(转。太强大了)
“让我们面对它:总的来说数学是不容易的,但当你征服了问题,并达到新的理解高度,这就是它给你的回报.” ——Danica McKellar 数学是很难的科学,但因为它是科学家用数学来解释宇宙的语言,我们 ...
- STL set 使用小结
这是微软帮助文档中对集合(set)的解释: “描述了一个控制变长元素序列的对象(注:set中的key和value是Key类型的,而map中的key和value是一个pair结构中的两个分 量)的模板类 ...
- cf459A Pashmak and Garden
A. Pashmak and Garden time limit per test 1 second memory limit per test 256 megabytes input standar ...
- hdu 5621 KK's Point(数学,推理题)
题解: 在圆上点三个点时,除圆上三个交点外,圆内没有交点:在圆上点四个点时,除圆上四个交点外,圆内出现了一个交点,因此,在N个点中每四个点便可以在圆内产生一个交点,因此N个点在圆内形成的点的个数为CN ...
- 将ImageView中的图片保存到本地相冊
private void SaveImageToSysAlbum() { if (FileUtil.isSdCardExist()) { BitmapDrawable bmpDrawable = (B ...
- springmvc 传递和接收数组参数
java url中如何传递数组,springMVC框架controller类如何接收数组参数? 下面介绍一下URL中传递数组参数方法: dd.do?titles[]=col1&titles[] ...
- JS 利用CNZZ进行站长统计
利用CNZZ对网站进行站长统计 前端页面只需要在body中添加如下代码即可: <script type="text/javascript">var cnzz_proto ...
- 2016年gift上线相关知识点记录
1.图片初始化加载 2.如何判断横屏 function horAver() { if (window.orientation == 90 || window.orientation == -90) { ...
- android代码集锦
调用root权限的应用: /** * 执行Command命令的函数 * * @param command 命令 * @return 执行结果 */ public static boolean runR ...
- android开发时间和日期的代码实现工具类(一)
android开发时间和日期工具类的代码实现: package com.gzcivil.utils; import android.annotation.SuppressLint; import an ...